@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 +3 -3
- package/lib/cjs/Pagination.js +11 -11
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/es6/Pagination.js +11 -11
- package/lib/es6/index.d.js.map +1 -1
- package/lib/types/index.d.ts +56 -38
- package/package.json +9 -9
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
|
-
## [
|
|
5
|
+
## [4.0.0] - 2023-07-15
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Break
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- Strict, backward incompatible typings.
|
|
10
10
|
|
|
11
11
|
## [3.7.4] - 2023-06-28
|
|
12
12
|
|
package/lib/cjs/Pagination.js
CHANGED
|
@@ -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__*/".
|
|
32
|
-
"__SPagination": "
|
|
33
|
-
"__SNextPage": "
|
|
34
|
-
"__SPrevPage": "
|
|
35
|
-
"__SLabel": "
|
|
36
|
-
"__STotalPages": "
|
|
37
|
-
"__STotalPagesLabel": "
|
|
38
|
-
"__STotalLastPages": "
|
|
39
|
-
"__SPageInput": "
|
|
40
|
-
"_focus-within": "__focus-
|
|
41
|
-
"__SPageInputAddon": "
|
|
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);
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import {
|
|
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":""}
|
package/lib/es6/Pagination.js
CHANGED
|
@@ -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__*/".
|
|
33
|
-
"__SPagination": "
|
|
34
|
-
"__SNextPage": "
|
|
35
|
-
"__SPrevPage": "
|
|
36
|
-
"__SLabel": "
|
|
37
|
-
"__STotalPages": "
|
|
38
|
-
"__STotalPagesLabel": "
|
|
39
|
-
"__STotalLastPages": "
|
|
40
|
-
"__SPageInput": "
|
|
41
|
-
"_focus-within": "__focus-
|
|
42
|
-
"__SPageInputAddon": "
|
|
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);
|
package/lib/es6/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import {
|
|
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":""}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,55 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
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 {
|
|
6
|
+
import { WithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
30
|
+
/** @deprecated */
|
|
31
|
+
export interface ITotalPagesProps extends TotalPagesProps, UnknownProperties {}
|
|
32
|
+
export type TotalPagesProps = TextProps & WithI18nEnhanceProps & {};
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
/** @deprecated */
|
|
35
|
+
export interface IPageInputProps extends PageInputProps, UnknownProperties {}
|
|
36
|
+
export type PageInputProps = InputProps & WithI18nEnhanceProps & {};
|
|
31
37
|
|
|
32
|
-
|
|
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
|
-
|
|
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:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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": "
|
|
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": "
|
|
13
|
-
"@semcore/flex-box": "
|
|
14
|
-
"@semcore/icon": "
|
|
15
|
-
"@semcore/input": "
|
|
16
|
-
"@semcore/link": "
|
|
17
|
-
"@semcore/typography": "
|
|
18
|
-
"@semcore/utils": "
|
|
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": "
|
|
21
|
+
"@semcore/core": "2.0.0-beta.1",
|
|
22
22
|
"react": "16.8 - 18",
|
|
23
23
|
"react-dom": "16.8 - 18"
|
|
24
24
|
},
|