@semcore/pagination 3.7.5 → 4.0.0-beta.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.
package/CHANGELOG.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [3.7.5] - 2023-06-30
5
+ ## [4.0.0] - 2023-07-15
6
6
 
7
- ### Changed
7
+ ### Break
8
8
 
9
- - Version patch update due to children dependencies update (`@semcore/button` [4.4.8 ~> 4.4.9], `@semcore/flex-box` [4.7.32 ~> 4.7.33], `@semcore/icon` [3.16.0 ~> 3.16.1], `@semcore/input` [3.7.1 ~> 3.7.2], `@semcore/link` [4.3.36 ~> 4.3.37], `@semcore/utils` [3.54.0 ~> 3.54.1]).
9
+ - Strict, backward incompatible typings.
10
10
 
11
11
  ## [3.7.4] - 2023-06-28
12
12
 
@@ -28,17 +28,17 @@ var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i
28
28
  var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
29
29
  var _excluded = ["styles", "getI18nText", "totalPages", "isLastOrSingle", "children"];
30
30
  /*__reshadow-styles__:"./style/pagination.shadow.css"*/
31
- var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SPagination_1p321_gg_{display:flex;justify-content:flex-start;align-items:center}.___SNextPage_1p321_gg_,.___SPrevPage_1p321_gg_{align-self:center;margin-left:var(--intergalactic-spacing-2x, 8px)}.___SLabel_1p321_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SLabel_1p321_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-4x, 16px)}.___STotalPages_1p321_gg_{align-self:center;line-height:normal;color:var(--intergalactic-text-link, #006dca)}.___STotalPagesLabel_1p321_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-1x, 4px);color:var(--intergalactic-text-primary, #191b23)}.___STotalLastPages_1p321_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, #191b23)}.___SPageInput_1p321_gg_{max-width:68px;margin-left:var(--intergalactic-spacing-1x, 4px)}.___SPageInput_1p321_gg_.__focus-within_1p321_gg_ .___SPageInputAddon_1p321_gg_{opacity:1;clip:initial;position:static}.___SPageInput_1p321_gg_:focus-within .___SPageInputAddon_1p321_gg_{opacity:1;clip:initial;position:static}.___SPageInputAddon_1p321_gg_{opacity:0;clip:rect(1px,1px,1px,1px);position:absolute}.___SLabel_1p321_gg_,.___STotalPagesLabel_1p321_gg_,.___STotalPages_1p321_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}" /*__inner_css_end__*/, "1p321_gg_") /*__reshadow_css_end__*/, {
32
- "__SPagination": "___SPagination_1p321_gg_",
33
- "__SNextPage": "___SNextPage_1p321_gg_",
34
- "__SPrevPage": "___SPrevPage_1p321_gg_",
35
- "__SLabel": "___SLabel_1p321_gg_",
36
- "__STotalPages": "___STotalPages_1p321_gg_",
37
- "__STotalPagesLabel": "___STotalPagesLabel_1p321_gg_",
38
- "__STotalLastPages": "___STotalLastPages_1p321_gg_",
39
- "__SPageInput": "___SPageInput_1p321_gg_",
40
- "_focus-within": "__focus-within_1p321_gg_",
41
- "__SPageInputAddon": "___SPageInputAddon_1p321_gg_"
31
+ var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SPagination_5lt7t_gg_{display:flex;justify-content:flex-start;align-items:center}.___SNextPage_5lt7t_gg_,.___SPrevPage_5lt7t_gg_{align-self:center;margin-left:var(--intergalactic-spacing-2x, 8px)}.___SLabel_5lt7t_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SLabel_5lt7t_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-4x, 16px)}.___STotalPages_5lt7t_gg_{align-self:center;line-height:normal;color:var(--intergalactic-text-link, #006dca)}.___STotalPagesLabel_5lt7t_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-1x, 4px);color:var(--intergalactic-text-primary, #191b23)}.___STotalLastPages_5lt7t_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, #191b23)}.___SPageInput_5lt7t_gg_{max-width:68px;margin-left:var(--intergalactic-spacing-1x, 4px)}.___SPageInput_5lt7t_gg_.__focus-within_5lt7t_gg_ .___SPageInputAddon_5lt7t_gg_{opacity:1;clip:initial;position:static}.___SPageInput_5lt7t_gg_:focus-within .___SPageInputAddon_5lt7t_gg_{opacity:1;clip:initial;position:static}.___SPageInputAddon_5lt7t_gg_{opacity:0;clip:rect(1px,1px,1px,1px);position:absolute}.___SLabel_5lt7t_gg_,.___STotalPagesLabel_5lt7t_gg_,.___STotalPages_5lt7t_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}" /*__inner_css_end__*/, "5lt7t_gg_") /*__reshadow_css_end__*/, {
32
+ "__SPagination": "___SPagination_5lt7t_gg_",
33
+ "__SNextPage": "___SNextPage_5lt7t_gg_",
34
+ "__SPrevPage": "___SPrevPage_5lt7t_gg_",
35
+ "__SLabel": "___SLabel_5lt7t_gg_",
36
+ "__STotalPages": "___STotalPages_5lt7t_gg_",
37
+ "__STotalPagesLabel": "___STotalPagesLabel_5lt7t_gg_",
38
+ "__STotalLastPages": "___STotalLastPages_5lt7t_gg_",
39
+ "__SPageInput": "___SPageInput_5lt7t_gg_",
40
+ "_focus-within": "__focus-within_5lt7t_gg_",
41
+ "__SPageInputAddon": "___SPageInputAddon_5lt7t_gg_"
42
42
  });
43
43
  function formatThousands(value) {
44
44
  var main = String(value);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\nimport Input, { IInputProps } from '@semcore/input';\nimport { ITextProps } from '@semcore/typography';\nimport Button from '@semcore/button';\nimport { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\n\nexport interface IPaginationProps extends IBoxProps, IWithI18nEnhanceProps {\n /**\n * Total number of pages\n * @default 1\n */\n totalPages?: number;\n /**\n * Active page number\n * @default 1\n */\n currentPage?: number;\n /**\n * Callback for changing the active page\n * @param pageNumber\n */\n onCurrentPageChange?: (pageNumber: number) => void;\n locale?: string;\n}\n\nexport interface ITotalPagesProps extends ITextProps, IWithI18nEnhanceProps {}\n\nexport interface IPageInputProps extends IInputProps, IWithI18nEnhanceProps {}\n\nexport interface IPaginationContext {\n getFirstPageProps: PropGetterFn;\n getPrevPageProps: PropGetterFn;\n getNextPageProps: PropGetterFn;\n getPageInputProps: PropGetterFn;\n getTotalPagesProps: PropGetterFn;\n}\n\nexport interface IPaginationHandlers {\n totalPages: (value: number) => void;\n currentPage: (value: number) => void;\n}\n\ndeclare const Pagination: (<T>(\n props: CProps<IPaginationProps & T, IPaginationContext, IPaginationHandlers>,\n) => ReturnEl) & {\n PrevPage: (props: ComponentProps<typeof Button>) => ReturnEl;\n NextPage: (props: ComponentProps<typeof Button>) => ReturnEl;\n FirstPage: (props: ComponentProps<typeof Button>) => ReturnEl;\n TotalPages: (props: CProps<ITotalPagesProps, {}, IPaginationHandlers>) => ReturnEl;\n PageInput: (<T>(props: CProps<IPageInputProps & T, {}, IPaginationHandlers>) => ReturnEl) & {\n Value: typeof Input.Value;\n Addon: typeof Input.Addon;\n };\n};\n\nexport default Pagination;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\nimport Input, { InputProps } from '@semcore/input';\nimport { TextProps } from '@semcore/typography';\nimport Button from '@semcore/button';\nimport { WithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\n\n/** @deprecated */\nexport interface IPaginationProps extends PaginationProps, UnknownProperties {}\nexport type PaginationProps = BoxProps &\n WithI18nEnhanceProps & {\n /**\n * Total number of pages\n * @default 1\n */\n totalPages?: number;\n /**\n * Active page number\n * @default 1\n */\n currentPage?: number;\n /**\n * Callback for changing the active page\n * @param pageNumber\n */\n onCurrentPageChange?: (pageNumber: number) => void;\n locale?: string;\n };\n\n/** @deprecated */\nexport interface ITotalPagesProps extends TotalPagesProps, UnknownProperties {}\nexport type TotalPagesProps = TextProps & WithI18nEnhanceProps & {};\n\n/** @deprecated */\nexport interface IPageInputProps extends PageInputProps, UnknownProperties {}\nexport type PageInputProps = InputProps & WithI18nEnhanceProps & {};\n\n/** @deprecated */\nexport interface IPaginationContext extends PaginationContext, UnknownProperties {}\nexport type PaginationContext = {\n getFirstPageProps: PropGetterFn;\n getPrevPageProps: PropGetterFn;\n getNextPageProps: PropGetterFn;\n getPageInputProps: PropGetterFn;\n getTotalPagesProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IPaginationHandlers extends PaginationHandlers, UnknownProperties {}\nexport type PaginationHandlers = {\n totalPages: (value: number) => void;\n currentPage: (value: number) => void;\n};\n\ndeclare const Pagination: Intergalactic.Component<\n 'div',\n PaginationProps,\n PaginationContext,\n [handlers: PaginationHandlers]\n> & {\n PrevPage: typeof Button;\n NextPage: typeof Button;\n FirstPage: typeof Button;\n TotalPages: Intergalactic.Component<\n Intergalactic.Tag,\n TotalPagesProps,\n {},\n [handlers: PaginationHandlers]\n >;\n PageInput: Intergalactic.Component<'div', PageInputProps, {}, [handlers: PaginationHandlers]> & {\n Value: typeof Input.Value;\n Addon: typeof Input.Addon;\n };\n};\n\nexport default Pagination;\n"],"mappings":""}
@@ -29,17 +29,17 @@ import uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';
29
29
  import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
30
30
  import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
31
31
  /*__reshadow-styles__:"./style/pagination.shadow.css"*/
32
- var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPagination_1p321_gg_{display:flex;justify-content:flex-start;align-items:center}.___SNextPage_1p321_gg_,.___SPrevPage_1p321_gg_{align-self:center;margin-left:var(--intergalactic-spacing-2x, 8px)}.___SLabel_1p321_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SLabel_1p321_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-4x, 16px)}.___STotalPages_1p321_gg_{align-self:center;line-height:normal;color:var(--intergalactic-text-link, #006dca)}.___STotalPagesLabel_1p321_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-1x, 4px);color:var(--intergalactic-text-primary, #191b23)}.___STotalLastPages_1p321_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, #191b23)}.___SPageInput_1p321_gg_{max-width:68px;margin-left:var(--intergalactic-spacing-1x, 4px)}.___SPageInput_1p321_gg_.__focus-within_1p321_gg_ .___SPageInputAddon_1p321_gg_{opacity:1;clip:initial;position:static}.___SPageInput_1p321_gg_:focus-within .___SPageInputAddon_1p321_gg_{opacity:1;clip:initial;position:static}.___SPageInputAddon_1p321_gg_{opacity:0;clip:rect(1px,1px,1px,1px);position:absolute}.___SLabel_1p321_gg_,.___STotalPagesLabel_1p321_gg_,.___STotalPages_1p321_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}" /*__inner_css_end__*/, "1p321_gg_") /*__reshadow_css_end__*/, {
33
- "__SPagination": "___SPagination_1p321_gg_",
34
- "__SNextPage": "___SNextPage_1p321_gg_",
35
- "__SPrevPage": "___SPrevPage_1p321_gg_",
36
- "__SLabel": "___SLabel_1p321_gg_",
37
- "__STotalPages": "___STotalPages_1p321_gg_",
38
- "__STotalPagesLabel": "___STotalPagesLabel_1p321_gg_",
39
- "__STotalLastPages": "___STotalLastPages_1p321_gg_",
40
- "__SPageInput": "___SPageInput_1p321_gg_",
41
- "_focus-within": "__focus-within_1p321_gg_",
42
- "__SPageInputAddon": "___SPageInputAddon_1p321_gg_"
32
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPagination_5lt7t_gg_{display:flex;justify-content:flex-start;align-items:center}.___SNextPage_5lt7t_gg_,.___SPrevPage_5lt7t_gg_{align-self:center;margin-left:var(--intergalactic-spacing-2x, 8px)}.___SLabel_5lt7t_gg_{color:var(--intergalactic-text-primary, #191b23)}.___SLabel_5lt7t_gg_:not(:first-child){margin-left:var(--intergalactic-spacing-4x, 16px)}.___STotalPages_5lt7t_gg_{align-self:center;line-height:normal;color:var(--intergalactic-text-link, #006dca)}.___STotalPagesLabel_5lt7t_gg_{margin-left:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-1x, 4px);color:var(--intergalactic-text-primary, #191b23)}.___STotalLastPages_5lt7t_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);color:var(--intergalactic-text-primary, #191b23)}.___SPageInput_5lt7t_gg_{max-width:68px;margin-left:var(--intergalactic-spacing-1x, 4px)}.___SPageInput_5lt7t_gg_.__focus-within_5lt7t_gg_ .___SPageInputAddon_5lt7t_gg_{opacity:1;clip:initial;position:static}.___SPageInput_5lt7t_gg_:focus-within .___SPageInputAddon_5lt7t_gg_{opacity:1;clip:initial;position:static}.___SPageInputAddon_5lt7t_gg_{opacity:0;clip:rect(1px,1px,1px,1px);position:absolute}.___SLabel_5lt7t_gg_,.___STotalPagesLabel_5lt7t_gg_,.___STotalPages_5lt7t_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}" /*__inner_css_end__*/, "5lt7t_gg_") /*__reshadow_css_end__*/, {
33
+ "__SPagination": "___SPagination_5lt7t_gg_",
34
+ "__SNextPage": "___SNextPage_5lt7t_gg_",
35
+ "__SPrevPage": "___SPrevPage_5lt7t_gg_",
36
+ "__SLabel": "___SLabel_5lt7t_gg_",
37
+ "__STotalPages": "___STotalPages_5lt7t_gg_",
38
+ "__STotalPagesLabel": "___STotalPagesLabel_5lt7t_gg_",
39
+ "__STotalLastPages": "___STotalLastPages_5lt7t_gg_",
40
+ "__SPageInput": "___SPageInput_5lt7t_gg_",
41
+ "_focus-within": "__focus-within_5lt7t_gg_",
42
+ "__SPageInputAddon": "___SPageInputAddon_5lt7t_gg_"
43
43
  });
44
44
  function formatThousands(value) {
45
45
  var main = String(value);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { CProps, PropGetterFn, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\nimport Input, { IInputProps } from '@semcore/input';\nimport { ITextProps } from '@semcore/typography';\nimport Button from '@semcore/button';\nimport { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\n\nexport interface IPaginationProps extends IBoxProps, IWithI18nEnhanceProps {\n /**\n * Total number of pages\n * @default 1\n */\n totalPages?: number;\n /**\n * Active page number\n * @default 1\n */\n currentPage?: number;\n /**\n * Callback for changing the active page\n * @param pageNumber\n */\n onCurrentPageChange?: (pageNumber: number) => void;\n locale?: string;\n}\n\nexport interface ITotalPagesProps extends ITextProps, IWithI18nEnhanceProps {}\n\nexport interface IPageInputProps extends IInputProps, IWithI18nEnhanceProps {}\n\nexport interface IPaginationContext {\n getFirstPageProps: PropGetterFn;\n getPrevPageProps: PropGetterFn;\n getNextPageProps: PropGetterFn;\n getPageInputProps: PropGetterFn;\n getTotalPagesProps: PropGetterFn;\n}\n\nexport interface IPaginationHandlers {\n totalPages: (value: number) => void;\n currentPage: (value: number) => void;\n}\n\ndeclare const Pagination: (<T>(\n props: CProps<IPaginationProps & T, IPaginationContext, IPaginationHandlers>,\n) => ReturnEl) & {\n PrevPage: (props: ComponentProps<typeof Button>) => ReturnEl;\n NextPage: (props: ComponentProps<typeof Button>) => ReturnEl;\n FirstPage: (props: ComponentProps<typeof Button>) => ReturnEl;\n TotalPages: (props: CProps<ITotalPagesProps, {}, IPaginationHandlers>) => ReturnEl;\n PageInput: (<T>(props: CProps<IPageInputProps & T, {}, IPaginationHandlers>) => ReturnEl) & {\n Value: typeof Input.Value;\n Addon: typeof Input.Addon;\n };\n};\n\nexport default Pagination;\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\nimport Input, { InputProps } from '@semcore/input';\nimport { TextProps } from '@semcore/typography';\nimport Button from '@semcore/button';\nimport { WithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\n\n/** @deprecated */\nexport interface IPaginationProps extends PaginationProps, UnknownProperties {}\nexport type PaginationProps = BoxProps &\n WithI18nEnhanceProps & {\n /**\n * Total number of pages\n * @default 1\n */\n totalPages?: number;\n /**\n * Active page number\n * @default 1\n */\n currentPage?: number;\n /**\n * Callback for changing the active page\n * @param pageNumber\n */\n onCurrentPageChange?: (pageNumber: number) => void;\n locale?: string;\n };\n\n/** @deprecated */\nexport interface ITotalPagesProps extends TotalPagesProps, UnknownProperties {}\nexport type TotalPagesProps = TextProps & WithI18nEnhanceProps & {};\n\n/** @deprecated */\nexport interface IPageInputProps extends PageInputProps, UnknownProperties {}\nexport type PageInputProps = InputProps & WithI18nEnhanceProps & {};\n\n/** @deprecated */\nexport interface IPaginationContext extends PaginationContext, UnknownProperties {}\nexport type PaginationContext = {\n getFirstPageProps: PropGetterFn;\n getPrevPageProps: PropGetterFn;\n getNextPageProps: PropGetterFn;\n getPageInputProps: PropGetterFn;\n getTotalPagesProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IPaginationHandlers extends PaginationHandlers, UnknownProperties {}\nexport type PaginationHandlers = {\n totalPages: (value: number) => void;\n currentPage: (value: number) => void;\n};\n\ndeclare const Pagination: Intergalactic.Component<\n 'div',\n PaginationProps,\n PaginationContext,\n [handlers: PaginationHandlers]\n> & {\n PrevPage: typeof Button;\n NextPage: typeof Button;\n FirstPage: typeof Button;\n TotalPages: Intergalactic.Component<\n Intergalactic.Tag,\n TotalPagesProps,\n {},\n [handlers: PaginationHandlers]\n >;\n PageInput: Intergalactic.Component<'div', PageInputProps, {}, [handlers: PaginationHandlers]> & {\n Value: typeof Input.Value;\n Addon: typeof Input.Addon;\n };\n};\n\nexport default Pagination;\n"],"mappings":""}
@@ -1,55 +1,73 @@
1
- import { ComponentProps } from 'react';
2
- import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
3
- import { IBoxProps } from '@semcore/flex-box';
4
- import Input, { IInputProps } from '@semcore/input';
5
- import { ITextProps } from '@semcore/typography';
1
+ import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
2
+ import { BoxProps } from '@semcore/flex-box';
3
+ import Input, { InputProps } from '@semcore/input';
4
+ import { TextProps } from '@semcore/typography';
6
5
  import Button from '@semcore/button';
7
- import { IWithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
6
+ import { WithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
8
7
 
9
- export interface IPaginationProps extends IBoxProps, IWithI18nEnhanceProps {
10
- /**
11
- * Total number of pages
12
- * @default 1
13
- */
14
- totalPages?: number;
15
- /**
16
- * Active page number
17
- * @default 1
18
- */
19
- currentPage?: number;
20
- /**
21
- * Callback for changing the active page
22
- * @param pageNumber
23
- */
24
- onCurrentPageChange?: (pageNumber: number) => void;
25
- locale?: string;
26
- }
8
+ /** @deprecated */
9
+ export interface IPaginationProps extends PaginationProps, UnknownProperties {}
10
+ export type PaginationProps = BoxProps &
11
+ WithI18nEnhanceProps & {
12
+ /**
13
+ * Total number of pages
14
+ * @default 1
15
+ */
16
+ totalPages?: number;
17
+ /**
18
+ * Active page number
19
+ * @default 1
20
+ */
21
+ currentPage?: number;
22
+ /**
23
+ * Callback for changing the active page
24
+ * @param pageNumber
25
+ */
26
+ onCurrentPageChange?: (pageNumber: number) => void;
27
+ locale?: string;
28
+ };
27
29
 
28
- export interface ITotalPagesProps extends ITextProps, IWithI18nEnhanceProps {}
30
+ /** @deprecated */
31
+ export interface ITotalPagesProps extends TotalPagesProps, UnknownProperties {}
32
+ export type TotalPagesProps = TextProps & WithI18nEnhanceProps & {};
29
33
 
30
- export interface IPageInputProps extends IInputProps, IWithI18nEnhanceProps {}
34
+ /** @deprecated */
35
+ export interface IPageInputProps extends PageInputProps, UnknownProperties {}
36
+ export type PageInputProps = InputProps & WithI18nEnhanceProps & {};
31
37
 
32
- export interface IPaginationContext {
38
+ /** @deprecated */
39
+ export interface IPaginationContext extends PaginationContext, UnknownProperties {}
40
+ export type PaginationContext = {
33
41
  getFirstPageProps: PropGetterFn;
34
42
  getPrevPageProps: PropGetterFn;
35
43
  getNextPageProps: PropGetterFn;
36
44
  getPageInputProps: PropGetterFn;
37
45
  getTotalPagesProps: PropGetterFn;
38
- }
46
+ };
39
47
 
40
- export interface IPaginationHandlers {
48
+ /** @deprecated */
49
+ export interface IPaginationHandlers extends PaginationHandlers, UnknownProperties {}
50
+ export type PaginationHandlers = {
41
51
  totalPages: (value: number) => void;
42
52
  currentPage: (value: number) => void;
43
- }
53
+ };
44
54
 
45
- declare const Pagination: (<T>(
46
- props: CProps<IPaginationProps & T, IPaginationContext, IPaginationHandlers>,
47
- ) => ReturnEl) & {
48
- PrevPage: (props: ComponentProps<typeof Button>) => ReturnEl;
49
- NextPage: (props: ComponentProps<typeof Button>) => ReturnEl;
50
- FirstPage: (props: ComponentProps<typeof Button>) => ReturnEl;
51
- TotalPages: (props: CProps<ITotalPagesProps, {}, IPaginationHandlers>) => ReturnEl;
52
- PageInput: (<T>(props: CProps<IPageInputProps & T, {}, IPaginationHandlers>) => ReturnEl) & {
55
+ declare const Pagination: Intergalactic.Component<
56
+ 'div',
57
+ PaginationProps,
58
+ PaginationContext,
59
+ [handlers: PaginationHandlers]
60
+ > & {
61
+ PrevPage: typeof Button;
62
+ NextPage: typeof Button;
63
+ FirstPage: typeof Button;
64
+ TotalPages: Intergalactic.Component<
65
+ Intergalactic.Tag,
66
+ TotalPagesProps,
67
+ {},
68
+ [handlers: PaginationHandlers]
69
+ >;
70
+ PageInput: Intergalactic.Component<'div', PageInputProps, {}, [handlers: PaginationHandlers]> & {
53
71
  Value: typeof Input.Value;
54
72
  Addon: typeof Input.Addon;
55
73
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/pagination",
3
3
  "description": "Semrush Pagination Component",
4
- "version": "3.7.5",
4
+ "version": "4.0.0-beta.1",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -9,16 +9,16 @@
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@semcore/button": "^4",
13
- "@semcore/flex-box": "^4",
14
- "@semcore/icon": "2.16 - 3",
15
- "@semcore/input": "^3.0.0",
16
- "@semcore/link": "^4.0.0",
17
- "@semcore/typography": "^4",
18
- "@semcore/utils": "^3.27"
12
+ "@semcore/button": "5.0.0-beta.1",
13
+ "@semcore/flex-box": "5.0.0-beta.1",
14
+ "@semcore/icon": "4.0.0-beta.1",
15
+ "@semcore/input": "4.0.0-beta.1",
16
+ "@semcore/link": "5.0.0-beta.1",
17
+ "@semcore/typography": "5.0.0-beta.1",
18
+ "@semcore/utils": "4.0.0-beta.1"
19
19
  },
20
20
  "peerDependencies": {
21
- "@semcore/core": "^1.11",
21
+ "@semcore/core": "2.0.0-beta.1",
22
22
  "react": "16.8 - 18",
23
23
  "react-dom": "16.8 - 18"
24
24
  },