@salutejs/plasma-new-hope 0.69.0-canary.1148.8520837057.0 → 0.69.0-canary.1148.8538859580.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Cell/Cell.css +1 -1
- package/cjs/components/Cell/Cell.styles.js +1 -1
- package/cjs/components/Cell/Cell.styles.js.map +1 -1
- package/cjs/components/Cell/ui/CellTextbox/CellTextbox.js +4 -4
- package/cjs/components/Cell/ui/CellTextbox/CellTextbox.js.map +1 -1
- package/cjs/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.js +13 -0
- package/cjs/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.js.map +1 -0
- package/cjs/components/Cell/ui/{CellTextLabel/CellTextLabel.styles.js → CellTextboxLabel/CellTextboxLabel.styles.js} +4 -4
- package/cjs/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.styles.js.map +1 -0
- package/cjs/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.js +13 -0
- package/cjs/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.js.map +1 -0
- package/cjs/components/Cell/ui/{CellTextSubtitle/CellTextSubtitle.styles.js → CellTextboxSubtitle/CellTextboxSubtitle.styles.js} +4 -4
- package/cjs/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.styles.js.map +1 -0
- package/cjs/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.js +13 -0
- package/cjs/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.js.map +1 -0
- package/cjs/components/Cell/ui/{CellTextTitle/CellTextTitle.styles.js → CellTextboxTitle/CellTextboxTitle.styles.js} +4 -4
- package/cjs/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.styles.js.map +1 -0
- package/cjs/components/Cell/variations/_view/base.js +1 -1
- package/cjs/components/Cell/variations/_view/base.js.map +1 -1
- package/cjs/components/Cell/variations/_view/{base_13f5j4a.css → base_pir0qf.css} +1 -1
- package/cjs/components/Pagination/Pagination.js +14 -13
- package/cjs/components/Pagination/Pagination.js.map +1 -1
- package/cjs/index.css +1 -1
- package/cjs/index.js +6 -6
- package/es/components/Cell/Cell.css +1 -1
- package/es/components/Cell/Cell.styles.js +1 -1
- package/es/components/Cell/Cell.styles.js.map +1 -1
- package/es/components/Cell/ui/CellTextbox/CellTextbox.js +4 -4
- package/es/components/Cell/ui/CellTextbox/CellTextbox.js.map +1 -1
- package/es/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.js +9 -0
- package/es/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.js.map +1 -0
- package/es/components/Cell/ui/{CellTextLabel/CellTextLabel.styles.js → CellTextboxLabel/CellTextboxLabel.styles.js} +4 -4
- package/es/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.styles.js.map +1 -0
- package/es/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.js +9 -0
- package/es/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.js.map +1 -0
- package/es/components/Cell/ui/{CellTextSubtitle/CellTextSubtitle.styles.js → CellTextboxSubtitle/CellTextboxSubtitle.styles.js} +4 -4
- package/es/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.styles.js.map +1 -0
- package/es/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.js +9 -0
- package/es/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.js.map +1 -0
- package/es/components/Cell/ui/{CellTextTitle/CellTextTitle.styles.js → CellTextboxTitle/CellTextboxTitle.styles.js} +4 -4
- package/es/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.styles.js.map +1 -0
- package/es/components/Cell/variations/_view/base.js +1 -1
- package/es/components/Cell/variations/_view/base.js.map +1 -1
- package/es/components/Cell/variations/_view/{base_13f5j4a.css → base_pir0qf.css} +1 -1
- package/es/components/Pagination/Pagination.js +15 -14
- package/es/components/Pagination/Pagination.js.map +1 -1
- package/es/index.css +1 -1
- package/es/index.js +3 -3
- package/package.json +4 -4
- package/styled-components/cjs/components/Cell/Cell.styles.js +1 -1
- package/styled-components/cjs/components/Cell/index.js +11 -11
- package/styled-components/cjs/components/Cell/ui/CellTextbox/CellTextbox.js +4 -4
- package/styled-components/cjs/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.js +12 -0
- package/styled-components/cjs/components/Cell/ui/{CellTextLabel/CellTextLabel.styles.js → CellTextboxLabel/CellTextboxLabel.styles.js} +3 -3
- package/styled-components/cjs/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.js +12 -0
- package/styled-components/cjs/components/Cell/ui/{CellTextSubtitle/CellTextSubtitle.styles.js → CellTextboxSubtitle/CellTextboxSubtitle.styles.js} +3 -3
- package/styled-components/cjs/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.js +12 -0
- package/styled-components/cjs/components/Cell/ui/{CellTextTitle/CellTextTitle.styles.js → CellTextboxTitle/CellTextboxTitle.styles.js} +3 -3
- package/styled-components/cjs/components/Cell/variations/_view/base.js +1 -1
- package/styled-components/cjs/components/Pagination/Pagination.js +14 -13
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.js +8 -8
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.stories.tsx +10 -10
- package/styled-components/cjs/examples/plasma_b2c/components/Pagination/Pagination.config.js +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Pagination/Pagination.stories.tsx +14 -7
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.js +8 -8
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.stories.tsx +8 -8
- package/styled-components/cjs/examples/plasma_web/components/Pagination/Pagination.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Pagination/Pagination.stories.tsx +14 -7
- package/styled-components/es/components/Cell/Cell.styles.js +1 -1
- package/styled-components/es/components/Cell/index.js +3 -3
- package/styled-components/es/components/Cell/ui/CellTextbox/CellTextbox.js +4 -4
- package/styled-components/es/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.js +5 -0
- package/styled-components/es/components/Cell/ui/{CellTextLabel/CellTextLabel.styles.js → CellTextboxLabel/CellTextboxLabel.styles.js} +2 -2
- package/styled-components/es/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.js +5 -0
- package/styled-components/es/components/Cell/ui/{CellTextSubtitle/CellTextSubtitle.styles.js → CellTextboxSubtitle/CellTextboxSubtitle.styles.js} +2 -2
- package/styled-components/es/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.js +5 -0
- package/styled-components/es/components/Cell/ui/{CellTextTitle/CellTextTitle.styles.js → CellTextboxTitle/CellTextboxTitle.styles.js} +2 -2
- package/styled-components/es/components/Cell/variations/_view/base.js +1 -1
- package/styled-components/es/components/Pagination/Pagination.js +14 -13
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.stories.tsx +10 -10
- package/styled-components/es/examples/plasma_b2c/components/Pagination/Pagination.config.js +4 -4
- package/styled-components/es/examples/plasma_b2c/components/Pagination/Pagination.stories.tsx +14 -7
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.stories.tsx +8 -8
- package/styled-components/es/examples/plasma_web/components/Pagination/Pagination.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Pagination/Pagination.stories.tsx +14 -7
- package/types/components/Cell/Cell.styles.d.ts.map +1 -1
- package/types/components/Cell/index.d.ts +3 -3
- package/types/components/Cell/index.d.ts.map +1 -1
- package/types/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.d.ts +3 -0
- package/types/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.d.ts.map +1 -0
- package/types/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.styles.d.ts +2 -0
- package/types/components/Cell/ui/CellTextboxLabel/CellTextboxLabel.styles.d.ts.map +1 -0
- package/types/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.d.ts +3 -0
- package/types/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.d.ts.map +1 -0
- package/types/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.styles.d.ts +2 -0
- package/types/components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.styles.d.ts.map +1 -0
- package/types/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.d.ts +3 -0
- package/types/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.d.ts.map +1 -0
- package/types/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.styles.d.ts +2 -0
- package/types/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.styles.d.ts.map +1 -0
- package/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Cell/Cell.d.ts +2 -2
- package/types/examples/plasma_web/components/Cell/Cell.d.ts.map +1 -1
- package/cjs/components/Cell/ui/CellTextLabel/CellTextLabel.js +0 -13
- package/cjs/components/Cell/ui/CellTextLabel/CellTextLabel.js.map +0 -1
- package/cjs/components/Cell/ui/CellTextLabel/CellTextLabel.styles.js.map +0 -1
- package/cjs/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.js +0 -13
- package/cjs/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.js.map +0 -1
- package/cjs/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.styles.js.map +0 -1
- package/cjs/components/Cell/ui/CellTextTitle/CellTextTitle.js +0 -13
- package/cjs/components/Cell/ui/CellTextTitle/CellTextTitle.js.map +0 -1
- package/cjs/components/Cell/ui/CellTextTitle/CellTextTitle.styles.js.map +0 -1
- package/es/components/Cell/ui/CellTextLabel/CellTextLabel.js +0 -9
- package/es/components/Cell/ui/CellTextLabel/CellTextLabel.js.map +0 -1
- package/es/components/Cell/ui/CellTextLabel/CellTextLabel.styles.js.map +0 -1
- package/es/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.js +0 -9
- package/es/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.js.map +0 -1
- package/es/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.styles.js.map +0 -1
- package/es/components/Cell/ui/CellTextTitle/CellTextTitle.js +0 -9
- package/es/components/Cell/ui/CellTextTitle/CellTextTitle.js.map +0 -1
- package/es/components/Cell/ui/CellTextTitle/CellTextTitle.styles.js.map +0 -1
- package/styled-components/cjs/components/Cell/ui/CellTextLabel/CellTextLabel.js +0 -12
- package/styled-components/cjs/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.js +0 -12
- package/styled-components/cjs/components/Cell/ui/CellTextTitle/CellTextTitle.js +0 -12
- package/styled-components/es/components/Cell/ui/CellTextLabel/CellTextLabel.js +0 -5
- package/styled-components/es/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.js +0 -5
- package/styled-components/es/components/Cell/ui/CellTextTitle/CellTextTitle.js +0 -5
- package/types/components/Cell/ui/CellTextLabel/CellTextLabel.d.ts +0 -3
- package/types/components/Cell/ui/CellTextLabel/CellTextLabel.d.ts.map +0 -1
- package/types/components/Cell/ui/CellTextLabel/CellTextLabel.styles.d.ts +0 -2
- package/types/components/Cell/ui/CellTextLabel/CellTextLabel.styles.d.ts.map +0 -1
- package/types/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.d.ts +0 -3
- package/types/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.d.ts.map +0 -1
- package/types/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.styles.d.ts +0 -2
- package/types/components/Cell/ui/CellTextSubtitle/CellTextSubtitle.styles.d.ts.map +0 -1
- package/types/components/Cell/ui/CellTextTitle/CellTextTitle.d.ts +0 -3
- package/types/components/Cell/ui/CellTextTitle/CellTextTitle.d.ts.map +0 -1
- package/types/components/Cell/ui/CellTextTitle/CellTextTitle.styles.d.ts +0 -2
- package/types/components/Cell/ui/CellTextTitle/CellTextTitle.styles.d.ts.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CellTextboxTitle.styles.js","sources":["../../../../../src/components/Cell/ui/CellTextboxTitle/CellTextboxTitle.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { tokens } from '../../Cell.tokens';\n\nexport const StyledTextboxTitle = styled.div`\n color: var(${tokens.cellTitleColor});\n font-size: var(${tokens.cellTitleFontSize});\n font-weight: var(${tokens.cellTitleFontWeight});\n font-family: var(${tokens.cellTitleFontFamily});\n font-style: var(${tokens.cellTitleFontStyle});\n line-height: var(${tokens.cellTitleLineHeight});\n letter-spacing: var(${tokens.cellTitleLetterSpacing});\n`;\n"],"names":["StyledTextboxTitle","styled","div","withConfig","componentId","tokens","cellTitleColor","cellTitleFontSize","cellTitleFontWeight","cellTitleFontFamily","cellTitleFontStyle","cellTitleLineHeight","cellTitleLetterSpacing"],"mappings":";;;IAIaA,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8BAAA;AAAA,CAC3BC,CAAAA,CAAAA,CAAAA,YAAAA,EAAAA,kBAAAA,EAAAA,oBAAAA,EAAAA,oBAAAA,EAAAA,mBAAAA,EAAAA,oBAAAA,EAAAA,uBAAAA,EAAAA,IAAAA,CAAAA,EAAAA,MAAM,CAACC,cAAc,EACjBD,MAAM,CAACE,iBAAiB,EACtBF,MAAM,CAACG,mBAAmB,EAC1BH,MAAM,CAACI,mBAAmB,EAC3BJ,MAAM,CAACK,kBAAkB,EACxBL,MAAM,CAACM,mBAAmB,EACvBN,MAAM,CAACO,sBAAsB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/Cell/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../../Cell.tokens';\n\nexport const base = css`\n color: var(${tokens.cellColor});\n background-color: var(${tokens.cellBackgroundColor});\n\n width: 100%;\n display: flex;\n align-items:
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/Cell/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../../Cell.tokens';\n\nexport const base = css`\n color: var(${tokens.cellColor});\n background-color: var(${tokens.cellBackgroundColor});\n\n width: 100%;\n display: flex;\n align-items: stretch;\n gap: var(${tokens.cellGap});\n\n &:focus {\n outline: 0 none;\n }\n`;\n"],"names":["base"],"mappings":"AAIO,IAAMA,IAAI,GAYhB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
.b1sr9i7l{color:var(--plasma-cell-color);background-color:var(--plasma-cell-background-color);width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:
|
1
|
+
.b1sr9i7l{color:var(--plasma-cell-color);background-color:var(--plasma-cell-background-color);width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;gap:var(--plasma-cell-gap);}.b1sr9i7l:focus{outline:0 none;}
|
@@ -2,7 +2,7 @@ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _
|
|
2
2
|
import React, { forwardRef, useState, useEffect } from 'react';
|
3
3
|
import { cx } from '../../utils/index.js';
|
4
4
|
import { PaginationRoot, PaginationPages, PaginationButtonGroup, PaginationShorter, PaginationSection, PaginationButton, PaginationActions } from './Pagination.styles.js';
|
5
|
-
import {
|
5
|
+
import { getSections, defaultValues } from './utils/index.js';
|
6
6
|
import { base } from './variations/_view/base.js';
|
7
7
|
import { base as base$2 } from './variations/_type/base.js';
|
8
8
|
import { base as base$1 } from './variations/_size/base.js';
|
@@ -52,7 +52,7 @@ var paginationRoot = function paginationRoot(Root) {
|
|
52
52
|
onChangePageValue = _ref.onChangePageValue,
|
53
53
|
onChangePerPageValue = _ref.onChangePerPageValue,
|
54
54
|
rest = _objectWithoutProperties(_ref, _excluded);
|
55
|
-
var _useState = useState(
|
55
|
+
var _useState = useState(1),
|
56
56
|
_useState2 = _slicedToArray(_useState, 2),
|
57
57
|
page = _useState2[0],
|
58
58
|
setPageValue = _useState2[1];
|
@@ -79,24 +79,22 @@ var paginationRoot = function paginationRoot(Root) {
|
|
79
79
|
setPagesValue(Math.ceil(count / (newPerPage || (hasPerPage ? defaultValues.perPage : 1))));
|
80
80
|
};
|
81
81
|
var handlerSetPage = function handlerSetPage(newPageValue) {
|
82
|
-
var
|
83
|
-
|
84
|
-
|
85
|
-
newPageValue = pages;
|
82
|
+
var pageValue = newPageValue !== null && newPageValue !== void 0 ? newPageValue : defaultValues.value;
|
83
|
+
if (pageValue > pages) {
|
84
|
+
pageValue = pages;
|
86
85
|
}
|
87
|
-
if (
|
88
|
-
|
86
|
+
if (pageValue < 1) {
|
87
|
+
pageValue = 1;
|
89
88
|
}
|
90
|
-
if (disabled.includes(
|
89
|
+
if (disabled.includes(pageValue)) {
|
91
90
|
return;
|
92
91
|
}
|
93
|
-
setPageValue(
|
94
|
-
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(
|
92
|
+
setPageValue(pageValue);
|
93
|
+
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(pageValue);
|
95
94
|
};
|
96
95
|
var handlerSetPerPage = function handlerSetPerPage(newPerPageValue) {
|
97
|
-
|
96
|
+
handlerSetPage(1);
|
98
97
|
setPerPageValue(newPerPageValue);
|
99
|
-
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(1);
|
100
98
|
onChangePerPageValue === null || onChangePerPageValue === void 0 ? void 0 : onChangePerPageValue(newPerPageValue);
|
101
99
|
handlerSetPages(newPerPageValue);
|
102
100
|
};
|
@@ -105,7 +103,10 @@ var paginationRoot = function paginationRoot(Root) {
|
|
105
103
|
};
|
106
104
|
useEffect(function () {
|
107
105
|
handlerSetPages(perPage);
|
108
|
-
}, [perPage, handlerSetPages]);
|
106
|
+
}, [perPage, count, handlerSetPages]);
|
107
|
+
useEffect(function () {
|
108
|
+
handlerSetPage(value);
|
109
|
+
}, [value]);
|
109
110
|
useEffect(function () {
|
110
111
|
setSections(getSections(page, pages, slots));
|
111
112
|
}, [page, slots, pages, setSections, getSections]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import React, { useEffect, useState, forwardRef } from 'react';\n\nimport { cx, isNumber } from '../../utils';\nimport { RootProps } from '../../engines';\n\nimport {\n PaginationPages,\n PaginationActions,\n PaginationButton,\n PaginationSection,\n PaginationButtonGroup,\n PaginationRoot,\n PaginationShorter,\n} from './Pagination.styles';\nimport type { PaginationProps } from './Pagination.types';\nimport { getSections, defaultValues } from './utils';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as typeCSS } from './variations/_type/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { classes } from './Pagination.tokens';\nimport { PaginationQuickJumpToPage } from './ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage';\nimport { PaginationSelectPerPage } from './ui/PaginationSelectPerPage/PaginationSelectPerPage';\n\nexport const paginationRoot = (Root: RootProps<HTMLDivElement, PaginationProps>) =>\n forwardRef<HTMLDivElement, PaginationProps>(\n (\n {\n value = defaultValues.value,\n perPage,\n slots = defaultValues.slots,\n\n view,\n viewCurrentPage,\n type = defaultValues.type,\n size,\n pilled = defaultValues.pilled,\n square = defaultValues.square,\n disabledPages = defaultValues.disabledPages,\n\n count = defaultValues.value,\n\n hasQuickJump = defaultValues.hasQuickJump,\n hasPerPage = defaultValues.hasPerPage,\n perPageList = defaultValues.perPageList,\n isCommonButtonStyles = defaultValues.isCommonButtonStyles,\n\n placeholderQuickJump = defaultValues.placeholderQuickJump,\n textQuickJump = defaultValues.textQuickJump,\n textPerPage = defaultValues.textPerPage,\n\n leftContent,\n rightContent,\n\n onChangePageValue,\n onChangePerPageValue,\n ...rest\n },\n ref,\n ) => {\n const [page, setPageValue] = useState<number>(value ?? defaultValues.value);\n const [perPageValue, setPerPageValue] = useState(perPage);\n const [pages, setPagesValue] = useState<number>(value);\n const [sections, setSections] = useState<number[][] | null>(null);\n\n const typeClass = classes[`${type}Type` as keyof typeof classes];\n const roundedClass = pilled ? 'circle-circle' : 'square-square';\n\n const withHasPerPageSelect = hasPerPage ? classes.withHasPerPageSelect : undefined;\n const withHasQuickJump = hasQuickJump ? classes.withHasQuickJump : undefined;\n\n const disabled = disabledPages.map((el) => (isNumber(el) ? Number(el) : null));\n\n const handlerSetPages = (newPerPage?: number) => {\n setPagesValue(Math.ceil(count / (newPerPage || (hasPerPage ? defaultValues.perPage : 1))));\n };\n\n const handlerSetPage = (newPageValue?: number) => {\n newPageValue = newPageValue ?? defaultValues.value;\n if (newPageValue > pages) {\n newPageValue = pages;\n }\n if (newPageValue < 1) {\n newPageValue = 1;\n }\n if (disabled.includes(newPageValue)) {\n return;\n }\n setPageValue(newPageValue);\n onChangePageValue?.(newPageValue);\n };\n\n const handlerSetPerPage = (newPerPageValue?: number) => {\n setPageValue(1);\n setPerPageValue(newPerPageValue);\n onChangePageValue?.(1);\n onChangePerPageValue?.(newPerPageValue);\n\n handlerSetPages(newPerPageValue);\n };\n\n const isActiveButton = (checkPage: number) => {\n return page === checkPage ? classes.paginationPageButtonActive : '';\n };\n\n useEffect(() => {\n handlerSetPages(perPage);\n }, [perPage, handlerSetPages]);\n\n useEffect(() => {\n setSections(getSections(page, pages, slots));\n }, [page, slots, pages, setSections, getSections]);\n\n return (\n <Root\n size={size}\n view={view}\n viewCurrentPage={viewCurrentPage}\n className={cx(classes.wrapper, typeClass)}\n ref={ref}\n {...rest}\n >\n <PaginationRoot className={typeClass}>\n <PaginationPages>\n {leftContent && (\n <PaginationButtonGroup isCommonButtonStyles={isCommonButtonStyles}>\n {leftContent}\n </PaginationButtonGroup>\n )}\n {sections &&\n sections.map((section, indexSection) => (\n <>\n {indexSection !== 0 && (\n <PaginationShorter stretching=\"fixed\" disabled>\n ...\n </PaginationShorter>\n )}\n <PaginationSection key={indexSection}>\n {section.map((pageValue) => (\n <PaginationButton\n square={square}\n pin={roundedClass}\n key={pageValue}\n onClick={() => handlerSetPage(pageValue)}\n disabled={disabled.includes(pageValue)}\n className={cx(\n classes.paginationPageButton,\n isActiveButton(pageValue),\n )}\n >\n {pageValue}\n </PaginationButton>\n ))}\n </PaginationSection>\n </>\n ))}\n {rightContent && (\n <PaginationButtonGroup isCommonButtonStyles={isCommonButtonStyles}>\n {rightContent}\n </PaginationButtonGroup>\n )}\n </PaginationPages>\n <PaginationActions\n className={cx(classes.actions, typeClass, withHasPerPageSelect, withHasQuickJump)}\n >\n {hasQuickJump && (\n <PaginationQuickJumpToPage\n placeholderQuickJump={placeholderQuickJump}\n textQuickJump={textQuickJump}\n onChangeValue={handlerSetPage}\n />\n )}\n {hasPerPage && (\n <PaginationSelectPerPage\n textPerPage={textPerPage}\n value={perPageValue}\n valuesList={perPageList}\n onChangeValue={handlerSetPerPage}\n />\n )}\n </PaginationActions>\n </PaginationRoot>\n </Root>\n );\n },\n );\n\nexport const paginationConfig = {\n name: 'Pagination',\n tag: 'div',\n layout: paginationRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n type: {\n css: typeCSS,\n },\n },\n defaults: {\n view: 'clear',\n size: 'm',\n },\n};\n"],"names":["paginationRoot","Root","forwardRef","_ref","ref","_ref$value","value","defaultValues","perPage","_ref$slots","slots","view","viewCurrentPage","_ref$type","type","size","_ref$pilled","pilled","_ref$square","square","_ref$disabledPages","disabledPages","_ref$count","count","_ref$hasQuickJump","hasQuickJump","_ref$hasPerPage","hasPerPage","_ref$perPageList","perPageList","_ref$isCommonButtonSt","isCommonButtonStyles","_ref$placeholderQuick","placeholderQuickJump","_ref$textQuickJump","textQuickJump","_ref$textPerPage","textPerPage","leftContent","rightContent","onChangePageValue","onChangePerPageValue","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","page","setPageValue","_useState3","_useState4","perPageValue","setPerPageValue","_useState5","_useState6","pages","setPagesValue","_useState7","_useState8","sections","setSections","typeClass","classes","concat","roundedClass","withHasPerPageSelect","undefined","withHasQuickJump","disabled","map","el","isNumber","Number","handlerSetPages","newPerPage","Math","ceil","handlerSetPage","newPageValue","_newPageValue","includes","handlerSetPerPage","newPerPageValue","isActiveButton","checkPage","paginationPageButtonActive","useEffect","getSections","React","createElement","_extends","className","cx","wrapper","PaginationRoot","PaginationPages","PaginationButtonGroup","section","indexSection","Fragment","_PaginationShorter","PaginationShorter","stretching","PaginationSection","key","pageValue","PaginationButton","pin","onClick","paginationPageButton","PaginationActions","actions","PaginationQuickJumpToPage","onChangeValue","PaginationSelectPerPage","valuesList","paginationConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","typeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;IAuBaA,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,IAAgD,EAAA;AAAA,EAAA,oBAC3EC,UAAU,CACN,UAAAC,IAAA,EAgCIC,GAAG,EACF;AAAA,IAAA,IAAAC,UAAA,GAAAF,IAAA,CA/BGG,KAAK;AAALA,MAAAA,KAAK,GAAAD,UAAA,KAAA,KAAA,CAAA,GAAGE,aAAa,CAACD,KAAK,GAAAD,UAAA;MAC3BG,OAAO,GAAAL,IAAA,CAAPK,OAAO;MAAAC,UAAA,GAAAN,IAAA,CACPO,KAAK;AAALA,MAAAA,KAAK,GAAAD,UAAA,KAAA,KAAA,CAAA,GAAGF,aAAa,CAACG,KAAK,GAAAD,UAAA;MAE3BE,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MACJC,eAAe,GAAAT,IAAA,CAAfS,eAAe;MAAAC,SAAA,GAAAV,IAAA,CACfW,IAAI;AAAJA,MAAAA,IAAI,GAAAD,SAAA,KAAA,KAAA,CAAA,GAAGN,aAAa,CAACO,IAAI,GAAAD,SAAA;MACzBE,IAAI,GAAAZ,IAAA,CAAJY,IAAI;MAAAC,WAAA,GAAAb,IAAA,CACJc,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAA,KAAA,C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d,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMmC,gBAAgB,GAAG;AAC5BC,EAAAA,IAAI,EAAE,YAAY;AAClBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEzH,cAAc;AACtB0H,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRhH,IAAAA,IAAI,EAAE;AACFiH,MAAAA,GAAG,EAAEC,IAAAA;KACR;AACD9G,IAAAA,IAAI,EAAE;AACF6G,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDhH,IAAAA,IAAI,EAAE;AACF8G,MAAAA,GAAG,EAAEG,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNrH,IAAAA,IAAI,EAAE,OAAO;AACbI,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import React, { useEffect, useState, forwardRef } from 'react';\n\nimport { cx, isNumber } from '../../utils';\nimport { RootProps } from '../../engines';\n\nimport {\n PaginationPages,\n PaginationActions,\n PaginationButton,\n PaginationSection,\n PaginationButtonGroup,\n PaginationRoot,\n PaginationShorter,\n} from './Pagination.styles';\nimport type { PaginationProps } from './Pagination.types';\nimport { getSections, defaultValues } from './utils';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as typeCSS } from './variations/_type/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { classes } from './Pagination.tokens';\nimport { PaginationQuickJumpToPage } from './ui/PaginationQuickJumpToPage/PaginationQuickJumpToPage';\nimport { PaginationSelectPerPage } from './ui/PaginationSelectPerPage/PaginationSelectPerPage';\n\nexport const paginationRoot = (Root: RootProps<HTMLDivElement, PaginationProps>) =>\n forwardRef<HTMLDivElement, PaginationProps>(\n (\n {\n value = defaultValues.value,\n perPage,\n slots = defaultValues.slots,\n\n view,\n viewCurrentPage,\n type = defaultValues.type,\n size,\n pilled = defaultValues.pilled,\n square = defaultValues.square,\n disabledPages = defaultValues.disabledPages,\n\n count = defaultValues.value,\n\n hasQuickJump = defaultValues.hasQuickJump,\n hasPerPage = defaultValues.hasPerPage,\n perPageList = defaultValues.perPageList,\n isCommonButtonStyles = defaultValues.isCommonButtonStyles,\n\n placeholderQuickJump = defaultValues.placeholderQuickJump,\n textQuickJump = defaultValues.textQuickJump,\n textPerPage = defaultValues.textPerPage,\n\n leftContent,\n rightContent,\n\n onChangePageValue,\n onChangePerPageValue,\n ...rest\n },\n ref,\n ) => {\n const [page, setPageValue] = useState<number>(1);\n const [perPageValue, setPerPageValue] = useState(perPage);\n const [pages, setPagesValue] = useState<number>(value);\n const [sections, setSections] = useState<number[][] | null>(null);\n\n const typeClass = classes[`${type}Type` as keyof typeof classes];\n const roundedClass = pilled ? 'circle-circle' : 'square-square';\n\n const withHasPerPageSelect = hasPerPage ? classes.withHasPerPageSelect : undefined;\n const withHasQuickJump = hasQuickJump ? classes.withHasQuickJump : undefined;\n\n const disabled = disabledPages.map((el) => (isNumber(el) ? Number(el) : null));\n\n const handlerSetPages = (newPerPage?: number) => {\n setPagesValue(Math.ceil(count / (newPerPage || (hasPerPage ? defaultValues.perPage : 1))));\n };\n\n const handlerSetPage = (newPageValue?: number) => {\n let pageValue = newPageValue ?? defaultValues.value;\n if (pageValue > pages) {\n pageValue = pages;\n }\n if (pageValue < 1) {\n pageValue = 1;\n }\n if (disabled.includes(pageValue)) {\n return;\n }\n setPageValue(pageValue);\n onChangePageValue?.(pageValue);\n };\n\n const handlerSetPerPage = (newPerPageValue?: number) => {\n handlerSetPage(1);\n setPerPageValue(newPerPageValue);\n onChangePerPageValue?.(newPerPageValue);\n\n handlerSetPages(newPerPageValue);\n };\n\n const isActiveButton = (checkPage: number) => {\n return page === checkPage ? classes.paginationPageButtonActive : '';\n };\n\n useEffect(() => {\n handlerSetPages(perPage);\n }, [perPage, count, handlerSetPages]);\n\n useEffect(() => {\n handlerSetPage(value);\n }, [value]);\n\n useEffect(() => {\n setSections(getSections(page, pages, slots));\n }, [page, slots, pages, setSections, getSections]);\n\n return (\n <Root\n size={size}\n view={view}\n viewCurrentPage={viewCurrentPage}\n className={cx(classes.wrapper, typeClass)}\n ref={ref}\n {...rest}\n >\n <PaginationRoot className={typeClass}>\n <PaginationPages>\n {leftContent && (\n <PaginationButtonGroup isCommonButtonStyles={isCommonButtonStyles}>\n {leftContent}\n </PaginationButtonGroup>\n )}\n {sections &&\n sections.map((section, indexSection) => (\n <>\n {indexSection !== 0 && (\n <PaginationShorter stretching=\"fixed\" disabled>\n ...\n </PaginationShorter>\n )}\n <PaginationSection key={indexSection}>\n {section.map((pageValue) => (\n <PaginationButton\n square={square}\n pin={roundedClass}\n key={pageValue}\n onClick={() => handlerSetPage(pageValue)}\n disabled={disabled.includes(pageValue)}\n className={cx(\n classes.paginationPageButton,\n isActiveButton(pageValue),\n )}\n >\n {pageValue}\n </PaginationButton>\n ))}\n </PaginationSection>\n </>\n ))}\n {rightContent && (\n <PaginationButtonGroup isCommonButtonStyles={isCommonButtonStyles}>\n {rightContent}\n </PaginationButtonGroup>\n )}\n </PaginationPages>\n <PaginationActions\n className={cx(classes.actions, typeClass, withHasPerPageSelect, withHasQuickJump)}\n >\n {hasQuickJump && (\n <PaginationQuickJumpToPage\n placeholderQuickJump={placeholderQuickJump}\n textQuickJump={textQuickJump}\n onChangeValue={handlerSetPage}\n />\n )}\n {hasPerPage && (\n <PaginationSelectPerPage\n textPerPage={textPerPage}\n value={perPageValue}\n valuesList={perPageList}\n onChangeValue={handlerSetPerPage}\n />\n )}\n </PaginationActions>\n </PaginationRoot>\n </Root>\n );\n },\n );\n\nexport const paginationConfig = {\n name: 'Pagination',\n tag: 'div',\n layout: paginationRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n type: {\n css: typeCSS,\n },\n },\n defaults: {\n view: 'clear',\n size: 'm',\n },\n};\n"],"names":["paginationRoot","Root","forwardRef","_ref","ref","_ref$value","value","defaultValues","perPage","_ref$slots","slots","view","viewCurrentPage","_ref$type","type","size","_ref$pilled","pilled","_ref$square","square","_ref$disabledPages","disabledPages","_ref$count","count","_ref$hasQuickJump","hasQuickJump","_ref$hasPerPage","hasPerPage","_ref$perPageList","perPageList","_ref$isCommonButtonSt","isCommonButtonStyles","_ref$placeholderQuick","placeholderQuickJump","_ref$textQuickJump","textQuickJump","_ref$textPerPage","textPerPage","leftContent","rightContent","onChangePageValue","onChangePerPageValue","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","page","setPageValue","_useState3","_useState4","perPageValue","setPerPageValue","_useState5","_useState6","pages","setPagesValue","_useState7","_useState8","sections","setSections","typeClass","classes","concat","roundedClass","withHasPerPageSelect","undefined","withHasQuickJump","disabled","map","el","isNumber","Number","handlerSetPages","newPerPage","Math","ceil","handlerSetPage","newPageValue","pageValue","includes","handlerSetPerPage","newPerPageValue","isActiveButton","checkPage","paginationPageButtonActive","useEffect","getSections","React","createElement","_extends","className","cx","wrapper","PaginationRoot","PaginationPages","PaginationButtonGroup","section","indexSection","Fragment","_PaginationShorter","PaginationShorter","stretching","PaginationSection","key","PaginationButton","pin","onClick","paginationPageButton","PaginationActions","actions","PaginationQuickJumpToPage","onChangeValue","PaginationSelectPerPage","valuesList","paginationConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","typeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;IAuBaA,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,IAAgD,EAAA;AAAA,EAAA,oBAC3EC,UAAU,CACN,UAAAC,IAAA,EAgCIC,GAAG,EACF;AAAA,IAAA,IAAAC,UAAA,GAAAF,IAAA,CA/BGG,KAAK;AAALA,MAAAA,KAAK,GAAAD,UAAA,KAAA,KAAA,CAAA,GAAGE,aAAa,CAACD,KAAK,GAAAD,UAAA;MAC3BG,OAAO,GAAAL,IAAA,CAAPK,OAAO;M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EA,oBAAqB;AAC3CE,MAAAA,aAAa,EAAEA,aAAc;AAC7B+E,MAAAA,aAAa,EAAEnC,cAAAA;KAClB,CACJ,EACApD,UAAU,iBACP+D,KAAA,CAAAC,aAAA,CAACwB,uBAAuB,EAAA;AACpB9E,MAAAA,WAAW,EAAEA,WAAY;AACzB/B,MAAAA,KAAK,EAAE+C,YAAa;AACpB+D,MAAAA,UAAU,EAAEvF,WAAY;AACxBqF,MAAAA,aAAa,EAAE/B,iBAAAA;KAClB,CAEU,CACP,CACd,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMkC,gBAAgB,GAAG;AAC5BC,EAAAA,IAAI,EAAE,YAAY;AAClBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAExH,cAAc;AACtByH,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACR/G,IAAAA,IAAI,EAAE;AACFgH,MAAAA,GAAG,EAAEC,IAAAA;KACR;AACD7G,IAAAA,IAAI,EAAE;AACF4G,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACD/G,IAAAA,IAAI,EAAE;AACF6G,MAAAA,GAAG,EAAEG,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNpH,IAAAA,IAAI,EAAE,OAAO;AACbI,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
package/es/index.css
CHANGED
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
.Cell_styles_ygfo1w_b1wikybr__e668c908.Cell_styles_ygfo1w_b1wikybr__e668c908.Cell_styles_ygfo1w_cellStretchingFixed__e668c908{width:var(--plasma-cell-width);}.Cell_styles_ygfo1w_b1wikybr__e668c908.Cell_styles_ygfo1w_b1wikybr__e668c908.Cell_styles_ygfo1w_cellStretchingFilled__e668c908{width:100%;}.Cell_styles_ygfo1w_b1wikybr__e668c908.Cell_styles_ygfo1w_b1wikybr__e668c908.Cell_styles_ygfo1w_cellStretchingAuto__e668c908{width:auto;}
|
50
50
|
|
51
|
-
.
|
51
|
+
.base_pir0qf_b1sr9i7l__baa3f156{color:var(--plasma-cell-color);background-color:var(--plasma-cell-background-color);width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;gap:var(--plasma-cell-gap);}.base_pir0qf_b1sr9i7l__baa3f156:focus{outline:0 none;}
|
52
52
|
|
53
53
|
.base_1vy4dme_bcchm3r__d3e4eaba{font-family:var(--plasma-link-font-family);color:var(--plasma-link-color);}.base_1vy4dme_bcchm3r__d3e4eaba::before{border-bottom:var(--plasma-link-underline-border) solid currentColor;}.base_1vy4dme_bcchm3r__d3e4eaba:hover{color:var(--plasma-link-color-hover,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:hover::before{opacity:1;}.base_1vy4dme_bcchm3r__d3e4eaba:active{color:var(--plasma-link-color-active,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:active::before{opacity:1;}.base_1vy4dme_bcchm3r__d3e4eaba:visited{color:var(--plasma-link-color-visited,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:visited::before{opacity:1;}.base_1vy4dme_bcchm3r__d3e4eaba:visited:hover{color:var(--plasma-link-color-visited-hover,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:visited:hover::before{opacity:1;}.base_1vy4dme_bcchm3r__d3e4eaba:visited:active{color:var(--plasma-link-color-visited-active,var(--plasma-link-color));}.base_1vy4dme_bcchm3r__d3e4eaba:visited:active::before{opacity:1;}
|
54
54
|
|
package/es/index.js
CHANGED
@@ -19,9 +19,9 @@ export { buttonGroupConfig, buttonGroupRoot } from './components/ButtonGroup/But
|
|
19
19
|
export { classes as buttonGroupClasses, tokens as buttonGroupTokens } from './components/ButtonGroup/ButtonGroup.tokens.js';
|
20
20
|
export { chipConfig, chipRoot } from './components/Chip/Chip.js';
|
21
21
|
export { tokens as chipTokens } from './components/Chip/Chip.tokens.js';
|
22
|
-
export {
|
23
|
-
export {
|
24
|
-
export {
|
22
|
+
export { CellTextboxLabel } from './components/Cell/ui/CellTextboxLabel/CellTextboxLabel.js';
|
23
|
+
export { CellTextboxTitle } from './components/Cell/ui/CellTextboxTitle/CellTextboxTitle.js';
|
24
|
+
export { CellTextboxSubtitle } from './components/Cell/ui/CellTextboxSubtitle/CellTextboxSubtitle.js';
|
25
25
|
export { cellConfig, cellRoot } from './components/Cell/Cell.js';
|
26
26
|
export { classes as cellClasses, tokens as cellTokens } from './components/Cell/Cell.tokens.js';
|
27
27
|
export { CellTextbox } from './components/Cell/ui/CellTextbox/CellTextbox.js';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.69.0-canary.1148.
|
3
|
+
"version": "0.69.0-canary.1148.8538859580.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -67,7 +67,7 @@
|
|
67
67
|
"@rollup/plugin-babel": "^6.0.3",
|
68
68
|
"@rollup/plugin-commonjs": "^25.0.4",
|
69
69
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
70
|
-
"@salutejs/plasma-sb-utils": "0.154.
|
70
|
+
"@salutejs/plasma-sb-utils": "0.154.1-dev.0",
|
71
71
|
"@storybook/addon-docs": "^7.6.17",
|
72
72
|
"@storybook/addon-essentials": "^7.6.17",
|
73
73
|
"@storybook/addons": "^7.6.17",
|
@@ -97,10 +97,10 @@
|
|
97
97
|
"@linaria/core": "5.0.2",
|
98
98
|
"@linaria/react": "5.0.3",
|
99
99
|
"@popperjs/core": "2.11.8",
|
100
|
-
"@salutejs/plasma-core": "1.156.
|
100
|
+
"@salutejs/plasma-core": "1.156.1-dev.0",
|
101
101
|
"focus-visible": "5.2.0",
|
102
102
|
"react-popper": "2.3.0",
|
103
103
|
"storeon": "3.1.5"
|
104
104
|
},
|
105
|
-
"gitHead": "
|
105
|
+
"gitHead": "ef6236cbac4a1ec7cd33de84717e77f05ab90593"
|
106
106
|
}
|
@@ -17,7 +17,7 @@ var alignToFlex = {
|
|
17
17
|
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["&&.", "{width:var(", ");}&&.", "{width:100%;}&&.", "{width:auto;}"], _Cell.classes.fixedStretching, _Cell.tokens.cellWidth, _Cell.classes.filledStretching, _Cell.classes.autoStretching);
|
18
18
|
var CellContentWrapper = exports.CellContentWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
19
19
|
componentId: "plasma-new-hope__sc-16emz3n-0"
|
20
|
-
})(["display:flex;flex:auto;justify-content:space-between;gap:var(", ");height:auto;"], _Cell.tokens.cellGap);
|
20
|
+
})(["display:flex;flex:auto;align-items:stretch;justify-content:space-between;gap:var(", ");height:auto;"], _Cell.tokens.cellGap);
|
21
21
|
var CellContent = exports.CellContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
22
22
|
componentId: "plasma-new-hope__sc-16emz3n-1"
|
23
23
|
})(["display:flex;align-items:center;height:auto;"]);
|
@@ -3,28 +3,28 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "
|
6
|
+
Object.defineProperty(exports, "CellTextbox", {
|
7
7
|
enumerable: true,
|
8
8
|
get: function get() {
|
9
|
-
return
|
9
|
+
return _CellTextbox.CellTextbox;
|
10
10
|
}
|
11
11
|
});
|
12
|
-
Object.defineProperty(exports, "
|
12
|
+
Object.defineProperty(exports, "CellTextboxLabel", {
|
13
13
|
enumerable: true,
|
14
14
|
get: function get() {
|
15
|
-
return
|
15
|
+
return _CellTextboxLabel.CellTextboxLabel;
|
16
16
|
}
|
17
17
|
});
|
18
|
-
Object.defineProperty(exports, "
|
18
|
+
Object.defineProperty(exports, "CellTextboxSubtitle", {
|
19
19
|
enumerable: true,
|
20
20
|
get: function get() {
|
21
|
-
return
|
21
|
+
return _CellTextboxSubtitle.CellTextboxSubtitle;
|
22
22
|
}
|
23
23
|
});
|
24
|
-
Object.defineProperty(exports, "
|
24
|
+
Object.defineProperty(exports, "CellTextboxTitle", {
|
25
25
|
enumerable: true,
|
26
26
|
get: function get() {
|
27
|
-
return
|
27
|
+
return _CellTextboxTitle.CellTextboxTitle;
|
28
28
|
}
|
29
29
|
});
|
30
30
|
Object.defineProperty(exports, "cellClasses", {
|
@@ -51,9 +51,9 @@ Object.defineProperty(exports, "cellTokens", {
|
|
51
51
|
return _Cell2.tokens;
|
52
52
|
}
|
53
53
|
});
|
54
|
-
var
|
55
|
-
var
|
56
|
-
var
|
54
|
+
var _CellTextboxLabel = /*#__PURE__*/require("./ui/CellTextboxLabel/CellTextboxLabel");
|
55
|
+
var _CellTextboxTitle = /*#__PURE__*/require("./ui/CellTextboxTitle/CellTextboxTitle");
|
56
|
+
var _CellTextboxSubtitle = /*#__PURE__*/require("./ui/CellTextboxSubtitle/CellTextboxSubtitle");
|
57
57
|
var _Cell = /*#__PURE__*/require("./Cell");
|
58
58
|
var _Cell2 = /*#__PURE__*/require("./Cell.tokens");
|
59
59
|
var _CellTextbox = /*#__PURE__*/require("./ui/CellTextbox/CellTextbox");
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.CellTextbox = void 0;
|
7
7
|
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
-
var
|
9
|
-
var
|
10
|
-
var
|
8
|
+
var _CellTextboxLabel = /*#__PURE__*/require("../CellTextboxLabel/CellTextboxLabel");
|
9
|
+
var _CellTextboxTitle = /*#__PURE__*/require("../CellTextboxTitle/CellTextboxTitle");
|
10
|
+
var _CellTextboxSubtitle = /*#__PURE__*/require("../CellTextboxSubtitle/CellTextboxSubtitle");
|
11
11
|
var _CellTextbox = /*#__PURE__*/require("./CellTextbox.styles");
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
13
|
var CellTextbox = exports.CellTextbox = function CellTextbox(_ref) {
|
@@ -15,5 +15,5 @@ var CellTextbox = exports.CellTextbox = function CellTextbox(_ref) {
|
|
15
15
|
title = _ref.title,
|
16
16
|
subtitle = _ref.subtitle,
|
17
17
|
children = _ref.children;
|
18
|
-
return /*#__PURE__*/_react["default"].createElement(_CellTextbox.CellTextboxStyled, null, label || title || subtitle ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, label && /*#__PURE__*/_react["default"].createElement(
|
18
|
+
return /*#__PURE__*/_react["default"].createElement(_CellTextbox.CellTextboxStyled, null, label || title || subtitle ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, label && /*#__PURE__*/_react["default"].createElement(_CellTextboxLabel.CellTextboxLabel, null, label), title && /*#__PURE__*/_react["default"].createElement(_CellTextboxTitle.CellTextboxTitle, null, title), subtitle && /*#__PURE__*/_react["default"].createElement(_CellTextboxSubtitle.CellTextboxSubtitle, null, subtitle)) : children);
|
19
19
|
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.CellTextboxLabel = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _CellTextboxLabel = /*#__PURE__*/require("./CellTextboxLabel.styles");
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
+
var CellTextboxLabel = exports.CellTextboxLabel = function CellTextboxLabel(props) {
|
11
|
+
return /*#__PURE__*/_react["default"].createElement(_CellTextboxLabel.StyledTextboxLabel, null, props.children);
|
12
|
+
};
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.StyledTextboxLabel = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
8
|
var _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
-
var
|
11
|
-
componentId: "plasma-new-hope__sc-
|
10
|
+
var StyledTextboxLabel = exports.StyledTextboxLabel = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
11
|
+
componentId: "plasma-new-hope__sc-j0en77-0"
|
12
12
|
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], _Cell.tokens.cellLabelColor, _Cell.tokens.cellLabelFontSize, _Cell.tokens.cellLabelFontWeight, _Cell.tokens.cellLabelFontFamily, _Cell.tokens.cellLabelFontStyle, _Cell.tokens.cellLabelLineHeight, _Cell.tokens.cellLabelLetterSpacing);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.CellTextboxSubtitle = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _CellTextboxSubtitle = /*#__PURE__*/require("./CellTextboxSubtitle.styles");
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
+
var CellTextboxSubtitle = exports.CellTextboxSubtitle = function CellTextboxSubtitle(props) {
|
11
|
+
return /*#__PURE__*/_react["default"].createElement(_CellTextboxSubtitle.StyledTextboxSubtitle, null, props.children);
|
12
|
+
};
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.StyledTextboxSubtitle = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
8
|
var _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
-
var
|
11
|
-
componentId: "plasma-new-hope__sc-
|
10
|
+
var StyledTextboxSubtitle = exports.StyledTextboxSubtitle = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
11
|
+
componentId: "plasma-new-hope__sc-lkssfu-0"
|
12
12
|
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], _Cell.tokens.cellSubtitleColor, _Cell.tokens.cellSubtitleFontSize, _Cell.tokens.cellSubtitleFontWeight, _Cell.tokens.cellSubtitleFontFamily, _Cell.tokens.cellSubtitleFontStyle, _Cell.tokens.cellSubtitleLineHeight, _Cell.tokens.cellSubtitleLetterSpacing);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.CellTextboxTitle = void 0;
|
7
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
8
|
+
var _CellTextboxTitle = /*#__PURE__*/require("./CellTextboxTitle.styles");
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
+
var CellTextboxTitle = exports.CellTextboxTitle = function CellTextboxTitle(props) {
|
11
|
+
return /*#__PURE__*/_react["default"].createElement(_CellTextboxTitle.StyledTextboxTitle, null, props.children);
|
12
|
+
};
|
@@ -3,10 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.StyledTextboxTitle = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
|
8
8
|
var _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
10
|
-
var
|
11
|
-
componentId: "plasma-new-hope__sc-
|
10
|
+
var StyledTextboxTitle = exports.StyledTextboxTitle = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
11
|
+
componentId: "plasma-new-hope__sc-3vis0m-0"
|
12
12
|
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], _Cell.tokens.cellTitleColor, _Cell.tokens.cellTitleFontSize, _Cell.tokens.cellTitleFontWeight, _Cell.tokens.cellTitleFontFamily, _Cell.tokens.cellTitleFontStyle, _Cell.tokens.cellTitleLineHeight, _Cell.tokens.cellTitleLetterSpacing);
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.base = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
8
|
var _Cell = /*#__PURE__*/require("../../Cell.tokens");
|
9
|
-
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["color:var(", ");background-color:var(", ");width:100%;display:flex;align-items:
|
9
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["color:var(", ");background-color:var(", ");width:100%;display:flex;align-items:stretch;gap:var(", ");&:focus{outline:0 none;}"], _Cell.tokens.cellColor, _Cell.tokens.cellBackgroundColor, _Cell.tokens.cellGap);
|
@@ -67,7 +67,7 @@ var paginationRoot = exports.paginationRoot = function paginationRoot(Root) {
|
|
67
67
|
onChangePageValue = _ref.onChangePageValue,
|
68
68
|
onChangePerPageValue = _ref.onChangePerPageValue,
|
69
69
|
rest = _objectWithoutProperties(_ref, _excluded);
|
70
|
-
var _useState = (0, _react.useState)(
|
70
|
+
var _useState = (0, _react.useState)(1),
|
71
71
|
_useState2 = _slicedToArray(_useState, 2),
|
72
72
|
page = _useState2[0],
|
73
73
|
setPageValue = _useState2[1];
|
@@ -94,24 +94,22 @@ var paginationRoot = exports.paginationRoot = function paginationRoot(Root) {
|
|
94
94
|
setPagesValue(Math.ceil(count / (newPerPage || (hasPerPage ? _utils2.defaultValues.perPage : 1))));
|
95
95
|
};
|
96
96
|
var handlerSetPage = function handlerSetPage(newPageValue) {
|
97
|
-
var
|
98
|
-
|
99
|
-
|
100
|
-
newPageValue = pages;
|
97
|
+
var pageValue = newPageValue !== null && newPageValue !== void 0 ? newPageValue : _utils2.defaultValues.value;
|
98
|
+
if (pageValue > pages) {
|
99
|
+
pageValue = pages;
|
101
100
|
}
|
102
|
-
if (
|
103
|
-
|
101
|
+
if (pageValue < 1) {
|
102
|
+
pageValue = 1;
|
104
103
|
}
|
105
|
-
if (disabled.includes(
|
104
|
+
if (disabled.includes(pageValue)) {
|
106
105
|
return;
|
107
106
|
}
|
108
|
-
setPageValue(
|
109
|
-
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(
|
107
|
+
setPageValue(pageValue);
|
108
|
+
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(pageValue);
|
110
109
|
};
|
111
110
|
var handlerSetPerPage = function handlerSetPerPage(newPerPageValue) {
|
112
|
-
|
111
|
+
handlerSetPage(1);
|
113
112
|
setPerPageValue(newPerPageValue);
|
114
|
-
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(1);
|
115
113
|
onChangePerPageValue === null || onChangePerPageValue === void 0 ? void 0 : onChangePerPageValue(newPerPageValue);
|
116
114
|
handlerSetPages(newPerPageValue);
|
117
115
|
};
|
@@ -120,7 +118,10 @@ var paginationRoot = exports.paginationRoot = function paginationRoot(Root) {
|
|
120
118
|
};
|
121
119
|
(0, _react.useEffect)(function () {
|
122
120
|
handlerSetPages(perPage);
|
123
|
-
}, [perPage, handlerSetPages]);
|
121
|
+
}, [perPage, count, handlerSetPages]);
|
122
|
+
(0, _react.useEffect)(function () {
|
123
|
+
handlerSetPage(value);
|
124
|
+
}, [value]);
|
124
125
|
(0, _react.useEffect)(function () {
|
125
126
|
setSections((0, _utils2.getSections)(page, pages, slots));
|
126
127
|
}, [page, slots, pages, setSections, _utils2.getSections]);
|
@@ -4,28 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.Cell = void 0;
|
7
|
-
Object.defineProperty(exports, "
|
7
|
+
Object.defineProperty(exports, "CellTextbox", {
|
8
8
|
enumerable: true,
|
9
9
|
get: function get() {
|
10
|
-
return _Cell.
|
10
|
+
return _Cell.CellTextbox;
|
11
11
|
}
|
12
12
|
});
|
13
|
-
Object.defineProperty(exports, "
|
13
|
+
Object.defineProperty(exports, "CellTextboxLabel", {
|
14
14
|
enumerable: true,
|
15
15
|
get: function get() {
|
16
|
-
return _Cell.
|
16
|
+
return _Cell.CellTextboxLabel;
|
17
17
|
}
|
18
18
|
});
|
19
|
-
Object.defineProperty(exports, "
|
19
|
+
Object.defineProperty(exports, "CellTextboxSubtitle", {
|
20
20
|
enumerable: true,
|
21
21
|
get: function get() {
|
22
|
-
return _Cell.
|
22
|
+
return _Cell.CellTextboxSubtitle;
|
23
23
|
}
|
24
24
|
});
|
25
|
-
Object.defineProperty(exports, "
|
25
|
+
Object.defineProperty(exports, "CellTextboxTitle", {
|
26
26
|
enumerable: true,
|
27
27
|
get: function get() {
|
28
|
-
return _Cell.
|
28
|
+
return _Cell.CellTextboxTitle;
|
29
29
|
}
|
30
30
|
});
|
31
31
|
var _Cell = /*#__PURE__*/require("../../../../components/Cell");
|
@@ -7,12 +7,12 @@ import { WithTheme } from '../../../_helpers';
|
|
7
7
|
import { Avatar } from '../Avatar/Avatar';
|
8
8
|
import { IconChevronLeft } from '../../../../components/_Icon';
|
9
9
|
|
10
|
-
import { Cell, CellTextbox,
|
10
|
+
import { Cell, CellTextbox, CellTextboxTitle } from './Cell';
|
11
11
|
|
12
12
|
type StoryProps = ComponentProps<typeof Cell> & {
|
13
13
|
itemsCount?: number;
|
14
|
-
|
15
|
-
|
14
|
+
disableLeftContent?: boolean;
|
15
|
+
disableRightContent?: boolean;
|
16
16
|
};
|
17
17
|
type Story = StoryObj<StoryProps>;
|
18
18
|
|
@@ -74,8 +74,8 @@ export const Default: Story = {
|
|
74
74
|
args: {
|
75
75
|
size: 'm',
|
76
76
|
stretching: 'filled',
|
77
|
-
|
78
|
-
|
77
|
+
disableLeftContent: false,
|
78
|
+
disableRightContent: false,
|
79
79
|
alignContentLeft: 'center',
|
80
80
|
alignContentRight: 'center',
|
81
81
|
title: 'Title',
|
@@ -86,11 +86,11 @@ export const Default: Story = {
|
|
86
86
|
return (
|
87
87
|
<Cell
|
88
88
|
contentLeft={
|
89
|
-
!args.
|
89
|
+
!args.disableLeftContent && (
|
90
90
|
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
91
91
|
)
|
92
92
|
}
|
93
|
-
contentRight={!args.
|
93
|
+
contentRight={!args.disableRightContent && <ChevronRight color="inherit" size="xs" />}
|
94
94
|
{...args}
|
95
95
|
/>
|
96
96
|
);
|
@@ -116,12 +116,12 @@ export const WithContentTextboxCustom: Story = {
|
|
116
116
|
contentLeft={
|
117
117
|
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
118
118
|
}
|
119
|
-
contentRight={!args.
|
119
|
+
contentRight={!args.disableRightContent && <ChevronRight color="inherit" size="xs" />}
|
120
120
|
>
|
121
|
-
<
|
121
|
+
<CellTextboxTitle>
|
122
122
|
<CellTextbox>Title</CellTextbox>
|
123
123
|
<MyStyledText>My styled Text</MyStyledText>
|
124
|
-
</
|
124
|
+
</CellTextboxTitle>
|
125
125
|
</Cell>
|
126
126
|
);
|
127
127
|
},
|