@atom-learning/components 2.58.2 → 2.58.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
## [2.58.
|
|
1
|
+
## [2.58.3](https://github.com/Atom-Learning/components/compare/v2.58.2...v2.58.3) (2023-06-20)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* List style position inside so it works better with text-align ([fcae452](https://github.com/Atom-Learning/components/commit/fcae452f197591d4104562d376f86a812e0ea92e))
|
|
6
|
+
* change all uses of absolute urls to relative ([963a854](https://github.com/Atom-Learning/components/commit/963a8541a2c2ae959b7ee98aa850c3edf33b7c40))
|
|
7
|
+
* data table pagination styles so it is responsive in small screens ([8927ef9](https://github.com/Atom-Learning/components/commit/8927ef938ffd512684303f9d11b0e6622fc271a7))
|
|
9
8
|
|
|
10
9
|
# [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
|
|
11
10
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{styled as
|
|
1
|
+
import*as e from"react";import{styled as P}from"../../../stitches.js";import{Flex as m}from"../../flex/Flex.js";import{Text as I}from"../../text/Text.js";import{AsyncDataState as o}from"../DataTable.types.js";import{useDataTable as b}from"../DataTableContext.js";import{GotoPageSelect as w,DirectionButton as c}from"./PaginationButtons.js";const y=P("nav",{display:"flex",justifyContent:"space-between",alignItems:"center",fontVariantNumeric:"tabular-nums",flexWrap:"wrap",rowGap:"$4"}),C=p=>{const{applyPagination:r,getState:g,getRowModel:f,getPageCount:i,previousPage:d,nextPage:u,setPageIndex:x,getTotalRows:s,asyncDataState:a}=b();e.useEffect(()=>{r()},[r]);const{pagination:t}=g();if(a!==o.PENDING&&s()===0)return null;const l=t.pageIndex*t.pageSize+1,E=l+f().rows.length-1,n=a===o.PENDING||a===o.REJECTED;return e.createElement(y,{...p},e.createElement(I,{size:"sm",css:{pr:"$4","@sm":{flexBasis:"50%"}}},`${l.toString()} - ${E.toString()} of ${s()} items`),e.createElement(m,{css:{justifyContent:"space-between",width:"100%","@sm":{flexBasis:"50%"}}},e.createElement(w,{gotoPage:x,pageCount:i(),pageIndex:t.pageIndex,disabled:n}),e.createElement(m,null,e.createElement(c,{direction:"previous",disabled:t.pageIndex===0||n,onClick:d,css:{mr:"$4"}}),e.createElement(c,{direction:"next",disabled:t.pageIndex===i()-1||n,onClick:u}))))};export{C as Pagination};
|
|
2
2
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../../src/components/data-table/pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { Flex } from '../../flex'\nimport { Text } from '../../text'\nimport { AsyncDataState } from '../DataTable.types'\nimport { useDataTable } from '../DataTableContext'\nimport { DirectionButton, GotoPageSelect } from './PaginationButtons'\n\nconst StyledNav = styled('nav', {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n fontVariantNumeric: 'tabular-nums'\n})\n\ntype PaginationProps = React.ComponentProps<typeof StyledNav>\n\n/** Applies pagination to parent DataTableProvider and renders UI to switch pages etc */\nexport const Pagination: React.FC<PaginationProps> = (props) => {\n const {\n applyPagination,\n getState,\n getRowModel,\n getPageCount,\n previousPage,\n nextPage,\n setPageIndex,\n getTotalRows,\n asyncDataState\n } = useDataTable()\n\n React.useEffect(() => {\n applyPagination()\n }, [applyPagination])\n\n const { pagination: paginationState } = getState()\n const isPending = asyncDataState === AsyncDataState.PENDING\n const isEmpty = !isPending && getTotalRows() === 0\n\n if (isEmpty) return null\n\n const recordsCountFrom =\n paginationState.pageIndex * paginationState.pageSize + 1\n const recordsCountTo = recordsCountFrom + getRowModel().rows.length - 1\n const isPaginationDisabled =\n asyncDataState === AsyncDataState.PENDING ||\n asyncDataState === AsyncDataState.REJECTED\n\n return (\n <StyledNav {...props}>\n <Text
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../../src/components/data-table/pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { Flex } from '../../flex'\nimport { Text } from '../../text'\nimport { AsyncDataState } from '../DataTable.types'\nimport { useDataTable } from '../DataTableContext'\nimport { DirectionButton, GotoPageSelect } from './PaginationButtons'\n\nconst StyledNav = styled('nav', {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n fontVariantNumeric: 'tabular-nums',\n flexWrap: 'wrap',\n rowGap: '$4'\n})\n\ntype PaginationProps = React.ComponentProps<typeof StyledNav>\n\n/** Applies pagination to parent DataTableProvider and renders UI to switch pages etc */\nexport const Pagination: React.FC<PaginationProps> = (props) => {\n const {\n applyPagination,\n getState,\n getRowModel,\n getPageCount,\n previousPage,\n nextPage,\n setPageIndex,\n getTotalRows,\n asyncDataState\n } = useDataTable()\n\n React.useEffect(() => {\n applyPagination()\n }, [applyPagination])\n\n const { pagination: paginationState } = getState()\n const isPending = asyncDataState === AsyncDataState.PENDING\n const isEmpty = !isPending && getTotalRows() === 0\n\n if (isEmpty) return null\n\n const recordsCountFrom =\n paginationState.pageIndex * paginationState.pageSize + 1\n const recordsCountTo = recordsCountFrom + getRowModel().rows.length - 1\n const isPaginationDisabled =\n asyncDataState === AsyncDataState.PENDING ||\n asyncDataState === AsyncDataState.REJECTED\n\n return (\n <StyledNav {...props}>\n <Text\n size=\"sm\"\n css={{\n pr: '$4',\n '@sm': { flexBasis: '50%' }\n }}\n >\n {`${recordsCountFrom.toString()} - ${recordsCountTo.toString()} of ${getTotalRows()} items`}\n </Text>\n\n <Flex\n css={{\n justifyContent: 'space-between',\n width: '100%',\n '@sm': { flexBasis: '50%' }\n }}\n >\n <GotoPageSelect\n gotoPage={setPageIndex}\n pageCount={getPageCount()}\n pageIndex={paginationState.pageIndex}\n disabled={isPaginationDisabled}\n />\n\n <Flex>\n <DirectionButton\n direction=\"previous\"\n disabled={paginationState.pageIndex === 0 || isPaginationDisabled}\n onClick={previousPage}\n css={{ mr: '$4' }}\n />\n <DirectionButton\n direction=\"next\"\n disabled={\n paginationState.pageIndex === getPageCount() - 1 ||\n isPaginationDisabled\n }\n onClick={nextPage}\n />\n </Flex>\n </Flex>\n </StyledNav>\n )\n}\n"],"names":["StyledNav","styled","Pagination","props","applyPagination","getState","getRowModel","getPageCount","previousPage","nextPage","setPageIndex","getTotalRows","asyncDataState","useDataTable","React","paginationState","AsyncDataState","recordsCountFrom","recordsCountTo","isPaginationDisabled","Text","Flex","GotoPageSelect","DirectionButton"],"mappings":"oVAUA,MAAMA,EAAYC,EAAO,MAAO,CAC9B,QAAS,OACT,eAAgB,gBAChB,WAAY,SACZ,mBAAoB,eACpB,SAAU,OACV,OAAQ,IACV,CAAC,EAKYC,EAAyCC,GAAU,CAC9D,KAAM,CACJ,gBAAAC,EACA,SAAAC,EACA,YAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,aAAAC,EACA,aAAAC,EACA,eAAAC,CACF,EAAIC,IAEJC,EAAM,UAAU,IAAM,CACpBV,EACF,CAAA,EAAG,CAACA,CAAe,CAAC,EAEpB,KAAM,CAAE,WAAYW,CAAgB,EAAIV,IAIxC,GAHkBO,IAAmBI,EAAe,SACtBL,EAAa,IAAM,EAEpC,OAAO,KAEpB,MAAMM,EACJF,EAAgB,UAAYA,EAAgB,SAAW,EACnDG,EAAiBD,EAAmBX,IAAc,KAAK,OAAS,EAChEa,EACJP,IAAmBI,EAAe,SAClCJ,IAAmBI,EAAe,SAEpC,OACEF,EAAA,cAACd,EAAA,CAAW,GAAGG,CACbW,EAAAA,EAAA,cAACM,EAAA,CACC,KAAK,KACL,IAAK,CACH,GAAI,KACJ,MAAO,CAAE,UAAW,KAAM,CAC5B,CAAA,EAEC,GAAGH,EAAiB,gBAAgBC,EAAe,SAAS,QAAQP,WACvE,EAEAG,EAAA,cAACO,EAAA,CACC,IAAK,CACH,eAAgB,gBAChB,MAAO,OACP,MAAO,CAAE,UAAW,KAAM,CAC5B,CAAA,EAEAP,EAAA,cAACQ,EAAA,CACC,SAAUZ,EACV,UAAWH,EACX,EAAA,UAAWQ,EAAgB,UAC3B,SAAUI,CAAAA,CACZ,EAEAL,EAAA,cAACO,EAAA,KACCP,EAAA,cAACS,EAAA,CACC,UAAU,WACV,SAAUR,EAAgB,YAAc,GAAKI,EAC7C,QAASX,EACT,IAAK,CAAE,GAAI,IAAK,EAClB,EACAM,EAAA,cAACS,EAAA,CACC,UAAU,OACV,SACER,EAAgB,YAAcR,IAAiB,GAC/CY,EAEF,QAASV,CACX,CAAA,CACF,CACF,CACF,CAEJ"}
|