ep-craft 0.1.29 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/src/hooks/use-form-common-props.js +15 -13
- package/dist/components/pagination/index.d.ts +4 -2
- package/dist/components/pagination/index.js +9 -3
- package/dist/components/pagination/src/components/jumper.d.ts +13 -0
- package/dist/components/pagination/src/components/jumper.js +16 -0
- package/dist/components/pagination/src/components/jumper.vue.d.ts +16 -0
- package/dist/components/pagination/src/components/jumper.vue.js +58 -0
- package/dist/components/pagination/src/components/jumper2.vue.js +4 -0
- package/dist/components/pagination/src/components/next.d.ts +22 -0
- package/dist/components/pagination/src/components/next.js +26 -0
- package/dist/components/pagination/src/components/next.vue.d.ts +42 -0
- package/dist/components/pagination/src/components/next.vue.js +44 -0
- package/dist/components/pagination/src/components/next2.vue.js +4 -0
- package/dist/components/pagination/src/components/pager.d.ts +16 -0
- package/dist/components/pagination/src/components/pager.js +24 -0
- package/dist/components/pagination/src/components/pager.vue.d.ts +30 -0
- package/dist/components/pagination/src/components/pager.vue.js +148 -0
- package/dist/components/pagination/src/components/pager2.vue.js +4 -0
- package/dist/components/pagination/src/components/prev.d.ts +24 -0
- package/dist/components/pagination/src/components/prev.js +25 -0
- package/dist/components/pagination/src/components/prev.vue.d.ts +39 -0
- package/dist/components/pagination/src/components/prev.vue.js +44 -0
- package/dist/components/pagination/src/components/prev2.vue.js +4 -0
- package/dist/components/pagination/src/components/sizes.d.ts +35 -0
- package/dist/components/pagination/src/components/sizes.js +34 -0
- package/dist/components/pagination/src/components/sizes.vue.d.ts +68 -0
- package/dist/components/pagination/src/components/sizes.vue.js +73 -0
- package/dist/components/pagination/src/components/sizes2.vue.js +4 -0
- package/dist/components/pagination/src/components/total.d.ts +8 -0
- package/dist/components/pagination/src/components/total.js +15 -0
- package/dist/components/pagination/src/components/total.vue.d.ts +8 -0
- package/dist/components/pagination/src/components/total.vue.js +33 -0
- package/dist/components/pagination/src/components/total2.vue.js +4 -0
- package/dist/components/pagination/src/constants.d.ts +9 -0
- package/dist/components/pagination/src/constants.js +4 -0
- package/dist/components/pagination/src/pagination.d.ts +147 -0
- package/dist/components/pagination/src/pagination.js +314 -0
- package/dist/components/pagination/src/usePagination.d.ts +1 -0
- package/dist/components/pagination/src/usePagination.js +6 -0
- package/dist/components/select/index.d.ts +2098 -0
- package/dist/components/select/index.js +10 -7
- package/dist/ep-craft.js +142 -131
- package/dist/index.css +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +1 -0
- package/package.json +1 -1
- package/theme-chalk/src/float-label.scss +51 -26
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as a, inject as r, computed as n, unref as d } from "vue";
|
|
2
2
|
import { useGlobalSize as f } from "../../../../hooks/use-size/index.js";
|
|
3
|
-
import { useProp as
|
|
4
|
-
import { formContextKey as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
() => u.value ||
|
|
3
|
+
import { useProp as l } from "../../../../hooks/use-prop/index.js";
|
|
4
|
+
import { formContextKey as m, formItemContextKey as p } from "../constants.js";
|
|
5
|
+
const v = (s, e = {}) => {
|
|
6
|
+
const o = a(void 0), u = e.prop ? o : l("size"), c = e.global ? o : f(), t = e.form ? { size: void 0 } : r(m, void 0), i = e.formItem ? { size: void 0 } : r(p, void 0);
|
|
7
|
+
return n(
|
|
8
|
+
() => u.value || d(s) || (i == null ? void 0 : i.size) || (t == null ? void 0 : t.size) || c.value || ""
|
|
9
9
|
);
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
};
|
|
10
|
+
}, z = (s) => {
|
|
11
|
+
const e = l("disabled"), o = r(m, void 0);
|
|
12
|
+
return n(() => e.value ?? d(s) ?? (o == null ? void 0 : o.disabled) ?? !1);
|
|
13
|
+
}, S = v, D = z;
|
|
14
14
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
D as useDisabled,
|
|
16
|
+
z as useFormDisabled,
|
|
17
|
+
v as useFormSize,
|
|
18
|
+
S as useSize
|
|
17
19
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
export declare const EpPagination: typeof
|
|
2
|
+
import Pagination from './src/pagination';
|
|
3
|
+
export declare const EpPagination: typeof Pagination & Plugin;
|
|
4
4
|
export default EpPagination;
|
|
5
|
+
export * from './src/pagination';
|
|
6
|
+
export * from './src/constants';
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { ElPagination as n } from "element-plus";
|
|
2
1
|
import { withInstall as i } from "../../utils/with-install.js";
|
|
3
|
-
|
|
2
|
+
import o from "./src/pagination.js";
|
|
3
|
+
import { paginationEmits as m, paginationProps as g } from "./src/pagination.js";
|
|
4
|
+
const a = i(
|
|
5
|
+
o,
|
|
6
|
+
"ep-pagination"
|
|
7
|
+
);
|
|
4
8
|
export {
|
|
5
|
-
|
|
9
|
+
a as EpPagination,
|
|
10
|
+
m as paginationEmits,
|
|
11
|
+
g as paginationProps
|
|
6
12
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type Jumper from './jumper.vue';
|
|
3
|
+
export declare const paginationJumperProps: {
|
|
4
|
+
readonly size: {
|
|
5
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
|
|
6
|
+
readonly required: false;
|
|
7
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
8
|
+
__epPropKey: true;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type PaginationJumperProps = ExtractPropTypes<typeof paginationJumperProps>;
|
|
12
|
+
export type PaginationJumperPropsPublic = ExtractPublicPropTypes<typeof paginationJumperProps>;
|
|
13
|
+
export type PaginationJumperInstance = InstanceType<typeof Jumper> & unknown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import { componentSizes as o } from "../../../../constants/size.js";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import { buildProps as p } from "../../../../utils/vue/props/runtime.js";
|
|
7
|
+
import "vue";
|
|
8
|
+
const a = p({
|
|
9
|
+
size: {
|
|
10
|
+
type: String,
|
|
11
|
+
values: o
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
a as paginationJumperProps
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly size: {
|
|
3
|
+
readonly type: import("vue").PropType<import("../../../../utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
|
|
4
|
+
readonly required: false;
|
|
5
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
6
|
+
__epPropKey: true;
|
|
7
|
+
};
|
|
8
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
readonly size: {
|
|
10
|
+
readonly type: import("vue").PropType<import("../../../../utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", unknown>>;
|
|
11
|
+
readonly required: false;
|
|
12
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
13
|
+
__epPropKey: true;
|
|
14
|
+
};
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent as g, ref as _, computed as b, openBlock as h, createElementBlock as v, unref as e, normalizeClass as i, createElementVNode as l, toDisplayString as m, createVNode as C } from "vue";
|
|
2
|
+
import { useNamespace as z } from "../../../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import { useLocale as V } from "../../../../hooks/use-locale/index.js";
|
|
8
|
+
import "../../../../hooks/use-size/index.js";
|
|
9
|
+
import "@popperjs/core";
|
|
10
|
+
import "../../../../hooks/use-z-index/index.js";
|
|
11
|
+
import "../../../../hooks/use-delayed-toggle/index.js";
|
|
12
|
+
import "../../../../hooks/use-aria/index.js";
|
|
13
|
+
import "../../../../hooks/use-model-toggle/index.js";
|
|
14
|
+
import "../../../../hooks/use-empty-values/index.js";
|
|
15
|
+
import { EpInput as x } from "../../../input/index.js";
|
|
16
|
+
import { usePagination as E } from "../usePagination.js";
|
|
17
|
+
import { paginationJumperProps as I } from "./jumper.js";
|
|
18
|
+
const N = ["disabled"], Q = /* @__PURE__ */ g({
|
|
19
|
+
name: "ElPaginationJumper",
|
|
20
|
+
__name: "jumper",
|
|
21
|
+
props: I,
|
|
22
|
+
setup(j) {
|
|
23
|
+
const { t } = V(), o = z("pagination"), { pageCount: u, disabled: r, currentPage: n, changeEvent: p } = E(), s = _(), c = b(() => s.value ?? (n == null ? void 0 : n.value));
|
|
24
|
+
function d(a) {
|
|
25
|
+
s.value = a ? +a : "";
|
|
26
|
+
}
|
|
27
|
+
function f(a) {
|
|
28
|
+
a = Math.trunc(+a), p == null || p(a), s.value = void 0;
|
|
29
|
+
}
|
|
30
|
+
return (a, k) => (h(), v("span", {
|
|
31
|
+
class: i(e(o).e("jump")),
|
|
32
|
+
disabled: e(r)
|
|
33
|
+
}, [
|
|
34
|
+
l("span", {
|
|
35
|
+
class: i([e(o).e("goto")])
|
|
36
|
+
}, m(e(t)("el.pagination.goto")), 3),
|
|
37
|
+
C(e(x), {
|
|
38
|
+
size: a.size,
|
|
39
|
+
class: i([e(o).e("editor"), e(o).is("in-pagination")]),
|
|
40
|
+
min: 1,
|
|
41
|
+
max: e(u),
|
|
42
|
+
disabled: e(r),
|
|
43
|
+
"model-value": c.value,
|
|
44
|
+
"validate-event": !1,
|
|
45
|
+
"aria-label": e(t)("el.pagination.page"),
|
|
46
|
+
type: "number",
|
|
47
|
+
"onUpdate:modelValue": d,
|
|
48
|
+
onChange: f
|
|
49
|
+
}, null, 8, ["size", "class", "max", "disabled", "model-value", "aria-label"]),
|
|
50
|
+
l("span", {
|
|
51
|
+
class: i([e(o).e("classifier")])
|
|
52
|
+
}, m(e(t)("el.pagination.pageClassifier")), 3)
|
|
53
|
+
], 10, N));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
Q as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type Next from './next.vue';
|
|
3
|
+
export declare const paginationNextProps: {
|
|
4
|
+
readonly disabled: BooleanConstructor;
|
|
5
|
+
readonly currentPage: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
6
|
+
readonly pageCount: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 50, boolean>;
|
|
7
|
+
readonly nextText: {
|
|
8
|
+
readonly type: import("vue").PropType<string>;
|
|
9
|
+
readonly required: false;
|
|
10
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
11
|
+
__epPropKey: true;
|
|
12
|
+
};
|
|
13
|
+
readonly nextIcon: {
|
|
14
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
15
|
+
readonly required: false;
|
|
16
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
17
|
+
__epPropKey: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type PaginationNextProps = ExtractPropTypes<typeof paginationNextProps>;
|
|
21
|
+
export type PaginationNextPropsPublic = ExtractPublicPropTypes<typeof paginationNextProps>;
|
|
22
|
+
export type NextInstance = InstanceType<typeof Next> & unknown;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import { iconPropType as t } from "../../../../utils/vue/icon.js";
|
|
5
|
+
import "vue";
|
|
6
|
+
import { buildProps as e } from "../../../../utils/vue/props/runtime.js";
|
|
7
|
+
const a = e({
|
|
8
|
+
disabled: Boolean,
|
|
9
|
+
currentPage: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 1
|
|
12
|
+
},
|
|
13
|
+
pageCount: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 50
|
|
16
|
+
},
|
|
17
|
+
nextText: {
|
|
18
|
+
type: String
|
|
19
|
+
},
|
|
20
|
+
nextIcon: {
|
|
21
|
+
type: t
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
a as paginationNextProps
|
|
26
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly disabled: BooleanConstructor;
|
|
3
|
+
readonly currentPage: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
4
|
+
readonly pageCount: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 50, boolean>;
|
|
5
|
+
readonly nextText: {
|
|
6
|
+
readonly type: import("vue").PropType<string>;
|
|
7
|
+
readonly required: false;
|
|
8
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
9
|
+
__epPropKey: true;
|
|
10
|
+
};
|
|
11
|
+
readonly nextIcon: {
|
|
12
|
+
readonly type: import("vue").PropType<import("../../../../utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
13
|
+
readonly required: false;
|
|
14
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
15
|
+
__epPropKey: true;
|
|
16
|
+
};
|
|
17
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
click: (...args: any[]) => void;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
readonly disabled: BooleanConstructor;
|
|
21
|
+
readonly currentPage: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
22
|
+
readonly pageCount: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 50, boolean>;
|
|
23
|
+
readonly nextText: {
|
|
24
|
+
readonly type: import("vue").PropType<string>;
|
|
25
|
+
readonly required: false;
|
|
26
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
27
|
+
__epPropKey: true;
|
|
28
|
+
};
|
|
29
|
+
readonly nextIcon: {
|
|
30
|
+
readonly type: import("vue").PropType<import("../../../../utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
31
|
+
readonly required: false;
|
|
32
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
33
|
+
__epPropKey: true;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{
|
|
36
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
readonly disabled: boolean;
|
|
39
|
+
readonly currentPage: number;
|
|
40
|
+
readonly pageCount: number;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineComponent as c, computed as d, openBlock as o, createElementBlock as a, unref as r, toDisplayString as u, createBlock as p, withCtx as b, resolveDynamicComponent as x } from "vue";
|
|
2
|
+
import "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import { useLocale as f } from "../../../../hooks/use-locale/index.js";
|
|
7
|
+
import "../../../../hooks/use-size/index.js";
|
|
8
|
+
import "@popperjs/core";
|
|
9
|
+
import "../../../../hooks/use-z-index/index.js";
|
|
10
|
+
import "../../../../hooks/use-delayed-toggle/index.js";
|
|
11
|
+
import "../../../../hooks/use-aria/index.js";
|
|
12
|
+
import "../../../../hooks/use-model-toggle/index.js";
|
|
13
|
+
import "../../../../hooks/use-empty-values/index.js";
|
|
14
|
+
import { ElIcon as k } from "../../../icon/index.js";
|
|
15
|
+
import { paginationNextProps as g } from "./next.js";
|
|
16
|
+
const C = ["disabled", "aria-label", "aria-disabled"], y = { key: 0 }, q = /* @__PURE__ */ c({
|
|
17
|
+
name: "ElPaginationNext",
|
|
18
|
+
__name: "next",
|
|
19
|
+
props: g,
|
|
20
|
+
emits: ["click"],
|
|
21
|
+
setup(l) {
|
|
22
|
+
const e = l, { t: m } = f(), n = d(
|
|
23
|
+
() => e.disabled || e.currentPage === e.pageCount || e.pageCount === 0
|
|
24
|
+
);
|
|
25
|
+
return (t, i) => (o(), a("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
class: "btn-next",
|
|
28
|
+
disabled: n.value,
|
|
29
|
+
"aria-label": t.nextText || r(m)("el.pagination.next"),
|
|
30
|
+
"aria-disabled": n.value,
|
|
31
|
+
onClick: i[0] || (i[0] = (s) => t.$emit("click", s))
|
|
32
|
+
}, [
|
|
33
|
+
t.nextText ? (o(), a("span", y, u(t.nextText), 1)) : (o(), p(r(k), { key: 1 }, {
|
|
34
|
+
default: b(() => [
|
|
35
|
+
(o(), p(x(t.nextIcon)))
|
|
36
|
+
]),
|
|
37
|
+
_: 1
|
|
38
|
+
}))
|
|
39
|
+
], 8, C));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
q as default
|
|
44
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type Pager from './pager.vue';
|
|
3
|
+
export declare const paginationPagerProps: {
|
|
4
|
+
readonly currentPage: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
5
|
+
readonly pageCount: {
|
|
6
|
+
readonly type: import("vue").PropType<number>;
|
|
7
|
+
readonly required: true;
|
|
8
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
9
|
+
__epPropKey: true;
|
|
10
|
+
};
|
|
11
|
+
readonly pagerCount: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
|
12
|
+
readonly disabled: BooleanConstructor;
|
|
13
|
+
};
|
|
14
|
+
export type PaginationPagerProps = ExtractPropTypes<typeof paginationPagerProps>;
|
|
15
|
+
export type PaginationPagerPropsPublic = ExtractPublicPropTypes<typeof paginationPagerProps>;
|
|
16
|
+
export type PagerInstance = InstanceType<typeof Pager> & unknown;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import { buildProps as r } from "../../../../utils/vue/props/runtime.js";
|
|
6
|
+
import "vue";
|
|
7
|
+
const a = r({
|
|
8
|
+
currentPage: {
|
|
9
|
+
type: Number,
|
|
10
|
+
default: 1
|
|
11
|
+
},
|
|
12
|
+
pageCount: {
|
|
13
|
+
type: Number,
|
|
14
|
+
required: !0
|
|
15
|
+
},
|
|
16
|
+
pagerCount: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 7
|
|
19
|
+
},
|
|
20
|
+
disabled: Boolean
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
a as paginationPagerProps
|
|
24
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly currentPage: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
3
|
+
readonly pageCount: {
|
|
4
|
+
readonly type: import("vue").PropType<number>;
|
|
5
|
+
readonly required: true;
|
|
6
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
7
|
+
__epPropKey: true;
|
|
8
|
+
};
|
|
9
|
+
readonly pagerCount: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
|
10
|
+
readonly disabled: BooleanConstructor;
|
|
11
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
change: (...args: any[]) => void;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
|
+
readonly currentPage: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
15
|
+
readonly pageCount: {
|
|
16
|
+
readonly type: import("vue").PropType<number>;
|
|
17
|
+
readonly required: true;
|
|
18
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
19
|
+
__epPropKey: true;
|
|
20
|
+
};
|
|
21
|
+
readonly pagerCount: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
|
22
|
+
readonly disabled: BooleanConstructor;
|
|
23
|
+
}>> & Readonly<{
|
|
24
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
readonly disabled: boolean;
|
|
27
|
+
readonly currentPage: number;
|
|
28
|
+
readonly pagerCount: number;
|
|
29
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { defineComponent as S, ref as c, computed as N, watch as T, openBlock as u, createElementBlock as g, withKeys as j, normalizeClass as b, unref as r, createCommentVNode as k, createBlock as w, Fragment as J, renderList as Q, toDisplayString as K } from "vue";
|
|
2
|
+
import { DArrowLeft as U, MoreFilled as x, DArrowRight as W } from "@element-plus/icons-vue";
|
|
3
|
+
import { useNamespace as D } from "../../../../hooks/use-namespace/index.js";
|
|
4
|
+
import "@vue/shared";
|
|
5
|
+
import "lodash-unified";
|
|
6
|
+
import "@vueuse/core";
|
|
7
|
+
import { CHANGE_EVENT as L } from "../../../../constants/event.js";
|
|
8
|
+
import { useLocale as X } from "../../../../hooks/use-locale/index.js";
|
|
9
|
+
import "../../../../hooks/use-size/index.js";
|
|
10
|
+
import "@popperjs/core";
|
|
11
|
+
import "../../../../hooks/use-z-index/index.js";
|
|
12
|
+
import "../../../../hooks/use-delayed-toggle/index.js";
|
|
13
|
+
import "../../../../hooks/use-aria/index.js";
|
|
14
|
+
import "../../../../hooks/use-model-toggle/index.js";
|
|
15
|
+
import "../../../../hooks/use-empty-values/index.js";
|
|
16
|
+
import { paginationPagerProps as Y } from "./pager.js";
|
|
17
|
+
const Z = ["aria-current", "aria-label", "tabindex"], H = ["tabindex", "aria-label"], _ = ["aria-current", "aria-label", "tabindex"], ee = ["tabindex", "aria-label"], ae = ["aria-current", "aria-label", "tabindex"], Pe = /* @__PURE__ */ S({
|
|
18
|
+
name: "ElPaginationPager",
|
|
19
|
+
__name: "pager",
|
|
20
|
+
props: Y,
|
|
21
|
+
emits: [L],
|
|
22
|
+
setup(V, { emit: z }) {
|
|
23
|
+
const n = V, $ = z, f = D("pager"), E = D("icon"), { t: v } = X(), F = c(!1), h = c(!1), m = c(!1), d = c(!1), y = c(!1), M = c(!1), G = N(() => {
|
|
24
|
+
const e = n.pagerCount, a = (e - 1) / 2, t = Number(n.currentPage), i = Number(n.pageCount);
|
|
25
|
+
let o = !1, l = !1;
|
|
26
|
+
i > e && (t > e - a && (o = !0), t < i - a && (l = !0));
|
|
27
|
+
const C = [];
|
|
28
|
+
if (o && !l) {
|
|
29
|
+
const s = i - (e - 2);
|
|
30
|
+
for (let p = s; p < i; p++)
|
|
31
|
+
C.push(p);
|
|
32
|
+
} else if (!o && l)
|
|
33
|
+
for (let s = 2; s < e; s++)
|
|
34
|
+
C.push(s);
|
|
35
|
+
else if (o && l) {
|
|
36
|
+
const s = Math.floor(e / 2) - 1;
|
|
37
|
+
for (let p = t - s; p <= t + s; p++)
|
|
38
|
+
C.push(p);
|
|
39
|
+
} else
|
|
40
|
+
for (let s = 2; s < i; s++)
|
|
41
|
+
C.push(s);
|
|
42
|
+
return C;
|
|
43
|
+
}), I = N(() => [
|
|
44
|
+
"more",
|
|
45
|
+
"btn-quickprev",
|
|
46
|
+
E.b(),
|
|
47
|
+
f.is("disabled", n.disabled)
|
|
48
|
+
]), O = N(() => [
|
|
49
|
+
"more",
|
|
50
|
+
"btn-quicknext",
|
|
51
|
+
E.b(),
|
|
52
|
+
f.is("disabled", n.disabled)
|
|
53
|
+
]), P = N(() => n.disabled ? -1 : 0);
|
|
54
|
+
T(
|
|
55
|
+
() => [n.pageCount, n.pagerCount, n.currentPage],
|
|
56
|
+
([e, a, t]) => {
|
|
57
|
+
const i = (a - 1) / 2;
|
|
58
|
+
let o = !1, l = !1;
|
|
59
|
+
e > a && (o = t > a - i, l = t < e - i), m.value && (m.value = o), d.value && (d.value = l), F.value = o, h.value = l;
|
|
60
|
+
},
|
|
61
|
+
{ immediate: !0 }
|
|
62
|
+
);
|
|
63
|
+
function A(e = !1) {
|
|
64
|
+
n.disabled || (e ? m.value = !0 : d.value = !0);
|
|
65
|
+
}
|
|
66
|
+
function B(e = !1) {
|
|
67
|
+
e ? y.value = !0 : M.value = !0;
|
|
68
|
+
}
|
|
69
|
+
function R(e) {
|
|
70
|
+
const a = e.target;
|
|
71
|
+
if (a.tagName.toLowerCase() === "li" && Array.from(a.classList).includes("number")) {
|
|
72
|
+
const t = Number(a.textContent);
|
|
73
|
+
t !== n.currentPage && $(L, t);
|
|
74
|
+
} else a.tagName.toLowerCase() === "li" && Array.from(a.classList).includes("more") && q(e);
|
|
75
|
+
}
|
|
76
|
+
function q(e) {
|
|
77
|
+
const a = e.target;
|
|
78
|
+
if (a.tagName.toLowerCase() === "ul" || n.disabled)
|
|
79
|
+
return;
|
|
80
|
+
let t = Number(a.textContent);
|
|
81
|
+
const i = n.pageCount, o = n.currentPage, l = n.pagerCount - 2;
|
|
82
|
+
a.className.includes("more") && (a.className.includes("quickprev") ? t = o - l : a.className.includes("quicknext") && (t = o + l)), Number.isNaN(+t) || (t < 1 && (t = 1), t > i && (t = i)), t !== o && $(L, t);
|
|
83
|
+
}
|
|
84
|
+
return (e, a) => (u(), g("ul", {
|
|
85
|
+
class: b(r(f).b()),
|
|
86
|
+
onClick: q,
|
|
87
|
+
onKeyup: j(R, ["enter"])
|
|
88
|
+
}, [
|
|
89
|
+
e.pageCount > 0 ? (u(), g("li", {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: b([[
|
|
92
|
+
r(f).is("active", e.currentPage === 1),
|
|
93
|
+
r(f).is("disabled", e.disabled)
|
|
94
|
+
], "number"]),
|
|
95
|
+
"aria-current": e.currentPage === 1,
|
|
96
|
+
"aria-label": r(v)("el.pagination.currentPage", { pager: 1 }),
|
|
97
|
+
tabindex: P.value
|
|
98
|
+
}, " 1 ", 10, Z)) : k("", !0),
|
|
99
|
+
F.value ? (u(), g("li", {
|
|
100
|
+
key: 1,
|
|
101
|
+
class: b(I.value),
|
|
102
|
+
tabindex: P.value,
|
|
103
|
+
"aria-label": r(v)("el.pagination.prevPages", { pager: e.pagerCount - 2 }),
|
|
104
|
+
onMouseenter: a[0] || (a[0] = (t) => A(!0)),
|
|
105
|
+
onMouseleave: a[1] || (a[1] = (t) => m.value = !1),
|
|
106
|
+
onFocus: a[2] || (a[2] = (t) => B(!0)),
|
|
107
|
+
onBlur: a[3] || (a[3] = (t) => y.value = !1)
|
|
108
|
+
}, [
|
|
109
|
+
(m.value || y.value) && !e.disabled ? (u(), w(r(U), { key: 0 })) : (u(), w(r(x), { key: 1 }))
|
|
110
|
+
], 42, H)) : k("", !0),
|
|
111
|
+
(u(!0), g(J, null, Q(G.value, (t) => (u(), g("li", {
|
|
112
|
+
key: t,
|
|
113
|
+
class: b([[
|
|
114
|
+
r(f).is("active", e.currentPage === t),
|
|
115
|
+
r(f).is("disabled", e.disabled)
|
|
116
|
+
], "number"]),
|
|
117
|
+
"aria-current": e.currentPage === t,
|
|
118
|
+
"aria-label": r(v)("el.pagination.currentPage", { pager: t }),
|
|
119
|
+
tabindex: P.value
|
|
120
|
+
}, K(t), 11, _))), 128)),
|
|
121
|
+
h.value ? (u(), g("li", {
|
|
122
|
+
key: 2,
|
|
123
|
+
class: b(O.value),
|
|
124
|
+
tabindex: P.value,
|
|
125
|
+
"aria-label": r(v)("el.pagination.nextPages", { pager: e.pagerCount - 2 }),
|
|
126
|
+
onMouseenter: a[4] || (a[4] = (t) => A()),
|
|
127
|
+
onMouseleave: a[5] || (a[5] = (t) => d.value = !1),
|
|
128
|
+
onFocus: a[6] || (a[6] = (t) => B()),
|
|
129
|
+
onBlur: a[7] || (a[7] = (t) => M.value = !1)
|
|
130
|
+
}, [
|
|
131
|
+
(d.value || M.value) && !e.disabled ? (u(), w(r(W), { key: 0 })) : (u(), w(r(x), { key: 1 }))
|
|
132
|
+
], 42, ee)) : k("", !0),
|
|
133
|
+
e.pageCount > 1 ? (u(), g("li", {
|
|
134
|
+
key: 3,
|
|
135
|
+
class: b([[
|
|
136
|
+
r(f).is("active", e.currentPage === e.pageCount),
|
|
137
|
+
r(f).is("disabled", e.disabled)
|
|
138
|
+
], "number"]),
|
|
139
|
+
"aria-current": e.currentPage === e.pageCount,
|
|
140
|
+
"aria-label": r(v)("el.pagination.currentPage", { pager: e.pageCount }),
|
|
141
|
+
tabindex: P.value
|
|
142
|
+
}, K(e.pageCount), 11, ae)) : k("", !0)
|
|
143
|
+
], 34));
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
export {
|
|
147
|
+
Pe as default
|
|
148
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type Prev from './prev.vue';
|
|
3
|
+
export declare const paginationPrevProps: {
|
|
4
|
+
readonly disabled: BooleanConstructor;
|
|
5
|
+
readonly currentPage: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
6
|
+
readonly prevText: {
|
|
7
|
+
readonly type: import("vue").PropType<string>;
|
|
8
|
+
readonly required: false;
|
|
9
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
10
|
+
__epPropKey: true;
|
|
11
|
+
};
|
|
12
|
+
readonly prevIcon: {
|
|
13
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
14
|
+
readonly required: false;
|
|
15
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
16
|
+
__epPropKey: true;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const paginationPrevEmits: {
|
|
20
|
+
click: (evt: MouseEvent) => boolean;
|
|
21
|
+
};
|
|
22
|
+
export type PaginationPrevProps = ExtractPropTypes<typeof paginationPrevProps>;
|
|
23
|
+
export type PaginationPrevPropsPublic = ExtractPublicPropTypes<typeof paginationPrevProps>;
|
|
24
|
+
export type PrevInstance = InstanceType<typeof Prev> & unknown;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import { iconPropType as t } from "../../../../utils/vue/icon.js";
|
|
5
|
+
import "vue";
|
|
6
|
+
import { buildProps as r } from "../../../../utils/vue/props/runtime.js";
|
|
7
|
+
const c = r({
|
|
8
|
+
disabled: Boolean,
|
|
9
|
+
currentPage: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 1
|
|
12
|
+
},
|
|
13
|
+
prevText: {
|
|
14
|
+
type: String
|
|
15
|
+
},
|
|
16
|
+
prevIcon: {
|
|
17
|
+
type: t
|
|
18
|
+
}
|
|
19
|
+
}), s = {
|
|
20
|
+
click: (o) => o instanceof MouseEvent
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
s as paginationPrevEmits,
|
|
24
|
+
c as paginationPrevProps
|
|
25
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly disabled: BooleanConstructor;
|
|
3
|
+
readonly currentPage: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
4
|
+
readonly prevText: {
|
|
5
|
+
readonly type: import("vue").PropType<string>;
|
|
6
|
+
readonly required: false;
|
|
7
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
8
|
+
__epPropKey: true;
|
|
9
|
+
};
|
|
10
|
+
readonly prevIcon: {
|
|
11
|
+
readonly type: import("vue").PropType<import("../../../../utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
12
|
+
readonly required: false;
|
|
13
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
14
|
+
__epPropKey: true;
|
|
15
|
+
};
|
|
16
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
click: (evt: MouseEvent) => void;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
readonly disabled: BooleanConstructor;
|
|
20
|
+
readonly currentPage: import("../../../../utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
21
|
+
readonly prevText: {
|
|
22
|
+
readonly type: import("vue").PropType<string>;
|
|
23
|
+
readonly required: false;
|
|
24
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
25
|
+
__epPropKey: true;
|
|
26
|
+
};
|
|
27
|
+
readonly prevIcon: {
|
|
28
|
+
readonly type: import("vue").PropType<import("../../../../utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
29
|
+
readonly required: false;
|
|
30
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
31
|
+
__epPropKey: true;
|
|
32
|
+
};
|
|
33
|
+
}>> & Readonly<{
|
|
34
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
readonly disabled: boolean;
|
|
37
|
+
readonly currentPage: number;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
export default _default;
|