@economic/taco 2.0.0-alpha.5 → 2.0.0-alpha.6
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/components/Table3/Table3.d.ts +2 -2
- package/dist/components/Table3/hooks/{useTableData.d.ts → useTableDataLoader.d.ts} +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/{useTableData.js → useTableDataLoader.js} +3 -3
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTableDataLoader.js.map +1 -0
- package/dist/esm/packages/taco/src/index.js +1 -1
- package/dist/taco.cjs.development.js +2 -2
- 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 +2 -3
- package/types.json +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTableData.js.map +0 -1
|
@@ -7,6 +7,6 @@ declare type Table3WithStatics<TType = unknown> = React.ForwardRefExoticComponen
|
|
|
7
7
|
ref?: React.Ref<Table3Ref>;
|
|
8
8
|
}) => JSX.Element);
|
|
9
9
|
export declare const Table3: Table3WithStatics<unknown>;
|
|
10
|
-
export {
|
|
11
|
-
export type { useTable3DataFetcher, useTable3DataOptions, useTableDataValues } from './hooks/
|
|
10
|
+
export { useTable3DataLoader } from './hooks/useTableDataLoader';
|
|
11
|
+
export type { useTable3DataFetcher, useTable3DataOptions, useTableDataValues } from './hooks/useTableDataLoader';
|
|
12
12
|
export type { Table3Ref, Table3Props, Table3Preset, Table3Settings, Table3SettingsAdapter, Table3RowHeight, Table3FilterComparator, Table3FilterHandler, Table3SearchHandler, Table3LoadPageHandler, Table3LoadAllHandler, Table3RowGotoHandler, Table3SortHandler, Table3Shortcuts, Table3ShortcutHandlerFn, Table3ShortcutHandlerObject, Table3FontSize, Table3SortDirection, Table3SortFn, Table3RowActionRenderer, Table3RowSelectionHandler, Table3RowExpansionRenderer, Table3RowDropHandler, Table3RowDragHandler, Table3RowClickHandler, Table3ColumnProps, Table3ColumnAlignment, Table3ColumnDataType, Table3ColumnHeaderMenu, Table3ColumnClassNameHandler, Table3ColumnFooterRenderer, Table3ColumnRenderer, Table3ColumnControlRenderer, Table3ColumnControlProps, } from './types';
|
|
@@ -20,4 +20,4 @@ export declare type useTableDataValues<TType = unknown> = {
|
|
|
20
20
|
onSort: Table3SortHandler;
|
|
21
21
|
pageSize: number;
|
|
22
22
|
};
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function useTable3DataLoader<TType = unknown>(fetch: useTable3DataFetcher<TType>, fetchAll: useTable3AllDataFetcher<TType>, options?: useTable3DataOptions): useTableDataValues<TType>;
|
|
@@ -11,7 +11,7 @@ import { Toolbar } from './components/toolbar/Toolbar.js';
|
|
|
11
11
|
import { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup.js';
|
|
12
12
|
import { Summary } from './components/columns/footer/Summary.js';
|
|
13
13
|
import { useCssVars } from './hooks/useCssVars.js';
|
|
14
|
-
export {
|
|
14
|
+
export { useTable3DataLoader } from './hooks/useTableDataLoader.js';
|
|
15
15
|
|
|
16
16
|
function Column(_) {
|
|
17
17
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table3.js","sources":["../../../../../../../src/components/Table3/Table3.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, TableMeta } from '@tanstack/react-table';\nimport { FocusScope } from '@react-aria/focus';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useCssGrid } from './hooks/useCssGrid';\nimport { useTable } from './hooks/useTable';\nimport { useTableRenderStrategy } from './strategies';\nimport { Table3ColumnProps, Table3Props, Table3Ref } from './types';\nimport { Toolbar } from './components/toolbar/Toolbar';\nimport { useColumnFreezingStyle } from './hooks/features/useColumnFreezing';\nimport { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup';\nimport { Summary } from './components/columns/footer/Summary';\nimport { useCssVars } from './hooks/useCssVars';\nimport './style.css';\n\nfunction Column(_: Table3ColumnProps) {\n return null;\n}\n\nconst Table = React.forwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const { emptyState: EmptyState, toolbarLeft, toolbarRight } = props;\n const internalRef = useMergedRef<Table3Ref>(ref);\n\n const { table, length } = useTable<TType>(props);\n useTableRefInstanceSetup(table, internalRef);\n\n const { renderBody, scrollToIndex } = useTableRenderStrategy<TType>(props, table, internalRef);\n const tableMeta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n tableMeta.hoverState.handleKeyDown(event);\n tableMeta.currentRow.handleKeyDown(event, table.getRowModel().rows.length, scrollToIndex);\n tableMeta.rowClick.handleKeyDown(event, table);\n tableMeta.rowSelection.handleKeyDown(event, table);\n tableMeta.editing.handleKeyDown(event, internalRef);\n };\n\n const handleBlur = (event: React.FocusEvent) => {\n tableMeta.editing.handleBlur(event);\n };\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n tableMeta.columnFreezing.handleScroll(event);\n };\n\n const className = cn(\n 'border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px]',\n 'focus:yt-focus focus-within:yt-focus',\n '[&[data-resizing=\"true\"]]:select-none',\n {\n 'text-xs': tableMeta.fontSize.size === 'small',\n 'text-sm': tableMeta.fontSize.size === 'medium',\n 'text-base': tableMeta.fontSize.size === 'large',\n }\n );\n\n const { style: cssGridStyle } = useCssGrid<TType>(table);\n const { style: cssVars } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);\n\n const style = {\n ...cssVars,\n ...cssGridStyle,\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n };\n\n const columnFreezingStyle = useColumnFreezingStyle(props.id, table);\n const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;\n\n return (\n <>\n {columnFreezingStyle ? <style data-taco=\"table3-column-freezing-styles\">{columnFreezingStyle}</style> : null}\n <Toolbar\n table={table}\n tableProps={props}\n total={length}\n left={toolbarLeft}\n right={toolbarRight}\n scrollToIndex={scrollToIndex}\n />\n <div\n className={className}\n id={props.id}\n data-font-size={tableMeta.fontSize.size}\n data-editing={tableMeta.editing.isEditing}\n data-horizontally-scrolled={tableMeta.columnFreezing.horizontallyScrolled}\n data-pause-hover={tableMeta?.hoverState.isPaused}\n data-resizing={!!state.columnSizingInfo.isResizingColumn}\n data-taco=\"table3\"\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onScroll={handleScroll}\n ref={internalRef}\n role=\"table\"\n style={style}\n tabIndex={0}>\n {isServerLoadingAndNotReady ? null : (\n <div className=\"group/header contents\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map(header => (\n <React.Fragment key={header.id}>\n {flexRender(header.column.columnDef.header, { ...header.getContext(), scrollToIndex })}\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n )}\n {table.getRowModel().rows.length ? (\n <>\n <FocusScope>\n <div className=\"group/body contents\" role=\"rowgroup\">\n {renderBody()}\n <span className=\"col-span-full h-16 print:hidden\" />\n </div>\n </FocusScope>\n <div className=\"group/footer contents\" role=\"rowgroup\">\n {table.getFooterGroups().map(footerGroup => (\n <div className=\"contents\" key={footerGroup.id} role=\"row\">\n {footerGroup.headers.map(footer => (\n <React.Fragment key={footer.id}>\n {flexRender(footer.column.columnDef.footer, footer.getContext())}\n </React.Fragment>\n ))}\n </div>\n ))}\n {length ? <Summary length={length} table={table} /> : null}\n </div>\n </>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n </div>\n </>\n );\n}) as Table3WithStatics;\n\ntype Table3WithStatics<TType = unknown> = React.ForwardRefExoticComponent<Table3Props<TType>> & {\n Column: (props: Table3ColumnProps) => null;\n} & (<TType>(props: Table3Props<TType> & { ref?: React.Ref<Table3Ref> }) => JSX.Element);\n\nexport const Table3 = React.forwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n // we force a remount (using key) when the child columns change because there are too many places to add children as an effect\n // this is cheaper from a complexity perspective, and probably performance wise as well\n const key = React.useMemo(() => String('tableKey_' + String(props.children)), [props.children]);\n return <Table {...props} key={key} ref={ref} />;\n}) as Table3WithStatics;\n\nTable3.Column = Column;\n\n// hooks\nexport { useTableData } from './hooks/useTableData';\n\n// types\nexport type { useTable3DataFetcher, useTable3DataOptions, useTableDataValues } from './hooks/useTableData';\n\nexport type {\n Table3Ref,\n Table3Props,\n Table3Preset,\n Table3Settings,\n Table3SettingsAdapter,\n Table3RowHeight,\n Table3FilterComparator,\n Table3FilterHandler,\n Table3SearchHandler,\n Table3LoadPageHandler,\n Table3LoadAllHandler,\n Table3RowGotoHandler,\n Table3SortHandler,\n Table3Shortcuts,\n Table3ShortcutHandlerFn,\n Table3ShortcutHandlerObject,\n Table3FontSize,\n Table3SortDirection,\n Table3SortFn,\n Table3RowActionRenderer,\n Table3RowSelectionHandler,\n Table3RowExpansionRenderer,\n Table3RowDropHandler,\n Table3RowDragHandler,\n Table3RowClickHandler,\n Table3ColumnProps,\n Table3ColumnAlignment,\n Table3ColumnDataType,\n Table3ColumnHeaderMenu,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n Table3ColumnRenderer,\n Table3ColumnControlRenderer,\n Table3ColumnControlProps,\n} from './types';\n"],"names":["Column","_","Table","React","forwardRef","Table3","props","ref","emptyState","EmptyState","toolbarLeft","toolbarRight","internalRef","useMergedRef","table","length","useTable","useTableRefInstanceSetup","renderBody","scrollToIndex","useTableRenderStrategy","tableMeta","options","meta","state","getState","handleKeyDown","event","hoverState","currentRow","getRowModel","rows","rowClick","rowSelection","editing","handleBlur","handleScroll","columnFreezing","className","cn","fontSize","size","style","cssGridStyle","useCssGrid","cssVars","useCssVars","rowHeight","height","opacity","columnFreezingStyle","useColumnFreezingStyle","id","isServerLoadingAndNotReady","isUsingServer","undefined","Toolbar","tableProps","total","left","right","isEditing","horizontallyScrolled","isPaused","columnSizingInfo","isResizingColumn","onBlur","onKeyDown","onScroll","role","tabIndex","getHeaderGroups","map","headerGroup","key","headers","header","Fragment","flexRender","column","columnDef","getContext","FocusScope","getFooterGroups","footerGroup","footer","Summary","useMemo","String","children"],"mappings":";;;;;;;;;;;;;;;AAgBA,SAASA,MAAM,CAACC,CAAoB;EAChC,OAAO,IAAI;AACf;AAEA,MAAMC,KAAK,gBAAGC,cAAK,CAACC,UAAU,CAAC,SAASC,MAAM,CAAkBC,KAAyB,EAAEC,GAAyB;EAChH,MAAM;IAAEC,UAAU,EAAEC,UAAU;IAAEC,WAAW;IAAEC;GAAc,GAAGL,KAAK;EACnE,MAAMM,WAAW,GAAGC,YAAY,CAAYN,GAAG,CAAC;EAEhD,MAAM;IAAEO,KAAK;IAAEC;GAAQ,GAAGC,QAAQ,CAAQV,KAAK,CAAC;EAChDW,wBAAwB,CAACH,KAAK,EAAEF,WAAW,CAAC;EAE5C,MAAM;IAAEM,UAAU;IAAEC;GAAe,GAAGC,sBAAsB,CAAQd,KAAK,EAAEQ,KAAK,EAAEF,WAAW,CAAC;EAC9F,MAAMS,SAAS,GAAGP,KAAK,CAACQ,OAAO,CAACC,IAAwB;EACxD,MAAMC,KAAK,GAAGV,KAAK,CAACW,QAAQ,EAAE;EAE9B,MAAMC,aAAa,GAAIC,KAA0B;IAC7CN,SAAS,CAACO,UAAU,CAACF,aAAa,CAACC,KAAK,CAAC;IACzCN,SAAS,CAACQ,UAAU,CAACH,aAAa,CAACC,KAAK,EAAE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AACmF,QAAQ,CAAC,CAAC,EAAE,CAACnF,KAAK,CAACmF,QAAQ,CAAC,CAAC;EAC/F,oBAAOtF,6BAACD,KAAK,oBAAKI,KAAK;IAAEoE,GAAG,EAAEA,GAAG;IAAEnE,GAAG,EAAEA;KAAO;AACnD,CAAC;AAEDF,MAAM,CAACL,MAAM,GAAGA,MAAM;;;;"}
|
|
1
|
+
{"version":3,"file":"Table3.js","sources":["../../../../../../../src/components/Table3/Table3.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { flexRender, TableMeta } from '@tanstack/react-table';\nimport { FocusScope } from '@react-aria/focus';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { useCssGrid } from './hooks/useCssGrid';\nimport { useTable } from './hooks/useTable';\nimport { useTableRenderStrategy } from './strategies';\nimport { Table3ColumnProps, Table3Props, Table3Ref } from './types';\nimport { Toolbar } from './components/toolbar/Toolbar';\nimport { useColumnFreezingStyle } from './hooks/features/useColumnFreezing';\nimport { useTableRefInstanceSetup } from './hooks/useTableRefInstanceSetup';\nimport { Summary } from './components/columns/footer/Summary';\nimport { useCssVars } from './hooks/useCssVars';\nimport './style.css';\n\nfunction Column(_: Table3ColumnProps) {\n return null;\n}\n\nconst Table = React.forwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n const { emptyState: EmptyState, toolbarLeft, toolbarRight } = props;\n const internalRef = useMergedRef<Table3Ref>(ref);\n\n const { table, length } = useTable<TType>(props);\n useTableRefInstanceSetup(table, internalRef);\n\n const { renderBody, scrollToIndex } = useTableRenderStrategy<TType>(props, table, internalRef);\n const tableMeta = table.options.meta as TableMeta<TType>;\n const state = table.getState();\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n tableMeta.hoverState.handleKeyDown(event);\n tableMeta.currentRow.handleKeyDown(event, table.getRowModel().rows.length, scrollToIndex);\n tableMeta.rowClick.handleKeyDown(event, table);\n tableMeta.rowSelection.handleKeyDown(event, table);\n tableMeta.editing.handleKeyDown(event, internalRef);\n };\n\n const handleBlur = (event: React.FocusEvent) => {\n tableMeta.editing.handleBlur(event);\n };\n\n const handleScroll = async (event: React.MouseEvent<HTMLDivElement>) => {\n tableMeta.columnFreezing.handleScroll(event);\n };\n\n const className = cn(\n 'border-grey-300 relative grid h-full w-full flex-grow overflow-auto rounded border bg-white scroll-mt-[41px]',\n 'focus:yt-focus focus-within:yt-focus',\n '[&[data-resizing=\"true\"]]:select-none',\n {\n 'text-xs': tableMeta.fontSize.size === 'small',\n 'text-sm': tableMeta.fontSize.size === 'medium',\n 'text-base': tableMeta.fontSize.size === 'large',\n }\n );\n\n const { style: cssGridStyle } = useCssGrid<TType>(table);\n const { style: cssVars } = useCssVars(tableMeta.rowHeight.height, tableMeta.fontSize.size);\n\n const style = {\n ...cssVars,\n ...cssGridStyle,\n // create a new stacking context so our internal z-indexes don't effect external components\n // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n opacity: 0.999,\n };\n\n const columnFreezingStyle = useColumnFreezingStyle(props.id, table);\n const isServerLoadingAndNotReady = tableMeta.isUsingServer && props.length === undefined;\n\n return (\n <>\n {columnFreezingStyle ? <style data-taco=\"table3-column-freezing-styles\">{columnFreezingStyle}</style> : null}\n <Toolbar\n table={table}\n tableProps={props}\n total={length}\n left={toolbarLeft}\n right={toolbarRight}\n scrollToIndex={scrollToIndex}\n />\n <div\n className={className}\n id={props.id}\n data-font-size={tableMeta.fontSize.size}\n data-editing={tableMeta.editing.isEditing}\n data-horizontally-scrolled={tableMeta.columnFreezing.horizontallyScrolled}\n data-pause-hover={tableMeta?.hoverState.isPaused}\n data-resizing={!!state.columnSizingInfo.isResizingColumn}\n data-taco=\"table3\"\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onScroll={handleScroll}\n ref={internalRef}\n role=\"table\"\n style={style}\n tabIndex={0}>\n {isServerLoadingAndNotReady ? null : (\n <div className=\"group/header contents\" role=\"rowgroup\">\n {table.getHeaderGroups().map(headerGroup => (\n <div className=\"contents\" key={headerGroup.id} role=\"row\">\n {headerGroup.headers.map(header => (\n <React.Fragment key={header.id}>\n {flexRender(header.column.columnDef.header, { ...header.getContext(), scrollToIndex })}\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n )}\n {table.getRowModel().rows.length ? (\n <>\n <FocusScope>\n <div className=\"group/body contents\" role=\"rowgroup\">\n {renderBody()}\n <span className=\"col-span-full h-16 print:hidden\" />\n </div>\n </FocusScope>\n <div className=\"group/footer contents\" role=\"rowgroup\">\n {table.getFooterGroups().map(footerGroup => (\n <div className=\"contents\" key={footerGroup.id} role=\"row\">\n {footerGroup.headers.map(footer => (\n <React.Fragment key={footer.id}>\n {flexRender(footer.column.columnDef.footer, footer.getContext())}\n </React.Fragment>\n ))}\n </div>\n ))}\n {length ? <Summary length={length} table={table} /> : null}\n </div>\n </>\n ) : (\n <div className=\"col-span-full min-h-[theme(spacing.8)]\">{EmptyState ? <EmptyState /> : null}</div>\n )}\n </div>\n </>\n );\n}) as Table3WithStatics;\n\ntype Table3WithStatics<TType = unknown> = React.ForwardRefExoticComponent<Table3Props<TType>> & {\n Column: (props: Table3ColumnProps) => null;\n} & (<TType>(props: Table3Props<TType> & { ref?: React.Ref<Table3Ref> }) => JSX.Element);\n\nexport const Table3 = React.forwardRef(function Table3<TType = unknown>(props: Table3Props<TType>, ref: React.Ref<Table3Ref>) {\n // we force a remount (using key) when the child columns change because there are too many places to add children as an effect\n // this is cheaper from a complexity perspective, and probably performance wise as well\n const key = React.useMemo(() => String('tableKey_' + String(props.children)), [props.children]);\n return <Table {...props} key={key} ref={ref} />;\n}) as Table3WithStatics;\n\nTable3.Column = Column;\n\n// hooks\nexport { useTable3DataLoader } from './hooks/useTableDataLoader';\n\n// types\nexport type { useTable3DataFetcher, useTable3DataOptions, useTableDataValues } from './hooks/useTableDataLoader';\n\nexport type {\n Table3Ref,\n Table3Props,\n Table3Preset,\n Table3Settings,\n Table3SettingsAdapter,\n Table3RowHeight,\n Table3FilterComparator,\n Table3FilterHandler,\n Table3SearchHandler,\n Table3LoadPageHandler,\n Table3LoadAllHandler,\n Table3RowGotoHandler,\n Table3SortHandler,\n Table3Shortcuts,\n Table3ShortcutHandlerFn,\n Table3ShortcutHandlerObject,\n Table3FontSize,\n Table3SortDirection,\n Table3SortFn,\n Table3RowActionRenderer,\n Table3RowSelectionHandler,\n Table3RowExpansionRenderer,\n Table3RowDropHandler,\n Table3RowDragHandler,\n Table3RowClickHandler,\n Table3ColumnProps,\n Table3ColumnAlignment,\n Table3ColumnDataType,\n Table3ColumnHeaderMenu,\n Table3ColumnClassNameHandler,\n Table3ColumnFooterRenderer,\n Table3ColumnRenderer,\n Table3ColumnControlRenderer,\n Table3ColumnControlProps,\n} from './types';\n"],"names":["Column","_","Table","React","forwardRef","Table3","props","ref","emptyState","EmptyState","toolbarLeft","toolbarRight","internalRef","useMergedRef","table","length","useTable","useTableRefInstanceSetup","renderBody","scrollToIndex","useTableRenderStrategy","tableMeta","options","meta","state","getState","handleKeyDown","event","hoverState","currentRow","getRowModel","rows","rowClick","rowSelection","editing","handleBlur","handleScroll","columnFreezing","className","cn","fontSize","size","style","cssGridStyle","useCssGrid","cssVars","useCssVars","rowHeight","height","opacity","columnFreezingStyle","useColumnFreezingStyle","id","isServerLoadingAndNotReady","isUsingServer","undefined","Toolbar","tableProps","total","left","right","isEditing","horizontallyScrolled","isPaused","columnSizingInfo","isResizingColumn","onBlur","onKeyDown","onScroll","role","tabIndex","getHeaderGroups","map","headerGroup","key","headers","header","Fragment","flexRender","column","columnDef","getContext","FocusScope","getFooterGroups","footerGroup","footer","Summary","useMemo","String","children"],"mappings":";;;;;;;;;;;;;;;AAgBA,SAASA,MAAM,CAACC,CAAoB;EAChC,OAAO,IAAI;AACf;AAEA,MAAMC,KAAK,gBAAGC,cAAK,CAACC,UAAU,CAAC,SAASC,MAAM,CAAkBC,KAAyB,EAAEC,GAAyB;EAChH,MAAM;IAAEC,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Q;IAACH,GAAG,EAAEW,MAAM,CAACjC;KACvB0B,UAAU,CAACO,MAAM,CAACN,MAAM,CAACC,SAAS,CAACK,MAAM,EAAEA,MAAM,CAACJ,UAAU,EAAE,CAAC,CAEvE,CAAC,CAET,CAAC,EACDlE,MAAM,gBAAGZ,6BAACmF,OAAO;IAACvE,MAAM,EAAEA,MAAM;IAAED,KAAK,EAAEA;IAAS,GAAG,IAAI,CACxD,CACP,gBAEHX;IAAKmC,SAAS,EAAC;KAA0C7B,UAAU,gBAAGN,6BAACM,UAAU,OAAG,GAAG,IAAI,CAC9F,CACC,CACP;AAEX,CAAC,CAAsB;MAMVJ,MAAM,gBAAGF,cAAK,CAACC,UAAU,CAAC,SAASC,MAAM,CAAkBC,KAAyB,EAAEC,GAAyB;;;EAGxH,MAAMmE,GAAG,GAAGvE,cAAK,CAACoF,OAAO,CAAC,MAAMC,MAAM,CAAC,WAAW,GAAGA,MAAM,CAAClF,KAAK,CAACmF,QAAQ,CAAC,CAAC,EAAE,CAACnF,KAAK,CAACmF,QAAQ,CAAC,CAAC;EAC/F,oBAAOtF,6BAACD,KAAK,oBAAKI,KAAK;IAAEoE,GAAG,EAAEA,GAAG;IAAEnE,GAAG,EAAEA;KAAO;AACnD,CAAC;AAEDF,MAAM,CAACL,MAAM,GAAGA,MAAM;;;;"}
|
package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js
CHANGED
|
@@ -66,7 +66,7 @@ import '../../../../../hooks/useBoundaryOverflowDetection.js';
|
|
|
66
66
|
import '../../../../Table2/Table2.js';
|
|
67
67
|
import '../../../../../hooks/useLazyEffect.js';
|
|
68
68
|
import { useParentStylesheets } from './hooks/useParentStylesheets.js';
|
|
69
|
-
import '../../../hooks/
|
|
69
|
+
import '../../../hooks/useTableDataLoader.js';
|
|
70
70
|
import { Table3 } from '../../../Table3.js';
|
|
71
71
|
import '../../../../Tabs/Tabs.js';
|
|
72
72
|
import '../../../../Textarea/Textarea.js';
|
package/dist/esm/packages/taco/src/components/Table3/hooks/{useTableData.js → useTableDataLoader.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { _finallyRethrows, _catch } from '../../../../../../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
function useTable3DataLoader(fetch, fetchAll, options = {
|
|
5
5
|
pageSize: 100
|
|
6
6
|
}) {
|
|
7
7
|
const {
|
|
@@ -124,5 +124,5 @@ function useTableData(fetch, fetchAll, options = {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
export {
|
|
128
|
-
//# sourceMappingURL=
|
|
127
|
+
export { useTable3DataLoader };
|
|
128
|
+
//# sourceMappingURL=useTableDataLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTableDataLoader.js","sources":["../../../../../../../../src/components/Table3/hooks/useTableDataLoader.ts"],"sourcesContent":["import React from 'react';\nimport {\n ColumnFilter,\n Table3ColumnSort,\n Table3FilterHandler,\n Table3LoadAllHandler,\n Table3LoadPageHandler,\n Table3SearchHandler,\n Table3SortHandler,\n} from '../types';\n\nexport type useTable3DataFetcher<TType = unknown> = (\n pageIndex: number,\n pageSize: number,\n sorting: Table3ColumnSort[],\n filters: ColumnFilter[],\n search: string | undefined\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTable3AllDataFetcher<TType = unknown> = (\n sorting: Table3ColumnSort[],\n filters: ColumnFilter[],\n search: string | undefined\n) => Promise<{ data: TType[]; length: number }>;\n\nexport type useTable3DataOptions = { pageSize: number };\n\nexport type useTableDataValues<TType = unknown> = {\n data: TType[];\n length: number | undefined;\n loadAll: Table3LoadAllHandler;\n loadPage: Table3LoadPageHandler;\n onFilter: Table3FilterHandler;\n onSearch: Table3SearchHandler;\n onSort: Table3SortHandler;\n pageSize: number;\n};\n\nexport function useTable3DataLoader<TType = unknown>(\n fetch: useTable3DataFetcher<TType>,\n fetchAll: useTable3AllDataFetcher<TType>,\n options: useTable3DataOptions = { pageSize: 100 }\n): useTableDataValues<TType> {\n const { pageSize } = options;\n\n // track the data length, we don't know it until the first request\n const length = React.useRef<number | undefined>(undefined);\n // data will be filled after the first request, then we'll update values in place\n const [data, setData] = React.useState<any[]>([]);\n // track which pages have been loaded to dedupe requests\n const _pendingPageRequests = React.useRef({});\n const lastUsedSorting = React.useRef<Table3ColumnSort[]>([]);\n const lastUsedFilters = React.useRef<ColumnFilter[]>([]);\n const lastUsedSearch = React.useRef<string>();\n\n const loadPage = async (\n pageIndex: number,\n sorting: Table3ColumnSort[],\n filters: ColumnFilter[],\n search: string | undefined\n ) => {\n let reset = false;\n\n // sorting or filters changed, reset everything\n if (\n JSON.stringify(sorting) !== JSON.stringify(lastUsedSorting.current) ||\n JSON.stringify(filters) !== JSON.stringify(lastUsedFilters.current) ||\n search !== lastUsedSearch.current\n ) {\n _pendingPageRequests.current = {};\n // nuke the dataset so that we \"start again\" after sorting\n reset = true;\n }\n\n if (_pendingPageRequests.current[pageIndex]) {\n // if page is already loaded/loading, abort, otherwise mark it as loading\n return;\n } else {\n _pendingPageRequests.current[pageIndex] = true;\n }\n\n // set the sorting so we can track if it changed between loads\n lastUsedSorting.current = sorting;\n // set the filters so we can track if it changed between loads\n lastUsedFilters.current = filters;\n // set the search so we can track if it changed between loads\n lastUsedSearch.current = search;\n\n try {\n const response = await fetch(pageIndex, pageSize, sorting, filters, search);\n\n // update state, here we do some \"magic\" to support \"load in place\"\n setData(currentData => {\n let nextData;\n\n // reset table state if:\n // - the length isn't set at all (first load)\n // - the client length and server length are different (the data changed)\n if (reset || length.current !== response.length) {\n length.current = response.length;\n nextData = Array(length.current).fill(undefined);\n } else {\n nextData = [...currentData];\n }\n\n const startIndex = pageIndex * pageSize;\n nextData.splice(startIndex, pageSize, ...response.data);\n return nextData;\n });\n } catch {\n //\n } finally {\n _pendingPageRequests.current[pageIndex] = false;\n }\n };\n\n const loadAll = async (sorting: Table3ColumnSort[], filters: ColumnFilter[], search: string | undefined) => {\n try {\n const response = await fetchAll(sorting, filters, search);\n length.current = response.length;\n\n setData(() => {\n let nextData;\n\n if (response.data.length !== response.length) {\n nextData = Array(response.length).fill(undefined);\n nextData.splice(0, response.data.length, ...response.data);\n } else {\n nextData = [...response.data];\n }\n\n return nextData;\n });\n } catch {\n //\n }\n };\n\n // we reset the page to 0 whenever sorting, filtering or search changes\n const handleSort = async (sorting: Table3ColumnSort[]) =>\n loadPage(0, sorting, lastUsedFilters.current, lastUsedSearch.current);\n const handleFilter = async (filters: ColumnFilter[]) => loadPage(0, lastUsedSorting.current, filters, lastUsedSearch.current);\n const handleSearch = async (query: string) => loadAll(lastUsedSorting.current, lastUsedFilters.current, query);\n\n return {\n data,\n length: length.current,\n loadAll,\n loadPage,\n onFilter: handleFilter,\n onSearch: handleSearch as any,\n onSort: handleSort,\n pageSize,\n };\n}\n"],"names":["useTable3DataLoader","fetch","fetchAll","options","pageSize","length","React","useRef","undefined","data","setData","useState","_pendingPageRequests","lastUsedSorting","lastUsedFilters","lastUsedSearch","loadPage","pageIndex","sorting","filters","search","reset","JSON","stringify","current","response","currentData","nextData","Array","fill","startIndex","splice","loadAll","handleSort","handleFilter","handleSearch","query","onFilter","onSearch","onSort"],"mappings":";;;SAsCgBA,mBAAmB,CAC/BC,KAAkC,EAClCC,QAAwC,EACxCC,UAAgC;EAAEC,QAAQ,EAAE;CAAK;EAEjD,MAAM;IAAEA;GAAU,GAAGD,OAAO;;EAG5B,MAAME,MAAM,GAAGC,cAAK,CAACC,MAAM,CAAqBC,SAAS,CAAC;;EAE1D,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGJ,cAAK,CAACK,QAAQ,CAAQ,EAAE,CAAC;;EAEjD,MAAMC,oBAAoB,GAAGN,cAAK,CAACC,MAAM,CAAC,EAAE,CAAC;EAC7C,MAAMM,eAAe,GAAGP,cAAK,CAACC,MAAM,CAAqB,EA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A;MAAA,OAAKH,QAAQ,CAAC,CAAC,EAAEH,eAAe,CAACW,OAAO,EAAEL,OAAO,EAAEJ,cAAc,CAACS,OAAO,CAAC;;MAAA;;;EAC7H,MAAMW,YAAY,aAAUC,KAAa;IAAA;MAAA,OAAKJ,OAAO,CAACnB,eAAe,CAACW,OAAO,EAAEV,eAAe,CAACU,OAAO,EAAEY,KAAK,CAAC;;MAAA;;;EAE9G,OAAO;IACH3B,IAAI;IACJJ,MAAM,EAAEA,MAAM,CAACmB,OAAO;IACtBQ,OAAO;IACPhB,QAAQ;IACRqB,QAAQ,EAAEH,YAAY;IACtBI,QAAQ,EAAEH,YAAmB;IAC7BI,MAAM,EAAEN,UAAU;IAClB7B;GACH;AACL;;;;"}
|
|
@@ -64,7 +64,7 @@ export { insertChildTableRow, removeChildTableRow, useTableRowCreation } from '.
|
|
|
64
64
|
export { useBoundaryOverflowDetection } from './hooks/useBoundaryOverflowDetection.js';
|
|
65
65
|
export { Table2 } from './components/Table2/Table2.js';
|
|
66
66
|
export { useLazyEffect } from './hooks/useLazyEffect.js';
|
|
67
|
-
export {
|
|
67
|
+
export { useTable3DataLoader } from './components/Table3/hooks/useTableDataLoader.js';
|
|
68
68
|
export { Table3 } from './components/Table3/Table3.js';
|
|
69
69
|
export { Tabs } from './components/Tabs/Tabs.js';
|
|
70
70
|
export { Textarea } from './components/Textarea/Textarea.js';
|
|
@@ -19857,7 +19857,7 @@ const useCssVars = (height, fontSize) => {
|
|
|
19857
19857
|
};
|
|
19858
19858
|
};
|
|
19859
19859
|
|
|
19860
|
-
function
|
|
19860
|
+
function useTable3DataLoader(fetch, fetchAll, options = {
|
|
19861
19861
|
pageSize: 100
|
|
19862
19862
|
}) {
|
|
19863
19863
|
const {
|
|
@@ -21189,7 +21189,7 @@ exports.useMergedRef = useMergedRef;
|
|
|
21189
21189
|
exports.useOnClickOutside = useOnClickOutside;
|
|
21190
21190
|
exports.usePagination = usePagination;
|
|
21191
21191
|
exports.useRadioGroup = useRadioGroup;
|
|
21192
|
-
exports.
|
|
21192
|
+
exports.useTable3DataLoader = useTable3DataLoader;
|
|
21193
21193
|
exports.useTableRowCreation = useTableRowCreation;
|
|
21194
21194
|
exports.useToast = useToast;
|
|
21195
21195
|
//# sourceMappingURL=taco.cjs.development.js.map
|