@salutejs/plasma-new-hope 0.68.0-canary.1155.8481923291.0 → 0.68.1-canary.1154.8507812308.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Pagination/Pagination.js +6 -4
- package/cjs/components/Pagination/Pagination.js.map +1 -1
- package/es/components/Pagination/Pagination.js +6 -4
- package/es/components/Pagination/Pagination.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Chip/Chip.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Pagination/Pagination.js +6 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Pagination/Pagination.stories.tsx +14 -7
- package/styled-components/cjs/examples/plasma_web/components/Pagination/Pagination.stories.tsx +14 -7
- package/styled-components/es/components/Chip/Chip.template-doc.mdx +2 -2
- package/styled-components/es/components/Pagination/Pagination.js +6 -4
- package/styled-components/es/examples/plasma_b2c/components/Pagination/Pagination.stories.tsx +14 -7
- package/styled-components/es/examples/plasma_web/components/Pagination/Pagination.stories.tsx +14 -7
- package/types/components/Chip/Chip.d.ts +26 -2
- package/types/components/Chip/Chip.d.ts.map +1 -1
- package/types/components/Chip/Chip.types.d.ts +6 -5
- package/types/components/Chip/Chip.types.d.ts.map +1 -1
- package/types/components/Combobox/ui/ComboboxChip/ComboboxChip.styles.d.ts +13 -1
- package/types/components/Combobox/ui/ComboboxChip/ComboboxChip.styles.d.ts.map +1 -1
- package/types/components/Indicator/Indicator.d.ts +2 -2
- package/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/types/components/Select/ui/SelectChip/SelectChip.styles.d.ts +13 -1
- package/types/components/Select/ui/SelectChip/SelectChip.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Chip/Chip.d.ts +13 -1
- package/types/examples/plasma_b2c/components/Chip/Chip.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Indicator/Indicator.d.ts +2 -2
- package/types/examples/plasma_web/components/Chip/Chip.d.ts +13 -1
- package/types/examples/plasma_web/components/Chip/Chip.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Indicator/Indicator.d.ts +2 -2
- package/types/examples/sds_engineer/components/Chip/Chip.d.ts +13 -1
- package/types/examples/sds_engineer/components/Chip/Chip.d.ts.map +1 -1
@@ -56,7 +56,7 @@ var paginationRoot = function paginationRoot(Root) {
|
|
56
56
|
onChangePageValue = _ref.onChangePageValue,
|
57
57
|
onChangePerPageValue = _ref.onChangePerPageValue,
|
58
58
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
59
|
-
var _useState = React.useState(
|
59
|
+
var _useState = React.useState(1),
|
60
60
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
61
61
|
page = _useState2[0],
|
62
62
|
setPageValue = _useState2[1];
|
@@ -98,9 +98,8 @@ var paginationRoot = function paginationRoot(Root) {
|
|
98
98
|
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(newPageValue);
|
99
99
|
};
|
100
100
|
var handlerSetPerPage = function handlerSetPerPage(newPerPageValue) {
|
101
|
-
|
101
|
+
handlerSetPage(1);
|
102
102
|
setPerPageValue(newPerPageValue);
|
103
|
-
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(1);
|
104
103
|
onChangePerPageValue === null || onChangePerPageValue === void 0 ? void 0 : onChangePerPageValue(newPerPageValue);
|
105
104
|
handlerSetPages(newPerPageValue);
|
106
105
|
};
|
@@ -109,7 +108,10 @@ var paginationRoot = function paginationRoot(Root) {
|
|
109
108
|
};
|
110
109
|
React.useEffect(function () {
|
111
110
|
handlerSetPages(perPage);
|
112
|
-
}, [perPage, handlerSetPages]);
|
111
|
+
}, [perPage, count, handlerSetPages]);
|
112
|
+
React.useEffect(function () {
|
113
|
+
handlerSetPage(value !== null && value !== void 0 ? value : index.defaultValues.value);
|
114
|
+
}, [value, index.defaultValues]);
|
113
115
|
React.useEffect(function () {
|
114
116
|
setSections(index.getSections(page, pages, slots));
|
115
117
|
}, [page, slots, pages, setSections, index.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,gBAAU,CACN,UAAAC,IAAA,EAgCIC,GAAG,EACF;AAAA,IAAA,IAAAC,UAAA,GAAAF,IAAA,CA/BGG,KAAK;AAALA,MAAAA,KAAK,GAAAD,UAAA,KAAA,KAAA,CAAA,GAAGE,mBAAa,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,mBAAa,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,mBAAa,CAACO,IAAI,GAAAD,SAAA;MACzBE,IAAI,GAAAZ,IAAA,CAAJY,IAAI;MAAAC,WAAA,GAAAb,IAAA,CACJc,MAAM;AAANA,MAAAA,MAAM,GAAAD,WAAA,KAAA,KAAA,CAAA,GAAGT,mBAAa,CAACU,MAAM,GAAAD,WAAA;MAAAE,WAAA,GAAAf,IAAA,CAC7BgB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A,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,SAAAA;KACR;AACD9G,IAAAA,IAAI,EAAE;AACF6G,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDhH,IAAAA,IAAI,EAAE;AACF8G,MAAAA,GAAG,EAAEG,WAAAA;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 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 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 ?? defaultValues.value);\n }, [value, defaultValues]);\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,gBAAU,CACN,UAAAC,IAAA,EAgCIC,GAAG,EACF;AAAA,IAAA,IAAAC,UAAA,GAAAF,IAAA,CA/BGG,KAAK;AAALA,MAAAA,KAAK,GAAAD,UAAA,KAAA,KAAA,CAAA,GAAGE,mBAAa,CAACD,KAAK,GAAAD,UAAA;MAC3BG,OAAO,GAAAL,IAAA,CAAPK,OAAO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SAAS,EAAEC,UAAE,CAAC9B,yBAAO,CAACiD,OAAO,EAAElD,SAAS,EAAEI,oBAAoB,EAAEE,gBAAgB,CAAA;AAAE,KAAA,EAEjF5C,YAAY,iBACTiE,KAAA,CAAAC,aAAA,CAACuB,mDAAyB,EAAA;AACtBjF,MAAAA,oBAAoB,EAAEA,oBAAqB;AAC3CE,MAAAA,aAAa,EAAEA,aAAc;AAC7BgF,MAAAA,aAAa,EAAEpC,cAAAA;KAClB,CACJ,EACApD,UAAU,iBACP+D,KAAA,CAAAC,aAAA,CAACyB,+CAAuB,EAAA;AACpB/E,MAAAA,WAAW,EAAEA,WAAY;AACzB/B,MAAAA,KAAK,EAAE+C,YAAa;AACpBgE,MAAAA,UAAU,EAAExF,WAAY;AACxBsF,MAAAA,aAAa,EAAEhC,iBAAAA;KAClB,CAEU,CACP,CACd,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,SAAAA;KACR;AACD9G,IAAAA,IAAI,EAAE;AACF6G,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDhH,IAAAA,IAAI,EAAE;AACF8G,MAAAA,GAAG,EAAEG,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNrH,IAAAA,IAAI,EAAE,OAAO;AACbI,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -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];
|
@@ -94,9 +94,8 @@ var paginationRoot = function paginationRoot(Root) {
|
|
94
94
|
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(newPageValue);
|
95
95
|
};
|
96
96
|
var handlerSetPerPage = function handlerSetPerPage(newPerPageValue) {
|
97
|
-
|
97
|
+
handlerSetPage(1);
|
98
98
|
setPerPageValue(newPerPageValue);
|
99
|
-
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(1);
|
100
99
|
onChangePerPageValue === null || onChangePerPageValue === void 0 ? void 0 : onChangePerPageValue(newPerPageValue);
|
101
100
|
handlerSetPages(newPerPageValue);
|
102
101
|
};
|
@@ -105,7 +104,10 @@ var paginationRoot = function paginationRoot(Root) {
|
|
105
104
|
};
|
106
105
|
useEffect(function () {
|
107
106
|
handlerSetPages(perPage);
|
108
|
-
}, [perPage, handlerSetPages]);
|
107
|
+
}, [perPage, count, handlerSetPages]);
|
108
|
+
useEffect(function () {
|
109
|
+
handlerSetPage(value !== null && value !== void 0 ? value : defaultValues.value);
|
110
|
+
}, [value, defaultValues]);
|
109
111
|
useEffect(function () {
|
110
112
|
setSections(getSections(page, pages, slots));
|
111
113
|
}, [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","vari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AA,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 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 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 ?? defaultValues.value);\n }, [value, defaultValues]);\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,I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AK,EAAE+C,YAAa;AACpBgE,MAAAA,UAAU,EAAExF,WAAY;AACxBsF,MAAAA,aAAa,EAAEhC,iBAAAA;KAClB,CAEU,CACP,CACd,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;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.68.
|
3
|
+
"version": "0.68.1-canary.1154.8507812308.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.
|
70
|
+
"@salutejs/plasma-sb-utils": "0.154.0-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.
|
100
|
+
"@salutejs/plasma-core": "1.156.0-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": "2398ba33eb0142627a62161d60c198c2094b0039"
|
106
106
|
}
|
@@ -70,7 +70,7 @@ export function App() {
|
|
70
70
|
|
71
71
|
### Вид Chip
|
72
72
|
Вид Chip задается с помощью свойства `view`. Возможные значения свойства `view`:
|
73
|
-
+ `"
|
73
|
+
+ `"default"` – основная;
|
74
74
|
+ `"secondary"` – вторичная;
|
75
75
|
+ `"positive"` – успешное завершение;
|
76
76
|
|
@@ -81,7 +81,7 @@ import { Chip } from '@salutejs/{{ package }}';
|
|
81
81
|
export function App() {
|
82
82
|
return (
|
83
83
|
<div>
|
84
|
-
<Chip text="Chip" size="m" view="
|
84
|
+
<Chip text="Chip" size="m" view="default" />
|
85
85
|
<Chip text="Chip" size="m" view="secondary" />
|
86
86
|
<Chip text="Chip" size="m" view="positive" />
|
87
87
|
</div>
|
@@ -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];
|
@@ -109,9 +109,8 @@ var paginationRoot = exports.paginationRoot = function paginationRoot(Root) {
|
|
109
109
|
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(newPageValue);
|
110
110
|
};
|
111
111
|
var handlerSetPerPage = function handlerSetPerPage(newPerPageValue) {
|
112
|
-
|
112
|
+
handlerSetPage(1);
|
113
113
|
setPerPageValue(newPerPageValue);
|
114
|
-
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(1);
|
115
114
|
onChangePerPageValue === null || onChangePerPageValue === void 0 ? void 0 : onChangePerPageValue(newPerPageValue);
|
116
115
|
handlerSetPages(newPerPageValue);
|
117
116
|
};
|
@@ -120,7 +119,10 @@ var paginationRoot = exports.paginationRoot = function paginationRoot(Root) {
|
|
120
119
|
};
|
121
120
|
(0, _react.useEffect)(function () {
|
122
121
|
handlerSetPages(perPage);
|
123
|
-
}, [perPage, handlerSetPages]);
|
122
|
+
}, [perPage, count, handlerSetPages]);
|
123
|
+
(0, _react.useEffect)(function () {
|
124
|
+
handlerSetPage(value !== null && value !== void 0 ? value : _utils2.defaultValues.value);
|
125
|
+
}, [value, _utils2.defaultValues]);
|
124
126
|
(0, _react.useEffect)(function () {
|
125
127
|
setSections((0, _utils2.getSections)(page, pages, slots));
|
126
128
|
}, [page, slots, pages, setSections, _utils2.getSections]);
|
package/styled-components/cjs/examples/plasma_b2c/components/Pagination/Pagination.stories.tsx
CHANGED
@@ -53,7 +53,7 @@ type Story = StoryObj<typeof Pagination>;
|
|
53
53
|
|
54
54
|
export const Default: Story = {
|
55
55
|
args: {
|
56
|
-
count:
|
56
|
+
count: 2000,
|
57
57
|
value: 1,
|
58
58
|
slots: 9,
|
59
59
|
type: 'default',
|
@@ -71,12 +71,18 @@ const PaginationContent = (agrs) => {
|
|
71
71
|
const [pageValue, setPageValue] = useState(agrs.value);
|
72
72
|
const [perPageValue, setPerPageValue] = useState(agrs.perPage);
|
73
73
|
|
74
|
-
const
|
75
|
-
(page: number
|
76
|
-
setPerPageValue(perPage);
|
74
|
+
const handleChangePage = useCallback(
|
75
|
+
(page: number) => {
|
77
76
|
setPageValue(page);
|
78
77
|
},
|
79
|
-
[pageValue,
|
78
|
+
[pageValue, setPageValue],
|
79
|
+
);
|
80
|
+
|
81
|
+
const handleChangePerpage = useCallback(
|
82
|
+
(perPage: number) => {
|
83
|
+
setPerPageValue(perPage);
|
84
|
+
},
|
85
|
+
[perPageValue, setPerPageValue],
|
80
86
|
);
|
81
87
|
|
82
88
|
return (
|
@@ -103,7 +109,8 @@ const PaginationContent = (agrs) => {
|
|
103
109
|
Next
|
104
110
|
</Button>
|
105
111
|
}
|
106
|
-
|
112
|
+
onChangePageValue={handleChangePage}
|
113
|
+
onChangePerPageValue={handleChangePerpage}
|
107
114
|
/>
|
108
115
|
</>
|
109
116
|
);
|
@@ -111,7 +118,7 @@ const PaginationContent = (agrs) => {
|
|
111
118
|
|
112
119
|
export const Content: Story = {
|
113
120
|
args: {
|
114
|
-
count:
|
121
|
+
count: 2000,
|
115
122
|
value: 1,
|
116
123
|
slots: 9,
|
117
124
|
type: 'default',
|
package/styled-components/cjs/examples/plasma_web/components/Pagination/Pagination.stories.tsx
CHANGED
@@ -53,7 +53,7 @@ type Story = StoryObj<typeof Pagination>;
|
|
53
53
|
|
54
54
|
export const Default: Story = {
|
55
55
|
args: {
|
56
|
-
count:
|
56
|
+
count: 2000,
|
57
57
|
value: 1,
|
58
58
|
slots: 9,
|
59
59
|
type: 'default',
|
@@ -72,12 +72,18 @@ const PaginationContent = (agrs) => {
|
|
72
72
|
const [pageValue, setPageValue] = useState(agrs.value);
|
73
73
|
const [perPageValue, setPerPageValue] = useState(agrs.perPage);
|
74
74
|
|
75
|
-
const
|
76
|
-
(page: number
|
77
|
-
setPerPageValue(perPage);
|
75
|
+
const handleChangePage = useCallback(
|
76
|
+
(page: number) => {
|
78
77
|
setPageValue(page);
|
79
78
|
},
|
80
|
-
[pageValue,
|
79
|
+
[pageValue, setPageValue],
|
80
|
+
);
|
81
|
+
|
82
|
+
const handleChangePerpage = useCallback(
|
83
|
+
(perPage: number) => {
|
84
|
+
setPerPageValue(perPage);
|
85
|
+
},
|
86
|
+
[perPageValue, setPerPageValue],
|
81
87
|
);
|
82
88
|
|
83
89
|
return (
|
@@ -104,7 +110,8 @@ const PaginationContent = (agrs) => {
|
|
104
110
|
Next
|
105
111
|
</Button>
|
106
112
|
}
|
107
|
-
|
113
|
+
onChangePageValue={handleChangePage}
|
114
|
+
onChangePerPageValue={handleChangePerpage}
|
108
115
|
/>
|
109
116
|
</>
|
110
117
|
);
|
@@ -112,7 +119,7 @@ const PaginationContent = (agrs) => {
|
|
112
119
|
|
113
120
|
export const Content: Story = {
|
114
121
|
args: {
|
115
|
-
count:
|
122
|
+
count: 2000,
|
116
123
|
value: 1,
|
117
124
|
slots: 9,
|
118
125
|
type: 'default',
|
@@ -70,7 +70,7 @@ export function App() {
|
|
70
70
|
|
71
71
|
### Вид Chip
|
72
72
|
Вид Chip задается с помощью свойства `view`. Возможные значения свойства `view`:
|
73
|
-
+ `"
|
73
|
+
+ `"default"` – основная;
|
74
74
|
+ `"secondary"` – вторичная;
|
75
75
|
+ `"positive"` – успешное завершение;
|
76
76
|
|
@@ -81,7 +81,7 @@ import { Chip } from '@salutejs/{{ package }}';
|
|
81
81
|
export function App() {
|
82
82
|
return (
|
83
83
|
<div>
|
84
|
-
<Chip text="Chip" size="m" view="
|
84
|
+
<Chip text="Chip" size="m" view="default" />
|
85
85
|
<Chip text="Chip" size="m" view="secondary" />
|
86
86
|
<Chip text="Chip" size="m" view="positive" />
|
87
87
|
</div>
|
@@ -58,7 +58,7 @@ export var paginationRoot = function paginationRoot(Root) {
|
|
58
58
|
onChangePageValue = _ref.onChangePageValue,
|
59
59
|
onChangePerPageValue = _ref.onChangePerPageValue,
|
60
60
|
rest = _objectWithoutProperties(_ref, _excluded);
|
61
|
-
var _useState = useState(
|
61
|
+
var _useState = useState(1),
|
62
62
|
_useState2 = _slicedToArray(_useState, 2),
|
63
63
|
page = _useState2[0],
|
64
64
|
setPageValue = _useState2[1];
|
@@ -100,9 +100,8 @@ export var paginationRoot = function paginationRoot(Root) {
|
|
100
100
|
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(newPageValue);
|
101
101
|
};
|
102
102
|
var handlerSetPerPage = function handlerSetPerPage(newPerPageValue) {
|
103
|
-
|
103
|
+
handlerSetPage(1);
|
104
104
|
setPerPageValue(newPerPageValue);
|
105
|
-
onChangePageValue === null || onChangePageValue === void 0 ? void 0 : onChangePageValue(1);
|
106
105
|
onChangePerPageValue === null || onChangePerPageValue === void 0 ? void 0 : onChangePerPageValue(newPerPageValue);
|
107
106
|
handlerSetPages(newPerPageValue);
|
108
107
|
};
|
@@ -111,7 +110,10 @@ export var paginationRoot = function paginationRoot(Root) {
|
|
111
110
|
};
|
112
111
|
useEffect(function () {
|
113
112
|
handlerSetPages(perPage);
|
114
|
-
}, [perPage, handlerSetPages]);
|
113
|
+
}, [perPage, count, handlerSetPages]);
|
114
|
+
useEffect(function () {
|
115
|
+
handlerSetPage(value !== null && value !== void 0 ? value : defaultValues.value);
|
116
|
+
}, [value, defaultValues]);
|
115
117
|
useEffect(function () {
|
116
118
|
setSections(getSections(page, pages, slots));
|
117
119
|
}, [page, slots, pages, setSections, getSections]);
|
package/styled-components/es/examples/plasma_b2c/components/Pagination/Pagination.stories.tsx
CHANGED
@@ -53,7 +53,7 @@ type Story = StoryObj<typeof Pagination>;
|
|
53
53
|
|
54
54
|
export const Default: Story = {
|
55
55
|
args: {
|
56
|
-
count:
|
56
|
+
count: 2000,
|
57
57
|
value: 1,
|
58
58
|
slots: 9,
|
59
59
|
type: 'default',
|
@@ -71,12 +71,18 @@ const PaginationContent = (agrs) => {
|
|
71
71
|
const [pageValue, setPageValue] = useState(agrs.value);
|
72
72
|
const [perPageValue, setPerPageValue] = useState(agrs.perPage);
|
73
73
|
|
74
|
-
const
|
75
|
-
(page: number
|
76
|
-
setPerPageValue(perPage);
|
74
|
+
const handleChangePage = useCallback(
|
75
|
+
(page: number) => {
|
77
76
|
setPageValue(page);
|
78
77
|
},
|
79
|
-
[pageValue,
|
78
|
+
[pageValue, setPageValue],
|
79
|
+
);
|
80
|
+
|
81
|
+
const handleChangePerpage = useCallback(
|
82
|
+
(perPage: number) => {
|
83
|
+
setPerPageValue(perPage);
|
84
|
+
},
|
85
|
+
[perPageValue, setPerPageValue],
|
80
86
|
);
|
81
87
|
|
82
88
|
return (
|
@@ -103,7 +109,8 @@ const PaginationContent = (agrs) => {
|
|
103
109
|
Next
|
104
110
|
</Button>
|
105
111
|
}
|
106
|
-
|
112
|
+
onChangePageValue={handleChangePage}
|
113
|
+
onChangePerPageValue={handleChangePerpage}
|
107
114
|
/>
|
108
115
|
</>
|
109
116
|
);
|
@@ -111,7 +118,7 @@ const PaginationContent = (agrs) => {
|
|
111
118
|
|
112
119
|
export const Content: Story = {
|
113
120
|
args: {
|
114
|
-
count:
|
121
|
+
count: 2000,
|
115
122
|
value: 1,
|
116
123
|
slots: 9,
|
117
124
|
type: 'default',
|
package/styled-components/es/examples/plasma_web/components/Pagination/Pagination.stories.tsx
CHANGED
@@ -53,7 +53,7 @@ type Story = StoryObj<typeof Pagination>;
|
|
53
53
|
|
54
54
|
export const Default: Story = {
|
55
55
|
args: {
|
56
|
-
count:
|
56
|
+
count: 2000,
|
57
57
|
value: 1,
|
58
58
|
slots: 9,
|
59
59
|
type: 'default',
|
@@ -72,12 +72,18 @@ const PaginationContent = (agrs) => {
|
|
72
72
|
const [pageValue, setPageValue] = useState(agrs.value);
|
73
73
|
const [perPageValue, setPerPageValue] = useState(agrs.perPage);
|
74
74
|
|
75
|
-
const
|
76
|
-
(page: number
|
77
|
-
setPerPageValue(perPage);
|
75
|
+
const handleChangePage = useCallback(
|
76
|
+
(page: number) => {
|
78
77
|
setPageValue(page);
|
79
78
|
},
|
80
|
-
[pageValue,
|
79
|
+
[pageValue, setPageValue],
|
80
|
+
);
|
81
|
+
|
82
|
+
const handleChangePerpage = useCallback(
|
83
|
+
(perPage: number) => {
|
84
|
+
setPerPageValue(perPage);
|
85
|
+
},
|
86
|
+
[perPageValue, setPerPageValue],
|
81
87
|
);
|
82
88
|
|
83
89
|
return (
|
@@ -104,7 +110,8 @@ const PaginationContent = (agrs) => {
|
|
104
110
|
Next
|
105
111
|
</Button>
|
106
112
|
}
|
107
|
-
|
113
|
+
onChangePageValue={handleChangePage}
|
114
|
+
onChangePerPageValue={handleChangePerpage}
|
108
115
|
/>
|
109
116
|
</>
|
110
117
|
);
|
@@ -112,7 +119,7 @@ const PaginationContent = (agrs) => {
|
|
112
119
|
|
113
120
|
export const Content: Story = {
|
114
121
|
args: {
|
115
|
-
count:
|
122
|
+
count: 2000,
|
116
123
|
value: 1,
|
117
124
|
slots: 9,
|
118
125
|
type: 'default',
|
@@ -1,11 +1,35 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import type { RootProps } from '../../engines';
|
3
3
|
import type { ChipProps } from './Chip.types';
|
4
|
-
export declare const chipRoot: (Root: RootProps<HTMLButtonElement, ChipProps>) => React.ForwardRefExoticComponent<
|
4
|
+
export declare const chipRoot: (Root: RootProps<HTMLButtonElement, ChipProps>) => React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
5
|
+
text?: string | undefined;
|
6
|
+
contentLeft?: React.ReactNode;
|
7
|
+
contentRight?: React.ReactNode;
|
8
|
+
contentClearButton?: React.ReactNode;
|
9
|
+
disabled?: boolean | undefined;
|
10
|
+
readOnly?: boolean | undefined;
|
11
|
+
size?: ("m" | "s" | "xs" | "l") | undefined;
|
12
|
+
view?: ("secondary" | "default" | "positive") | undefined;
|
13
|
+
onClear?: (() => void) | undefined;
|
14
|
+
} & {
|
15
|
+
children?: React.ReactNode;
|
16
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
5
17
|
export declare const chipConfig: {
|
6
18
|
name: string;
|
7
19
|
tag: string;
|
8
|
-
layout: (Root: RootProps<HTMLButtonElement, ChipProps>) => React.ForwardRefExoticComponent<
|
20
|
+
layout: (Root: RootProps<HTMLButtonElement, ChipProps>) => React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
21
|
+
text?: string | undefined;
|
22
|
+
contentLeft?: React.ReactNode;
|
23
|
+
contentRight?: React.ReactNode;
|
24
|
+
contentClearButton?: React.ReactNode;
|
25
|
+
disabled?: boolean | undefined;
|
26
|
+
readOnly?: boolean | undefined;
|
27
|
+
size?: ("m" | "s" | "xs" | "l") | undefined;
|
28
|
+
view?: ("secondary" | "default" | "positive") | undefined;
|
29
|
+
onClear?: (() => void) | undefined;
|
30
|
+
} & {
|
31
|
+
children?: React.ReactNode;
|
32
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
9
33
|
base: import("@linaria/core").LinariaClassName;
|
10
34
|
variations: {
|
11
35
|
view: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,eAAO,MAAM,QAAQ,SAAU,UAAU,iBAAiB,EAAE,SAAS,CAAC,
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,eAAO,MAAM,QAAQ,SAAU,UAAU,iBAAiB,EAAE,SAAS,CAAC;;;;;;;;;;;;2CAsDhE,CAAC;AAEP,eAAO,MAAM,UAAU;;;mBAxDQ,UAAU,iBAAiB,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFrE,CAAC"}
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
2
|
+
declare type ChipSize = 'l' | 'm' | 's' | 'xs';
|
3
|
+
declare type ChipView = 'default' | 'secondary' | 'positive';
|
2
4
|
declare type CustomChipProps = {
|
3
5
|
/**
|
4
6
|
* Текстовая надпись
|
@@ -33,19 +35,18 @@ declare type CustomChipProps = {
|
|
33
35
|
* @default
|
34
36
|
* m
|
35
37
|
*/
|
36
|
-
size?:
|
38
|
+
size?: ChipSize;
|
37
39
|
/**
|
38
40
|
* Вид Chip
|
39
41
|
* @default
|
40
|
-
*
|
42
|
+
* default
|
41
43
|
*/
|
42
|
-
view?:
|
44
|
+
view?: ChipView;
|
43
45
|
/**
|
44
46
|
* Коллбек при взаимодействии с элементом
|
45
47
|
*/
|
46
48
|
onClear?: () => void;
|
47
49
|
} & PropsWithChildren;
|
48
|
-
export
|
49
|
-
}
|
50
|
+
export declare type ChipProps = ButtonHTMLAttributes<HTMLButtonElement> & CustomChipProps;
|
50
51
|
export {};
|
51
52
|
//# sourceMappingURL=Chip.types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.types.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhF,aAAK,eAAe,GAAG;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,
|
1
|
+
{"version":3,"file":"Chip.types.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhF,aAAK,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AACvC,aAAK,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAErD,aAAK,eAAe,GAAG;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,GAAG,iBAAiB,CAAC;AAEtB,oBAAY,SAAS,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,eAAe,CAAC"}
|
@@ -1,3 +1,15 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
export declare const StyledChip: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("
|
2
|
+
export declare const StyledChip: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
3
|
+
text?: string | undefined;
|
4
|
+
contentLeft?: import("react").ReactNode;
|
5
|
+
contentRight?: import("react").ReactNode;
|
6
|
+
contentClearButton?: import("react").ReactNode;
|
7
|
+
disabled?: boolean | undefined;
|
8
|
+
readOnly?: boolean | undefined;
|
9
|
+
size?: ("m" | "s" | "xs" | "l") | undefined;
|
10
|
+
view?: ("secondary" | "default" | "positive") | undefined;
|
11
|
+
onClear?: (() => void) | undefined;
|
12
|
+
} & {
|
13
|
+
children?: import("react").ReactNode;
|
14
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
3
15
|
//# sourceMappingURL=ComboboxChip.styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ComboboxChip.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ui/ComboboxChip/ComboboxChip.styles.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,UAAU,
|
1
|
+
{"version":3,"file":"ComboboxChip.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Combobox/ui/ComboboxChip/ComboboxChip.styles.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,UAAU;;;;;;;;;;;;qDAwCtB,CAAC"}
|
@@ -3,14 +3,14 @@ import { RootProps } from '../../engines';
|
|
3
3
|
import { IndicatorProps } from './Indicator.types';
|
4
4
|
export declare const indicatorRoot: (Root: RootProps<HTMLDivElement, IndicatorProps>) => React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
5
5
|
size: "m" | "s" | "l";
|
6
|
-
view: "accent" | "black" | "white" | "default" | "inactive" | "
|
6
|
+
view: "accent" | "black" | "white" | "default" | "inactive" | "positive" | "warning" | "negative";
|
7
7
|
} & React.RefAttributes<HTMLDivElement>>;
|
8
8
|
export declare const indicatorConfig: {
|
9
9
|
name: string;
|
10
10
|
tag: string;
|
11
11
|
layout: (Root: RootProps<HTMLDivElement, IndicatorProps>) => React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
12
12
|
size: "m" | "s" | "l";
|
13
|
-
view: "accent" | "black" | "white" | "default" | "inactive" | "
|
13
|
+
view: "accent" | "black" | "white" | "default" | "inactive" | "positive" | "warning" | "negative";
|
14
14
|
} & React.RefAttributes<HTMLDivElement>>;
|
15
15
|
base: import("@linaria/core").LinariaClassName;
|
16
16
|
variations: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAW1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAS1D,eAAO,MAAM,cAAc,SAAU,UAAU,cAAc,EAAE,eAAe,CAAC,
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAW1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAS1D,eAAO,MAAM,cAAc,SAAU,UAAU,cAAc,EAAE,eAAe,CAAC,2FAoK1E,CAAC;AAEN,eAAO,MAAM,gBAAgB;;;mBAtKQ,UAAU,cAAc,EAAE,eAAe,CAAC;;;;;;;;;;;;;;;;;CA0L9E,CAAC"}
|
@@ -1,3 +1,15 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
export declare const StyledChip: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("
|
2
|
+
export declare const StyledChip: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
3
|
+
text?: string | undefined;
|
4
|
+
contentLeft?: import("react").ReactNode;
|
5
|
+
contentRight?: import("react").ReactNode;
|
6
|
+
contentClearButton?: import("react").ReactNode;
|
7
|
+
disabled?: boolean | undefined;
|
8
|
+
readOnly?: boolean | undefined;
|
9
|
+
size?: ("m" | "s" | "xs" | "l") | undefined;
|
10
|
+
view?: ("secondary" | "default" | "positive") | undefined;
|
11
|
+
onClear?: (() => void) | undefined;
|
12
|
+
} & {
|
13
|
+
children?: import("react").ReactNode;
|
14
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
3
15
|
//# sourceMappingURL=SelectChip.styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SelectChip.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/ui/SelectChip/SelectChip.styles.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,UAAU,
|
1
|
+
{"version":3,"file":"SelectChip.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Select/ui/SelectChip/SelectChip.styles.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,UAAU;;;;;;;;;;;;qDAwCtB,CAAC"}
|
@@ -17,5 +17,17 @@ export declare const Chip: import("react").FunctionComponent<import("../../../..
|
|
17
17
|
focused: {
|
18
18
|
true: import("@linaria/core").LinariaClassName;
|
19
19
|
};
|
20
|
-
}> & import("
|
20
|
+
}> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
21
|
+
text?: string | undefined;
|
22
|
+
contentLeft?: import("react").ReactNode;
|
23
|
+
contentRight?: import("react").ReactNode;
|
24
|
+
contentClearButton?: import("react").ReactNode;
|
25
|
+
disabled?: boolean | undefined;
|
26
|
+
readOnly?: boolean | undefined;
|
27
|
+
size?: ("m" | "s" | "xs" | "l") | undefined;
|
28
|
+
view?: ("secondary" | "default" | "positive") | undefined;
|
29
|
+
onClear?: (() => void) | undefined;
|
30
|
+
} & {
|
31
|
+
children?: import("react").ReactNode;
|
32
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
21
33
|
//# sourceMappingURL=Chip.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Chip/Chip.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,IAAI
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_b2c/components/Chip/Chip.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAA0B,CAAC"}
|
@@ -33,7 +33,7 @@ declare const mergedConfig: import("../../../../engines").ComponentConfig<string
|
|
33
33
|
};
|
34
34
|
}>, import("react").HTMLAttributes<HTMLDivElement> & {
|
35
35
|
size: "m" | "s" | "l";
|
36
|
-
view: "accent" | "black" | "white" | "default" | "inactive" | "
|
36
|
+
view: "accent" | "black" | "white" | "default" | "inactive" | "positive" | "warning" | "negative";
|
37
37
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
38
38
|
declare const Indicator: import("react").FunctionComponent<import("../../../../engines/types").PropsType<{
|
39
39
|
view: {
|
@@ -53,7 +53,7 @@ declare const Indicator: import("react").FunctionComponent<import("../../../../e
|
|
53
53
|
};
|
54
54
|
}> & import("react").HTMLAttributes<HTMLDivElement> & {
|
55
55
|
size: "m" | "s" | "l";
|
56
|
-
view: "accent" | "black" | "white" | "default" | "inactive" | "
|
56
|
+
view: "accent" | "black" | "white" | "default" | "inactive" | "positive" | "warning" | "negative";
|
57
57
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
58
58
|
export { Indicator, mergedConfig };
|
59
59
|
//# sourceMappingURL=Indicator.d.ts.map
|
@@ -17,5 +17,17 @@ export declare const Chip: import("react").FunctionComponent<import("../../../..
|
|
17
17
|
focused: {
|
18
18
|
true: import("@linaria/core").LinariaClassName;
|
19
19
|
};
|
20
|
-
}> & import("
|
20
|
+
}> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
21
|
+
text?: string | undefined;
|
22
|
+
contentLeft?: import("react").ReactNode;
|
23
|
+
contentRight?: import("react").ReactNode;
|
24
|
+
contentClearButton?: import("react").ReactNode;
|
25
|
+
disabled?: boolean | undefined;
|
26
|
+
readOnly?: boolean | undefined;
|
27
|
+
size?: ("m" | "s" | "xs" | "l") | undefined;
|
28
|
+
view?: ("secondary" | "default" | "positive") | undefined;
|
29
|
+
onClear?: (() => void) | undefined;
|
30
|
+
} & {
|
31
|
+
children?: import("react").ReactNode;
|
32
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
21
33
|
//# sourceMappingURL=Chip.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Chip/Chip.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,IAAI
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/Chip/Chip.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAA0B,CAAC"}
|
@@ -33,7 +33,7 @@ declare const mergedConfig: import("../../../../engines").ComponentConfig<string
|
|
33
33
|
};
|
34
34
|
}>, import("react").HTMLAttributes<HTMLDivElement> & {
|
35
35
|
size: "m" | "s" | "l";
|
36
|
-
view: "accent" | "black" | "white" | "default" | "inactive" | "
|
36
|
+
view: "accent" | "black" | "white" | "default" | "inactive" | "positive" | "warning" | "negative";
|
37
37
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
38
38
|
declare const Indicator: import("react").FunctionComponent<import("../../../../engines/types").PropsType<{
|
39
39
|
view: {
|
@@ -53,7 +53,7 @@ declare const Indicator: import("react").FunctionComponent<import("../../../../e
|
|
53
53
|
};
|
54
54
|
}> & import("react").HTMLAttributes<HTMLDivElement> & {
|
55
55
|
size: "m" | "s" | "l";
|
56
|
-
view: "accent" | "black" | "white" | "default" | "inactive" | "
|
56
|
+
view: "accent" | "black" | "white" | "default" | "inactive" | "positive" | "warning" | "negative";
|
57
57
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
58
58
|
export { Indicator, mergedConfig };
|
59
59
|
//# sourceMappingURL=Indicator.d.ts.map
|
@@ -12,5 +12,17 @@ export declare const Chip: import("react").FunctionComponent<import("../../../..
|
|
12
12
|
readOnly: {
|
13
13
|
true: import("@linaria/core").LinariaClassName;
|
14
14
|
};
|
15
|
-
}> & import("
|
15
|
+
}> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
16
|
+
text?: string | undefined;
|
17
|
+
contentLeft?: import("react").ReactNode;
|
18
|
+
contentRight?: import("react").ReactNode;
|
19
|
+
contentClearButton?: import("react").ReactNode;
|
20
|
+
disabled?: boolean | undefined;
|
21
|
+
readOnly?: boolean | undefined;
|
22
|
+
size?: ("m" | "s" | "xs" | "l") | undefined;
|
23
|
+
view?: ("secondary" | "default" | "positive") | undefined;
|
24
|
+
onClear?: (() => void) | undefined;
|
25
|
+
} & {
|
26
|
+
children?: import("react").ReactNode;
|
27
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
16
28
|
//# sourceMappingURL=Chip.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../src/examples/sds_engineer/components/Chip/Chip.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,IAAI
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../../src/examples/sds_engineer/components/Chip/Chip.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;qDAA0B,CAAC"}
|