@toife/vue 3.5.8 → 3.6.1

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.
@@ -26,6 +26,7 @@ export * from './refresher';
26
26
  export * from './route';
27
27
  export * from './scrollbar';
28
28
  export * from './page';
29
+ export * from './pagination';
29
30
  export * from './collapse';
30
31
  export * from './form-group';
31
32
  export * from './dropdown';
@@ -0,0 +1 @@
1
+ export { default as Pagination } from './pagination.vue';
@@ -0,0 +1,21 @@
1
+ import { PaginationProps } from '../../core';
2
+ declare const _default: import('vue').DefineComponent<PaginationProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
+ change: (value: number) => any;
4
+ "update:modelValue": (value: number) => any;
5
+ }, string, import('vue').PublicProps, Readonly<PaginationProps> & Readonly<{
6
+ onChange?: ((value: number) => any) | undefined;
7
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
8
+ }>, {
9
+ size: import('../../core').PaginationSize;
10
+ direction: import('../../core').AppDirection;
11
+ length: number;
12
+ variant: import('../../core').PaginationVariant;
13
+ disabled: boolean;
14
+ value: number;
15
+ modelValue: number;
16
+ siblings: number;
17
+ boundaries: number;
18
+ activeVariant: import('../../core').PaginationVariant;
19
+ controls: boolean;
20
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
+ export default _default;
@@ -14,9 +14,9 @@ declare const _default: import('vue').DefineComponent<SegmentedFieldProps, {}, {
14
14
  }>, {
15
15
  size: import('../../core').SegmentedFieldSize;
16
16
  direction: import('../../core').AppDirection;
17
+ length: number;
17
18
  variant: import('../../core').SegmentedFieldVariant;
18
19
  disabled: boolean;
19
- length: number;
20
20
  message: string;
21
21
  type: string;
22
22
  pattern: string[];
@@ -17,6 +17,7 @@ export * from './image';
17
17
  export * from './layout';
18
18
  export * from './modal';
19
19
  export * from './page';
20
+ export * from './pagination';
20
21
  export * from './present';
21
22
  export * from './progress';
22
23
  export * from './radio';
@@ -0,0 +1,3 @@
1
+ export * from './pagination.constants';
2
+ export * from './pagination.type';
3
+ export * from './pagination.logic';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Pagination Default Props
3
+ */
4
+ export declare const PAGINATION_DEFAULT_PROPS: {
5
+ readonly modelValue: undefined;
6
+ readonly value: undefined;
7
+ readonly length: 1;
8
+ readonly siblings: 1;
9
+ readonly boundaries: 1;
10
+ readonly variant: "text";
11
+ readonly activeVariant: "fill";
12
+ readonly size: "standard";
13
+ readonly disabled: false;
14
+ readonly controls: true;
15
+ readonly direction: undefined;
16
+ };
@@ -0,0 +1,22 @@
1
+ import { PaginationAttrOptions, PaginationItem, PaginationItemAttrOptions, PaginationItemsOptions } from './pagination.type';
2
+ /**
3
+ * Clamp a page into [1, length]
4
+ */
5
+ export declare const clampPaginationPage: (page: number, length: number) => number;
6
+ /**
7
+ * Build the visible page list, e.g. [1, …, 4, 5, 6, …, 10]
8
+ */
9
+ export declare const getPaginationItems: (options: PaginationItemsOptions) => PaginationItem[];
10
+ export declare const getPaginationAttrs: (options: PaginationAttrOptions) => {
11
+ class: (string | {
12
+ disabled: boolean;
13
+ })[];
14
+ };
15
+ export declare const getPaginationItemAttrs: (options: PaginationItemAttrOptions) => {
16
+ class: (string | {
17
+ active: boolean;
18
+ })[];
19
+ };
20
+ export declare const getPaginationEllipsisAttrs: () => {
21
+ class: string[];
22
+ };
@@ -0,0 +1,44 @@
1
+ import { AppDirection } from '../app/app.type';
2
+ import { ButtonVariant } from '../button/button.type';
3
+ export type PaginationVariant = ButtonVariant;
4
+ export type PaginationSize = string;
5
+ export type PaginationItem = {
6
+ type: "page";
7
+ page: number;
8
+ } | {
9
+ type: "ellipsis";
10
+ key: string;
11
+ };
12
+ export type PaginationProps = {
13
+ modelValue?: number;
14
+ value?: number;
15
+ length?: number;
16
+ siblings?: number;
17
+ boundaries?: number;
18
+ variant?: PaginationVariant;
19
+ activeVariant?: PaginationVariant;
20
+ size?: PaginationSize;
21
+ role?: string;
22
+ shape?: string;
23
+ disabled?: boolean;
24
+ controls?: boolean;
25
+ direction?: AppDirection;
26
+ };
27
+ export type PaginationEvent = {
28
+ (e: "update:modelValue", value: number): void;
29
+ (e: "change", value: number): void;
30
+ };
31
+ export type PaginationItemsOptions = {
32
+ current: number;
33
+ length: number;
34
+ siblings: number;
35
+ boundaries: number;
36
+ };
37
+ export type PaginationAttrOptions = {
38
+ direction: string;
39
+ size: string;
40
+ disabled: boolean;
41
+ };
42
+ export type PaginationItemAttrOptions = {
43
+ active: boolean;
44
+ };