@economic/taco 2.49.0-server.3 → 2.49.0-server.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/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -1
- package/dist/taco.cjs.development.js +1 -1
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -56,7 +56,7 @@ function Row(props) {
|
|
|
56
56
|
pageIndexesToFetch.forEach(function (index) {
|
|
57
57
|
var _tableMeta$server$loa, _tableMeta$server;
|
|
58
58
|
// this can be called by every row within the current page, but loadPage returns early if a pending request exists
|
|
59
|
-
(_tableMeta$server$loa = (_tableMeta$server = tableMeta.server).loadPage) === null || _tableMeta$server$loa === void 0 ? void 0 : _tableMeta$server$loa.call(_tableMeta$server, index, sorting, filters, tableMeta.search.enableGlobalFilter ? search : undefined
|
|
59
|
+
(_tableMeta$server$loa = (_tableMeta$server = tableMeta.server).loadPage) === null || _tableMeta$server$loa === void 0 ? void 0 : _tableMeta$server$loa.call(_tableMeta$server, index, sorting, filters, hiddenColumns, tableMeta.search.enableGlobalFilter ? search : undefined);
|
|
60
60
|
});
|
|
61
61
|
}, DELAY_BEFORE_LOAD_MS);
|
|
62
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.js","sources":["../../../../../../../../../../src/primitives/Table/Core/components/Row/Row.tsx"],"sourcesContent":["import React from 'react';\nimport { TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { RowContext } from './RowContext';\nimport { TableRowRenderer, TableRowRendererProps } from '../../types';\nimport { getHiddenColumns } from '../../../useTableManager/util/columns';\n\nconst DELAY_BEFORE_LOAD_MS = 250;\n\nexport type RowProps<TType = unknown> = React.HTMLAttributes<HTMLTableRowElement> &\n TableRowRendererProps<TType> & {\n renderer: TableRowRenderer<TType>;\n scrollDirection?: 'forward' | 'backward';\n skipPageLoading?: boolean;\n };\n\n/* anonymous functions will break the memoisation on each render, wrap handlers in callbacks */\nexport function Row<TType = unknown>(props: RowProps<TType>) {\n const {\n renderer: RowRenderer,\n cellRenderer: CellRenderer,\n hideInternalColumns = false,\n hideRowActions = false,\n scrollDirection,\n skipPageLoading = false,\n ...displayRowProps\n } = props;\n\n const tableMeta = props.table.options.meta as ReactTableMeta<TType>;\n const isHovered = tableMeta.rowActive.rowHoverIndex === props.index;\n // context - it must be here for cells to read it, since they render alongside the row inside DisplayRow\n const contextValue = React.useMemo(\n () => ({ isHovered, rowIndex: props.index, hideInternalColumns, hideRowActions }),\n [isHovered, props.index, hideInternalColumns, hideRowActions]\n );\n\n React.useEffect(() => {\n let timeout;\n\n if (tableMeta.server.isEnabled && tableMeta.server._experimentalDataLoader2 && !skipPageLoading) {\n const pageIndex =\n (Math.floor(props.index / tableMeta.server.pageSize) * tableMeta.server.pageSize) / tableMeta.server.pageSize;\n\n const sorting = props.table.getState().sorting;\n const filters = props.table.getState().columnFilters;\n const search = props.table.getState().globalFilter;\n const hiddenColumns = getHiddenColumns(props.table.getState().columnVisibility);\n\n const pageIndexesToFetch: number[] = [];\n\n // if there's no direction, it means the scroll bar got dropped un unloaded pages,\n // in that case, load forward and backward pages to prevent skeletons\n if (scrollDirection === 'backward' || !scrollDirection) {\n const backIndex = pageIndex - 1;\n\n if (backIndex > -1) {\n pageIndexesToFetch.push(backIndex);\n }\n }\n\n // always load the next page\n if ((scrollDirection === 'forward' || !scrollDirection) && pageIndex + 2 < tableMeta.server.pageCount) {\n pageIndexesToFetch.push(pageIndex + 1);\n }\n\n if (pageIndexesToFetch.length) {\n // the virtualiser fetches a page ahead, so this won't get called in most cases\n // but it provides a fallback for some edge cases\n timeout = setTimeout(() => {\n pageIndexesToFetch.forEach(index => {\n // this can be called by every row within the current page, but loadPage returns early if a pending request exists\n tableMeta.server.loadPage?.(\n index,\n sorting,\n filters,\n tableMeta.search.enableGlobalFilter ? search : undefined
|
|
1
|
+
{"version":3,"file":"Row.js","sources":["../../../../../../../../../../src/primitives/Table/Core/components/Row/Row.tsx"],"sourcesContent":["import React from 'react';\nimport { TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { RowContext } from './RowContext';\nimport { TableRowRenderer, TableRowRendererProps } from '../../types';\nimport { getHiddenColumns } from '../../../useTableManager/util/columns';\n\nconst DELAY_BEFORE_LOAD_MS = 250;\n\nexport type RowProps<TType = unknown> = React.HTMLAttributes<HTMLTableRowElement> &\n TableRowRendererProps<TType> & {\n renderer: TableRowRenderer<TType>;\n scrollDirection?: 'forward' | 'backward';\n skipPageLoading?: boolean;\n };\n\n/* anonymous functions will break the memoisation on each render, wrap handlers in callbacks */\nexport function Row<TType = unknown>(props: RowProps<TType>) {\n const {\n renderer: RowRenderer,\n cellRenderer: CellRenderer,\n hideInternalColumns = false,\n hideRowActions = false,\n scrollDirection,\n skipPageLoading = false,\n ...displayRowProps\n } = props;\n\n const tableMeta = props.table.options.meta as ReactTableMeta<TType>;\n const isHovered = tableMeta.rowActive.rowHoverIndex === props.index;\n // context - it must be here for cells to read it, since they render alongside the row inside DisplayRow\n const contextValue = React.useMemo(\n () => ({ isHovered, rowIndex: props.index, hideInternalColumns, hideRowActions }),\n [isHovered, props.index, hideInternalColumns, hideRowActions]\n );\n\n React.useEffect(() => {\n let timeout;\n\n if (tableMeta.server.isEnabled && tableMeta.server._experimentalDataLoader2 && !skipPageLoading) {\n const pageIndex =\n (Math.floor(props.index / tableMeta.server.pageSize) * tableMeta.server.pageSize) / tableMeta.server.pageSize;\n\n const sorting = props.table.getState().sorting;\n const filters = props.table.getState().columnFilters;\n const search = props.table.getState().globalFilter;\n const hiddenColumns = getHiddenColumns(props.table.getState().columnVisibility);\n\n const pageIndexesToFetch: number[] = [];\n\n // if there's no direction, it means the scroll bar got dropped un unloaded pages,\n // in that case, load forward and backward pages to prevent skeletons\n if (scrollDirection === 'backward' || !scrollDirection) {\n const backIndex = pageIndex - 1;\n\n if (backIndex > -1) {\n pageIndexesToFetch.push(backIndex);\n }\n }\n\n // always load the next page\n if ((scrollDirection === 'forward' || !scrollDirection) && pageIndex + 2 < tableMeta.server.pageCount) {\n pageIndexesToFetch.push(pageIndex + 1);\n }\n\n if (pageIndexesToFetch.length) {\n // the virtualiser fetches a page ahead, so this won't get called in most cases\n // but it provides a fallback for some edge cases\n timeout = setTimeout(() => {\n pageIndexesToFetch.forEach(index => {\n // this can be called by every row within the current page, but loadPage returns early if a pending request exists\n tableMeta.server.loadPage?.(\n index,\n sorting,\n filters,\n hiddenColumns,\n tableMeta.search.enableGlobalFilter ? search : undefined\n );\n });\n }, DELAY_BEFORE_LOAD_MS);\n }\n }\n\n return () => {\n clearTimeout(timeout);\n };\n }, [tableMeta.server.pages]);\n\n return (\n <RowContext.Provider value={contextValue}>\n <RowRenderer<TType> {...displayRowProps} cellRenderer={CellRenderer} />\n </RowContext.Provider>\n );\n}\n"],"names":["DELAY_BEFORE_LOAD_MS","Row","props","RowRenderer","renderer","CellRenderer","cellRenderer","_props$hideInternalCo","hideInternalColumns","_props$hideRowActions","hideRowActions","scrollDirection","_props$skipPageLoadin","skipPageLoading","displayRowProps","_objectWithoutPropertiesLoose","_excluded","tableMeta","table","options","meta","isHovered","rowActive","rowHoverIndex","index","contextValue","React","useMemo","rowIndex","useEffect","timeout","server","isEnabled","_experimentalDataLoader2","pageIndex","Math","floor","pageSize","sorting","getState","filters","columnFilters","search","globalFilter","hiddenColumns","getHiddenColumns","columnVisibility","pageIndexesToFetch","backIndex","push","pageCount","length","setTimeout","forEach","_tableMeta$server$loa","_tableMeta$server","loadPage","call","enableGlobalFilter","undefined","clearTimeout","pages","RowContext","Provider","value"],"mappings":";;;;;;AAMA,IAAMA,oBAAoB,GAAG,GAAG;AAShC;SACgBC,GAAGA,CAAkBC,KAAsB;EACvD,IACcC,WAAW,GAOrBD,KAAK,CAP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CAAC9B,OAAO,CAAC;KACxB;GACJ,EAAE,CAACb,SAAS,CAACc,MAAM,CAAC8B,KAAK,CAAC,CAAC;EAE5B,oBACInC,6BAACoC,UAAU,CAACC,QAAQ;IAACC,KAAK,EAAEvC;kBACxBC,6BAACvB,WAAW,oBAAYW,eAAe;IAAER,YAAY,EAAED;KAAgB,CACrD;AAE9B;;;;"}
|
|
@@ -12808,7 +12808,7 @@ function Row(props) {
|
|
|
12808
12808
|
pageIndexesToFetch.forEach(function (index) {
|
|
12809
12809
|
var _tableMeta$server$loa, _tableMeta$server;
|
|
12810
12810
|
// this can be called by every row within the current page, but loadPage returns early if a pending request exists
|
|
12811
|
-
(_tableMeta$server$loa = (_tableMeta$server = tableMeta.server).loadPage) === null || _tableMeta$server$loa === void 0 ? void 0 : _tableMeta$server$loa.call(_tableMeta$server, index, sorting, filters, tableMeta.search.enableGlobalFilter ? search : undefined
|
|
12811
|
+
(_tableMeta$server$loa = (_tableMeta$server = tableMeta.server).loadPage) === null || _tableMeta$server$loa === void 0 ? void 0 : _tableMeta$server$loa.call(_tableMeta$server, index, sorting, filters, hiddenColumns, tableMeta.search.enableGlobalFilter ? search : undefined);
|
|
12812
12812
|
});
|
|
12813
12813
|
}, DELAY_BEFORE_LOAD_MS);
|
|
12814
12814
|
}
|