@redis-ui/table 2.4.0 → 2.18.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/dist/Table/Table.cjs +85 -136
- package/dist/Table/Table.context.cjs +16 -1
- package/dist/Table/Table.context.d.ts +22 -4
- package/dist/Table/Table.context.js +16 -1
- package/dist/Table/Table.d.ts +83 -3
- package/dist/Table/Table.js +86 -137
- package/dist/Table/Table.style.cjs +33 -17
- package/dist/Table/Table.style.d.ts +5 -2
- package/dist/Table/Table.style.js +34 -18
- package/dist/Table/Table.types.d.ts +21 -22
- package/dist/Table/components/Compose/Compose.cjs +42 -0
- package/dist/Table/components/Compose/Compose.d.ts +13 -0
- package/dist/Table/components/Compose/Compose.js +42 -0
- package/dist/Table/components/EmptyState/EmptyState.cjs +31 -0
- package/dist/Table/components/EmptyState/EmptyState.d.ts +6 -0
- package/dist/Table/components/EmptyState/EmptyState.js +31 -0
- package/dist/Table/components/ExpandRowButton/ExpandRowButton.cjs +1 -0
- package/dist/Table/components/ExpandRowButton/ExpandRowButton.js +1 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.cjs +13 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.d.ts +3 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.js +13 -0
- package/dist/Table/components/PluggableTable/PluggableTable.cjs +19 -0
- package/dist/Table/components/PluggableTable/PluggableTable.d.ts +10 -0
- package/dist/Table/components/PluggableTable/PluggableTable.js +19 -0
- package/dist/Table/components/PluggableTable/compositionComponents.cjs +21 -0
- package/dist/Table/components/PluggableTable/compositionComponents.d.ts +67 -0
- package/dist/Table/components/PluggableTable/compositionComponents.js +21 -0
- package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.cjs +29 -0
- package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.d.ts +7 -0
- package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.js +29 -0
- package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.test.d.ts +1 -0
- package/dist/Table/components/RowSelection/RowSelectionButton.cjs +15 -0
- package/dist/Table/components/RowSelection/RowSelectionButton.d.ts +6 -0
- package/dist/Table/components/RowSelection/RowSelectionButton.js +15 -0
- package/dist/Table/components/RowSelection/RowSelectionButton.test.d.ts +1 -0
- package/dist/Table/components/TableBody/TableBody.cjs +33 -0
- package/dist/Table/components/TableBody/TableBody.d.ts +23 -0
- package/dist/Table/components/TableBody/TableBody.js +33 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.cjs +10 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.js +10 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.cjs +22 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.d.ts +12 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.js +22 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.cjs +38 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.d.ts +20 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.js +38 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.cjs +33 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.d.ts +2 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.js +33 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.cjs +17 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.d.ts +4 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.js +17 -0
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.cjs +3 -4
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.js +3 -4
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.cjs +1 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.js +1 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.cjs +9 -4
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.js +9 -4
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.cjs +2 -2
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.js +2 -2
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.types.d.ts +3 -5
- package/dist/Table/components/TableHeader/TableHeader.cjs +28 -0
- package/dist/Table/components/TableHeader/TableHeader.d.ts +21 -0
- package/dist/Table/components/TableHeader/TableHeader.js +28 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.cjs +19 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.d.ts +1 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.js +19 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.cjs +23 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.cjs +15 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.d.ts +8 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.js +15 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.d.ts +16 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.js +23 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.test.d.ts +1 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.types.d.ts +13 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.cjs +79 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.d.ts +10 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.js +79 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.cjs +40 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.d.ts +9 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.js +40 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.cjs +34 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.d.ts +5 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.js +34 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.cjs +16 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.d.ts +8 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.js +16 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.cjs +23 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.d.ts +5 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.js +23 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.cjs +6 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.d.ts +2 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.js +6 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.cjs +27 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.d.ts +12 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.js +27 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TablePagination/TablePagination.cjs +63 -78
- package/dist/Table/components/TablePagination/TablePagination.d.ts +23 -3
- package/dist/Table/components/TablePagination/TablePagination.js +64 -79
- package/dist/Table/components/TablePagination/TablePagination.style.cjs +78 -53
- package/dist/Table/components/TablePagination/TablePagination.style.d.ts +17 -49
- package/dist/Table/components/TablePagination/TablePagination.style.js +80 -55
- package/dist/Table/components/TablePagination/components/Compose/Compose.cjs +41 -0
- package/dist/Table/components/TablePagination/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TablePagination/components/Compose/Compose.js +41 -0
- package/dist/Table/components/TableRoot/TableRoot.cjs +5 -0
- package/dist/Table/components/TableRoot/TableRoot.d.ts +1 -0
- package/dist/Table/components/TableRoot/TableRoot.js +5 -0
- package/dist/Table/index.d.ts +3 -6
- package/dist/Table/plugins/ClickableRowPlugin.cjs +48 -0
- package/dist/Table/plugins/ClickableRowPlugin.d.ts +25 -0
- package/dist/Table/plugins/ClickableRowPlugin.js +48 -0
- package/dist/Table/plugins/ExpandableRowPlugin.cjs +38 -0
- package/dist/Table/plugins/ExpandableRowPlugin.d.ts +22 -0
- package/dist/Table/plugins/ExpandableRowPlugin.js +38 -0
- package/dist/Table/plugins/PaginationPlugin.cjs +45 -0
- package/dist/Table/plugins/PaginationPlugin.d.ts +16 -0
- package/dist/Table/plugins/PaginationPlugin.js +45 -0
- package/dist/Table/plugins/RowSelectionPlugin.cjs +28 -0
- package/dist/Table/plugins/RowSelectionPlugin.d.ts +12 -0
- package/dist/Table/plugins/RowSelectionPlugin.js +28 -0
- package/dist/Table/plugins/SortingPlugin.cjs +44 -0
- package/dist/Table/plugins/SortingPlugin.d.ts +18 -0
- package/dist/Table/plugins/SortingPlugin.js +44 -0
- package/dist/Table/tanStackExtendedTypes.d.ts +11 -0
- package/dist/Table/utils/plugin.utils.cjs +49 -0
- package/dist/Table/utils/plugin.utils.d.ts +17 -0
- package/dist/Table/utils/plugin.utils.js +49 -0
- package/dist/Table/utils/plugin.utils.test.d.ts +1 -0
- package/dist/index.cjs +60 -0
- package/dist/index.js +61 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +55 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +100 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +82 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +51 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +33 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.cjs +7 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +8 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index.cjs +361 -4
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +361 -4
- package/package.json +7 -5
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useControllableState } from "../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
|
|
2
|
+
const DEFAULT_ROW_SELECTION = {};
|
|
3
|
+
const useRowSelectionPlugin = ({
|
|
4
|
+
rowSelection,
|
|
5
|
+
defaultRowSelection,
|
|
6
|
+
onRowSelectionChange,
|
|
7
|
+
rowSelectionMode,
|
|
8
|
+
getRowCanSelect
|
|
9
|
+
}) => {
|
|
10
|
+
const [rowSelectionState = DEFAULT_ROW_SELECTION, setRowSelectionState] = useControllableState({
|
|
11
|
+
prop: rowSelection,
|
|
12
|
+
defaultProp: defaultRowSelection,
|
|
13
|
+
onChange: onRowSelectionChange
|
|
14
|
+
});
|
|
15
|
+
return rowSelectionMode && {
|
|
16
|
+
tableOptions: {
|
|
17
|
+
state: {
|
|
18
|
+
rowSelection: rowSelectionState
|
|
19
|
+
},
|
|
20
|
+
enableRowSelection: getRowCanSelect ?? true,
|
|
21
|
+
enableMultiRowSelection: rowSelectionMode === "multiple",
|
|
22
|
+
onRowSelectionChange: setRowSelectionState
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
useRowSelectionPlugin
|
|
28
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("../../node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const plugin_utils = require("../utils/plugin.utils.cjs");
|
|
6
|
+
const Table_context = require("../Table.context.cjs");
|
|
7
|
+
const index$1 = require("../../node_modules/@tanstack/table-core/build/lib/index.cjs");
|
|
8
|
+
const TableSortingContextKey = "sorting";
|
|
9
|
+
const useSortingPlugin = ({
|
|
10
|
+
defaultSorting,
|
|
11
|
+
onSortingChange,
|
|
12
|
+
sorting,
|
|
13
|
+
manualSorting = false,
|
|
14
|
+
enableSorting = true
|
|
15
|
+
// added plugin is enabled by default
|
|
16
|
+
}) => {
|
|
17
|
+
const [sortedByUser, setSortedByUser] = React.useState(false);
|
|
18
|
+
const [sortingState, setSortingState] = index.useControllableState({
|
|
19
|
+
prop: sorting,
|
|
20
|
+
defaultProp: defaultSorting,
|
|
21
|
+
onChange: onSortingChange
|
|
22
|
+
});
|
|
23
|
+
return enableSorting ? {
|
|
24
|
+
tableOptions: {
|
|
25
|
+
enableSorting: true,
|
|
26
|
+
getSortedRowModel: index$1.getSortedRowModel(),
|
|
27
|
+
state: {
|
|
28
|
+
sorting: sortingState
|
|
29
|
+
},
|
|
30
|
+
manualSorting,
|
|
31
|
+
onSortingChange: (value) => {
|
|
32
|
+
setSortingState(value);
|
|
33
|
+
setSortedByUser(true);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
context: plugin_utils.buildPluginContext(TableSortingContextKey, {
|
|
37
|
+
sortedByUser
|
|
38
|
+
})
|
|
39
|
+
} : void 0;
|
|
40
|
+
};
|
|
41
|
+
const useSortingContext = () => Table_context.usePluginContext(TableSortingContextKey);
|
|
42
|
+
exports.TableSortingContextKey = TableSortingContextKey;
|
|
43
|
+
exports.useSortingContext = useSortingContext;
|
|
44
|
+
exports.useSortingPlugin = useSortingPlugin;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SortingState } from '@tanstack/react-table';
|
|
2
|
+
import { TablePluginData } from '../utils/plugin.utils';
|
|
3
|
+
export declare const TableSortingContextKey = "sorting";
|
|
4
|
+
export interface TableSortingContext {
|
|
5
|
+
/** true, if user clicked on sorting. Ignores programmatic state changes from outside */
|
|
6
|
+
sortedByUser: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface TableSortingParams {
|
|
9
|
+
sorting?: SortingState;
|
|
10
|
+
defaultSorting?: SortingState;
|
|
11
|
+
onSortingChange?: (state: SortingState) => void;
|
|
12
|
+
/** If true, then table expects that items are sorted out of the table */
|
|
13
|
+
manualSorting?: boolean;
|
|
14
|
+
/** Set false to disable sorting */
|
|
15
|
+
enableSorting?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const useSortingPlugin: <T extends object>({ defaultSorting, onSortingChange, sorting, manualSorting, enableSorting }: TableSortingParams) => TablePluginData<T>;
|
|
18
|
+
export declare const useSortingContext: () => TableSortingContext | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useControllableState } from "../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { buildPluginContext } from "../utils/plugin.utils.js";
|
|
4
|
+
import { usePluginContext } from "../Table.context.js";
|
|
5
|
+
import { getSortedRowModel } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
6
|
+
const TableSortingContextKey = "sorting";
|
|
7
|
+
const useSortingPlugin = ({
|
|
8
|
+
defaultSorting,
|
|
9
|
+
onSortingChange,
|
|
10
|
+
sorting,
|
|
11
|
+
manualSorting = false,
|
|
12
|
+
enableSorting = true
|
|
13
|
+
// added plugin is enabled by default
|
|
14
|
+
}) => {
|
|
15
|
+
const [sortedByUser, setSortedByUser] = useState(false);
|
|
16
|
+
const [sortingState, setSortingState] = useControllableState({
|
|
17
|
+
prop: sorting,
|
|
18
|
+
defaultProp: defaultSorting,
|
|
19
|
+
onChange: onSortingChange
|
|
20
|
+
});
|
|
21
|
+
return enableSorting ? {
|
|
22
|
+
tableOptions: {
|
|
23
|
+
enableSorting: true,
|
|
24
|
+
getSortedRowModel: getSortedRowModel(),
|
|
25
|
+
state: {
|
|
26
|
+
sorting: sortingState
|
|
27
|
+
},
|
|
28
|
+
manualSorting,
|
|
29
|
+
onSortingChange: (value) => {
|
|
30
|
+
setSortingState(value);
|
|
31
|
+
setSortedByUser(true);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
context: buildPluginContext(TableSortingContextKey, {
|
|
35
|
+
sortedByUser
|
|
36
|
+
})
|
|
37
|
+
} : void 0;
|
|
38
|
+
};
|
|
39
|
+
const useSortingContext = () => usePluginContext(TableSortingContextKey);
|
|
40
|
+
export {
|
|
41
|
+
TableSortingContextKey,
|
|
42
|
+
useSortingContext,
|
|
43
|
+
useSortingPlugin
|
|
44
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import '@tanstack/table-core';
|
|
2
|
+
declare module '@tanstack/table-core' {
|
|
3
|
+
interface StringHeaderIdentifier {
|
|
4
|
+
isHeaderHidden?: boolean;
|
|
5
|
+
isHeaderCustom?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface IdIdentifier<TData, TValue> {
|
|
8
|
+
isHeaderHidden?: boolean;
|
|
9
|
+
isHeaderCustom?: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const mergeArrays = (key, container1, container2) => {
|
|
4
|
+
const arr1 = container1 == null ? void 0 : container1[key];
|
|
5
|
+
const arr2 = container2 == null ? void 0 : container2[key];
|
|
6
|
+
return arr1 && arr2 ? {
|
|
7
|
+
[key]: [...arr1, ...arr2]
|
|
8
|
+
} : null;
|
|
9
|
+
};
|
|
10
|
+
const mergeObjects = (key, container1, container2) => {
|
|
11
|
+
const obj1 = container1 == null ? void 0 : container1[key];
|
|
12
|
+
const obj2 = container2 == null ? void 0 : container2[key];
|
|
13
|
+
return obj1 && obj2 ? {
|
|
14
|
+
[key]: {
|
|
15
|
+
...obj1,
|
|
16
|
+
...obj2
|
|
17
|
+
}
|
|
18
|
+
} : null;
|
|
19
|
+
};
|
|
20
|
+
const mergePluginsData = (plugins) => {
|
|
21
|
+
const merged = {
|
|
22
|
+
tableOptions: {},
|
|
23
|
+
context: {}
|
|
24
|
+
};
|
|
25
|
+
if (!(plugins == null ? void 0 : plugins.length)) {
|
|
26
|
+
return merged;
|
|
27
|
+
}
|
|
28
|
+
plugins.forEach((plugin) => {
|
|
29
|
+
if (plugin) {
|
|
30
|
+
merged.tableOptions = {
|
|
31
|
+
...merged.tableOptions,
|
|
32
|
+
...plugin.tableOptions,
|
|
33
|
+
...mergeArrays("_features", merged.tableOptions, plugin.tableOptions),
|
|
34
|
+
...mergeObjects("state", merged.tableOptions, plugin.tableOptions),
|
|
35
|
+
...mergeObjects("initialState", merged.tableOptions, plugin.tableOptions)
|
|
36
|
+
};
|
|
37
|
+
merged.context = {
|
|
38
|
+
...merged.context,
|
|
39
|
+
...plugin.context
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return plugins.map((plugin) => plugin == null ? void 0 : plugin.postMerge).filter(Boolean).reduce((acc, postMerge) => (postMerge == null ? void 0 : postMerge(acc)) ?? acc, merged);
|
|
44
|
+
};
|
|
45
|
+
const buildPluginContext = (key, context) => ({
|
|
46
|
+
[key]: context
|
|
47
|
+
});
|
|
48
|
+
exports.buildPluginContext = buildPluginContext;
|
|
49
|
+
exports.mergePluginsData = mergePluginsData;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TableOptions } from '@tanstack/table-core';
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
|
+
export type PartialTableOptions<T extends RowData> = Partial<Omit<TableOptions<T>, 'columns' | 'data' | 'getRowId' | 'getSubRows' | 'onStateChange' | 'getCoreRowModel' | 'defaultColumn' | 'debugTable' | 'debugRows' | 'debugHeaders' | 'debugColumns' | 'debugCells' | 'debugAll' | 'autoResetAll' | 'meta'>>;
|
|
4
|
+
export type TablePluginData<T extends RowData> = {
|
|
5
|
+
/** Partial table options that will be smartly merged with other table options */
|
|
6
|
+
tableOptions: PartialTableOptions<T>;
|
|
7
|
+
/** Plugin context data accessible via usePluginContext */
|
|
8
|
+
context?: Record<string, Record<string, unknown>>;
|
|
9
|
+
/** Optional function to modify merged plugin data after all plugins are combined */
|
|
10
|
+
postMerge?: (merged: TableMergedData<T>) => TableMergedData<T>;
|
|
11
|
+
} | undefined;
|
|
12
|
+
export type TableMergedData<T extends RowData> = {
|
|
13
|
+
tableOptions: PartialTableOptions<T>;
|
|
14
|
+
context?: Record<string, Record<string, unknown>>;
|
|
15
|
+
};
|
|
16
|
+
export declare const mergePluginsData: <T extends unknown>(plugins?: TablePluginData<T>[] | undefined) => TableMergedData<T>;
|
|
17
|
+
export declare const buildPluginContext: (key: string, context: Record<string, unknown>) => Record<string, Record<string, unknown>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const mergeArrays = (key, container1, container2) => {
|
|
2
|
+
const arr1 = container1 == null ? void 0 : container1[key];
|
|
3
|
+
const arr2 = container2 == null ? void 0 : container2[key];
|
|
4
|
+
return arr1 && arr2 ? {
|
|
5
|
+
[key]: [...arr1, ...arr2]
|
|
6
|
+
} : null;
|
|
7
|
+
};
|
|
8
|
+
const mergeObjects = (key, container1, container2) => {
|
|
9
|
+
const obj1 = container1 == null ? void 0 : container1[key];
|
|
10
|
+
const obj2 = container2 == null ? void 0 : container2[key];
|
|
11
|
+
return obj1 && obj2 ? {
|
|
12
|
+
[key]: {
|
|
13
|
+
...obj1,
|
|
14
|
+
...obj2
|
|
15
|
+
}
|
|
16
|
+
} : null;
|
|
17
|
+
};
|
|
18
|
+
const mergePluginsData = (plugins) => {
|
|
19
|
+
const merged = {
|
|
20
|
+
tableOptions: {},
|
|
21
|
+
context: {}
|
|
22
|
+
};
|
|
23
|
+
if (!(plugins == null ? void 0 : plugins.length)) {
|
|
24
|
+
return merged;
|
|
25
|
+
}
|
|
26
|
+
plugins.forEach((plugin) => {
|
|
27
|
+
if (plugin) {
|
|
28
|
+
merged.tableOptions = {
|
|
29
|
+
...merged.tableOptions,
|
|
30
|
+
...plugin.tableOptions,
|
|
31
|
+
...mergeArrays("_features", merged.tableOptions, plugin.tableOptions),
|
|
32
|
+
...mergeObjects("state", merged.tableOptions, plugin.tableOptions),
|
|
33
|
+
...mergeObjects("initialState", merged.tableOptions, plugin.tableOptions)
|
|
34
|
+
};
|
|
35
|
+
merged.context = {
|
|
36
|
+
...merged.context,
|
|
37
|
+
...plugin.context
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return plugins.map((plugin) => plugin == null ? void 0 : plugin.postMerge).filter(Boolean).reduce((acc, postMerge) => (postMerge == null ? void 0 : postMerge(acc)) ?? acc, merged);
|
|
42
|
+
};
|
|
43
|
+
const buildPluginContext = (key, context) => ({
|
|
44
|
+
[key]: context
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
buildPluginContext,
|
|
48
|
+
mergePluginsData
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,67 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const Table = require("./Table/Table.cjs");
|
|
4
4
|
const ShowOnRowHover_style = require("./Table/components/ShowOnRowHover/ShowOnRowHover.style.cjs");
|
|
5
|
+
const index = require("./node_modules/@tanstack/react-table/build/lib/index.cjs");
|
|
5
6
|
const Table_context = require("./Table/Table.context.cjs");
|
|
7
|
+
const plugin_utils = require("./Table/utils/plugin.utils.cjs");
|
|
8
|
+
const index$1 = require("./node_modules/@tanstack/table-core/build/lib/index.cjs");
|
|
6
9
|
exports.Table = Table.default;
|
|
7
10
|
exports.ShowOnRowHover = ShowOnRowHover_style.ShowOnRowHover;
|
|
11
|
+
exports.flexRender = index.flexRender;
|
|
12
|
+
exports.useReactTable = index.useReactTable;
|
|
13
|
+
exports.TableContextProvider = Table_context.TableContextProvider;
|
|
14
|
+
exports.useComposeContext = Table_context.useComposeContext;
|
|
15
|
+
exports.usePluginContext = Table_context.usePluginContext;
|
|
8
16
|
exports.useTableContext = Table_context.useTableContext;
|
|
17
|
+
exports.buildPluginContext = plugin_utils.buildPluginContext;
|
|
18
|
+
exports.ColumnFaceting = index$1.ColumnFaceting;
|
|
19
|
+
exports.ColumnFiltering = index$1.ColumnFiltering;
|
|
20
|
+
exports.ColumnGrouping = index$1.ColumnGrouping;
|
|
21
|
+
exports.ColumnOrdering = index$1.ColumnOrdering;
|
|
22
|
+
exports.ColumnPinning = index$1.ColumnPinning;
|
|
23
|
+
exports.ColumnSizing = index$1.ColumnSizing;
|
|
24
|
+
exports.ColumnVisibility = index$1.ColumnVisibility;
|
|
25
|
+
exports.GlobalFaceting = index$1.GlobalFaceting;
|
|
26
|
+
exports.GlobalFiltering = index$1.GlobalFiltering;
|
|
27
|
+
exports.Headers = index$1.Headers;
|
|
28
|
+
exports.RowExpanding = index$1.RowExpanding;
|
|
29
|
+
exports.RowPagination = index$1.RowPagination;
|
|
30
|
+
exports.RowPinning = index$1.RowPinning;
|
|
31
|
+
exports.RowSelection = index$1.RowSelection;
|
|
32
|
+
exports.RowSorting = index$1.RowSorting;
|
|
33
|
+
exports._getVisibleLeafColumns = index$1._getVisibleLeafColumns;
|
|
34
|
+
exports.aggregationFns = index$1.aggregationFns;
|
|
35
|
+
exports.buildHeaderGroups = index$1.buildHeaderGroups;
|
|
36
|
+
exports.createCell = index$1.createCell;
|
|
37
|
+
exports.createColumn = index$1.createColumn;
|
|
38
|
+
exports.createColumnHelper = index$1.createColumnHelper;
|
|
39
|
+
exports.createRow = index$1.createRow;
|
|
40
|
+
exports.createTable = index$1.createTable;
|
|
41
|
+
exports.defaultColumnSizing = index$1.defaultColumnSizing;
|
|
42
|
+
exports.expandRows = index$1.expandRows;
|
|
43
|
+
exports.filterFns = index$1.filterFns;
|
|
44
|
+
exports.flattenBy = index$1.flattenBy;
|
|
45
|
+
exports.functionalUpdate = index$1.functionalUpdate;
|
|
46
|
+
exports.getCoreRowModel = index$1.getCoreRowModel;
|
|
47
|
+
exports.getExpandedRowModel = index$1.getExpandedRowModel;
|
|
48
|
+
exports.getFacetedMinMaxValues = index$1.getFacetedMinMaxValues;
|
|
49
|
+
exports.getFacetedRowModel = index$1.getFacetedRowModel;
|
|
50
|
+
exports.getFacetedUniqueValues = index$1.getFacetedUniqueValues;
|
|
51
|
+
exports.getFilteredRowModel = index$1.getFilteredRowModel;
|
|
52
|
+
exports.getGroupedRowModel = index$1.getGroupedRowModel;
|
|
53
|
+
exports.getMemoOptions = index$1.getMemoOptions;
|
|
54
|
+
exports.getPaginationRowModel = index$1.getPaginationRowModel;
|
|
55
|
+
exports.getSortedRowModel = index$1.getSortedRowModel;
|
|
56
|
+
exports.isFunction = index$1.isFunction;
|
|
57
|
+
exports.isNumberArray = index$1.isNumberArray;
|
|
58
|
+
exports.isRowSelected = index$1.isRowSelected;
|
|
59
|
+
exports.isSubRowSelected = index$1.isSubRowSelected;
|
|
60
|
+
exports.makeStateUpdater = index$1.makeStateUpdater;
|
|
61
|
+
exports.memo = index$1.memo;
|
|
62
|
+
exports.noop = index$1.noop;
|
|
63
|
+
exports.orderColumns = index$1.orderColumns;
|
|
64
|
+
exports.passiveEventSupported = index$1.passiveEventSupported;
|
|
65
|
+
exports.reSplitAlphaNumeric = index$1.reSplitAlphaNumeric;
|
|
66
|
+
exports.selectRowsFn = index$1.selectRowsFn;
|
|
67
|
+
exports.shouldAutoRemoveFilter = index$1.shouldAutoRemoveFilter;
|
|
68
|
+
exports.sortingFns = index$1.sortingFns;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,68 @@
|
|
|
1
1
|
import { default as default2 } from "./Table/Table.js";
|
|
2
2
|
import { ShowOnRowHover } from "./Table/components/ShowOnRowHover/ShowOnRowHover.style.js";
|
|
3
|
-
import {
|
|
3
|
+
import { flexRender, useReactTable } from "./node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
+
import { TableContextProvider, useComposeContext, usePluginContext, useTableContext } from "./Table/Table.context.js";
|
|
5
|
+
import { buildPluginContext } from "./Table/utils/plugin.utils.js";
|
|
6
|
+
import { ColumnFaceting, ColumnFiltering, ColumnGrouping, ColumnOrdering, ColumnPinning, ColumnSizing, ColumnVisibility, GlobalFaceting, GlobalFiltering, Headers, RowExpanding, RowPagination, RowPinning, RowSelection, RowSorting, _getVisibleLeafColumns, aggregationFns, buildHeaderGroups, createCell, createColumn, createColumnHelper, createRow, createTable, defaultColumnSizing, expandRows, filterFns, flattenBy, functionalUpdate, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getMemoOptions, getPaginationRowModel, getSortedRowModel, isFunction, isNumberArray, isRowSelected, isSubRowSelected, makeStateUpdater, memo, noop, orderColumns, passiveEventSupported, reSplitAlphaNumeric, selectRowsFn, shouldAutoRemoveFilter, sortingFns } from "./node_modules/@tanstack/table-core/build/lib/index.js";
|
|
4
7
|
export {
|
|
8
|
+
ColumnFaceting,
|
|
9
|
+
ColumnFiltering,
|
|
10
|
+
ColumnGrouping,
|
|
11
|
+
ColumnOrdering,
|
|
12
|
+
ColumnPinning,
|
|
13
|
+
ColumnSizing,
|
|
14
|
+
ColumnVisibility,
|
|
15
|
+
GlobalFaceting,
|
|
16
|
+
GlobalFiltering,
|
|
17
|
+
Headers,
|
|
18
|
+
RowExpanding,
|
|
19
|
+
RowPagination,
|
|
20
|
+
RowPinning,
|
|
21
|
+
RowSelection,
|
|
22
|
+
RowSorting,
|
|
5
23
|
ShowOnRowHover,
|
|
6
24
|
default2 as Table,
|
|
25
|
+
TableContextProvider,
|
|
26
|
+
_getVisibleLeafColumns,
|
|
27
|
+
aggregationFns,
|
|
28
|
+
buildHeaderGroups,
|
|
29
|
+
buildPluginContext,
|
|
30
|
+
createCell,
|
|
31
|
+
createColumn,
|
|
32
|
+
createColumnHelper,
|
|
33
|
+
createRow,
|
|
34
|
+
createTable,
|
|
35
|
+
defaultColumnSizing,
|
|
36
|
+
expandRows,
|
|
37
|
+
filterFns,
|
|
38
|
+
flattenBy,
|
|
39
|
+
flexRender,
|
|
40
|
+
functionalUpdate,
|
|
41
|
+
getCoreRowModel,
|
|
42
|
+
getExpandedRowModel,
|
|
43
|
+
getFacetedMinMaxValues,
|
|
44
|
+
getFacetedRowModel,
|
|
45
|
+
getFacetedUniqueValues,
|
|
46
|
+
getFilteredRowModel,
|
|
47
|
+
getGroupedRowModel,
|
|
48
|
+
getMemoOptions,
|
|
49
|
+
getPaginationRowModel,
|
|
50
|
+
getSortedRowModel,
|
|
51
|
+
isFunction,
|
|
52
|
+
isNumberArray,
|
|
53
|
+
isRowSelected,
|
|
54
|
+
isSubRowSelected,
|
|
55
|
+
makeStateUpdater,
|
|
56
|
+
memo,
|
|
57
|
+
noop,
|
|
58
|
+
orderColumns,
|
|
59
|
+
passiveEventSupported,
|
|
60
|
+
reSplitAlphaNumeric,
|
|
61
|
+
selectRowsFn,
|
|
62
|
+
shouldAutoRemoveFilter,
|
|
63
|
+
sortingFns,
|
|
64
|
+
useComposeContext,
|
|
65
|
+
usePluginContext,
|
|
66
|
+
useReactTable,
|
|
7
67
|
useTableContext
|
|
8
68
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
require("react-dom");
|
|
5
|
+
const index = require("../../react-slot/dist/index.cjs");
|
|
6
|
+
const jsxRuntime = require("../../../react/jsx-runtime.cjs");
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
+
if (e) {
|
|
11
|
+
for (const k in e) {
|
|
12
|
+
if (k !== "default") {
|
|
13
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: () => e[k]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
25
|
+
var NODES = [
|
|
26
|
+
"a",
|
|
27
|
+
"button",
|
|
28
|
+
"div",
|
|
29
|
+
"form",
|
|
30
|
+
"h2",
|
|
31
|
+
"h3",
|
|
32
|
+
"img",
|
|
33
|
+
"input",
|
|
34
|
+
"label",
|
|
35
|
+
"li",
|
|
36
|
+
"nav",
|
|
37
|
+
"ol",
|
|
38
|
+
"p",
|
|
39
|
+
"span",
|
|
40
|
+
"svg",
|
|
41
|
+
"ul"
|
|
42
|
+
];
|
|
43
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
44
|
+
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
45
|
+
const { asChild, ...primitiveProps } = props;
|
|
46
|
+
const Comp = asChild ? index.Slot : node;
|
|
47
|
+
if (typeof window !== "undefined") {
|
|
48
|
+
window[Symbol.for("radix-ui")] = true;
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
51
|
+
});
|
|
52
|
+
Node.displayName = `Primitive.${node}`;
|
|
53
|
+
return { ...primitive, [node]: Node };
|
|
54
|
+
}, {});
|
|
55
|
+
exports.Primitive = Primitive;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import "react-dom";
|
|
3
|
+
import { Slot } from "../../react-slot/dist/index.js";
|
|
4
|
+
import { j as jsxRuntimeExports } from "../../../react/jsx-runtime.js";
|
|
5
|
+
var NODES = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"span",
|
|
20
|
+
"svg",
|
|
21
|
+
"ul"
|
|
22
|
+
];
|
|
23
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
24
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
25
|
+
const { asChild, ...primitiveProps } = props;
|
|
26
|
+
const Comp = asChild ? Slot : node;
|
|
27
|
+
if (typeof window !== "undefined") {
|
|
28
|
+
window[Symbol.for("radix-ui")] = true;
|
|
29
|
+
}
|
|
30
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
31
|
+
});
|
|
32
|
+
Node.displayName = `Primitive.${node}`;
|
|
33
|
+
return { ...primitive, [node]: Node };
|
|
34
|
+
}, {});
|
|
35
|
+
export {
|
|
36
|
+
Primitive
|
|
37
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const index = require("../../react-compose-refs/dist/index.cjs");
|
|
5
|
+
const jsxRuntime = require("../../../react/jsx-runtime.cjs");
|
|
6
|
+
function _interopNamespace(e) {
|
|
7
|
+
if (e && e.__esModule) return e;
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
24
|
+
var Slot = React__namespace.forwardRef((props, forwardedRef) => {
|
|
25
|
+
const { children, ...slotProps } = props;
|
|
26
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
|
27
|
+
const slottable = childrenArray.find(isSlottable);
|
|
28
|
+
if (slottable) {
|
|
29
|
+
const newElement = slottable.props.children;
|
|
30
|
+
const newChildren = childrenArray.map((child) => {
|
|
31
|
+
if (child === slottable) {
|
|
32
|
+
if (React__namespace.Children.count(newElement) > 1) return React__namespace.Children.only(null);
|
|
33
|
+
return React__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
34
|
+
} else {
|
|
35
|
+
return child;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React__namespace.isValidElement(newElement) ? React__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
39
|
+
}
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
41
|
+
});
|
|
42
|
+
Slot.displayName = "Slot";
|
|
43
|
+
var SlotClone = React__namespace.forwardRef((props, forwardedRef) => {
|
|
44
|
+
const { children, ...slotProps } = props;
|
|
45
|
+
if (React__namespace.isValidElement(children)) {
|
|
46
|
+
const childrenRef = getElementRef(children);
|
|
47
|
+
return React__namespace.cloneElement(children, {
|
|
48
|
+
...mergeProps(slotProps, children.props),
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
ref: forwardedRef ? index.composeRefs(forwardedRef, childrenRef) : childrenRef
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return React__namespace.Children.count(children) > 1 ? React__namespace.Children.only(null) : null;
|
|
54
|
+
});
|
|
55
|
+
SlotClone.displayName = "SlotClone";
|
|
56
|
+
var Slottable = ({ children }) => {
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, { children });
|
|
58
|
+
};
|
|
59
|
+
function isSlottable(child) {
|
|
60
|
+
return React__namespace.isValidElement(child) && child.type === Slottable;
|
|
61
|
+
}
|
|
62
|
+
function mergeProps(slotProps, childProps) {
|
|
63
|
+
const overrideProps = { ...childProps };
|
|
64
|
+
for (const propName in childProps) {
|
|
65
|
+
const slotPropValue = slotProps[propName];
|
|
66
|
+
const childPropValue = childProps[propName];
|
|
67
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
68
|
+
if (isHandler) {
|
|
69
|
+
if (slotPropValue && childPropValue) {
|
|
70
|
+
overrideProps[propName] = (...args) => {
|
|
71
|
+
childPropValue(...args);
|
|
72
|
+
slotPropValue(...args);
|
|
73
|
+
};
|
|
74
|
+
} else if (slotPropValue) {
|
|
75
|
+
overrideProps[propName] = slotPropValue;
|
|
76
|
+
}
|
|
77
|
+
} else if (propName === "style") {
|
|
78
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
79
|
+
} else if (propName === "className") {
|
|
80
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { ...slotProps, ...overrideProps };
|
|
84
|
+
}
|
|
85
|
+
function getElementRef(element) {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
88
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
89
|
+
if (mayWarn) {
|
|
90
|
+
return element.ref;
|
|
91
|
+
}
|
|
92
|
+
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
93
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
94
|
+
if (mayWarn) {
|
|
95
|
+
return element.props.ref;
|
|
96
|
+
}
|
|
97
|
+
return element.props.ref || element.ref;
|
|
98
|
+
}
|
|
99
|
+
exports.Slot = Slot;
|
|
100
|
+
exports.Slottable = Slottable;
|