@harpercollins/harpercollins-design-system 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -614,7 +614,7 @@ function Zi(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=
614
614
  pointer-events: none;
615
615
  }
616
616
  }
617
- `;function tl({data:r,columns:i,pageCount:l,totalCount:a,next:s,previous:c,page:u,pageable:d,pageSize:g}){const[p,f]=o.useState((()=>[...r])),[m,h]=o.useState({pageIndex:0,pageSize:g||10}),v=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[o]=n.useState((()=>({current:Ki(t)}))),[r,i]=n.useState((()=>o.current.initialState));return o.current.setOptions((t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}}))),o.current}({columns:i,data:p,getCoreRowModel:e=>ii((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,i){void 0===r&&(r=0);const l=[];for(let s=0;s<t.length;s++){const c=di(e,e._getRowId(t[s],s,i),t[s],s,r,void 0,null==i?void 0:i.id);var a;n.flatRows.push(c),n.rowsById[c.id]=c,l.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=c.originalSubRows)&&a.length&&(c.subRows=o(c.originalSubRows,r+1,c)))}return l};return n.rows=o(t),n}),li(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),pageCount:l,state:{pagination:o.useMemo((()=>({pageIndex:m.pageIndex,pageSize:m.pageSize})),[m.pageIndex,m.pageSize])},onPaginationChange:h,manualPagination:!0});return o.useEffect((()=>{void 0!==u&&v.setPageIndex(Number(u-1))}),[u,v]),o.useEffect((()=>{f(r)}),[r]),t(Ji,{children:[v.getHeaderGroups().map((t=>e("thead",{children:e("tr",{children:t.headers.map((t=>e("th",{key:t.id,colSpan:t.colSpan,style:{width:t.getSize()},children:t.isPlaceholder?null:Zi(t.column.columnDef.header,t.getContext())})))},t.id)}))),e("tbody",{children:v.getRowModel().rows.map((t=>e("tr",{children:t.getVisibleCells().map((t=>e("td",{key:t.id,style:{width:t.column.getSize()},children:Zi(t.column.columnDef.cell,t.getContext())})))},t.id)))}),e("tfoot",{children:t(Qi,{children:[void 0!==a?t("div",{children:["Total: ",a]}):null,d?t(el,{children:[e(io,{type:"link",href:v.getCanPreviousPage()?"/":"",disabled:!v.getCanPreviousPage(),children:"<<"}),e(io,{type:"link",href:v.getCanPreviousPage()&&c?c:"",disabled:!v.getCanPreviousPage(),children:"<"}),e(io,{type:"link",href:v.getCanNextPage()&&s?s:"",disabled:!v.getCanNextPage(),children:">"}),e(io,{href:v.getCanNextPage()?`/?page=${String(l)}`:"",type:"link",disabled:!v.getCanNextPage(),children:">>"}),t("span",{children:[e("div",{children:"Page"}),t("strong",{children:[v.getState().pagination.pageIndex+1," of"," ",v.getPageCount()]})]})]}):null]})})]})}const nl=tn.div`
617
+ `;function tl({data:r,columns:i,pageCount:l,totalCount:a,next:s,previous:c,page:u,pageable:d,pageSize:g}){const[p,f]=o.useState((()=>[...r])),[m,h]=o.useState({pageIndex:0,pageSize:g||10}),v=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[o]=n.useState((()=>({current:Ki(t)}))),[r,i]=n.useState((()=>o.current.initialState));return o.current.setOptions((t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}}))),o.current}({columns:i,data:p,getCoreRowModel:e=>ii((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,i){void 0===r&&(r=0);const l=[];for(let s=0;s<t.length;s++){const c=di(e,e._getRowId(t[s],s,i),t[s],s,r,void 0,null==i?void 0:i.id);var a;n.flatRows.push(c),n.rowsById[c.id]=c,l.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=c.originalSubRows)&&a.length&&(c.subRows=o(c.originalSubRows,r+1,c)))}return l};return n.rows=o(t),n}),li(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),pageCount:l,state:{pagination:o.useMemo((()=>({pageIndex:m.pageIndex,pageSize:m.pageSize})),[m.pageIndex,m.pageSize])},onPaginationChange:h,manualPagination:!0});return o.useEffect((()=>{void 0!==u&&v.setPageIndex(Number(u-1))}),[u,v]),o.useEffect((()=>{f(r)}),[r]),t(Ji,{children:[v.getHeaderGroups().map((t=>e("thead",{children:e("tr",{children:t.headers.map((t=>e("th",{key:t.id,colSpan:t.colSpan,style:{width:t.getSize()},children:t.isPlaceholder?null:Zi(t.column.columnDef.header,t.getContext())})))},t.id)}))),e("tbody",{children:v.getRowModel().rows.map((t=>e("tr",{children:t.getVisibleCells().map((t=>e("td",{key:t.id,style:{width:t.column.getSize()},children:Zi(t.column.columnDef.cell,t.getContext())})))},t.id)))}),e("tfoot",{children:t(Qi,{children:[void 0!==a?t("div",{children:["Total: ",a]}):null,d?t(el,{children:[e(io,{type:"link",href:v.getCanPreviousPage()?window.location.href:"",disabled:!v.getCanPreviousPage(),children:"<<"}),e(io,{type:"link",href:v.getCanPreviousPage()&&c?c:"",disabled:!v.getCanPreviousPage(),children:"<"}),e(io,{type:"link",href:v.getCanNextPage()&&s?s:"",disabled:!v.getCanNextPage(),children:">"}),e(io,{href:v.getCanNextPage()?`${window.location.href}?page=${String(l)}`:"",type:"link",disabled:!v.getCanNextPage(),children:">>"}),t("span",{children:[e("div",{children:"Page"}),t("strong",{children:[v.getState().pagination.pageIndex+1," of"," ",v.getPageCount()]})]})]}):null]})})]})}const nl=tn.div`
618
618
  background-color: transparent;
619
619
  border-bottom: 2px solid transparent;
620
620
  color: var(--color--grey-dark);