This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import Pagination from './src/pagination';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElPagination: SFCWithInstall<typeof Pagination>;
export default ElPagination;
export * from './src/pagination';
export * from './src/constants';

View File

@@ -0,0 +1,16 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var pagination = require('./src/pagination.js');
var constants = require('./src/constants.js');
var install = require('../../utils/vue/install.js');
const ElPagination = install.withInstall(pagination["default"]);
exports.paginationEmits = pagination.paginationEmits;
exports.paginationProps = pagination.paginationProps;
exports.elPaginationKey = constants.elPaginationKey;
exports.ElPagination = ElPagination;
exports["default"] = ElPagination;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../../packages/components/pagination/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Pagination from './src/pagination'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElPagination: SFCWithInstall<typeof Pagination> =\n withInstall(Pagination)\nexport default ElPagination\n\nexport * from './src/pagination'\nexport * from './src/constants'\n"],"names":["withInstall","Pagination"],"mappings":";;;;;;;;AAEY,MAAC,YAAY,GAAGA,mBAAW,CAACC,qBAAU;;;;;;;;"}

View File

@@ -0,0 +1,13 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type Jumper from './jumper.vue';
export declare const paginationJumperProps: {
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
export type PaginationJumperProps = ExtractPropTypes<typeof paginationJumperProps>;
export type PaginationJumperPropsPublic = __ExtractPublicPropTypes<typeof paginationJumperProps>;
export type PaginationJumperInstance = InstanceType<typeof Jumper> & unknown;

View File

@@ -0,0 +1,16 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../../utils/vue/props/runtime.js');
var size = require('../../../../constants/size.js');
const paginationJumperProps = runtime.buildProps({
size: {
type: String,
values: size.componentSizes
}
});
exports.paginationJumperProps = paginationJumperProps;
//# sourceMappingURL=jumper.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"jumper.js","sources":["../../../../../../../packages/components/pagination/src/components/jumper.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Jumper from './jumper.vue'\n\nexport const paginationJumperProps = buildProps({\n size: {\n type: String,\n values: componentSizes,\n },\n} as const)\n\nexport type PaginationJumperProps = ExtractPropTypes<\n typeof paginationJumperProps\n>\nexport type PaginationJumperPropsPublic = __ExtractPublicPropTypes<\n typeof paginationJumperProps\n>\n\nexport type PaginationJumperInstance = InstanceType<typeof Jumper> & unknown\n"],"names":["buildProps","componentSizes"],"mappings":";;;;;;;AAEY,MAAC,qBAAqB,GAAGA,kBAAU,CAAC;AAChD,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEC,mBAAc;AAC1B,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,16 @@
declare const _default: import("vue").DefineComponent<{
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}>>, {}>;
export default _default;

View File

@@ -0,0 +1,67 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var index$2 = require('../../../input/index.js');
var usePagination = require('../usePagination.js');
var jumper = require('./jumper.js');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../../hooks/use-locale/index.js');
var index$1 = require('../../../../hooks/use-namespace/index.js');
const __default__ = vue.defineComponent({
name: "ElPaginationJumper"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: jumper.paginationJumperProps,
setup(__props) {
const { t } = index.useLocale();
const ns = index$1.useNamespace("pagination");
const { pageCount, disabled, currentPage, changeEvent } = usePagination.usePagination();
const userInput = vue.ref();
const innerValue = vue.computed(() => {
var _a;
return (_a = userInput.value) != null ? _a : currentPage == null ? void 0 : currentPage.value;
});
function handleInput(val) {
userInput.value = val ? +val : "";
}
function handleChange(val) {
val = Math.trunc(+val);
changeEvent == null ? void 0 : changeEvent(val);
userInput.value = void 0;
}
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("span", {
class: vue.normalizeClass(vue.unref(ns).e("jump")),
disabled: vue.unref(disabled)
}, [
vue.createElementVNode("span", {
class: vue.normalizeClass([vue.unref(ns).e("goto")])
}, vue.toDisplayString(vue.unref(t)("el.pagination.goto")), 3),
vue.createVNode(vue.unref(index$2.ElInput), {
size: _ctx.size,
class: vue.normalizeClass([vue.unref(ns).e("editor"), vue.unref(ns).is("in-pagination")]),
min: 1,
max: vue.unref(pageCount),
disabled: vue.unref(disabled),
"model-value": vue.unref(innerValue),
"validate-event": false,
"aria-label": vue.unref(t)("el.pagination.page"),
type: "number",
"onUpdate:modelValue": handleInput,
onChange: handleChange
}, null, 8, ["size", "class", "max", "disabled", "model-value", "aria-label"]),
vue.createElementVNode("span", {
class: vue.normalizeClass([vue.unref(ns).e("classifier")])
}, vue.toDisplayString(vue.unref(t)("el.pagination.pageClassifier")), 3)
], 10, ["disabled"]);
};
}
});
var Jumper = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "jumper.vue"]]);
exports["default"] = Jumper;
//# sourceMappingURL=jumper2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"jumper2.js","sources":["../../../../../../../packages/components/pagination/src/components/jumper.vue"],"sourcesContent":["<template>\n <span :class=\"ns.e('jump')\" :disabled=\"disabled\">\n <span :class=\"[ns.e('goto')]\">{{ t('el.pagination.goto') }}</span>\n <el-input\n :size=\"size\"\n :class=\"[ns.e('editor'), ns.is('in-pagination')]\"\n :min=\"1\"\n :max=\"pageCount\"\n :disabled=\"disabled\"\n :model-value=\"innerValue\"\n :validate-event=\"false\"\n :aria-label=\"t('el.pagination.page')\"\n type=\"number\"\n @update:model-value=\"handleInput\"\n @change=\"handleChange\"\n />\n <span :class=\"[ns.e('classifier')]\">{{\n t('el.pagination.pageClassifier')\n }}</span>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { usePagination } from '../usePagination'\nimport { paginationJumperProps } from './jumper'\n\ndefineOptions({\n name: 'ElPaginationJumper',\n})\n\ndefineProps(paginationJumperProps)\nconst { t } = useLocale()\nconst ns = useNamespace('pagination')\nconst { pageCount, disabled, currentPage, changeEvent } = usePagination()\nconst userInput = ref<number | string>()\nconst innerValue = computed(() => userInput.value ?? currentPage?.value)\n\nfunction handleInput(val: number | string) {\n userInput.value = val ? +val : ''\n}\n\nfunction handleChange(val: number | string) {\n val = Math.trunc(+val)\n changeEvent?.(val)\n userInput.value = undefined\n}\n</script>\n"],"names":["useLocale","useNamespace","usePagination","ref","computed"],"mappings":";;;;;;;;;;;;uCA6Bc,CAAA;AAAA,EACZ,IAAM,EAAA,oBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAGA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,YAAY,CAAA,CAAA;AACpC,IAAA,MAAM,EAAE,SAAW,EAAA,QAAA,EAAU,WAAa,EAAA,WAAA,KAAgBC,2BAAc,EAAA,CAAA;AACxE,IAAA,MAAM,YAAYC,OAAqB,EAAA,CAAA;AACvC,IAAA,MAAM,aAAaC,YAAS,CAAA,MAAM;AAElC,MAAA,IAAA,EAAA,CAAS;AACP,MAAU,OAAA,CAAA,EAAA,GAAA,SAAc,CAAA,KAAO,KAAA,IAAA,GAAA,EAAA,GAAA,WAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,WAAA,CAAA,KAAA,CAAA;AAAA,KACjC,CAAA,CAAA;AAEA,IAAA,SAAS,eAAmC,EAAA;AAC1C,MAAM,SAAA,CAAA,KAAW,GAAC,GAAG,GAAA,CAAA,GAAA,GAAA,EAAA,CAAA;AACrB,KAAA;AACA,IAAA,SAAA,YAAkB,CAAA,GAAA,EAAA;AAAA,MACpB,GAAA,GAAA,IAAA,CAAA,KAAA,CAAA,CAAA,GAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,22 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type Next from './next.vue';
export declare const paginationNextProps: {
readonly disabled: BooleanConstructor;
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly pageCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 50, boolean>;
readonly nextText: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly nextIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
export type PaginationNextProps = ExtractPropTypes<typeof paginationNextProps>;
export type PaginationNextPropsPublic = __ExtractPublicPropTypes<typeof paginationNextProps>;
export type NextInstance = InstanceType<typeof Next> & unknown;

View File

@@ -0,0 +1,27 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../../utils/vue/props/runtime.js');
var icon = require('../../../../utils/vue/icon.js');
const paginationNextProps = runtime.buildProps({
disabled: Boolean,
currentPage: {
type: Number,
default: 1
},
pageCount: {
type: Number,
default: 50
},
nextText: {
type: String
},
nextIcon: {
type: icon.iconPropType
}
});
exports.paginationNextProps = paginationNextProps;
//# sourceMappingURL=next.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"next.js","sources":["../../../../../../../packages/components/pagination/src/components/next.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Next from './next.vue'\n\nexport const paginationNextProps = buildProps({\n disabled: Boolean,\n currentPage: {\n type: Number,\n default: 1,\n },\n pageCount: {\n type: Number,\n default: 50,\n },\n nextText: {\n type: String,\n },\n nextIcon: {\n type: iconPropType,\n },\n} as const)\n\nexport type PaginationNextProps = ExtractPropTypes<typeof paginationNextProps>\nexport type PaginationNextPropsPublic = __ExtractPublicPropTypes<\n typeof paginationNextProps\n>\n\nexport type NextInstance = InstanceType<typeof Next> & unknown\n"],"names":["buildProps","iconPropType"],"mappings":";;;;;;;AACY,MAAC,mBAAmB,GAAGA,kBAAU,CAAC;AAC9C,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,42 @@
declare const _default: import("vue").DefineComponent<{
readonly disabled: BooleanConstructor;
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly pageCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 50, boolean>;
readonly nextText: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly nextIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
click: (...args: any[]) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly disabled: BooleanConstructor;
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly pageCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 50, boolean>;
readonly nextText: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly nextIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}>> & {
onClick?: ((...args: any[]) => any) | undefined;
}, {
readonly disabled: boolean;
readonly currentPage: number;
readonly pageCount: number;
}>;
export default _default;

View File

@@ -0,0 +1,44 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var index$1 = require('../../../icon/index.js');
var next = require('./next.js');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../../hooks/use-locale/index.js');
const __default__ = vue.defineComponent({
name: "ElPaginationNext"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: next.paginationNextProps,
emits: ["click"],
setup(__props) {
const props = __props;
const { t } = index.useLocale();
const internalDisabled = vue.computed(() => props.disabled || props.currentPage === props.pageCount || props.pageCount === 0);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("button", {
type: "button",
class: "btn-next",
disabled: vue.unref(internalDisabled),
"aria-label": _ctx.nextText || vue.unref(t)("el.pagination.next"),
"aria-disabled": vue.unref(internalDisabled),
onClick: ($event) => _ctx.$emit("click", $event)
}, [
_ctx.nextText ? (vue.openBlock(), vue.createElementBlock("span", { key: 0 }, vue.toDisplayString(_ctx.nextText), 1)) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), { key: 1 }, {
default: vue.withCtx(() => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.nextIcon)))
]),
_: 1
}))
], 8, ["disabled", "aria-label", "aria-disabled", "onClick"]);
};
}
});
var Next = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "next.vue"]]);
exports["default"] = Next;
//# sourceMappingURL=next2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"next2.js","sources":["../../../../../../../packages/components/pagination/src/components/next.vue"],"sourcesContent":["<template>\n <button\n type=\"button\"\n class=\"btn-next\"\n :disabled=\"internalDisabled\"\n :aria-label=\"nextText || t('el.pagination.next')\"\n :aria-disabled=\"internalDisabled\"\n @click=\"$emit('click', $event)\"\n >\n <span v-if=\"nextText\">{{ nextText }}</span>\n <el-icon v-else>\n <component :is=\"nextIcon\" />\n </el-icon>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useLocale } from '@element-plus/hooks'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { paginationNextProps } from './next'\n\ndefineOptions({\n name: 'ElPaginationNext',\n})\n\nconst props = defineProps(paginationNextProps)\n\ndefineEmits(['click'])\n\nconst { t } = useLocale()\n\nconst internalDisabled = computed(\n () =>\n props.disabled ||\n props.currentPage === props.pageCount ||\n props.pageCount === 0\n)\n</script>\n"],"names":["useLocale","computed","_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;uCAsBc,CAAA;AAAA,EACZ,IAAM,EAAA,kBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAMA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AAExB,IAAA,MAAM,gBAAmB,GAAAC,YAAA,CAAA,MAAA,KAAA,CAAA,QAAA,IAAA,KAAA,CAAA,WAAA,KAAA,KAAA,CAAA,SAAA,IAAA,KAAA,CAAA,SAAA,KAAA,CAAA,CAAA,CAAA;AAAA,IACvB,OAAA,CACE,MAAM,MACN,KAAA;AACoB,MACxB,OAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,16 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type Pager from './pager.vue';
export declare const paginationPagerProps: {
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly pageCount: {
readonly type: import("vue").PropType<number>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly pagerCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
readonly disabled: BooleanConstructor;
};
export type PaginationPagerProps = ExtractPropTypes<typeof paginationPagerProps>;
export type PaginationPagerPropsPublic = __ExtractPublicPropTypes<typeof paginationPagerProps>;
export type PagerInstance = InstanceType<typeof Pager> & unknown;

View File

@@ -0,0 +1,24 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../../utils/vue/props/runtime.js');
const paginationPagerProps = runtime.buildProps({
currentPage: {
type: Number,
default: 1
},
pageCount: {
type: Number,
required: true
},
pagerCount: {
type: Number,
default: 7
},
disabled: Boolean
});
exports.paginationPagerProps = paginationPagerProps;
//# sourceMappingURL=pager.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pager.js","sources":["../../../../../../../packages/components/pagination/src/components/pager.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Pager from './pager.vue'\n\nexport const paginationPagerProps = buildProps({\n currentPage: {\n type: Number,\n default: 1,\n },\n pageCount: {\n type: Number,\n required: true,\n },\n pagerCount: {\n type: Number,\n default: 7,\n },\n disabled: Boolean,\n} as const)\n\nexport type PaginationPagerProps = ExtractPropTypes<typeof paginationPagerProps>\nexport type PaginationPagerPropsPublic = __ExtractPublicPropTypes<\n typeof paginationPagerProps\n>\n\nexport type PagerInstance = InstanceType<typeof Pager> & unknown\n"],"names":["buildProps"],"mappings":";;;;;;AACY,MAAC,oBAAoB,GAAGA,kBAAU,CAAC;AAC/C,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC;;;;"}

View File

@@ -0,0 +1,30 @@
declare const _default: import("vue").DefineComponent<{
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly pageCount: {
readonly type: import("vue").PropType<number>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly pagerCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
readonly disabled: BooleanConstructor;
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
change: (...args: any[]) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly pageCount: {
readonly type: import("vue").PropType<number>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly pagerCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
readonly disabled: BooleanConstructor;
}>> & {
onChange?: ((...args: any[]) => any) | undefined;
}, {
readonly disabled: boolean;
readonly currentPage: number;
readonly pagerCount: number;
}>;
export default _default;

View File

@@ -0,0 +1,218 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var iconsVue = require('@element-plus/icons-vue');
var pager = require('./pager.js');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
var event = require('../../../../constants/event.js');
var index = require('../../../../hooks/use-namespace/index.js');
var index$1 = require('../../../../hooks/use-locale/index.js');
const __default__ = vue.defineComponent({
name: "ElPaginationPager"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: pager.paginationPagerProps,
emits: [event.CHANGE_EVENT],
setup(__props, { emit }) {
const props = __props;
const nsPager = index.useNamespace("pager");
const nsIcon = index.useNamespace("icon");
const { t } = index$1.useLocale();
const showPrevMore = vue.ref(false);
const showNextMore = vue.ref(false);
const quickPrevHover = vue.ref(false);
const quickNextHover = vue.ref(false);
const quickPrevFocus = vue.ref(false);
const quickNextFocus = vue.ref(false);
const pagers = vue.computed(() => {
const pagerCount = props.pagerCount;
const halfPagerCount = (pagerCount - 1) / 2;
const currentPage = Number(props.currentPage);
const pageCount = Number(props.pageCount);
let showPrevMore2 = false;
let showNextMore2 = false;
if (pageCount > pagerCount) {
if (currentPage > pagerCount - halfPagerCount) {
showPrevMore2 = true;
}
if (currentPage < pageCount - halfPagerCount) {
showNextMore2 = true;
}
}
const array = [];
if (showPrevMore2 && !showNextMore2) {
const startPage = pageCount - (pagerCount - 2);
for (let i = startPage; i < pageCount; i++) {
array.push(i);
}
} else if (!showPrevMore2 && showNextMore2) {
for (let i = 2; i < pagerCount; i++) {
array.push(i);
}
} else if (showPrevMore2 && showNextMore2) {
const offset = Math.floor(pagerCount / 2) - 1;
for (let i = currentPage - offset; i <= currentPage + offset; i++) {
array.push(i);
}
} else {
for (let i = 2; i < pageCount; i++) {
array.push(i);
}
}
return array;
});
const prevMoreKls = vue.computed(() => [
"more",
"btn-quickprev",
nsIcon.b(),
nsPager.is("disabled", props.disabled)
]);
const nextMoreKls = vue.computed(() => [
"more",
"btn-quicknext",
nsIcon.b(),
nsPager.is("disabled", props.disabled)
]);
const tabindex = vue.computed(() => props.disabled ? -1 : 0);
vue.watch(() => [props.pageCount, props.pagerCount, props.currentPage], ([pageCount, pagerCount, currentPage]) => {
const halfPagerCount = (pagerCount - 1) / 2;
let showPrev = false;
let showNext = false;
if (pageCount > pagerCount) {
showPrev = currentPage > pagerCount - halfPagerCount;
showNext = currentPage < pageCount - halfPagerCount;
}
quickPrevHover.value && (quickPrevHover.value = showPrev);
quickNextHover.value && (quickNextHover.value = showNext);
showPrevMore.value = showPrev;
showNextMore.value = showNext;
}, { immediate: true });
function onMouseEnter(forward = false) {
if (props.disabled)
return;
if (forward) {
quickPrevHover.value = true;
} else {
quickNextHover.value = true;
}
}
function onFocus(forward = false) {
if (forward) {
quickPrevFocus.value = true;
} else {
quickNextFocus.value = true;
}
}
function onEnter(e) {
const target = e.target;
if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
const newPage = Number(target.textContent);
if (newPage !== props.currentPage) {
emit(event.CHANGE_EVENT, newPage);
}
} else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
onPagerClick(e);
}
}
function onPagerClick(event$1) {
const target = event$1.target;
if (target.tagName.toLowerCase() === "ul" || props.disabled) {
return;
}
let newPage = Number(target.textContent);
const pageCount = props.pageCount;
const currentPage = props.currentPage;
const pagerCountOffset = props.pagerCount - 2;
if (target.className.includes("more")) {
if (target.className.includes("quickprev")) {
newPage = currentPage - pagerCountOffset;
} else if (target.className.includes("quicknext")) {
newPage = currentPage + pagerCountOffset;
}
}
if (!Number.isNaN(+newPage)) {
if (newPage < 1) {
newPage = 1;
}
if (newPage > pageCount) {
newPage = pageCount;
}
}
if (newPage !== currentPage) {
emit(event.CHANGE_EVENT, newPage);
}
}
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("ul", {
class: vue.normalizeClass(vue.unref(nsPager).b()),
onClick: onPagerClick,
onKeyup: vue.withKeys(onEnter, ["enter"])
}, [
_ctx.pageCount > 0 ? (vue.openBlock(), vue.createElementBlock("li", {
key: 0,
class: vue.normalizeClass([[
vue.unref(nsPager).is("active", _ctx.currentPage === 1),
vue.unref(nsPager).is("disabled", _ctx.disabled)
], "number"]),
"aria-current": _ctx.currentPage === 1,
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager: 1 }),
tabindex: vue.unref(tabindex)
}, " 1 ", 10, ["aria-current", "aria-label", "tabindex"])) : vue.createCommentVNode("v-if", true),
showPrevMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
key: 1,
class: vue.normalizeClass(vue.unref(prevMoreKls)),
tabindex: vue.unref(tabindex),
"aria-label": vue.unref(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }),
onMouseenter: ($event) => onMouseEnter(true),
onMouseleave: ($event) => quickPrevHover.value = false,
onFocus: ($event) => onFocus(true),
onBlur: ($event) => quickPrevFocus.value = false
}, [
(quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowLeft), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
], 42, ["tabindex", "aria-label", "onMouseenter", "onMouseleave", "onFocus", "onBlur"])) : vue.createCommentVNode("v-if", true),
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(pagers), (pager) => {
return vue.openBlock(), vue.createElementBlock("li", {
key: pager,
class: vue.normalizeClass([[
vue.unref(nsPager).is("active", _ctx.currentPage === pager),
vue.unref(nsPager).is("disabled", _ctx.disabled)
], "number"]),
"aria-current": _ctx.currentPage === pager,
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager }),
tabindex: vue.unref(tabindex)
}, vue.toDisplayString(pager), 11, ["aria-current", "aria-label", "tabindex"]);
}), 128)),
showNextMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
key: 2,
class: vue.normalizeClass(vue.unref(nextMoreKls)),
tabindex: vue.unref(tabindex),
"aria-label": vue.unref(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }),
onMouseenter: ($event) => onMouseEnter(),
onMouseleave: ($event) => quickNextHover.value = false,
onFocus: ($event) => onFocus(),
onBlur: ($event) => quickNextFocus.value = false
}, [
(quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowRight), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
], 42, ["tabindex", "aria-label", "onMouseenter", "onMouseleave", "onFocus", "onBlur"])) : vue.createCommentVNode("v-if", true),
_ctx.pageCount > 1 ? (vue.openBlock(), vue.createElementBlock("li", {
key: 3,
class: vue.normalizeClass([[
vue.unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
vue.unref(nsPager).is("disabled", _ctx.disabled)
], "number"]),
"aria-current": _ctx.currentPage === _ctx.pageCount,
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager: _ctx.pageCount }),
tabindex: vue.unref(tabindex)
}, vue.toDisplayString(_ctx.pageCount), 11, ["aria-current", "aria-label", "tabindex"])) : vue.createCommentVNode("v-if", true)
], 42, ["onKeyup"]);
};
}
});
var Pager = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "pager.vue"]]);
exports["default"] = Pager;
//# sourceMappingURL=pager2.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type Prev from './prev.vue';
export declare const paginationPrevProps: {
readonly disabled: BooleanConstructor;
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly prevText: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly prevIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
export declare const paginationPrevEmits: {
click: (evt: MouseEvent) => boolean;
};
export type PaginationPrevProps = ExtractPropTypes<typeof paginationPrevProps>;
export type PaginationPrevPropsPublic = __ExtractPublicPropTypes<typeof paginationPrevProps>;
export type PrevInstance = InstanceType<typeof Prev> & unknown;

View File

@@ -0,0 +1,27 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../../utils/vue/props/runtime.js');
var icon = require('../../../../utils/vue/icon.js');
const paginationPrevProps = runtime.buildProps({
disabled: Boolean,
currentPage: {
type: Number,
default: 1
},
prevText: {
type: String
},
prevIcon: {
type: icon.iconPropType
}
});
const paginationPrevEmits = {
click: (evt) => evt instanceof MouseEvent
};
exports.paginationPrevEmits = paginationPrevEmits;
exports.paginationPrevProps = paginationPrevProps;
//# sourceMappingURL=prev.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"prev.js","sources":["../../../../../../../packages/components/pagination/src/components/prev.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Prev from './prev.vue'\n\nexport const paginationPrevProps = buildProps({\n disabled: Boolean,\n currentPage: {\n type: Number,\n default: 1,\n },\n prevText: {\n type: String,\n },\n prevIcon: {\n type: iconPropType,\n },\n} as const)\n\nexport const paginationPrevEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\n\nexport type PaginationPrevProps = ExtractPropTypes<typeof paginationPrevProps>\nexport type PaginationPrevPropsPublic = __ExtractPublicPropTypes<\n typeof paginationPrevProps\n>\n\nexport type PrevInstance = InstanceType<typeof Prev> & unknown\n"],"names":["buildProps","iconPropType"],"mappings":";;;;;;;AACY,MAAC,mBAAmB,GAAGA,kBAAU,CAAC;AAC9C,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,mBAAmB,GAAG;AACnC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;;"}

View File

@@ -0,0 +1,39 @@
declare const _default: import("vue").DefineComponent<{
readonly disabled: BooleanConstructor;
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly prevText: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly prevIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
click: (evt: MouseEvent) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly disabled: BooleanConstructor;
readonly currentPage: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly prevText: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly prevIcon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}>> & {
onClick?: ((evt: MouseEvent) => any) | undefined;
}, {
readonly disabled: boolean;
readonly currentPage: number;
}>;
export default _default;

View File

@@ -0,0 +1,44 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var index$1 = require('../../../icon/index.js');
var prev = require('./prev.js');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../../hooks/use-locale/index.js');
const __default__ = vue.defineComponent({
name: "ElPaginationPrev"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: prev.paginationPrevProps,
emits: prev.paginationPrevEmits,
setup(__props) {
const props = __props;
const { t } = index.useLocale();
const internalDisabled = vue.computed(() => props.disabled || props.currentPage <= 1);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("button", {
type: "button",
class: "btn-prev",
disabled: vue.unref(internalDisabled),
"aria-label": _ctx.prevText || vue.unref(t)("el.pagination.prev"),
"aria-disabled": vue.unref(internalDisabled),
onClick: ($event) => _ctx.$emit("click", $event)
}, [
_ctx.prevText ? (vue.openBlock(), vue.createElementBlock("span", { key: 0 }, vue.toDisplayString(_ctx.prevText), 1)) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), { key: 1 }, {
default: vue.withCtx(() => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.prevIcon)))
]),
_: 1
}))
], 8, ["disabled", "aria-label", "aria-disabled", "onClick"]);
};
}
});
var Prev = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "prev.vue"]]);
exports["default"] = Prev;
//# sourceMappingURL=prev2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"prev2.js","sources":["../../../../../../../packages/components/pagination/src/components/prev.vue"],"sourcesContent":["<template>\n <button\n type=\"button\"\n class=\"btn-prev\"\n :disabled=\"internalDisabled\"\n :aria-label=\"prevText || t('el.pagination.prev')\"\n :aria-disabled=\"internalDisabled\"\n @click=\"$emit('click', $event)\"\n >\n <span v-if=\"prevText\">{{ prevText }}</span>\n <el-icon v-else>\n <component :is=\"prevIcon\" />\n </el-icon>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useLocale } from '@element-plus/hooks'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { paginationPrevEmits, paginationPrevProps } from './prev'\n\ndefineOptions({\n name: 'ElPaginationPrev',\n})\n\nconst props = defineProps(paginationPrevProps)\ndefineEmits(paginationPrevEmits)\n\nconst { t } = useLocale()\n\nconst internalDisabled = computed(\n () => props.disabled || props.currentPage <= 1\n)\n</script>\n"],"names":["useLocale","computed","_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;uCAsBc,CAAA;AAAA,EACZ,IAAM,EAAA,kBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AAExB,IAAA,MAAM,gBAAmB,GAAAC,YAAA,CAAA,MAAA,KAAA,CAAA,QAAA,IAAA,KAAA,CAAA,WAAA,IAAA,CAAA,CAAA,CAAA;AAAA,IAAA,OACjB,CAAA,IAAA,EAAM,MAAY,KAAA;AAAqB,MAC/C,OAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,29 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type Sizes from './sizes.vue';
export declare const paginationSizesProps: {
readonly pageSize: {
readonly type: import("vue").PropType<number>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly pageSizes: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | ((new (...args: any[]) => number[]) | (() => number[]))[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
readonly popperClass: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly disabled: BooleanConstructor;
readonly teleported: BooleanConstructor;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly appendSizeTo: StringConstructor;
};
export type PaginationSizesProps = ExtractPropTypes<typeof paginationSizesProps>;
export type PaginationSizesPropsPublic = __ExtractPublicPropTypes<typeof paginationSizesProps>;
export type SizesInstance = InstanceType<typeof Sizes> & unknown;

View File

@@ -0,0 +1,79 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var lodashUnified = require('lodash-unified');
var index$2 = require('../../../select/index.js');
var usePagination = require('../usePagination.js');
var sizes = require('./sizes2.js');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../../hooks/use-locale/index.js');
var index$1 = require('../../../../hooks/use-namespace/index.js');
var shared = require('@vue/shared');
const __default__ = vue.defineComponent({
name: "ElPaginationSizes"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: sizes.paginationSizesProps,
emits: ["page-size-change"],
setup(__props, { emit }) {
const props = __props;
const { t } = index.useLocale();
const ns = index$1.useNamespace("pagination");
const pagination = usePagination.usePagination();
const innerPageSize = vue.ref(props.pageSize);
vue.watch(() => props.pageSizes, (newVal, oldVal) => {
if (lodashUnified.isEqual(newVal, oldVal))
return;
if (shared.isArray(newVal)) {
const pageSize = newVal.includes(props.pageSize) ? props.pageSize : props.pageSizes[0];
emit("page-size-change", pageSize);
}
});
vue.watch(() => props.pageSize, (newVal) => {
innerPageSize.value = newVal;
});
const innerPageSizes = vue.computed(() => props.pageSizes);
function handleChange(val) {
var _a;
if (val !== innerPageSize.value) {
innerPageSize.value = val;
(_a = pagination.handleSizeChange) == null ? void 0 : _a.call(pagination, Number(val));
}
}
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("span", {
class: vue.normalizeClass(vue.unref(ns).e("sizes"))
}, [
vue.createVNode(vue.unref(index$2.ElSelect), {
"model-value": innerPageSize.value,
disabled: _ctx.disabled,
"popper-class": _ctx.popperClass,
size: _ctx.size,
teleported: _ctx.teleported,
"validate-event": false,
"append-to": _ctx.appendSizeTo,
onChange: handleChange
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(innerPageSizes), (item) => {
return vue.openBlock(), vue.createBlock(vue.unref(index$2.ElOption), {
key: item,
value: item,
label: item + vue.unref(t)("el.pagination.pagesize")
}, null, 8, ["value", "label"]);
}), 128))
]),
_: 1
}, 8, ["model-value", "disabled", "popper-class", "size", "teleported", "append-to"])
], 2);
};
}
});
var Sizes = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "sizes.vue"]]);
exports["default"] = Sizes;
//# sourceMappingURL=sizes.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sizes.js","sources":["../../../../../../../packages/components/pagination/src/components/sizes.vue"],"sourcesContent":["<template>\n <span :class=\"ns.e('sizes')\">\n <el-select\n :model-value=\"innerPageSize\"\n :disabled=\"disabled\"\n :popper-class=\"popperClass\"\n :size=\"size\"\n :teleported=\"teleported\"\n :validate-event=\"false\"\n :append-to=\"appendSizeTo\"\n @change=\"handleChange\"\n >\n <el-option\n v-for=\"item in innerPageSizes\"\n :key=\"item\"\n :value=\"item\"\n :label=\"item + t('el.pagination.pagesize')\"\n />\n </el-select>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { isEqual } from 'lodash-unified'\nimport { ElOption, ElSelect } from '@element-plus/components/select'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { isArray } from '@element-plus/utils'\nimport { usePagination } from '../usePagination'\nimport { paginationSizesProps } from './sizes'\n\ndefineOptions({\n name: 'ElPaginationSizes',\n})\n\nconst props = defineProps(paginationSizesProps)\nconst emit = defineEmits(['page-size-change'])\nconst { t } = useLocale()\nconst ns = useNamespace('pagination')\nconst pagination = usePagination()\nconst innerPageSize = ref<number>(props.pageSize!)\n\nwatch(\n () => props.pageSizes,\n (newVal, oldVal) => {\n if (isEqual(newVal, oldVal)) return\n if (isArray(newVal)) {\n const pageSize = newVal.includes(props.pageSize!)\n ? props.pageSize\n : props.pageSizes[0]\n emit('page-size-change', pageSize)\n }\n }\n)\n\nwatch(\n () => props.pageSize,\n (newVal) => {\n innerPageSize.value = newVal!\n }\n)\n\nconst innerPageSizes = computed(() => props.pageSizes)\nfunction handleChange(val: number) {\n if (val !== innerPageSize.value) {\n innerPageSize.value = val\n pagination.handleSizeChange?.(Number(val))\n }\n}\n</script>\n"],"names":["useLocale","useNamespace","usePagination","ref","watch","isArray","computed","_openBlock","_createElementBlock","_normalizeClass","_unref"],"mappings":";;;;;;;;;;;;;;uCA+Bc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,YAAY,CAAA,CAAA;AACpC,IAAA,MAAM,aAAaC,2BAAc,EAAA,CAAA;AACjC,IAAM,MAAA,aAAA,GAAgBC,OAAY,CAAA,KAAA,CAAM,QAAS,CAAA,CAAA;AAEjD,IAAAC,SAAA,CAAA,MAAA,KAAA,CAAA,SAAA,EAAA,CAAA,MAAA,EAAA,MAAA,KAAA;AAAA,MACE,yBAAY,CAAA,MAAA,EAAA,MAAA,CAAA;AAAA,eACH;AACP,MAAI,IAAAC,cAAA,CAAA,MAAgB,CAAA,EAAA;AACpB,QAAI,MAAA,iBAAiB,CAAA,QAAA,CAAA,KAAA,CAAA,QAAA,CAAA,GAAA,KAAA,CAAA,QAAA,GAAA,KAAA,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA;AACnB,QAAM,IAAA,CAAA,kBAAkB,EAAA,QAAA,CAAA,CAAS;AAGjC,OAAA;AAAiC,KACnC,CAAA,CAAA;AAAA,IACFD,SAAA,CAAA,MAAA,KAAA,CAAA,QAAA,EAAA,CAAA,MAAA,KAAA;AAAA,MACF,aAAA,CAAA,KAAA,GAAA,MAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AAAA,IAAA,oBACc,GAAAE,YAAA,CAAA,MAAA,KAAA,CAAA,SAAA,CAAA,CAAA;AAAA,IAAA,SACA,YAAA,CAAA,GAAA,EAAA;AACV,MAAA,IAAA,EAAA,CAAA;AAAsB,MACxB,IAAA,GAAA,KAAA,aAAA,CAAA,KAAA,EAAA;AAAA,QACF,aAAA,CAAA,KAAA,GAAA,GAAA,CAAA;AAEA,QAAA,CAAA,EAAuB,GAAA,UAAA,CAAA,gBAAe,KAAA,IAAe,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,UAAA,EAAA,MAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AACrD,OAAA;AACE,KAAI;AACF,IAAA,OAAA,CAAA,IAAA,EAAA,MAAsB,KAAA;AACtB,MAAW,OAAAC,aAAA,EAAA,EAAAC,sBAA0B,CAAA,MAAI,EAAA;AAAA,QAC3C,KAAA,EAAAC,kBAAA,CAAAC,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA;AAAA,OACF,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,56 @@
declare const _default: import("vue").DefineComponent<{
readonly pageSize: {
readonly type: import("vue").PropType<number>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly pageSizes: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | ((new (...args: any[]) => number[]) | (() => number[]))[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
readonly popperClass: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly disabled: BooleanConstructor;
readonly teleported: BooleanConstructor;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly appendSizeTo: StringConstructor;
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
"page-size-change": (...args: any[]) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly pageSize: {
readonly type: import("vue").PropType<number>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly pageSizes: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | ((new (...args: any[]) => number[]) | (() => number[]))[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
readonly popperClass: {
readonly type: import("vue").PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly disabled: BooleanConstructor;
readonly teleported: BooleanConstructor;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly appendSizeTo: StringConstructor;
}>> & {
"onPage-size-change"?: ((...args: any[]) => any) | undefined;
}, {
readonly disabled: boolean;
readonly teleported: boolean;
readonly pageSizes: number[];
}>;
export default _default;

View File

@@ -0,0 +1,31 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../../utils/vue/props/runtime.js');
var typescript = require('../../../../utils/typescript.js');
var size = require('../../../../constants/size.js');
const paginationSizesProps = runtime.buildProps({
pageSize: {
type: Number,
required: true
},
pageSizes: {
type: runtime.definePropType(Array),
default: () => typescript.mutable([10, 20, 30, 40, 50, 100])
},
popperClass: {
type: String
},
disabled: Boolean,
teleported: Boolean,
size: {
type: String,
values: size.componentSizes
},
appendSizeTo: String
});
exports.paginationSizesProps = paginationSizesProps;
//# sourceMappingURL=sizes2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sizes2.js","sources":["../../../../../../../packages/components/pagination/src/components/sizes.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Sizes from './sizes.vue'\n\nexport const paginationSizesProps = buildProps({\n pageSize: {\n type: Number,\n required: true,\n },\n pageSizes: {\n type: definePropType<number[]>(Array),\n default: () => mutable([10, 20, 30, 40, 50, 100] as const),\n },\n popperClass: {\n type: String,\n },\n disabled: Boolean,\n teleported: Boolean,\n size: {\n type: String,\n values: componentSizes,\n },\n appendSizeTo: String,\n} as const)\n\nexport type PaginationSizesProps = ExtractPropTypes<typeof paginationSizesProps>\nexport type PaginationSizesPropsPublic = __ExtractPublicPropTypes<\n typeof paginationSizesProps\n>\n\nexport type SizesInstance = InstanceType<typeof Sizes> & unknown\n"],"names":["buildProps","definePropType","mutable","componentSizes"],"mappings":";;;;;;;;AAEY,MAAC,oBAAoB,GAAGA,kBAAU,CAAC;AAC/C,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAMC,kBAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;AACrD,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEC,mBAAc;AAC1B,GAAG;AACH,EAAE,YAAY,EAAE,MAAM;AACtB,CAAC;;;;"}

View File

@@ -0,0 +1,8 @@
import type Total from './total.vue';
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
export declare const paginationTotalProps: {
readonly total: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1000, boolean>;
};
export type PaginationTotalProps = ExtractPropTypes<typeof paginationTotalProps>;
export type PaginationTotalPropsPublic = __ExtractPublicPropTypes<typeof paginationTotalProps>;
export type TotalInstance = InstanceType<typeof Total> & unknown;

View File

@@ -0,0 +1,15 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../../utils/vue/props/runtime.js');
const paginationTotalProps = runtime.buildProps({
total: {
type: Number,
default: 1e3
}
});
exports.paginationTotalProps = paginationTotalProps;
//# sourceMappingURL=total.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"total.js","sources":["../../../../../../../packages/components/pagination/src/components/total.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\n\nimport type Total from './total.vue'\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport const paginationTotalProps = buildProps({\n total: {\n type: Number,\n default: 1000,\n },\n} as const)\n\nexport type PaginationTotalProps = ExtractPropTypes<typeof paginationTotalProps>\nexport type PaginationTotalPropsPublic = __ExtractPublicPropTypes<\n typeof paginationTotalProps\n>\n\nexport type TotalInstance = InstanceType<typeof Total> & unknown\n"],"names":["buildProps"],"mappings":";;;;;;AACY,MAAC,oBAAoB,GAAGA,kBAAU,CAAC;AAC/C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,8 @@
declare const _default: import("vue").DefineComponent<{
readonly total: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1000, boolean>;
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly total: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1000, boolean>;
}>>, {
readonly total: number;
}>;
export default _default;

View File

@@ -0,0 +1,35 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var usePagination = require('../usePagination.js');
var total = require('./total.js');
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../../hooks/use-locale/index.js');
var index$1 = require('../../../../hooks/use-namespace/index.js');
const __default__ = vue.defineComponent({
name: "ElPaginationTotal"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: total.paginationTotalProps,
setup(__props) {
const { t } = index.useLocale();
const ns = index$1.useNamespace("pagination");
const { disabled } = usePagination.usePagination();
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("span", {
class: vue.normalizeClass(vue.unref(ns).e("total")),
disabled: vue.unref(disabled)
}, vue.toDisplayString(vue.unref(t)("el.pagination.total", {
total: _ctx.total
})), 11, ["disabled"]);
};
}
});
var Total = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "total.vue"]]);
exports["default"] = Total;
//# sourceMappingURL=total2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"total2.js","sources":["../../../../../../../packages/components/pagination/src/components/total.vue"],"sourcesContent":["<template>\n <span :class=\"ns.e('total')\" :disabled=\"disabled\">\n {{\n t('el.pagination.total', {\n total,\n })\n }}\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { usePagination } from '../usePagination'\nimport { paginationTotalProps } from './total'\n\nconst { t } = useLocale()\nconst ns = useNamespace('pagination')\nconst { disabled } = usePagination()\n\ndefineOptions({\n name: 'ElPaginationTotal',\n})\n\ndefineProps(paginationTotalProps)\n</script>\n"],"names":["useLocale","useNamespace","usePagination"],"mappings":";;;;;;;;;;;uCAmBc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;AANA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,YAAY,CAAA,CAAA;AACpC,IAAM,MAAA,EAAE,QAAS,EAAA,GAAIC,2BAAc,EAAA,CAAA;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,9 @@
import type { ComputedRef, InjectionKey, WritableComputedRef } from 'vue';
export interface ElPaginationContext {
currentPage?: WritableComputedRef<number>;
pageCount?: ComputedRef<number>;
disabled?: ComputedRef<boolean>;
changeEvent?: (val: number) => void;
handleSizeChange?: (val: number) => void;
}
export declare const elPaginationKey: InjectionKey<ElPaginationContext>;

View File

@@ -0,0 +1,8 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const elPaginationKey = Symbol("elPaginationKey");
exports.elPaginationKey = elPaginationKey;
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../../../packages/components/pagination/src/constants.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey, WritableComputedRef } from 'vue'\n\nexport interface ElPaginationContext {\n currentPage?: WritableComputedRef<number>\n pageCount?: ComputedRef<number>\n disabled?: ComputedRef<boolean>\n changeEvent?: (val: number) => void\n handleSizeChange?: (val: number) => void\n}\n\nexport const elPaginationKey: InjectionKey<ElPaginationContext> =\n Symbol('elPaginationKey')\n"],"names":[],"mappings":";;;;AAAY,MAAC,eAAe,GAAG,MAAM,CAAC,iBAAiB;;;;"}

View File

@@ -0,0 +1,129 @@
import type { ExtractPropTypes, VNode, __ExtractPublicPropTypes } from 'vue';
export declare const paginationProps: {
readonly pageSize: NumberConstructor;
readonly defaultPageSize: NumberConstructor;
readonly total: NumberConstructor;
readonly pageCount: NumberConstructor;
readonly pagerCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
readonly currentPage: NumberConstructor;
readonly defaultCurrentPage: NumberConstructor;
readonly layout: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
readonly pageSizes: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | ((new (...args: any[]) => number[]) | (() => number[]))[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
readonly popperClass: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly prevText: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly prevIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
readonly nextText: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly nextIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
readonly teleported: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly small: BooleanConstructor;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly background: BooleanConstructor;
readonly disabled: BooleanConstructor;
readonly hideOnSinglePage: BooleanConstructor;
readonly appendSizeTo: StringConstructor;
};
export type PaginationProps = ExtractPropTypes<typeof paginationProps>;
export type PaginationPropsPublic = __ExtractPublicPropTypes<typeof paginationProps>;
export declare const paginationEmits: {
'update:current-page': (val: number) => boolean;
'update:page-size': (val: number) => boolean;
'size-change': (val: number) => boolean;
change: (currentPage: number, pageSize: number) => boolean;
'current-change': (val: number) => boolean;
'prev-click': (val: number) => boolean;
'next-click': (val: number) => boolean;
};
export type PaginationEmits = typeof paginationEmits;
declare const _default: import("vue").DefineComponent<{
readonly pageSize: NumberConstructor;
readonly defaultPageSize: NumberConstructor;
readonly total: NumberConstructor;
readonly pageCount: NumberConstructor;
readonly pagerCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
readonly currentPage: NumberConstructor;
readonly defaultCurrentPage: NumberConstructor;
readonly layout: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
readonly pageSizes: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | ((new (...args: any[]) => number[]) | (() => number[]))[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
readonly popperClass: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly prevText: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly prevIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
readonly nextText: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly nextIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
readonly teleported: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly small: BooleanConstructor;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly background: BooleanConstructor;
readonly disabled: BooleanConstructor;
readonly hideOnSinglePage: BooleanConstructor;
readonly appendSizeTo: StringConstructor;
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> | null, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
'update:current-page': (val: number) => boolean;
'update:page-size': (val: number) => boolean;
'size-change': (val: number) => boolean;
change: (currentPage: number, pageSize: number) => boolean;
'current-change': (val: number) => boolean;
'prev-click': (val: number) => boolean;
'next-click': (val: number) => boolean;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
readonly pageSize: NumberConstructor;
readonly defaultPageSize: NumberConstructor;
readonly total: NumberConstructor;
readonly pageCount: NumberConstructor;
readonly pagerCount: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
readonly currentPage: NumberConstructor;
readonly defaultCurrentPage: NumberConstructor;
readonly layout: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
readonly pageSizes: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | ((new (...args: any[]) => number[]) | (() => number[]))[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
readonly popperClass: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly prevText: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly prevIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
readonly nextText: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly nextIcon: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown, () => any, boolean>;
readonly teleported: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly small: BooleanConstructor;
readonly size: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly background: BooleanConstructor;
readonly disabled: BooleanConstructor;
readonly hideOnSinglePage: BooleanConstructor;
readonly appendSizeTo: StringConstructor;
}>> & {
onChange?: ((currentPage: number, pageSize: number) => any) | undefined;
"onUpdate:current-page"?: ((val: number) => any) | undefined;
"onUpdate:page-size"?: ((val: number) => any) | undefined;
"onSize-change"?: ((val: number) => any) | undefined;
"onCurrent-change"?: ((val: number) => any) | undefined;
"onPrev-click"?: ((val: number) => any) | undefined;
"onNext-click"?: ((val: number) => any) | undefined;
}, {
readonly small: boolean;
readonly disabled: boolean;
readonly background: boolean;
readonly layout: string;
readonly popperClass: string;
readonly teleported: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
readonly prevText: string;
readonly prevIcon: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>;
readonly nextText: string;
readonly nextIcon: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>;
readonly pageSizes: number[];
readonly pagerCount: number;
readonly hideOnSinglePage: boolean;
}>;
export default _default;

View File

@@ -0,0 +1,304 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var iconsVue = require('@element-plus/icons-vue');
var constants = require('./constants.js');
var prev = require('./components/prev2.js');
var next = require('./components/next2.js');
var sizes = require('./components/sizes.js');
var jumper = require('./components/jumper2.js');
var total = require('./components/total2.js');
var pager = require('./components/pager2.js');
var index = require('../../../hooks/use-size/index.js');
var runtime = require('../../../utils/vue/props/runtime.js');
var types = require('../../../utils/types.js');
var typescript = require('../../../utils/typescript.js');
var icon = require('../../../utils/vue/icon.js');
var index$1 = require('../../../hooks/use-locale/index.js');
var index$2 = require('../../../hooks/use-namespace/index.js');
var index$3 = require('../../../hooks/use-deprecated/index.js');
var event = require('../../../constants/event.js');
var error = require('../../../utils/error.js');
const isAbsent = (v) => typeof v !== "number";
const paginationProps = runtime.buildProps({
pageSize: Number,
defaultPageSize: Number,
total: Number,
pageCount: Number,
pagerCount: {
type: Number,
validator: (value) => {
return types.isNumber(value) && Math.trunc(value) === value && value > 4 && value < 22 && value % 2 === 1;
},
default: 7
},
currentPage: Number,
defaultCurrentPage: Number,
layout: {
type: String,
default: ["prev", "pager", "next", "jumper", "->", "total"].join(", ")
},
pageSizes: {
type: runtime.definePropType(Array),
default: () => typescript.mutable([10, 20, 30, 40, 50, 100])
},
popperClass: {
type: String,
default: ""
},
prevText: {
type: String,
default: ""
},
prevIcon: {
type: icon.iconPropType,
default: () => iconsVue.ArrowLeft
},
nextText: {
type: String,
default: ""
},
nextIcon: {
type: icon.iconPropType,
default: () => iconsVue.ArrowRight
},
teleported: {
type: Boolean,
default: true
},
small: Boolean,
size: index.useSizeProp,
background: Boolean,
disabled: Boolean,
hideOnSinglePage: Boolean,
appendSizeTo: String
});
const paginationEmits = {
"update:current-page": (val) => types.isNumber(val),
"update:page-size": (val) => types.isNumber(val),
"size-change": (val) => types.isNumber(val),
change: (currentPage, pageSize) => types.isNumber(currentPage) && types.isNumber(pageSize),
"current-change": (val) => types.isNumber(val),
"prev-click": (val) => types.isNumber(val),
"next-click": (val) => types.isNumber(val)
};
const componentName = "ElPagination";
var Pagination = vue.defineComponent({
name: componentName,
props: paginationProps,
emits: paginationEmits,
setup(props, { emit, slots }) {
const { t } = index$1.useLocale();
const ns = index$2.useNamespace("pagination");
const vnodeProps = vue.getCurrentInstance().vnode.props || {};
const _globalSize = index.useGlobalSize();
const _size = vue.computed(() => {
var _a;
return props.small ? "small" : (_a = props.size) != null ? _a : _globalSize.value;
});
index$3.useDeprecated({
from: "small",
replacement: "size",
version: "3.0.0",
scope: "el-pagination",
ref: "https://element-plus.org/zh-CN/component/pagination.html"
}, vue.computed(() => !!props.small));
const hasCurrentPageListener = "onUpdate:currentPage" in vnodeProps || "onUpdate:current-page" in vnodeProps || "onCurrentChange" in vnodeProps;
const hasPageSizeListener = "onUpdate:pageSize" in vnodeProps || "onUpdate:page-size" in vnodeProps || "onSizeChange" in vnodeProps;
const assertValidUsage = vue.computed(() => {
if (isAbsent(props.total) && isAbsent(props.pageCount))
return false;
if (!isAbsent(props.currentPage) && !hasCurrentPageListener)
return false;
if (props.layout.includes("sizes")) {
if (!isAbsent(props.pageCount)) {
if (!hasPageSizeListener)
return false;
} else if (!isAbsent(props.total)) {
if (!isAbsent(props.pageSize)) {
if (!hasPageSizeListener) {
return false;
}
}
}
}
return true;
});
const innerPageSize = vue.ref(isAbsent(props.defaultPageSize) ? 10 : props.defaultPageSize);
const innerCurrentPage = vue.ref(isAbsent(props.defaultCurrentPage) ? 1 : props.defaultCurrentPage);
const pageSizeBridge = vue.computed({
get() {
return isAbsent(props.pageSize) ? innerPageSize.value : props.pageSize;
},
set(v) {
if (isAbsent(props.pageSize)) {
innerPageSize.value = v;
}
if (hasPageSizeListener) {
emit("update:page-size", v);
emit("size-change", v);
}
}
});
const pageCountBridge = vue.computed(() => {
let pageCount = 0;
if (!isAbsent(props.pageCount)) {
pageCount = props.pageCount;
} else if (!isAbsent(props.total)) {
pageCount = Math.max(1, Math.ceil(props.total / pageSizeBridge.value));
}
return pageCount;
});
const currentPageBridge = vue.computed({
get() {
return isAbsent(props.currentPage) ? innerCurrentPage.value : props.currentPage;
},
set(v) {
let newCurrentPage = v;
if (v < 1) {
newCurrentPage = 1;
} else if (v > pageCountBridge.value) {
newCurrentPage = pageCountBridge.value;
}
if (isAbsent(props.currentPage)) {
innerCurrentPage.value = newCurrentPage;
}
if (hasCurrentPageListener) {
emit("update:current-page", newCurrentPage);
emit("current-change", newCurrentPage);
}
}
});
vue.watch(pageCountBridge, (val) => {
if (currentPageBridge.value > val)
currentPageBridge.value = val;
});
vue.watch([currentPageBridge, pageSizeBridge], (value) => {
emit(event.CHANGE_EVENT, ...value);
}, { flush: "post" });
function handleCurrentChange(val) {
currentPageBridge.value = val;
}
function handleSizeChange(val) {
pageSizeBridge.value = val;
const newPageCount = pageCountBridge.value;
if (currentPageBridge.value > newPageCount) {
currentPageBridge.value = newPageCount;
}
}
function prev$1() {
if (props.disabled)
return;
currentPageBridge.value -= 1;
emit("prev-click", currentPageBridge.value);
}
function next$1() {
if (props.disabled)
return;
currentPageBridge.value += 1;
emit("next-click", currentPageBridge.value);
}
function addClass(element, cls) {
if (element) {
if (!element.props) {
element.props = {};
}
element.props.class = [element.props.class, cls].join(" ");
}
}
vue.provide(constants.elPaginationKey, {
pageCount: pageCountBridge,
disabled: vue.computed(() => props.disabled),
currentPage: currentPageBridge,
changeEvent: handleCurrentChange,
handleSizeChange
});
return () => {
var _a, _b;
if (!assertValidUsage.value) {
error.debugWarn(componentName, t("el.pagination.deprecationWarning"));
return null;
}
if (!props.layout)
return null;
if (props.hideOnSinglePage && pageCountBridge.value <= 1)
return null;
const rootChildren = [];
const rightWrapperChildren = [];
const rightWrapperRoot = vue.h("div", { class: ns.e("rightwrapper") }, rightWrapperChildren);
const TEMPLATE_MAP = {
prev: vue.h(prev["default"], {
disabled: props.disabled,
currentPage: currentPageBridge.value,
prevText: props.prevText,
prevIcon: props.prevIcon,
onClick: prev$1
}),
jumper: vue.h(jumper["default"], {
size: _size.value
}),
pager: vue.h(pager["default"], {
currentPage: currentPageBridge.value,
pageCount: pageCountBridge.value,
pagerCount: props.pagerCount,
onChange: handleCurrentChange,
disabled: props.disabled
}),
next: vue.h(next["default"], {
disabled: props.disabled,
currentPage: currentPageBridge.value,
pageCount: pageCountBridge.value,
nextText: props.nextText,
nextIcon: props.nextIcon,
onClick: next$1
}),
sizes: vue.h(sizes["default"], {
pageSize: pageSizeBridge.value,
pageSizes: props.pageSizes,
popperClass: props.popperClass,
disabled: props.disabled,
teleported: props.teleported,
size: _size.value,
appendSizeTo: props.appendSizeTo
}),
slot: (_b = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : null,
total: vue.h(total["default"], { total: isAbsent(props.total) ? 0 : props.total })
};
const components = props.layout.split(",").map((item) => item.trim());
let haveRightWrapper = false;
components.forEach((c) => {
if (c === "->") {
haveRightWrapper = true;
return;
}
if (!haveRightWrapper) {
rootChildren.push(TEMPLATE_MAP[c]);
} else {
rightWrapperChildren.push(TEMPLATE_MAP[c]);
}
});
addClass(rootChildren[0], ns.is("first"));
addClass(rootChildren[rootChildren.length - 1], ns.is("last"));
if (haveRightWrapper && rightWrapperChildren.length > 0) {
addClass(rightWrapperChildren[0], ns.is("first"));
addClass(rightWrapperChildren[rightWrapperChildren.length - 1], ns.is("last"));
rootChildren.push(rightWrapperRoot);
}
return vue.h("div", {
class: [
ns.b(),
ns.is("background", props.background),
ns.m(_size.value)
]
}, rootChildren);
};
}
});
exports["default"] = Pagination;
exports.paginationEmits = paginationEmits;
exports.paginationProps = paginationProps;
//# sourceMappingURL=pagination.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
export declare const usePagination: () => import("./constants").ElPaginationContext;

View File

@@ -0,0 +1,11 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var constants = require('./constants.js');
const usePagination = () => vue.inject(constants.elPaginationKey, {});
exports.usePagination = usePagination;
//# sourceMappingURL=usePagination.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"usePagination.js","sources":["../../../../../../packages/components/pagination/src/usePagination.ts"],"sourcesContent":["import { inject } from 'vue'\nimport { elPaginationKey } from './constants'\n\nexport const usePagination = () => inject(elPaginationKey, {})\n"],"names":["inject","elPaginationKey"],"mappings":";;;;;;;AAEY,MAAC,aAAa,GAAG,MAAMA,UAAM,CAACC,yBAAe,EAAE,EAAE;;;;"}

View File

@@ -0,0 +1,4 @@
import 'element-plus/es/components/base/style/css';
import 'element-plus/theme-chalk/el-pagination.css';
import 'element-plus/es/components/select/style/css';
import 'element-plus/es/components/input/style/css';

View File

@@ -0,0 +1,8 @@
'use strict';
require('../../base/style/css.js');
require('element-plus/theme-chalk/el-pagination.css');
require('../../select/style/css.js');
require('../../input/style/css.js');
//# sourceMappingURL=css.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1,4 @@
import 'element-plus/es/components/base/style';
import 'element-plus/theme-chalk/src/pagination.scss';
import 'element-plus/es/components/select/style';
import 'element-plus/es/components/input/style';

View File

@@ -0,0 +1,8 @@
'use strict';
require('../../base/style/index.js');
require('element-plus/theme-chalk/src/pagination.scss');
require('../../select/style/index.js');
require('../../input/style/index.js');
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}