@commercelayer/react-components 4.1.0-beta.3 → 4.1.0-beta.4
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/lib/cjs/components/line_items/LineItemQuantity.d.ts +1 -1
- package/lib/cjs/components/orders/OrderList.d.ts +14 -1
- package/lib/cjs/components/orders/OrderList.js +1 -1
- package/lib/cjs/components/orders/OrderListPaginationInfo.js +1 -1
- package/lib/cjs/context/LineItemContext.js +1 -1
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +1 -1
- package/lib/esm/components/orders/OrderList.d.ts +14 -1
- package/lib/esm/components/orders/OrderList.js +1 -1
- package/lib/esm/components/orders/OrderListPaginationInfo.js +1 -1
- package/lib/esm/context/LineItemContext.js +1 -1
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,6 @@ type Props = {
|
|
|
9
9
|
max?: number;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
readonly?: boolean;
|
|
12
|
-
} & (JSX.IntrinsicElements['select'] & Omit<JSX.IntrinsicElements['span'], 'children'>);
|
|
12
|
+
} & (Omit<JSX.IntrinsicElements['select'], 'children'> & Omit<JSX.IntrinsicElements['span'], 'children'>);
|
|
13
13
|
export declare function LineItemQuantity(props: Props): JSX.Element;
|
|
14
14
|
export default LineItemQuantity;
|
|
@@ -8,6 +8,15 @@ export type OrderListColumn = Column & {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
titleClassName?: string;
|
|
10
10
|
};
|
|
11
|
+
type SortBy = {
|
|
12
|
+
id: keyof Order;
|
|
13
|
+
} & ({
|
|
14
|
+
desc: true;
|
|
15
|
+
asc?: never;
|
|
16
|
+
} | {
|
|
17
|
+
desc?: never;
|
|
18
|
+
asc: true;
|
|
19
|
+
});
|
|
11
20
|
type PaginationProps = {
|
|
12
21
|
/**
|
|
13
22
|
* Show table pagination. Default is false.
|
|
@@ -43,6 +52,10 @@ type Props = {
|
|
|
43
52
|
* Show actions column. Default is false.
|
|
44
53
|
*/
|
|
45
54
|
showActions?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Sort by column. Default is `number` column descending.
|
|
57
|
+
*/
|
|
58
|
+
sortBy?: SortBy[];
|
|
46
59
|
/**
|
|
47
60
|
* Class name to assign to pagination container.
|
|
48
61
|
*/
|
|
@@ -73,5 +86,5 @@ type Props = {
|
|
|
73
86
|
infiniteScroll?: false;
|
|
74
87
|
windowOptions?: never;
|
|
75
88
|
}) & PaginationProps;
|
|
76
|
-
export declare function OrderList({ children, columns, loadingElement, showActions, showPagination, pageSize, paginationContainerClassName, actionsComponent, actionsContainerClassName, infiniteScroll, windowOptions, theadClassName, rowTrClassName, ...p }: Props): JSX.Element;
|
|
89
|
+
export declare function OrderList({ children, columns, loadingElement, showActions, showPagination, sortBy, pageSize, paginationContainerClassName, actionsComponent, actionsContainerClassName, infiniteScroll, windowOptions, theadClassName, rowTrClassName, ...p }: Props): JSX.Element;
|
|
77
90
|
export default OrderList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OrderList=void 0;const tslib_1=require("tslib"),react_1=require("react"),jsx_runtime_1=require("react/jsx-runtime"),react_2=require("react"),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),OrderListChildrenContext_1=tslib_1.__importDefault(require("../../context/OrderListChildrenContext")),OrderListPaginationContext_1=tslib_1.__importDefault(require("../../context/OrderListPaginationContext")),react_table_1=require("react-table"),react_window_1=require("react-window"),scrollbarWidth_1=tslib_1.__importDefault(require("../../utils/scrollbarWidth")),icons_1=require("../../utils/icons"),filterChildren_1=tslib_1.__importDefault(require("../../utils/filterChildren")),rowComponents=["OrderListRow"],paginationComponents=["OrderListPaginationInfo","OrderListPaginationButtons"];function OrderList({children,columns,loadingElement,showActions=!1,showPagination=!1,pageSize=10,paginationContainerClassName,actionsComponent,actionsContainerClassName,infiniteScroll,windowOptions,theadClassName,rowTrClassName,...p}){const[loading,setLoading]=(0,react_2.useState)(!0),{orders}=(0,react_2.useContext)(CustomerContext_1.default),data=(0,react_2.useMemo)(()=>orders??[],[orders]),cols=(0,react_2.useMemo)(()=>columns,[columns]),tablePlugins=[react_table_1.useSortBy];infiniteScroll&&tablePlugins.push(react_table_1.useBlockLayout),showPagination&&tablePlugins.push(react_table_1.usePagination);const defaultColumn=(0,react_2.useMemo)(()=>({width:windowOptions?.column||150}),[windowOptions?.column]),table=(0,react_table_1.useTable)({data,columns:cols,...infiniteScroll&&{defaultColumn}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OrderList=void 0;const tslib_1=require("tslib"),react_1=require("react"),jsx_runtime_1=require("react/jsx-runtime"),react_2=require("react"),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),OrderListChildrenContext_1=tslib_1.__importDefault(require("../../context/OrderListChildrenContext")),OrderListPaginationContext_1=tslib_1.__importDefault(require("../../context/OrderListPaginationContext")),react_table_1=require("react-table"),react_window_1=require("react-window"),scrollbarWidth_1=tslib_1.__importDefault(require("../../utils/scrollbarWidth")),icons_1=require("../../utils/icons"),filterChildren_1=tslib_1.__importDefault(require("../../utils/filterChildren")),rowComponents=["OrderListRow"],paginationComponents=["OrderListPaginationInfo","OrderListPaginationButtons"];function OrderList({children,columns,loadingElement,showActions=!1,showPagination=!1,sortBy=[{id:"number",desc:!0}],pageSize=10,paginationContainerClassName,actionsComponent,actionsContainerClassName,infiniteScroll,windowOptions,theadClassName,rowTrClassName,...p}){const[loading,setLoading]=(0,react_2.useState)(!0),{orders}=(0,react_2.useContext)(CustomerContext_1.default),data=(0,react_2.useMemo)(()=>orders??[],[orders]),cols=(0,react_2.useMemo)(()=>columns,[columns]),tablePlugins=[react_table_1.useSortBy];infiniteScroll&&tablePlugins.push(react_table_1.useBlockLayout),showPagination&&tablePlugins.push(react_table_1.usePagination);const defaultColumn=(0,react_2.useMemo)(()=>({width:windowOptions?.column||150}),[windowOptions?.column]),initialState=(0,react_2.useMemo)(()=>({...showPagination&&{pageSize},sortBy}),[showPagination,pageSize]),table=(0,react_table_1.useTable)({data,columns:cols,...infiniteScroll&&{defaultColumn},initialState},...tablePlugins),TableHtmlElement=infiniteScroll?"div":"table",TheadHtmlElement=infiniteScroll?"div":"thead",TbodyHtmlElement=infiniteScroll?"div":"tbody",ThHtmlElement=infiniteScroll?"div":"th",TrHtmlElement=infiniteScroll?"div":"tr";(0,react_2.useEffect)(()=>(orders!==void 0&&setLoading(!1),()=>{setLoading(!0)}),[orders]);const scrollBarSize=infiniteScroll?(0,react_2.useMemo)(()=>(0,scrollbarWidth_1.default)(),[]):0,LoadingComponent=loadingElement||(0,jsx_runtime_1.jsx)("div",{children:"Loading..."}),headerComponent=table.headerGroups.map((headerGroup,i)=>{const columns2=headerGroup.headers.map((column,k)=>{const sortLabel=column.isSorted?column.isSortedDesc?"desc":"asc":"";return(0,react_1.createElement)(ThHtmlElement,{"data-testid":`thead-${k}`,"data-sort":`${sortLabel}`,className:column?.className,...column.getHeaderProps(column?.getSortByToggleProps&&column?.getSortByToggleProps()),key:k},(0,jsx_runtime_1.jsxs)("span",{className:column?.titleClassName,children:[column.render("Header"),column.isSorted?column.isSortedDesc?icons_1.sortDescIcon:icons_1.sortAscIcon:""]}))});return(0,react_1.createElement)(TrHtmlElement,{...headerGroup.getHeaderGroupProps(),key:i},columns2)}),rows=showPagination?table.page:table.rows,rowsComponents=(0,filterChildren_1.default)({children,filterBy:rowComponents,componentName:"OrderList"}),components=infiniteScroll?(0,react_2.useCallback)(({index,style})=>{const row=rows[index];row&&table.prepareRow(row);const childProps={orders,order:orders?.[index],row,showActions,actionsComponent,actionsContainerClassName,infiniteScroll};return(0,jsx_runtime_1.jsx)(TrHtmlElement,{...row?.getRowProps({style}),className:rowTrClassName,children:(0,jsx_runtime_1.jsx)(OrderListChildrenContext_1.default.Provider,{value:childProps,children:rowsComponents})})},[table.prepareRow,table.rows]):rows.map((row,i)=>{table.prepareRow(row);const childProps={orders,order:orders?.[i],row,showActions,actionsComponent,actionsContainerClassName,infiniteScroll};return(0,react_1.createElement)(TrHtmlElement,{...row.getRowProps(),className:rowTrClassName,key:i},(0,jsx_runtime_1.jsx)(OrderListChildrenContext_1.default.Provider,{value:childProps,children:rowsComponents}))}),pagComponents=(0,filterChildren_1.default)({children,filterBy:paginationComponents,componentName:"OrderList"}),Pagination=()=>showPagination?(0,jsx_runtime_1.jsx)(OrderListPaginationContext_1.default.Provider,{value:{canNextPage:table.canNextPage,canPreviousPage:table.canPreviousPage,gotoPage:table.gotoPage,nextPage:table.nextPage,page:table.page,pageCount:table.pageCount,pageIndex:table.state.pageIndex,pageNumber:table.pageNumber,pageOptions:table.pageOptions,pageSize:table.state.pageSize,previousPage:table.previousPage,setPageSize:table.setPageSize,totalRows:orders?.length??0},children:pagComponents}):null;return loading&&orders==null?(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:LoadingComponent}):orders?.length===0?(0,jsx_runtime_1.jsx)(OrderListChildrenContext_1.default.Provider,{value:{orders},children}):(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsxs)(TableHtmlElement,{...p,...table.getTableProps(),children:[(0,jsx_runtime_1.jsx)(TheadHtmlElement,{className:theadClassName,children:headerComponent}),(0,jsx_runtime_1.jsx)(TbodyHtmlElement,{...table.getTableBodyProps(),children:infiniteScroll?(0,jsx_runtime_1.jsx)(react_window_1.FixedSizeList,{height:windowOptions?.height||400,itemCount:table.rows.length,itemSize:windowOptions?.itemSize||100,width:windowOptions?.width||table.totalColumnsWidth+scrollBarSize,children:components}):components})]}),(0,jsx_runtime_1.jsx)("div",{className:paginationContainerClassName,children:(0,jsx_runtime_1.jsx)(Pagination,{})})]})}exports.OrderList=OrderList,exports.default=OrderList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OrderListPaginationInfo=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),OrderListPaginationContext_1=tslib_1.__importDefault(require("../../context/OrderListPaginationContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function OrderListPaginationInfo({as="span",children,...props}){const ctx=(0,useCustomContext_1.default)({context:OrderListPaginationContext_1.default,contextComponentName:"OrderList",currentComponentName:"OrderListPaginationInfo"}),TagElement=as,totRows=ctx?.totalRows??0,pageIndex=ctx?.pageIndex??0,pageSize=ctx?.pageSize??10;let firstRow=pageIndex===0?pageIndex+1:pageIndex,lastRow=firstRow*pageSize;ctx?.canPreviousPage===!0&&(firstRow=Math.floor(firstRow*
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OrderListPaginationInfo=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),OrderListPaginationContext_1=tslib_1.__importDefault(require("../../context/OrderListPaginationContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function OrderListPaginationInfo({as="span",children,...props}){const ctx=(0,useCustomContext_1.default)({context:OrderListPaginationContext_1.default,contextComponentName:"OrderList",currentComponentName:"OrderListPaginationInfo"}),TagElement=as,totRows=ctx?.totalRows??0,pageIndex=ctx?.pageIndex??0,pageSize=ctx?.pageSize??10;let firstRow=pageIndex===0?pageIndex+1:pageIndex,lastRow=firstRow*pageSize;ctx?.canPreviousPage===!0&&(firstRow=Math.floor(firstRow*pageSize)+1,lastRow=Math.floor(firstRow+pageSize-1)),ctx?.canNextPage===!1&&(lastRow=totRows);const parentProps={...props,as,firstRow,lastRow,totRows};return children==null?(0,jsx_runtime_1.jsx)(TagElement,{...props,children:`${firstRow} - ${lastRow} of ${totRows}`}):(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children})}exports.OrderListPaginationInfo=OrderListPaginationInfo,OrderListPaginationInfo.displayName="OrderListPaginationInfo",exports.default=OrderListPaginationInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const react_1=require("react"),initial={
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const react_1=require("react"),initial={},LineItemContext=(0,react_1.createContext)(initial);exports.default=LineItemContext;
|
|
@@ -9,6 +9,6 @@ type Props = {
|
|
|
9
9
|
max?: number;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
readonly?: boolean;
|
|
12
|
-
} & (JSX.IntrinsicElements['select'] & Omit<JSX.IntrinsicElements['span'], 'children'>);
|
|
12
|
+
} & (Omit<JSX.IntrinsicElements['select'], 'children'> & Omit<JSX.IntrinsicElements['span'], 'children'>);
|
|
13
13
|
export declare function LineItemQuantity(props: Props): JSX.Element;
|
|
14
14
|
export default LineItemQuantity;
|
|
@@ -8,6 +8,15 @@ export type OrderListColumn = Column & {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
titleClassName?: string;
|
|
10
10
|
};
|
|
11
|
+
type SortBy = {
|
|
12
|
+
id: keyof Order;
|
|
13
|
+
} & ({
|
|
14
|
+
desc: true;
|
|
15
|
+
asc?: never;
|
|
16
|
+
} | {
|
|
17
|
+
desc?: never;
|
|
18
|
+
asc: true;
|
|
19
|
+
});
|
|
11
20
|
type PaginationProps = {
|
|
12
21
|
/**
|
|
13
22
|
* Show table pagination. Default is false.
|
|
@@ -43,6 +52,10 @@ type Props = {
|
|
|
43
52
|
* Show actions column. Default is false.
|
|
44
53
|
*/
|
|
45
54
|
showActions?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Sort by column. Default is `number` column descending.
|
|
57
|
+
*/
|
|
58
|
+
sortBy?: SortBy[];
|
|
46
59
|
/**
|
|
47
60
|
* Class name to assign to pagination container.
|
|
48
61
|
*/
|
|
@@ -73,5 +86,5 @@ type Props = {
|
|
|
73
86
|
infiniteScroll?: false;
|
|
74
87
|
windowOptions?: never;
|
|
75
88
|
}) & PaginationProps;
|
|
76
|
-
export declare function OrderList({ children, columns, loadingElement, showActions, showPagination, pageSize, paginationContainerClassName, actionsComponent, actionsContainerClassName, infiniteScroll, windowOptions, theadClassName, rowTrClassName, ...p }: Props): JSX.Element;
|
|
89
|
+
export declare function OrderList({ children, columns, loadingElement, showActions, showPagination, sortBy, pageSize, paginationContainerClassName, actionsComponent, actionsContainerClassName, infiniteScroll, windowOptions, theadClassName, rowTrClassName, ...p }: Props): JSX.Element;
|
|
77
90
|
export default OrderList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as _createElement}from"react";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{useContext,useMemo,useState,useEffect,useCallback}from"react";import CustomerContext from"../../context/CustomerContext";import OrderListChildrenContext from"../../context/OrderListChildrenContext";import OrderListPagination from"../../context/OrderListPaginationContext";import{useTable,useSortBy,useBlockLayout,usePagination}from"react-table";import{FixedSizeList}from"react-window";import scrollbarWidth from"../../utils/scrollbarWidth";import{sortDescIcon,sortAscIcon}from"../../utils/icons";import filterChildren from"../../utils/filterChildren";const rowComponents=["OrderListRow"],paginationComponents=["OrderListPaginationInfo","OrderListPaginationButtons"];export function OrderList({children,columns,loadingElement,showActions=!1,showPagination=!1,pageSize=10,paginationContainerClassName,actionsComponent,actionsContainerClassName,infiniteScroll,windowOptions,theadClassName,rowTrClassName,...p}){const[loading,setLoading]=useState(!0),{orders}=useContext(CustomerContext),data=useMemo(()=>orders??[],[orders]),cols=useMemo(()=>columns,[columns]),tablePlugins=[useSortBy];infiniteScroll&&tablePlugins.push(useBlockLayout),showPagination&&tablePlugins.push(usePagination);const defaultColumn=useMemo(()=>({width:windowOptions?.column||150}),[windowOptions?.column]),table=useTable({data,columns:cols,...infiniteScroll&&{defaultColumn}
|
|
1
|
+
import{createElement as _createElement}from"react";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{useContext,useMemo,useState,useEffect,useCallback}from"react";import CustomerContext from"../../context/CustomerContext";import OrderListChildrenContext from"../../context/OrderListChildrenContext";import OrderListPagination from"../../context/OrderListPaginationContext";import{useTable,useSortBy,useBlockLayout,usePagination}from"react-table";import{FixedSizeList}from"react-window";import scrollbarWidth from"../../utils/scrollbarWidth";import{sortDescIcon,sortAscIcon}from"../../utils/icons";import filterChildren from"../../utils/filterChildren";const rowComponents=["OrderListRow"],paginationComponents=["OrderListPaginationInfo","OrderListPaginationButtons"];export function OrderList({children,columns,loadingElement,showActions=!1,showPagination=!1,sortBy=[{id:"number",desc:!0}],pageSize=10,paginationContainerClassName,actionsComponent,actionsContainerClassName,infiniteScroll,windowOptions,theadClassName,rowTrClassName,...p}){const[loading,setLoading]=useState(!0),{orders}=useContext(CustomerContext),data=useMemo(()=>orders??[],[orders]),cols=useMemo(()=>columns,[columns]),tablePlugins=[useSortBy];infiniteScroll&&tablePlugins.push(useBlockLayout),showPagination&&tablePlugins.push(usePagination);const defaultColumn=useMemo(()=>({width:windowOptions?.column||150}),[windowOptions?.column]),initialState=useMemo(()=>({...showPagination&&{pageSize},sortBy}),[showPagination,pageSize]),table=useTable({data,columns:cols,...infiniteScroll&&{defaultColumn},initialState},...tablePlugins),TableHtmlElement=infiniteScroll?"div":"table",TheadHtmlElement=infiniteScroll?"div":"thead",TbodyHtmlElement=infiniteScroll?"div":"tbody",ThHtmlElement=infiniteScroll?"div":"th",TrHtmlElement=infiniteScroll?"div":"tr";useEffect(()=>(orders!==void 0&&setLoading(!1),()=>{setLoading(!0)}),[orders]);const scrollBarSize=infiniteScroll?useMemo(()=>scrollbarWidth(),[]):0,LoadingComponent=loadingElement||_jsx("div",{children:"Loading..."}),headerComponent=table.headerGroups.map((headerGroup,i)=>{const columns2=headerGroup.headers.map((column,k)=>{const sortLabel=column.isSorted?column.isSortedDesc?"desc":"asc":"";return _createElement(ThHtmlElement,{"data-testid":`thead-${k}`,"data-sort":`${sortLabel}`,className:column?.className,...column.getHeaderProps(column?.getSortByToggleProps&&column?.getSortByToggleProps()),key:k},_jsxs("span",{className:column?.titleClassName,children:[column.render("Header"),column.isSorted?column.isSortedDesc?sortDescIcon:sortAscIcon:""]}))});return _createElement(TrHtmlElement,{...headerGroup.getHeaderGroupProps(),key:i},columns2)}),rows=showPagination?table.page:table.rows,rowsComponents=filterChildren({children,filterBy:rowComponents,componentName:"OrderList"}),components=infiniteScroll?useCallback(({index,style})=>{const row=rows[index];row&&table.prepareRow(row);const childProps={orders,order:orders?.[index],row,showActions,actionsComponent,actionsContainerClassName,infiniteScroll};return _jsx(TrHtmlElement,{...row?.getRowProps({style}),className:rowTrClassName,children:_jsx(OrderListChildrenContext.Provider,{value:childProps,children:rowsComponents})})},[table.prepareRow,table.rows]):rows.map((row,i)=>{table.prepareRow(row);const childProps={orders,order:orders?.[i],row,showActions,actionsComponent,actionsContainerClassName,infiniteScroll};return _createElement(TrHtmlElement,{...row.getRowProps(),className:rowTrClassName,key:i},_jsx(OrderListChildrenContext.Provider,{value:childProps,children:rowsComponents}))}),pagComponents=filterChildren({children,filterBy:paginationComponents,componentName:"OrderList"}),Pagination=()=>showPagination?_jsx(OrderListPagination.Provider,{value:{canNextPage:table.canNextPage,canPreviousPage:table.canPreviousPage,gotoPage:table.gotoPage,nextPage:table.nextPage,page:table.page,pageCount:table.pageCount,pageIndex:table.state.pageIndex,pageNumber:table.pageNumber,pageOptions:table.pageOptions,pageSize:table.state.pageSize,previousPage:table.previousPage,setPageSize:table.setPageSize,totalRows:orders?.length??0},children:pagComponents}):null;return loading&&orders==null?_jsx(_Fragment,{children:LoadingComponent}):orders?.length===0?_jsx(OrderListChildrenContext.Provider,{value:{orders},children}):_jsxs(_Fragment,{children:[_jsxs(TableHtmlElement,{...p,...table.getTableProps(),children:[_jsx(TheadHtmlElement,{className:theadClassName,children:headerComponent}),_jsx(TbodyHtmlElement,{...table.getTableBodyProps(),children:infiniteScroll?_jsx(FixedSizeList,{height:windowOptions?.height||400,itemCount:table.rows.length,itemSize:windowOptions?.itemSize||100,width:windowOptions?.width||table.totalColumnsWidth+scrollBarSize,children:components}):components})]}),_jsx("div",{className:paginationContainerClassName,children:_jsx(Pagination,{})})]})}export default OrderList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import OrderListPaginationContext from"../../context/OrderListPaginationContext";import useCustomContext from"../../utils/hooks/useCustomContext";export function OrderListPaginationInfo({as="span",children,...props}){const ctx=useCustomContext({context:OrderListPaginationContext,contextComponentName:"OrderList",currentComponentName:"OrderListPaginationInfo"}),TagElement=as,totRows=ctx?.totalRows??0,pageIndex=ctx?.pageIndex??0,pageSize=ctx?.pageSize??10;let firstRow=pageIndex===0?pageIndex+1:pageIndex,lastRow=firstRow*pageSize;ctx?.canPreviousPage===!0&&(firstRow=Math.floor(firstRow*
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import OrderListPaginationContext from"../../context/OrderListPaginationContext";import useCustomContext from"../../utils/hooks/useCustomContext";export function OrderListPaginationInfo({as="span",children,...props}){const ctx=useCustomContext({context:OrderListPaginationContext,contextComponentName:"OrderList",currentComponentName:"OrderListPaginationInfo"}),TagElement=as,totRows=ctx?.totalRows??0,pageIndex=ctx?.pageIndex??0,pageSize=ctx?.pageSize??10;let firstRow=pageIndex===0?pageIndex+1:pageIndex,lastRow=firstRow*pageSize;ctx?.canPreviousPage===!0&&(firstRow=Math.floor(firstRow*pageSize)+1,lastRow=Math.floor(firstRow+pageSize-1)),ctx?.canNextPage===!1&&(lastRow=totRows);const parentProps={...props,as,firstRow,lastRow,totRows};return children==null?_jsx(TagElement,{...props,children:`${firstRow} - ${lastRow} of ${totRows}`}):_jsx(Parent,{...parentProps,children})}OrderListPaginationInfo.displayName="OrderListPaginationInfo";export default OrderListPaginationInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const initial={
|
|
1
|
+
import{createContext}from"react";const initial={},LineItemContext=createContext(initial);export default LineItemContext;
|