@lobehub/ui 5.60.0 → 5.61.0
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/es/EmojiPicker/AvatarUploader.mjs +1 -1
- package/es/Form/components/FormSubmitFooter.mjs +1 -1
- package/es/base-ui/Input/style.d.mts +1 -1
- package/es/base-ui/Pagination/Pagination.mjs +158 -41
- package/es/base-ui/Pagination/Pagination.mjs.map +1 -1
- package/es/base-ui/Pagination/helpers.mjs +3 -3
- package/es/base-ui/Pagination/helpers.mjs.map +1 -1
- package/es/base-ui/Pagination/index.d.mts +2 -2
- package/es/base-ui/Pagination/style.mjs +39 -0
- package/es/base-ui/Pagination/style.mjs.map +1 -1
- package/es/base-ui/Pagination/type.d.mts +42 -4
- package/es/base-ui/QRCode/QRCode.mjs +1 -1
- package/es/base-ui/Table/Column.d.mts +9 -0
- package/es/base-ui/Table/Column.mjs +7 -0
- package/es/base-ui/Table/Column.mjs.map +1 -0
- package/es/base-ui/Table/ColumnGroup.d.mts +12 -0
- package/es/base-ui/Table/ColumnGroup.mjs +7 -0
- package/es/base-ui/Table/ColumnGroup.mjs.map +1 -0
- package/es/base-ui/Table/ExpandIcon.mjs +33 -0
- package/es/base-ui/Table/ExpandIcon.mjs.map +1 -0
- package/es/base-ui/Table/FilterDropdown.mjs +284 -0
- package/es/base-ui/Table/FilterDropdown.mjs.map +1 -0
- package/es/base-ui/Table/LoadingSkeleton.mjs +83 -0
- package/es/base-ui/Table/LoadingSkeleton.mjs.map +1 -0
- package/es/base-ui/Table/Table.d.mts +21 -3
- package/es/base-ui/Table/Table.mjs +444 -97
- package/es/base-ui/Table/Table.mjs.map +1 -1
- package/es/base-ui/Table/columnUtils.mjs +56 -0
- package/es/base-ui/Table/columnUtils.mjs.map +1 -0
- package/es/base-ui/Table/index.d.mts +4 -2
- package/es/base-ui/Table/selectionUtils.d.mts +9 -0
- package/es/base-ui/Table/selectionUtils.mjs +128 -0
- package/es/base-ui/Table/selectionUtils.mjs.map +1 -0
- package/es/base-ui/Table/semantic.mjs +55 -0
- package/es/base-ui/Table/semantic.mjs.map +1 -0
- package/es/base-ui/Table/style.mjs +801 -161
- package/es/base-ui/Table/style.mjs.map +1 -1
- package/es/base-ui/Table/type.d.mts +471 -37
- package/es/base-ui/Table/useBreakpoint.mjs +41 -0
- package/es/base-ui/Table/useBreakpoint.mjs.map +1 -0
- package/es/base-ui/Table/useFilter.mjs +64 -0
- package/es/base-ui/Table/useFilter.mjs.map +1 -0
- package/es/base-ui/Table/useSelection.mjs +421 -0
- package/es/base-ui/Table/useSelection.mjs.map +1 -0
- package/es/base-ui/Table/useSorter.mjs +152 -0
- package/es/base-ui/Table/useSorter.mjs.map +1 -0
- package/es/base-ui/Table/useTableState.mjs +82 -55
- package/es/base-ui/Table/useTableState.mjs.map +1 -1
- package/es/base-ui/index.d.mts +6 -4
- package/es/base-ui/index.mjs +9 -9
- package/es/chat/EditableMessageList/EditableMessageList.mjs +1 -1
- package/es/chat/MessageInput/MessageInput.mjs +1 -1
- package/es/chat/MessageModal/MessageModal.mjs +1 -1
- package/es/chat/TokenTag/TokenTag.mjs +1 -1
- package/es/i18n/resources/en/index.d.mts +3 -2
- package/es/i18n/resources/en/index.mjs +4 -2
- package/es/i18n/resources/en/index.mjs.map +1 -1
- package/es/i18n/resources/en/table.d.mts +23 -0
- package/es/i18n/resources/en/table.mjs +24 -0
- package/es/i18n/resources/en/table.mjs.map +1 -0
- package/es/i18n/resources/zhCn/index.d.mts +3 -2
- package/es/i18n/resources/zhCn/index.mjs +4 -2
- package/es/i18n/resources/zhCn/index.mjs.map +1 -1
- package/es/i18n/resources/zhCn/table.d.mts +23 -0
- package/es/i18n/resources/zhCn/table.mjs +24 -0
- package/es/i18n/resources/zhCn/table.mjs.map +1 -0
- package/es/i18n/types.d.mts +2 -1
- package/es/index.mjs +2 -2
- package/package.json +2 -2
- package/es/base-ui/Table/FilterMenu.mjs +0 -45
- package/es/base-ui/Table/FilterMenu.mjs.map +0 -1
- package/es/base-ui/Table/TableBody.mjs +0 -59
- package/es/base-ui/Table/TableBody.mjs.map +0 -1
- package/es/base-ui/Table/TableHead.mjs +0 -50
- package/es/base-ui/Table/TableHead.mjs.map +0 -1
- package/es/base-ui/Table/features.mjs +0 -12
- package/es/base-ui/Table/features.mjs.map +0 -1
- package/es/base-ui/Table/fixedOffsets.mjs +0 -29
- package/es/base-ui/Table/fixedOffsets.mjs.map +0 -1
- package/es/base-ui/Table/toColumnDefs.mjs +0 -26
- package/es/base-ui/Table/toColumnDefs.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/base-ui/Table/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nimport { focusRing } from '@/base-ui/focusRing';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n bordered: css`\n border: 1px solid ${cssVar.colorBorderSecondary};\n border-radius: ${cssVar.borderRadiusLG};\n\n & th,\n & td {\n border-inline-end: 1px solid ${cssVar.colorBorderSecondary};\n }\n\n & th:last-child,\n & td:last-child {\n border-inline-end: 0;\n }\n `,\n cell: css`\n border-block-end: 1px solid ${cssVar.colorBorderSecondary};\n font-variant-numeric: tabular-nums;\n background: ${cssVar.colorBgContainer};\n `,\n clickable: css`\n cursor: pointer;\n `,\n ellipsis: css`\n overflow: hidden;\n max-width: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n empty: css`\n padding-block: 32px;\n color: ${cssVar.colorTextDescription};\n text-align: center;\n `,\n filterActive: css`\n color: ${cssVar.colorPrimary};\n `,\n filterButton: css`\n ${focusRing};\n cursor: pointer;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n padding: 2px;\n border: 0;\n border-radius: 4px;\n\n color: ${cssVar.colorTextQuaternary};\n\n background: none;\n\n &:hover {\n color: ${cssVar.colorText};\n background: ${cssVar.colorFillTertiary};\n }\n `,\n fixed: css`\n z-index: 1;\n background: ${cssVar.colorBgContainer};\n `,\n header: css`\n position: sticky;\n z-index: 2;\n inset-block-start: 0;\n\n font-size: 13px;\n font-weight: 500;\n color: ${cssVar.colorTextSecondary};\n text-align: start;\n\n background: ${cssVar.colorBgContainer};\n box-shadow:\n inset 0 -1px 0 ${cssVar.colorBorderSecondary},\n inset 0 999px 0 ${cssVar.colorFillQuaternary};\n `,\n headerInner: css`\n display: inline-flex;\n gap: 6px;\n align-items: center;\n `,\n loading: css`\n position: absolute;\n z-index: 3;\n inset: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background: color-mix(in srgb, ${cssVar.colorBgContainer} 60%, transparent);\n `,\n middle: css`\n & th,\n & td {\n padding-block: 12px;\n padding-inline: 16px;\n }\n `,\n pagination: css`\n display: flex;\n justify-content: flex-end;\n margin-block-start: 12px;\n `,\n root: css`\n min-width: 0;\n `,\n row: css`\n &:hover > td {\n background: color-mix(in srgb, ${cssVar.colorBgContainer}, ${cssVar.colorText} 3%);\n }\n\n &:last-child > td {\n border-block-end: 0;\n }\n `,\n small: css`\n & th,\n & td {\n padding-block: 8px;\n padding-inline: 12px;\n }\n `,\n sortButton: css`\n ${focusRing};\n cursor: pointer;\n\n display: inline-flex;\n gap: 6px;\n align-items: center;\n\n padding: 0;\n border: 0;\n border-radius: 4px;\n\n font: inherit;\n color: inherit;\n\n background: none;\n `,\n sortCaret: css`\n display: inline-flex;\n flex-direction: column;\n color: ${cssVar.colorTextQuaternary};\n\n & > [data-active='true'] {\n color: ${cssVar.colorText};\n }\n `,\n table: css`\n border-spacing: 0;\n border-collapse: separate;\n width: 100%;\n font-size: 14px;\n `,\n wrapper: css`\n position: relative;\n overflow: auto;\n `,\n}));\n"],"mappings":";;;AAIA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,UAAU,GAAG;wBACS,OAAO,qBAAqB;qBAC/B,OAAO,eAAe;;;;qCAIN,OAAO,qBAAqB;;;;;;;;CAQ/D,MAAM,GAAG;kCACuB,OAAO,qBAAqB;;kBAE5C,OAAO,iBAAiB;;CAExC,WAAW,GAAG;;;CAGd,UAAU,GAAG;;;;;;CAMb,OAAO,GAAG;;aAEC,OAAO,qBAAqB;;;CAGvC,cAAc,GAAG;aACN,OAAO,aAAa;;CAE/B,cAAc,GAAG;MACb,UAAU;;;;;;;;;;;aAWH,OAAO,oBAAoB;;;;;eAKzB,OAAO,UAAU;oBACZ,OAAO,kBAAkB;;;CAG3C,OAAO,GAAG;;kBAEM,OAAO,iBAAiB;;CAExC,QAAQ,GAAG;;;;;;;aAOA,OAAO,mBAAmB;;;kBAGrB,OAAO,iBAAiB;;uBAEnB,OAAO,qBAAqB;wBAC3B,OAAO,oBAAoB;;CAEjD,aAAa,GAAG;;;;;CAKhB,SAAS,GAAG;;;;;;;;;qCASuB,OAAO,iBAAiB;;CAE3D,QAAQ,GAAG;;;;;;;CAOX,YAAY,GAAG;;;;;CAKf,MAAM,GAAG;;;CAGT,KAAK,GAAG;;uCAE6B,OAAO,iBAAiB,IAAI,OAAO,UAAU;;;;;;;CAOlF,OAAO,GAAG;;;;;;;CAOV,YAAY,GAAG;MACX,UAAU;;;;;;;;;;;;;;;;CAgBd,WAAW,GAAG;;;aAGH,OAAO,oBAAoB;;;eAGzB,OAAO,UAAU;;;CAG9B,OAAO,GAAG;;;;;;CAMV,SAAS,GAAG;;;;AAId,EAAE"}
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/base-ui/Table/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\n/** Own prefix so rc-table classNames never collide with antd's global `.ant-table` CSS. */\nexport const PREFIX_CLS = 'lobe-table';\n\nconst p = `.${PREFIX_CLS}`;\n\n// Cell padding comes from the size class through these vars, so title / footer / expanded rows\n// can reuse (and negate) it.\nconst PADDING_BLOCK = '--lobe-table-padding-block';\nconst PADDING_INLINE = '--lobe-table-padding-inline';\n\n// Matches antd's `zIndexTableFixed`.\nconst Z_FIXED = 2;\n\n// antd `expandColumnWidth`; nested tables start after it.\nexport const EXPAND_COLUMN_WIDTH = 48;\n\n// antd `selectionColumnWidth`, plus the `selections` trigger when there is one.\nexport const SELECTION_COLUMN_WIDTH = 32;\nexport const SELECTION_DROPDOWN_WIDTH = 24;\n\n/** Rows of this table's own sections only, so the rules never leak into nested tables. */\nconst ownRows = ['content', 'header', 'body', 'summary']\n .map((section) => `& > ${p}-container > ${p}-${section} > table > * > tr`)\n .join(', ');\nconst ownCells = (cell: string) =>\n ownRows\n .split(', ')\n .map((row) => `${row} > ${cell}`)\n .join(', ');\n\nexport const styles = createStaticStyles(({ css, cssVar }) => {\n const border = `1px solid ${cssVar.colorBorderSecondary}`;\n const fixShadowBase = `\n pointer-events: none;\n content: '';\n position: absolute;\n inset-block: 0 -1px;\n width: 30px;\n transition: box-shadow ${cssVar.motionDurationSlow};\n `;\n const startShadow = `box-shadow: inset 10px 0 8px -8px ${cssVar.colorSplit};`;\n const endShadow = `box-shadow: inset -10px 0 8px -8px ${cssVar.colorSplit};`;\n\n return {\n outlined: css`\n &${p}-outlined {\n & > ${p}-title {\n border: ${border};\n border-block-end: 0;\n border-start-start-radius: ${cssVar.borderRadiusLG};\n border-start-end-radius: ${cssVar.borderRadiusLG};\n }\n\n /* Like antd: start + top on the container; cells draw the end / bottom edges\n so rowspan group headers never lose a vertical line to \\`:last-child\\`. */\n & > ${p}-container {\n overflow: clip;\n border-block-start: ${border};\n border-inline-start: ${border};\n border-radius: ${cssVar.borderRadiusLG};\n }\n\n & > ${p}-title + ${p}-container {\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n &:has(> ${p}-footer) > ${p}-container {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n & > ${p}-footer {\n border: ${border};\n border-block-start: 0;\n border-end-start-radius: ${cssVar.borderRadiusLG};\n border-end-end-radius: ${cssVar.borderRadiusLG};\n }\n\n ${ownCells('th')}, ${ownCells('td')} {\n border-inline-end: ${border};\n }\n\n /* Every header row (including the last) draws one bottom edge — no inset\n shadow underneath, or group headers look double-thick. */\n & > ${p}-container > * > table > thead > tr > th {\n border-block-end: ${border};\n box-shadow: inset 0 999px 0 ${cssVar.colorFillQuaternary};\n }\n\n & ${p}-tbody-virtual ${p}-cell {\n border-inline-end: ${border};\n }\n }\n `,\n\n filled: css`\n &${p}-filled {\n & > ${p}-title, & > ${p}-footer {\n border-radius: ${cssVar.borderRadiusLG};\n background: ${cssVar.colorFillQuaternary};\n }\n\n & > ${p}-title {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n & > ${p}-footer {\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n & > ${p}-container {\n overflow: clip;\n border-radius: ${cssVar.borderRadiusLG};\n background: ${cssVar.colorFillTertiary};\n }\n\n & > ${p}-title + ${p}-container {\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n &:has(> ${p}-footer) > ${p}-container {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n /* Soft header band: same FillTertiary surface as the body, plus the same\n FillQuaternary inset wash borderless/outlined use — light layering, not a\n heavy Secondary fill. Sticky thead keeps an opaque Tertiary base so rows\n do not show through while scrolling. */\n & ${p}-thead > tr > th,\n & ${p}-thead > tr > td {\n background: ${cssVar.colorFillTertiary};\n box-shadow:\n inset 0 -1px 0 ${cssVar.colorBorderSecondary},\n inset 0 999px 0 ${cssVar.colorFillQuaternary};\n }\n\n & ${p}-tbody > tr > td,\n & ${p}-tbody > tr > th,\n & ${p}-tbody-virtual ${p}-cell {\n background: transparent;\n }\n\n & ${p}-thead > tr > th${p}-cell-fix, & ${p}-thead > tr > td${p}-cell-fix {\n background: ${cssVar.colorFillTertiary};\n box-shadow:\n inset 0 -1px 0 ${cssVar.colorBorderSecondary},\n inset 0 999px 0 ${cssVar.colorFillQuaternary};\n }\n }\n `,\n clickable: css`\n cursor: pointer;\n `,\n /** Title text of an `ellipsis` column; truncates inside the sort button / header controls. */\n columnTitle: css`\n overflow: hidden;\n\n min-width: 0;\n\n text-overflow: ellipsis;\n word-break: keep-all;\n white-space: nowrap;\n `,\n filterActive: css`\n &&,\n &&:hover {\n color: ${cssVar.colorPrimary};\n }\n `,\n filterButton: css`\n flex: none;\n margin-block: -4px;\n `,\n filterButtons: css`\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: space-between;\n\n padding-block: 7px;\n padding-inline: 8px;\n border-block-start: 1px solid ${cssVar.colorSplit};\n `,\n filterCheckAll: css`\n margin-block-end: 4px;\n padding-inline: 4px;\n `,\n filterDropdown: css`\n display: flex;\n flex-direction: column;\n min-width: 120px;\n `,\n filterEmpty: css`\n padding-block: 16px;\n padding-inline: 0;\n `,\n filterGroup: css`\n display: flex;\n flex-direction: column;\n\n & > div:not(:first-child) {\n padding-inline-start: 20px;\n }\n `,\n filterGroupTitle: css`\n padding-block: 5px;\n padding-inline: 8px;\n font-size: 12px;\n color: ${cssVar.colorTextDescription};\n `,\n filterItem: css`\n display: flex;\n align-items: center;\n\n padding-block: 5px;\n padding-inline: 8px;\n border-radius: ${cssVar.borderRadiusSM};\n\n white-space: nowrap;\n\n &:hover {\n background: ${cssVar.colorFillTertiary};\n }\n\n & > label {\n cursor: pointer;\n flex: 1;\n }\n `,\n filterMenu: css`\n overflow: auto;\n display: flex;\n flex-direction: column;\n\n max-height: 264px;\n padding: 4px;\n `,\n filterPopup: css`\n overflow: hidden;\n padding: 0;\n `,\n filterSearch: css`\n padding: 8px;\n border-block-end: 1px solid ${cssVar.colorSplit};\n `,\n filterTree: css`\n overflow: auto;\n max-height: 264px;\n padding: 8px;\n `,\n headerInner: css`\n display: inline-flex;\n gap: 6px;\n align-items: center;\n\n min-width: 0;\n max-width: 100%;\n\n vertical-align: middle;\n `,\n hoverable: css`\n & ${p}-tbody > tr > ${p}-cell-row-hover, & ${p}-tbody-virtual ${p}-row:hover > ${p}-cell {\n background: color-mix(in srgb, ${cssVar.colorBgContainer}, ${cssVar.colorText} 3%);\n }\n `,\n loading: css`\n position: absolute;\n z-index: calc(var(--columns-count, 1) * 2 + ${Z_FIXED} + 2);\n inset: 0;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n justify-content: center;\n\n color: ${cssVar.colorTextSecondary};\n\n background: color-mix(in srgb, ${cssVar.colorBgContainer} 60%, transparent);\n `,\n /**\n * Empty-state loading body. Tracks follow leaf column widths so bars sit under the\n * live header; cell padding reuses the size CSS vars on the table ancestor.\n */\n skeleton: css`\n display: flex;\n flex-direction: column;\n\n width: 100%;\n min-width: 0;\n\n text-align: start;\n `,\n skeletonCell: css`\n display: flex;\n align-items: center;\n\n min-width: 0;\n padding-block: var(${PADDING_BLOCK});\n padding-inline: var(${PADDING_INLINE});\n `,\n skeletonRow: css`\n display: grid;\n align-items: stretch;\n\n width: 100%;\n min-width: 0;\n border-block-end: 1px solid ${cssVar.colorBorderSecondary};\n\n &:last-child {\n border-block-end: 0;\n }\n `,\n // antd `paginationMargin` (token.margin): keep the pager off the table above and off\n // whatever sits below the table.\n pagination: css`\n display: flex;\n margin-block: 16px;\n `,\n paginationCenter: css`\n justify-content: center;\n `,\n paginationEnd: css`\n justify-content: flex-end;\n `,\n paginationStart: css`\n justify-content: flex-start;\n `,\n paginationTop: css`\n margin-block: 0 16px;\n `,\n root: css`\n min-width: 0;\n `,\n /** Header box of the selection column; `selectionExtra` hangs off its end. */\n selection: css`\n position: relative;\n display: inline-flex;\n flex-direction: column;\n vertical-align: middle;\n `,\n selectionColumn: css`\n && {\n padding-inline: 8px;\n text-align: center;\n }\n\n & > * {\n vertical-align: middle;\n }\n `,\n selectionExtra: css`\n position: absolute;\n z-index: 1;\n inset-block-start: 0;\n\n display: flex;\n align-items: center;\n\n height: 100%;\n margin-inline-start: 100%;\n padding-inline-start: 2px;\n `,\n selectionRadioGroup: css`\n display: inline-flex;\n vertical-align: middle;\n `,\n selectionTrigger: css`\n flex: none;\n margin-block: -4px;\n `,\n sizeLarge: css`\n ${PADDING_BLOCK}: 16px;\n ${PADDING_INLINE}: 16px;\n `,\n sizeMedium: css`\n ${PADDING_BLOCK}: 12px;\n ${PADDING_INLINE}: 16px;\n `,\n sizeSmall: css`\n ${PADDING_BLOCK}: 8px;\n ${PADDING_INLINE}: 12px;\n `,\n // Title + sort ActionIcon row (not a button — the ActionIcon owns the click).\n sortButton: css`\n display: inline-flex;\n gap: 4px;\n align-items: center;\n\n min-width: 0;\n max-width: 100%;\n `,\n // Matches the filter trigger: small ActionIcon with a slight negative margin so the\n // 24px block does not grow the header.\n sortCaret: css`\n flex: none;\n margin-block: -4px;\n `,\n sortTitle: css`\n cursor: pointer;\n min-width: 0;\n `,\n sortedColumn: css`\n ${p}-tbody > tr > &${p}-cell {\n background: ${cssVar.colorFillQuaternary};\n }\n `,\n spinContainer: css`\n position: relative;\n `,\n table: css`\n font-size: 14px;\n color: ${cssVar.colorText};\n background: ${cssVar.colorBgContainer};\n\n & table {\n border-spacing: 0;\n border-collapse: separate;\n width: 100%;\n text-align: start;\n }\n\n /* ============================== Cell ============================== */\n & ${p}-cell, & ${p}-thead > tr > th,\n & ${p}-tbody > tr > td,\n & tfoot > tr > th,\n & tfoot > tr > td {\n position: relative;\n padding-block: var(${PADDING_BLOCK});\n padding-inline: var(${PADDING_INLINE});\n overflow-wrap: break-word;\n }\n\n & ${p}-thead > tr > th,\n & ${p}-thead > tr > td {\n font-size: 13px;\n font-weight: 500;\n color: ${cssVar.colorTextSecondary};\n text-align: start;\n\n background: ${cssVar.colorBgContainer};\n box-shadow:\n inset 0 -1px 0 ${cssVar.colorBorderSecondary},\n inset 0 999px 0 ${cssVar.colorFillQuaternary};\n\n &[colspan]:not([colspan='1']) {\n text-align: center;\n }\n }\n\n /* th covers rowScope row headers. */\n & ${p}-tbody > tr > td,\n & ${p}-tbody > tr > th {\n border-block-end: ${border};\n\n font-weight: inherit;\n font-variant-numeric: tabular-nums;\n text-align: start;\n\n background: ${cssVar.colorBgContainer};\n\n transition: background-color ${cssVar.motionDurationMid};\n }\n\n &:not(${p}-outlined) ${p}-tbody > tr:last-child > td,\n &:not(${p}-outlined) ${p}-tbody > tr:last-child > th {\n border-block-end: 0;\n }\n\n & ${p}-tbody > tr${p}-placeholder > td {\n padding-block: 32px;\n color: ${cssVar.colorTextDescription};\n text-align: center;\n }\n\n /* Skeleton loading fills the placeholder like real body rows. */\n & ${p}-tbody > tr${p}-placeholder > td:has([data-table-skeleton]) {\n padding: 0;\n color: inherit;\n text-align: start;\n vertical-align: top;\n }\n\n & ${p}-cell-scrollbar:not([rowspan]) {\n box-shadow: 0 1px 0 1px ${cssVar.colorFillQuaternary};\n }\n\n /* ============================ Ellipsis ============================ */\n & ${p}-cell-ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: keep-all;\n white-space: nowrap;\n\n &${p}-cell-fix-start-shadow, &${p}-cell-fix-end-shadow {\n overflow: visible;\n\n & ${p}-cell-content {\n overflow: hidden;\n display: block;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n }\n\n /* ========================== Title / Footer ========================= */\n & > ${p}-title, & > ${p}-footer {\n padding-block: var(${PADDING_BLOCK});\n padding-inline: var(${PADDING_INLINE});\n }\n\n & > ${p}-footer {\n color: ${cssVar.colorText};\n background: ${cssVar.colorFillQuaternary};\n }\n\n /* ============================== Fixed ============================= */\n & ${p}-container {\n position: relative;\n\n &::before,\n &::after {\n ${fixShadowBase}\n z-index: calc(var(--columns-count, 1) * 2 + ${Z_FIXED} + 1);\n }\n\n &::before {\n inset-inline-start: 0;\n }\n\n &::after {\n inset-inline-end: 0;\n }\n }\n\n &${p}-has-fix-start > ${p}-container::before, &${p}-has-fix-end > ${p}-container::after {\n display: none;\n }\n\n &${p}-fix-start-shadow-show > ${p}-container::before {\n ${startShadow}\n }\n\n &${p}-fix-end-shadow-show > ${p}-container::after {\n ${endShadow}\n }\n\n /* Must outrank the generic cell rule that sets position: relative. */\n &\n ${p}-thead\n > tr\n > th${p}-cell-fix,\n &\n ${p}-tbody\n > tr\n > td${p}-cell-fix,\n &\n ${p}-cell${p}-cell-fix {\n position: sticky;\n z-index: calc(var(--z-offset-reverse) + ${Z_FIXED});\n }\n\n & ${p}-cell-fix {\n background: ${cssVar.colorBgContainer};\n\n &::after {\n ${fixShadowBase}\n }\n }\n\n & ${p}-cell-fix-start::after {\n inset-inline-start: 100%;\n }\n\n & ${p}-cell-fix-end::after {\n inset-inline-end: 100%;\n }\n\n & ${p}-cell-fix-start-shadow-show::after {\n ${startShadow}\n }\n\n & ${p}-cell-fix-end-shadow-show::after {\n ${endShadow}\n }\n\n /* ============================= Sticky ============================= */\n & ${p}-sticky-holder {\n position: sticky;\n z-index: calc(var(--columns-count, 1) * 2 + ${Z_FIXED} + 1);\n background: ${cssVar.colorBgContainer};\n }\n\n & ${p}-sticky-scroll {\n position: sticky;\n z-index: calc(var(--columns-count, 1) * 2 + ${Z_FIXED} + 1);\n inset-block-end: 0;\n\n display: flex;\n align-items: center;\n\n height: 8px !important;\n border-block-start: ${border};\n\n opacity: 0.65;\n background: ${cssVar.colorFillQuaternary};\n\n &-bar {\n position: absolute;\n inset-block-end: 0;\n\n height: 8px;\n border-radius: 100px;\n\n background-color: ${cssVar.colorFill};\n\n transition:\n all ${cssVar.motionDurationSlow},\n transform 0s;\n\n &:hover,\n &-active {\n background-color: ${cssVar.colorFillSecondary};\n }\n }\n }\n\n /* ============================ Selection =========================== */\n & ${p}-selection-col {\n width: ${SELECTION_COLUMN_WIDTH}px;\n\n &${p}-selection-col-with-dropdown {\n width: ${SELECTION_COLUMN_WIDTH + SELECTION_DROPDOWN_WIDTH}px;\n }\n }\n\n &${p}-outlined ${p}-selection-col {\n width: ${SELECTION_COLUMN_WIDTH + 16}px;\n\n &${p}-selection-col-with-dropdown {\n width: ${SELECTION_COLUMN_WIDTH + SELECTION_DROPDOWN_WIDTH + 16}px;\n }\n }\n\n & ${p}-tbody > tr${p}-row-selected > td {\n background: color-mix(in srgb, ${cssVar.colorBgContainer}, ${cssVar.colorPrimary} 6%);\n\n &${p}-cell-row-hover {\n background: color-mix(in srgb, ${cssVar.colorBgContainer}, ${cssVar.colorPrimary} 10%);\n }\n }\n\n /* ========================= Expand / Tree ========================== */\n & ${p}-expand-icon-col {\n width: ${EXPAND_COLUMN_WIDTH}px;\n }\n\n & ${p}-row-expand-icon-cell {\n text-align: center;\n\n & ${p}-row-expand-icon {\n float: none;\n display: inline-flex;\n vertical-align: sub;\n }\n }\n\n & ${p}-row-indent {\n float: inline-start;\n height: 1px;\n }\n\n & ${p}-row-expand-icon {\n float: inline-start;\n flex: none;\n vertical-align: middle;\n\n &${p}-row-expand-icon-spaced {\n display: inline-block;\n width: 24px;\n height: 24px;\n visibility: hidden;\n }\n }\n\n & ${p}-row-indent + ${p}-row-expand-icon {\n margin-block: -1px;\n margin-inline-end: 8px;\n }\n\n & tr${p}-expanded-row > td,\n & tr${p}-expanded-row:hover > td {\n background: ${cssVar.colorFillQuaternary};\n }\n\n & ${p}-expanded-row-fixed {\n position: relative;\n\n margin-block: calc(var(${PADDING_BLOCK}) * -1);\n margin-inline: calc(var(${PADDING_INLINE}) * -1);\n padding-block: var(${PADDING_BLOCK});\n padding-inline: var(${PADDING_INLINE});\n }\n\n /* ========================== Nested table ========================== */\n\n /* A table alone in a cell fills it, starting after the expand column. */\n &\n ${p}-tbody\n > tr\n > td\n > ${p}-wrapper:only-child,\n &\n ${p}-tbody\n > tr\n > td\n > ${p}-expanded-row-fixed\n > ${p}-wrapper:only-child {\n & ${p} {\n margin-block: calc(var(${PADDING_BLOCK}) * -1);\n margin-inline: calc(${EXPAND_COLUMN_WIDTH}px - var(${PADDING_INLINE}))\n calc(var(${PADDING_INLINE}) * -1);\n }\n\n & ${p}-tbody > tr:last-child > td {\n border-block-end: 0;\n }\n\n /* The outer cell already draws the frame: keep only the start edge of a bordered nest. */\n & ${p}${p}-outlined {\n & > ${p}-title, & > ${p}-container, & > ${p}-footer {\n border-block: 0;\n border-inline-end: 0;\n border-radius: 0;\n }\n\n & > ${p}-title + ${p}-container {\n border-block-start: ${border};\n }\n\n &:has(> ${p}-footer) > ${p}-container {\n border-block-end: ${border};\n }\n }\n }\n\n &${p}-outlined ${p}-tbody > tr > td > ${p}-expanded-row-fixed {\n margin-inline: calc((var(${PADDING_INLINE}) + 1px) * -1);\n }\n\n /* ============================= Summary ============================ */\n & ${p}-summary {\n position: relative;\n z-index: ${Z_FIXED};\n background: ${cssVar.colorBgContainer};\n\n & > tr > th,\n & > tr > td {\n border-block-end: ${border};\n }\n }\n\n & div${p}-summary {\n box-shadow: 0 -1px 0 ${cssVar.colorBorderSecondary};\n }\n\n /* A fixed summary under \\`sticky\\` is a sticky holder too; keep it sticky (antd orders sticky last). */\n & ${p}-summary${p}-sticky-holder {\n position: sticky;\n z-index: calc(var(--columns-count, 1) * 2 + ${Z_FIXED} + 1);\n }\n\n & tfoot > tr > th,\n & tfoot > tr > td {\n border-block-start: ${border};\n }\n\n /* ============================= Virtual ============================ */\n & ${p}-tbody-virtual {\n &\n ${p}-tbody-virtual-holder-inner\n > ${p}-row,\n &\n ${p}-tbody-virtual-holder-inner\n > div:not(${p}-row)\n > ${p}-row {\n display: flex;\n box-sizing: border-box;\n width: 100%;\n\n & > ${p}-cell {\n align-content: center;\n }\n }\n\n & ${p}-cell {\n border-block-end: ${border};\n background: ${cssVar.colorBgContainer};\n transition: background-color ${cssVar.motionDurationMid};\n }\n\n & ${p}-tbody-virtual-scrollbar {\n cursor: pointer;\n\n &:hover {\n background-color: ${cssVar.colorFillQuaternary};\n }\n }\n\n & ${p}-expanded-row ${p}-expanded-row-cell${p}-expanded-row-cell-fixed {\n position: sticky;\n inset-inline-start: 0;\n overflow: hidden;\n width: calc(var(--virtual-width) - 1px);\n }\n }\n `,\n };\n});\n"],"mappings":";;;AAGA,MAAa,aAAa;AAE1B,MAAM,IAAI,IAAI;AAId,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AAGvB,MAAM,UAAU;;AAUhB,MAAM,UAAU;CAAC;CAAW;CAAU;CAAQ;AAAS,CAAC,CACrD,KAAK,YAA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;;gBAMtC,EAAE,WAAW,EAAE;kCACG,OAAO;;;oBAGrB,EAAE,aAAa,EAAE;gCACL,OAAO;;;;;SAK9B,EAAE,YAAY,EAAE,qBAAqB,EAAE;mCACb,eAAe;;;;UAIxC,EAAE;;mBAEO,QAAQ;sBACL,OAAO,iBAAiB;;;;8BAIhB,OAAO;;;;aAIxB,EAAE;+BACgB,OAAO,qBAAqB;;;;UAIjD,EAAE,UAAU,EAAE;;sDAE8B,QAAQ;;;;;8BAKhC,OAAO;;;;UAI3B,EAAE;;YAEA,EAAE;cACA,EAAE;;YAEJ,EAAE;sBACQ,EAAE;cACV,EAAE;;;;;gBAKA,EAAE;;;;;YAKN,EAAE;8BACgB,OAAO;wBACb,OAAO,iBAAiB;yCACP,OAAO,kBAAkB;;;YAGtD,EAAE;;;;gCAIkB,OAAO,oBAAoB;;;;YAI/C,EAAE,gBAAgB,EAAE,oBAAoB,EAAE;;;;;;;;CAQpD;AACF,CAAC"}
|
|
@@ -1,68 +1,502 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TooltipProps } from "../Tooltip/type.mjs";
|
|
2
|
+
import { PopoverPlacement } from "../Popover/type.mjs";
|
|
3
|
+
import { PaginationProps, PaginationSemanticName } from "../Pagination/type.mjs";
|
|
4
|
+
import { SpinProps } from "../Spin/type.mjs";
|
|
5
|
+
import { CheckboxProps } from "../Checkbox/type.mjs";
|
|
6
|
+
import { AriaAttributes, CSSProperties, ComponentProps, HTMLAttributes, Key, MouseEvent, ReactNode, Ref, TdHTMLAttributes, ThHTMLAttributes, UIEventHandler } from "react";
|
|
7
|
+
import { ColumnType, Reference, RenderedCell, Summary, TableProps } from "@rc-component/table";
|
|
2
8
|
//#region src/base-ui/Table/type.d.ts
|
|
3
|
-
|
|
9
|
+
/** `null` (or `undefined`) means unsorted. */
|
|
10
|
+
type TableVariant = 'filled' | 'outlined' | 'borderless';
|
|
11
|
+
type SortOrder = 'ascend' | 'descend' | null;
|
|
12
|
+
/** The third argument is the order being applied; return the ascending comparison either way. */
|
|
13
|
+
type TableCompareFn<T> = (a: T, b: T, sortOrder?: SortOrder) => number;
|
|
14
|
+
/**
|
|
15
|
+
* `true` sorts on the server (row order is left alone), a function sorts locally, and
|
|
16
|
+
* `{ compare, multiple }` joins a multi-column sort where a higher `multiple` takes priority.
|
|
17
|
+
*/
|
|
18
|
+
type TableColumnSorter<T> = boolean | TableCompareFn<T> | {
|
|
19
|
+
compare?: TableCompareFn<T>;
|
|
20
|
+
multiple?: number;
|
|
21
|
+
};
|
|
22
|
+
/** Tooltip options for the sort trigger; `target` picks the whole header or just the icon. */
|
|
23
|
+
type TableSorterTooltipProps = Partial<Omit<TooltipProps, 'children'>> & {
|
|
24
|
+
/** @default 'full-header' */
|
|
25
|
+
target?: 'full-header' | 'sorter-icon';
|
|
26
|
+
};
|
|
4
27
|
type FilterValue = string | number | boolean;
|
|
5
|
-
|
|
6
|
-
|
|
28
|
+
/** A filter option; `children` nests options (a submenu, or tree nodes with `filterMode: 'tree'`). */
|
|
29
|
+
interface TableColumnFilterItem {
|
|
30
|
+
children?: TableColumnFilterItem[];
|
|
31
|
+
text: ReactNode;
|
|
32
|
+
value: FilterValue;
|
|
33
|
+
}
|
|
34
|
+
/** Argument of a function `filterDropdown`; mirrors antd `FilterDropdownProps`. */
|
|
35
|
+
interface TableFilterDropdownProps {
|
|
36
|
+
/** Drops the panel's draft selection and applies `selectedKeys`. */
|
|
37
|
+
clearFilters?: (params?: {
|
|
38
|
+
closeDropdown?: boolean;
|
|
39
|
+
confirm?: boolean;
|
|
40
|
+
}) => void;
|
|
41
|
+
close: () => void;
|
|
42
|
+
/** Applies `selectedKeys`; closes the panel unless `closeDropdown` is `false`. */
|
|
43
|
+
confirm: (params?: {
|
|
44
|
+
closeDropdown?: boolean;
|
|
45
|
+
}) => void;
|
|
46
|
+
filters?: TableColumnFilterItem[];
|
|
47
|
+
/** Class prefix for custom panels (kept for antd parity). */
|
|
48
|
+
prefixCls: string;
|
|
49
|
+
/** Draft selection, applied by `confirm`. */
|
|
50
|
+
selectedKeys: Key[];
|
|
51
|
+
setSelectedKeys: (selectedKeys: Key[]) => void;
|
|
52
|
+
visible: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** Options of the filter popup (antd `filterDropdownProps`, a subset of `DropdownProps`). */
|
|
55
|
+
interface TableFilterDropdownPopupProps {
|
|
7
56
|
className?: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
57
|
+
/** @deprecated use `popupRender` */
|
|
58
|
+
dropdownRender?: (menu: ReactNode) => ReactNode;
|
|
59
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
60
|
+
onOpenChange?: (open: boolean) => void;
|
|
61
|
+
/** Controlled open state. */
|
|
62
|
+
open?: boolean;
|
|
63
|
+
/** @default 'bottomRight' */
|
|
64
|
+
placement?: PopoverPlacement;
|
|
65
|
+
/** Wraps the panel content. */
|
|
66
|
+
popupRender?: (menu: ReactNode) => ReactNode;
|
|
67
|
+
rootClassName?: string;
|
|
68
|
+
style?: CSSProperties;
|
|
69
|
+
zIndex?: number;
|
|
70
|
+
}
|
|
71
|
+
/** antd / Grid breakpoints, from widest to narrowest. */
|
|
72
|
+
type TableBreakpoint = 'xxxl' | 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
73
|
+
/** `true` and `'left'` pin to the start edge, `'right'` to the end edge. */
|
|
74
|
+
type TableColumnFixed = boolean | 'start' | 'end' | 'left' | 'right';
|
|
75
|
+
type TableColumnEllipsis = boolean | {
|
|
76
|
+
showTitle?: boolean;
|
|
77
|
+
};
|
|
78
|
+
/** Arguments of a function `title`; mirrors antd `ColumnTitleProps`. */
|
|
79
|
+
interface TableColumnTitleProps<T> {
|
|
80
|
+
filters?: TableFilters;
|
|
81
|
+
/** @deprecated use `sortColumns` */
|
|
82
|
+
sortColumn?: TableColumn<T>;
|
|
83
|
+
sortColumns?: {
|
|
84
|
+
column: TableColumn<T>;
|
|
85
|
+
order?: SortOrder;
|
|
14
86
|
}[];
|
|
15
|
-
|
|
87
|
+
/** @deprecated use `sortColumns` */
|
|
88
|
+
sortOrder?: SortOrder;
|
|
89
|
+
}
|
|
90
|
+
type TableColumnTitle<T> = ReactNode | ((props: TableColumnTitleProps<T>) => ReactNode);
|
|
91
|
+
/** `render` may return a cell with `props.colSpan` / `props.rowSpan` (0 skips the cell). */
|
|
92
|
+
type TableRenderedCell<T> = RenderedCell<T>;
|
|
93
|
+
type TableCellAttributes = TdHTMLAttributes<HTMLTableCellElement> & Record<`data-${string}`, unknown>;
|
|
94
|
+
type TableHeaderCellAttributes = ThHTMLAttributes<HTMLTableCellElement> & Record<`data-${string}`, unknown>;
|
|
95
|
+
interface TableColumnType<T> {
|
|
96
|
+
/** `start` / `end` follow the writing direction. */
|
|
97
|
+
align?: ColumnType<T>['align'];
|
|
98
|
+
className?: string;
|
|
99
|
+
/** Header colSpan; `0` hides the header cell. */
|
|
100
|
+
colSpan?: number;
|
|
101
|
+
/** A key of the record, or a path into nested records such as `['address', 'city']`. */
|
|
102
|
+
dataIndex?: NoInfer<ColumnType<T>['dataIndex']>;
|
|
103
|
+
/** Initial filter of an uncontrolled column. */
|
|
104
|
+
defaultFilteredValue?: FilterValue[] | null;
|
|
105
|
+
/** Initial sort; several columns may set it when their sorters use `multiple`. */
|
|
106
|
+
defaultSortOrder?: SortOrder;
|
|
107
|
+
/** Truncate overflowing cells (and the header). `showTitle: false` drops the native tooltip. */
|
|
108
|
+
ellipsis?: TableColumnEllipsis;
|
|
109
|
+
/** Replaces the filter panel; a function receives the panel state and actions. */
|
|
110
|
+
filterDropdown?: ReactNode | ((props: TableFilterDropdownProps) => ReactNode);
|
|
111
|
+
/** @deprecated use `filterDropdownProps.open` */
|
|
112
|
+
filterDropdownOpen?: boolean;
|
|
113
|
+
/** Options of the filter popup, such as a controlled `open` / `onOpenChange`. */
|
|
114
|
+
filterDropdownProps?: TableFilterDropdownPopupProps;
|
|
115
|
+
/** Forces the filter icon's active state. */
|
|
116
|
+
filtered?: boolean;
|
|
117
|
+
/** Controlled filter; setting it on any column controls every column's filter. */
|
|
118
|
+
filteredValue?: FilterValue[] | null;
|
|
119
|
+
filterIcon?: ReactNode | ((filtered: boolean) => ReactNode);
|
|
120
|
+
/** `tree` renders `filters` (and their `children`) as a checkable tree. @default 'menu' */
|
|
121
|
+
filterMode?: 'menu' | 'tree';
|
|
122
|
+
/** `false` picks a single value (radio). @default true */
|
|
123
|
+
filterMultiple?: boolean;
|
|
124
|
+
/** Apply the draft selection when the panel closes without OK. @default true */
|
|
125
|
+
filterOnClose?: boolean;
|
|
126
|
+
/** Reset returns to `defaultFilteredValue` instead of clearing. */
|
|
127
|
+
filterResetToDefaultFilteredValue?: boolean;
|
|
128
|
+
filters?: TableColumnFilterItem[];
|
|
129
|
+
/** Search box above the options; a function decides whether an option matches the input. */
|
|
130
|
+
filterSearch?: boolean | ((input: string, item: TableColumnFilterItem) => boolean);
|
|
131
|
+
fixed?: TableColumnFixed;
|
|
132
|
+
/** Remove the column without unmounting the table's sort / filter state. */
|
|
133
|
+
hidden?: boolean;
|
|
16
134
|
key?: Key;
|
|
17
|
-
|
|
135
|
+
/** Minimum width when `tableLayout` is `auto`. */
|
|
136
|
+
minWidth?: number;
|
|
137
|
+
/** `colSpan` / `rowSpan` of `0` skip the cell. */
|
|
138
|
+
onCell?: (record: T, index: number) => TableCellAttributes;
|
|
18
139
|
onFilter?: (value: FilterValue, record: T) => boolean;
|
|
19
|
-
|
|
140
|
+
/** @deprecated use `filterDropdownProps.onOpenChange` */
|
|
141
|
+
onFilterDropdownOpenChange?: (open: boolean) => void;
|
|
142
|
+
onHeaderCell?: (column: TableColumn<T>) => TableHeaderCellAttributes;
|
|
143
|
+
render?: (value: any, record: T, index: number) => ReactNode | TableRenderedCell<T>;
|
|
144
|
+
/** Only show the column at these breakpoints. */
|
|
145
|
+
responsive?: TableBreakpoint[];
|
|
146
|
+
/** Render the cells as `<th scope>` row headers. */
|
|
147
|
+
rowScope?: 'row' | 'rowgroup';
|
|
148
|
+
/** Return `false` to skip re-rendering a cell when its record changes. */
|
|
149
|
+
shouldCellUpdate?: (record: T, prevRecord: T) => boolean;
|
|
150
|
+
/** Overrides the table-level `showSorterTooltip`. */
|
|
151
|
+
showSorterTooltip?: boolean | TableSorterTooltipProps;
|
|
152
|
+
/** Orders a header click cycles through before returning to unsorted. Overrides the table's. */
|
|
20
153
|
sortDirections?: SortOrder[];
|
|
21
|
-
sorter?:
|
|
22
|
-
|
|
154
|
+
sorter?: TableColumnSorter<T>;
|
|
155
|
+
/** Replaces the default sort carets. */
|
|
156
|
+
sortIcon?: (props: {
|
|
157
|
+
sortOrder: SortOrder;
|
|
158
|
+
}) => ReactNode;
|
|
159
|
+
/** Controlled sort order; `null` is unsorted. Setting it on any column controls the whole sort. */
|
|
160
|
+
sortOrder?: SortOrder;
|
|
161
|
+
title?: TableColumnTitle<T>;
|
|
23
162
|
width?: number | string;
|
|
24
163
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
164
|
+
/** A header group: renders `title` above its `children` columns. */
|
|
165
|
+
interface TableColumnGroupType<T> extends Omit<TableColumnType<T>, 'dataIndex'> {
|
|
166
|
+
children: TableColumnsType<T>;
|
|
167
|
+
}
|
|
168
|
+
type TableColumn<T> = TableColumnGroupType<T> | TableColumnType<T>;
|
|
169
|
+
type TableColumnsType<T> = TableColumn<T>[];
|
|
170
|
+
/** `indent` is the tree depth of the row (`0` for top-level records). */
|
|
171
|
+
type TableRowClassName<T> = (record: T, index: number, indent: number) => string;
|
|
172
|
+
type TableExpandedRowRender<T> = (record: T, index: number, indent: number, expanded: boolean) => ReactNode;
|
|
173
|
+
/** Argument of `expandable.expandIcon`; mirrors antd / rc-table `RenderExpandIconProps`. */
|
|
174
|
+
interface TableExpandIconProps<T> {
|
|
175
|
+
/** `false` for rows that cannot expand (`rowExpandable`, or tree leaves); render a spacer. */
|
|
176
|
+
expandable: boolean;
|
|
177
|
+
expanded: boolean;
|
|
178
|
+
onExpand: (record: T, event: MouseEvent<HTMLElement>) => void;
|
|
179
|
+
prefixCls: string;
|
|
180
|
+
record: T;
|
|
181
|
+
}
|
|
182
|
+
/** Expandable rows and tree data; mirrors antd `ExpandableConfig`. */
|
|
183
|
+
interface TableExpandableConfig<T> {
|
|
184
|
+
/** Field holding a record's tree children. @default 'children' */
|
|
185
|
+
childrenColumnName?: string;
|
|
186
|
+
/** Header of the expand column. */
|
|
187
|
+
columnTitle?: ReactNode;
|
|
188
|
+
/** Width of the expand column. @default 48 */
|
|
189
|
+
columnWidth?: number | string;
|
|
190
|
+
/** Expand every row (tree rows included) on mount. */
|
|
191
|
+
defaultExpandAllRows?: boolean;
|
|
192
|
+
/** Initially expanded row keys (uncontrolled). */
|
|
193
|
+
defaultExpandedRowKeys?: readonly Key[];
|
|
194
|
+
expandedRowClassName?: string | TableRowClassName<T>;
|
|
195
|
+
/** Controlled expanded row keys. */
|
|
196
|
+
expandedRowKeys?: readonly Key[];
|
|
197
|
+
/** @deprecated use `Table.EXPAND_COLUMN` in `columns` */
|
|
198
|
+
expandedRowOffset?: number;
|
|
199
|
+
/** Content of the row expanded under a record. */
|
|
200
|
+
expandedRowRender?: TableExpandedRowRender<T>;
|
|
201
|
+
expandIcon?: (props: TableExpandIconProps<T>) => ReactNode;
|
|
202
|
+
/** @deprecated use `Table.EXPAND_COLUMN` in `columns` */
|
|
203
|
+
expandIconColumnIndex?: number;
|
|
204
|
+
/** Toggle a row by clicking anywhere on it. */
|
|
205
|
+
expandRowByClick?: boolean;
|
|
206
|
+
/** Pin the expand column. */
|
|
207
|
+
fixed?: TableColumnFixed;
|
|
208
|
+
/** Render collapsed expanded rows too (hidden). */
|
|
209
|
+
forceRender?: boolean;
|
|
210
|
+
/** Indent in px per tree level. @default 15 */
|
|
211
|
+
indentSize?: number;
|
|
212
|
+
onExpand?: (expanded: boolean, record: T) => void;
|
|
213
|
+
onExpandedRowsChange?: (expandedKeys: readonly Key[]) => void;
|
|
214
|
+
/** Return `false` to hide a record's expand icon. */
|
|
215
|
+
rowExpandable?: (record: T) => boolean;
|
|
216
|
+
/** @default true */
|
|
217
|
+
showExpandColumn?: boolean;
|
|
218
|
+
}
|
|
219
|
+
type TableRowSelectionType = 'checkbox' | 'radio';
|
|
220
|
+
/** `info.type` of `rowSelection.onChange`: what changed the selection. */
|
|
221
|
+
type TableRowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple';
|
|
222
|
+
/** Props a row's (or the header's) selection box takes; `checked` follows `selectedRowKeys`. */
|
|
223
|
+
type TableRowSelectionCheckboxProps = Partial<Omit<CheckboxProps, 'checked' | 'defaultChecked'>> & AriaAttributes;
|
|
224
|
+
/** A custom entry of the `selections` dropdown. */
|
|
225
|
+
interface TableSelectionItem {
|
|
226
|
+
key: string;
|
|
227
|
+
/** Receives the keys of every selectable row on the current page. */
|
|
228
|
+
onSelect?: (changeableRowKeys: Key[]) => void;
|
|
229
|
+
text: ReactNode;
|
|
230
|
+
}
|
|
231
|
+
/** `Table.SELECTION_ALL` / `SELECTION_INVERT` / `SELECTION_NONE`. */
|
|
232
|
+
type TableSelectionPreset = 'SELECT_ALL' | 'SELECT_INVERT' | 'SELECT_NONE';
|
|
233
|
+
/** Row selection; mirrors antd `TableRowSelection`. */
|
|
234
|
+
interface TableRowSelection<T> {
|
|
235
|
+
/** Alignment of the selection column. */
|
|
236
|
+
align?: 'left' | 'center' | 'right';
|
|
237
|
+
/** `false` links tree parents and children (checking a parent checks its descendants). @default true */
|
|
238
|
+
checkStrictly?: boolean;
|
|
239
|
+
/** Replaces the header; a function receives the default select-all checkbox. */
|
|
240
|
+
columnTitle?: ReactNode | ((checkboxNode: ReactNode) => ReactNode);
|
|
241
|
+
/** @default 32 */
|
|
242
|
+
columnWidth?: number | string;
|
|
243
|
+
defaultSelectedRowKeys?: Key[];
|
|
244
|
+
/** Pin the selection column; defaults to the `fixed` of its neighbour column. */
|
|
245
|
+
fixed?: TableColumnFixed;
|
|
246
|
+
/** Per-row checkbox props, such as `disabled` or `name`. */
|
|
247
|
+
getCheckboxProps?: (record: T) => TableRowSelectionCheckboxProps;
|
|
248
|
+
/** Props of the header select-all checkbox. */
|
|
249
|
+
getTitleCheckboxProps?: () => TableRowSelectionCheckboxProps;
|
|
250
|
+
/** Hide the select-all checkbox and the `selections` dropdown. */
|
|
251
|
+
hideSelectAll?: boolean;
|
|
252
|
+
onCell?: (record: T, index: number) => TableCellAttributes;
|
|
253
|
+
onChange?: (selectedRowKeys: Key[], selectedRows: T[], info: {
|
|
254
|
+
type: TableRowSelectMethod;
|
|
255
|
+
}) => void;
|
|
256
|
+
/** A single row was (de)selected. */
|
|
257
|
+
onSelect?: (record: T, selected: boolean, selectedRows: T[], nativeEvent: Event) => void;
|
|
258
|
+
/** @deprecated use `onChange` */
|
|
259
|
+
onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
|
|
260
|
+
/** @deprecated use `onChange` */
|
|
261
|
+
onSelectInvert?: (selectedRowKeys: Key[]) => void;
|
|
262
|
+
/** @deprecated use `onChange` (Shift-click range selection, `info.type === 'multiple'`) */
|
|
263
|
+
onSelectMultiple?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
|
|
264
|
+
/** @deprecated use `onChange` */
|
|
265
|
+
onSelectNone?: () => void;
|
|
266
|
+
/** Keep selected keys whose records left `dataSource` (server paging). */
|
|
267
|
+
preserveSelectedRowKeys?: boolean;
|
|
268
|
+
/** Wrap or replace a row's selection box; may return `{ children, props }` to span cells. */
|
|
269
|
+
renderCell?: (value: boolean, record: T, index: number, originNode: ReactNode) => ReactNode | TableRenderedCell<T>;
|
|
270
|
+
/** Controlled selected keys. */
|
|
271
|
+
selectedRowKeys?: Key[];
|
|
272
|
+
/** Dropdown beside the select-all checkbox; `true` gives all / invert / none. */
|
|
273
|
+
selections?: (TableSelectionItem | TableSelectionPreset)[] | boolean;
|
|
274
|
+
/** @default 'checkbox' */
|
|
275
|
+
type?: TableRowSelectionType;
|
|
276
|
+
}
|
|
277
|
+
type TablePaginationPlacement = 'topStart' | 'topCenter' | 'topEnd' | 'bottomStart' | 'bottomCenter' | 'bottomEnd' | 'none';
|
|
278
|
+
/** @deprecated use `TablePaginationPlacement` */
|
|
279
|
+
type TablePaginationPosition = 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight' | 'none';
|
|
280
|
+
/** antd `TablePaginationConfig`: `base-ui/Pagination` props plus where to place the pager. */
|
|
281
|
+
interface TablePaginationConfig extends Omit<PaginationProps, 'onChange' | 'onPageSizeChange' | 'ref' | 'total'> {
|
|
29
282
|
onChange?: (page: number, pageSize: number) => void;
|
|
30
283
|
onShowSizeChange?: (current: number, size: number) => void;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
284
|
+
/** Pager positions; one top and/or one bottom entry. @default ['bottomEnd'] */
|
|
285
|
+
placement?: TablePaginationPlacement[];
|
|
286
|
+
/** @deprecated use `placement` */
|
|
287
|
+
position?: TablePaginationPosition[];
|
|
288
|
+
/** Server-side total; omitted means the (filtered) `dataSource` length. */
|
|
34
289
|
total?: number;
|
|
35
290
|
}
|
|
291
|
+
/** The fourth `onChange` argument. */
|
|
292
|
+
interface TableCurrentDataSource<T> {
|
|
293
|
+
action: 'paginate' | 'sort' | 'filter';
|
|
294
|
+
/** Every record after filtering and sorting (not just the current page). */
|
|
295
|
+
currentDataSource: T[];
|
|
296
|
+
}
|
|
36
297
|
interface TableSorterResult<T> {
|
|
37
298
|
column?: TableColumn<T>;
|
|
38
299
|
columnKey?: Key;
|
|
300
|
+
/** The column's `dataIndex`. */
|
|
301
|
+
field?: Key | readonly Key[];
|
|
39
302
|
order?: SortOrder;
|
|
40
303
|
}
|
|
41
304
|
type TableFilters = Record<string, FilterValue[] | null>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
305
|
+
/** Parts of the header / body sections: `wrapper` is the `thead` / `tbody`, then `row` (tr) and `cell` (th / td). */
|
|
306
|
+
type TableComponentsSemanticName = 'cell' | 'row' | 'wrapper';
|
|
307
|
+
/** Top-level keys of the semantic `classNames` / `styles` (antd 6 Semantic DOM). */
|
|
308
|
+
type TableSemanticName = 'body' | 'content' | 'footer' | 'header' | 'pagination' | 'root' | 'section' | 'title';
|
|
309
|
+
/** Flat keys from before the antd 6 structure; still accepted. */
|
|
310
|
+
type TableLegacySemanticName = 'body' | 'cell' | 'header' | 'row' | 'wrapper';
|
|
311
|
+
/**
|
|
312
|
+
* antd 6 Semantic DOM class names. `root` is the outer div, `section` the table container,
|
|
313
|
+
* `content` the scroll box, `title` / `footer` the title and footer bars.
|
|
314
|
+
*/
|
|
315
|
+
interface TableClassNames {
|
|
316
|
+
/** A string is the legacy flat key: the `tbody` (`body.wrapper`). */
|
|
317
|
+
body?: string | Partial<Record<TableComponentsSemanticName, string>>;
|
|
318
|
+
/** @deprecated use `body.cell` */
|
|
319
|
+
cell?: string;
|
|
320
|
+
content?: string;
|
|
321
|
+
footer?: string;
|
|
322
|
+
/** A string is the legacy flat key: every header cell (`header.cell`). */
|
|
323
|
+
header?: string | Partial<Record<TableComponentsSemanticName, string>>;
|
|
324
|
+
pagination?: Partial<Record<PaginationSemanticName, string>>;
|
|
325
|
+
root?: string;
|
|
326
|
+
/** @deprecated use `body.row` */
|
|
327
|
+
row?: string;
|
|
328
|
+
section?: string;
|
|
329
|
+
title?: string;
|
|
330
|
+
/** @deprecated use `section` */
|
|
331
|
+
wrapper?: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* antd 6 Semantic DOM styles, keyed like `TableClassNames`. A `header` / `body` object without
|
|
335
|
+
* `wrapper` / `row` / `cell` keys is the legacy flat style (`header.cell` / `body.wrapper`).
|
|
336
|
+
*/
|
|
337
|
+
interface TableStyles {
|
|
338
|
+
body?: CSSProperties | Partial<Record<TableComponentsSemanticName, CSSProperties>>;
|
|
339
|
+
/** @deprecated use `body.cell` */
|
|
340
|
+
cell?: CSSProperties;
|
|
341
|
+
content?: CSSProperties;
|
|
342
|
+
footer?: CSSProperties;
|
|
343
|
+
header?: CSSProperties | Partial<Record<TableComponentsSemanticName, CSSProperties>>;
|
|
344
|
+
pagination?: Partial<Record<PaginationSemanticName, CSSProperties>>;
|
|
345
|
+
root?: CSSProperties;
|
|
346
|
+
/** @deprecated use `body.row` */
|
|
347
|
+
row?: CSSProperties;
|
|
348
|
+
section?: CSSProperties;
|
|
349
|
+
title?: CSSProperties;
|
|
350
|
+
/** @deprecated use `section` */
|
|
351
|
+
wrapper?: CSSProperties;
|
|
352
|
+
}
|
|
353
|
+
/** antd `classNames` / `styles` function form: computed from the table's props. */
|
|
354
|
+
type TableSemanticInfo<T> = {
|
|
355
|
+
props: TableProps$1<T>;
|
|
356
|
+
};
|
|
357
|
+
/** antd `TableLocale`. Unset fields fall back to the `table.*` texts of `@lobehub/ui/i18n`. */
|
|
358
|
+
interface TableLocale {
|
|
359
|
+
cancelSort?: string;
|
|
360
|
+
collapse?: string;
|
|
361
|
+
/** Rendered instead of the default empty state; a function is called on render. */
|
|
362
|
+
emptyText?: ReactNode | (() => ReactNode);
|
|
363
|
+
expand?: string;
|
|
364
|
+
filterCheckAll?: ReactNode;
|
|
365
|
+
/** @deprecated use `filterCheckAll` */
|
|
366
|
+
filterCheckall?: ReactNode;
|
|
367
|
+
filterConfirm?: ReactNode;
|
|
368
|
+
filterEmptyText?: ReactNode;
|
|
369
|
+
filterReset?: ReactNode;
|
|
370
|
+
filterSearchPlaceholder?: string;
|
|
371
|
+
filterTitle?: string;
|
|
372
|
+
/** Accessible label of the header select-all checkbox. */
|
|
373
|
+
selectAll?: ReactNode;
|
|
374
|
+
/** Text of the `Table.SELECTION_INVERT` preset. */
|
|
375
|
+
selectInvert?: ReactNode;
|
|
376
|
+
/** Text of the `Table.SELECTION_ALL` preset. */
|
|
377
|
+
selectionAll?: ReactNode;
|
|
378
|
+
/** Text of the `Table.SELECTION_NONE` preset. */
|
|
379
|
+
selectNone?: ReactNode;
|
|
380
|
+
/** Native `title` of the sorter when `showSorterTooltip` is off. */
|
|
381
|
+
sortTitle?: string;
|
|
382
|
+
triggerAsc?: string;
|
|
383
|
+
triggerDesc?: string;
|
|
384
|
+
}
|
|
385
|
+
/** `middle` is kept as an alias of `medium` (antd v5 naming). */
|
|
386
|
+
type TableSize = 'large' | 'medium' | 'middle' | 'small';
|
|
387
|
+
/** Spin options for the loading overlay; `spinning` defaults to `true` when an object is passed. */
|
|
388
|
+
type TableLoadingConfig = Omit<SpinProps, 'children' | 'ref'>;
|
|
389
|
+
/** Override the rendered table, header and body elements (antd `components`). */
|
|
390
|
+
type TableComponents<T> = NonNullable<TableProps<T>['components']>;
|
|
391
|
+
/** `index` / `key` scroll a row into view (`align`, then `offset` px); `top` scrolls to a pixel offset. */
|
|
392
|
+
type TableScrollToConfig = Parameters<Reference['scrollTo']>[0];
|
|
393
|
+
/**
|
|
394
|
+
* Page-level sticky header (and horizontal scrollbar).
|
|
395
|
+
* `offsetHeader` / `offsetSummary` / `offsetScroll` are the distances from the container's top /
|
|
396
|
+
* bottom edges; `getContainer` is the scroll container. @default window
|
|
397
|
+
*/
|
|
398
|
+
interface TableSticky {
|
|
399
|
+
getContainer?: () => Window | HTMLElement;
|
|
400
|
+
offsetHeader?: number;
|
|
401
|
+
offsetScroll?: number;
|
|
402
|
+
offsetSummary?: number;
|
|
403
|
+
}
|
|
404
|
+
/** `fixed`: `true` / `'bottom'` pins the summary under a scrolling body, `'top'` above it. */
|
|
405
|
+
type TableSummaryProps = ComponentProps<typeof Summary>;
|
|
406
|
+
type TableSummaryRowProps = ComponentProps<typeof Summary.Row>;
|
|
407
|
+
/** `index` is the start column; `colSpan` / `rowSpan` / `align` as on a `td`. */
|
|
408
|
+
type TableSummaryCellProps = ComponentProps<typeof Summary.Cell>;
|
|
409
|
+
/** antd `Table` ref: the root element, plus `nativeElement` and a body `scrollTo`. */
|
|
410
|
+
type TableRef = HTMLDivElement & {
|
|
411
|
+
nativeElement: HTMLDivElement;
|
|
412
|
+
scrollTo: (config: TableScrollToConfig) => void;
|
|
413
|
+
};
|
|
414
|
+
interface TableProps$1<T> {
|
|
415
|
+
/** `Table.Column` / `Table.ColumnGroup` elements, used when `columns` is not set. */
|
|
416
|
+
children?: ReactNode;
|
|
417
|
+
/** @deprecated use `expandable.childrenColumnName` */
|
|
418
|
+
childrenColumnName?: string;
|
|
45
419
|
className?: string;
|
|
46
|
-
|
|
47
|
-
|
|
420
|
+
/** Semantic class names (antd 6 structure, or the legacy flat keys); a function gets `{ props }`. */
|
|
421
|
+
classNames?: TableClassNames | ((info: TableSemanticInfo<T>) => TableClassNames);
|
|
422
|
+
/** Defaults merged into every column (and group); a column's own fields win. */
|
|
423
|
+
column?: Partial<TableColumnType<T>>;
|
|
424
|
+
columns?: TableColumnsType<T>;
|
|
425
|
+
components?: TableComponents<T>;
|
|
48
426
|
dataSource?: T[];
|
|
49
|
-
emptyText
|
|
50
|
-
|
|
51
|
-
|
|
427
|
+
/** Alias of `locale.emptyText` (which wins when both are set). */
|
|
428
|
+
emptyText?: ReactNode | (() => ReactNode);
|
|
429
|
+
/** Expandable rows (`expandedRowRender`) and tree data (`childrenColumnName`). */
|
|
430
|
+
expandable?: TableExpandableConfig<T>;
|
|
431
|
+
/** @deprecated use `expandable.expandedRowRender` */
|
|
432
|
+
expandedRowRender?: TableExpandedRowRender<T>;
|
|
433
|
+
/** @deprecated use `expandable.expandIcon` */
|
|
434
|
+
expandIcon?: TableExpandableConfig<T>['expandIcon'];
|
|
435
|
+
/** @deprecated use `Table.EXPAND_COLUMN` in `columns` */
|
|
436
|
+
expandIconColumnIndex?: number;
|
|
437
|
+
footer?: (currentPageData: readonly T[]) => ReactNode;
|
|
438
|
+
/** Container of the filter popups. */
|
|
439
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
440
|
+
/** @deprecated use `expandable.indentSize` */
|
|
441
|
+
indentSize?: number;
|
|
442
|
+
loading?: boolean | TableLoadingConfig;
|
|
443
|
+
/** Texts of the table; unset fields use the `table.*` i18n texts (English by default). */
|
|
444
|
+
locale?: TableLocale;
|
|
445
|
+
/** Wrap the hidden row rc-table uses to measure column widths (debug / custom layouts). */
|
|
446
|
+
measureRowRender?: (measureRow: ReactNode) => ReactNode;
|
|
447
|
+
onChange?: (pagination: TablePaginationConfig, filters: TableFilters,
|
|
448
|
+
/** An array when more than one `multiple` sorter is active. */
|
|
449
|
+
sorter: TableSorterResult<T> | TableSorterResult<T>[], extra: TableCurrentDataSource<T>) => void;
|
|
450
|
+
onHeaderRow?: (columns: readonly ColumnType<T>[], index?: number) => HTMLAttributes<HTMLTableRowElement>;
|
|
52
451
|
onRow?: (record: T, index: number) => HTMLAttributes<HTMLTableRowElement>;
|
|
452
|
+
onScroll?: UIEventHandler<HTMLDivElement>;
|
|
53
453
|
pagination?: false | TablePaginationConfig;
|
|
54
|
-
ref?: Ref<HTMLDivElement>;
|
|
55
|
-
|
|
56
|
-
|
|
454
|
+
ref?: Ref<HTMLDivElement> | Ref<TableRef>;
|
|
455
|
+
/** Extra class on the root element, like `className`. */
|
|
456
|
+
rootClassName?: string;
|
|
457
|
+
/** A function also receives the row's tree depth (`indent`). */
|
|
458
|
+
rowClassName?: string | TableRowClassName<T>;
|
|
459
|
+
/** Highlight the hovered row. @default true */
|
|
460
|
+
rowHoverable?: boolean;
|
|
461
|
+
/** @default 'key' */
|
|
462
|
+
rowKey?: string | keyof T | ((record: T, index?: number) => Key);
|
|
463
|
+
/** Checkbox / radio row selection; see `TableRowSelection`. */
|
|
464
|
+
rowSelection?: TableRowSelection<T>;
|
|
465
|
+
/**
|
|
466
|
+
* `x: true` lets the table grow with its content; `y` splits the header from a scrolling body.
|
|
467
|
+
* `scrollToFirstRowOnChange` (default on) scrolls the body back to the top on paginate / sort / filter.
|
|
468
|
+
*/
|
|
57
469
|
scroll?: {
|
|
58
|
-
|
|
470
|
+
scrollToFirstRowOnChange?: boolean;
|
|
471
|
+
x?: number | string | true;
|
|
59
472
|
y?: number | string;
|
|
60
473
|
};
|
|
61
|
-
|
|
474
|
+
/** @default true */
|
|
475
|
+
showHeader?: boolean;
|
|
476
|
+
/** Tooltip on sortable headers telling what the next click does. @default { target: 'full-header' } */
|
|
477
|
+
showSorterTooltip?: boolean | TableSorterTooltipProps;
|
|
478
|
+
/** @default 'middle' */
|
|
479
|
+
size?: TableSize;
|
|
480
|
+
/** Default `sortDirections` of every column. @default ['ascend', 'descend'] */
|
|
481
|
+
sortDirections?: SortOrder[];
|
|
482
|
+
/** Stick the header (and the horizontal scrollbar) to the page while it scrolls. */
|
|
483
|
+
sticky?: boolean | TableSticky;
|
|
62
484
|
style?: CSSProperties;
|
|
63
|
-
styles
|
|
485
|
+
/** Semantic styles, keyed like `classNames`; a function gets `{ props }`. */
|
|
486
|
+
styles?: TableStyles | ((info: TableSemanticInfo<T>) => TableStyles);
|
|
487
|
+
/** Summary rows built from `Table.Summary`; receives the current page's rows. */
|
|
488
|
+
summary?: (currentPageData: readonly T[]) => ReactNode;
|
|
489
|
+
/** Defaults to `fixed` with fixed columns, a fixed header (`scroll.y`) or `ellipsis` columns. */
|
|
64
490
|
tableLayout?: 'auto' | 'fixed';
|
|
491
|
+
title?: (currentPageData: readonly T[]) => ReactNode;
|
|
492
|
+
/**
|
|
493
|
+
* Visual style: `borderless` (default) has no cell grid; `outlined` draws cell borders
|
|
494
|
+
* like antd `bordered`; `filled` uses a fill background without the grid.
|
|
495
|
+
*/
|
|
496
|
+
variant?: TableVariant;
|
|
497
|
+
/** Virtual scrolling (rc-virtual-list); needs numeric `scroll.y`, and numeric `scroll.x` with fixed columns. */
|
|
498
|
+
virtual?: boolean;
|
|
65
499
|
}
|
|
66
500
|
//#endregion
|
|
67
|
-
export { FilterValue, SortOrder, TableColumn, TableFilters, TablePaginationConfig, TableProps, TableSemanticName, TableSorterResult };
|
|
501
|
+
export { FilterValue, SortOrder, TableBreakpoint, TableCellAttributes, TableClassNames, TableColumn, TableColumnEllipsis, TableColumnFilterItem, TableColumnFixed, TableColumnGroupType, TableColumnSorter, TableColumnTitle, TableColumnTitleProps, TableColumnType, TableColumnsType, TableCompareFn, TableComponents, TableComponentsSemanticName, TableCurrentDataSource, TableExpandIconProps, TableExpandableConfig, TableExpandedRowRender, TableFilterDropdownPopupProps, TableFilterDropdownProps, TableFilters, TableHeaderCellAttributes, TableLegacySemanticName, TableLoadingConfig, TableLocale, TablePaginationConfig, TablePaginationPlacement, TablePaginationPosition, TableProps$1 as TableProps, TableRef, TableRenderedCell, TableRowClassName, TableRowSelectMethod, TableRowSelection, TableRowSelectionCheckboxProps, TableRowSelectionType, TableScrollToConfig, TableSelectionItem, TableSelectionPreset, TableSemanticInfo, TableSemanticName, TableSize, TableSorterResult, TableSorterTooltipProps, TableSticky, TableStyles, TableSummaryCellProps, TableSummaryProps, TableSummaryRowProps, TableVariant };
|
|
68
502
|
//# sourceMappingURL=type.d.mts.map
|