@homebound/beam 2.199.0 → 2.199.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Table/GridTable.js +1 -1
- package/dist/components/Table/components/CollapseToggle.js +1 -1
- package/dist/components/Table/components/Row.js +3 -3
- package/dist/components/Table/components/SelectToggle.js +1 -1
- package/dist/components/Table/components/SortHeader.d.ts +9 -5
- package/dist/components/Table/components/SortHeader.js +7 -3
- package/dist/components/Table/components/cell.d.ts +2 -2
- package/dist/components/Table/components/cell.js +2 -14
- package/dist/components/Table/index.d.ts +1 -4
- package/dist/components/Table/index.js +2 -5
- package/dist/components/Table/utils/TableState.d.ts +2 -2
- package/dist/components/Table/utils/TableState.js +4 -4
- package/dist/components/Table/utils/utils.d.ts +1 -1
- package/dist/components/Table/utils/utils.js +2 -2
- package/package.json +1 -1
- package/dist/components/Table/utils/GridSortContext.d.ts +0 -13
- package/dist/components/Table/utils/GridSortContext.js +0 -11
|
@@ -230,7 +230,7 @@ function GridTable(props) {
|
|
|
230
230
|
// behave semantically the same as `as=div` did for its tests.
|
|
231
231
|
const _as = as === "virtual" && runningInJest ? "div" : as;
|
|
232
232
|
const rowStateContext = (0, react_1.useMemo)(() => ({ tableState: tableState }), [tableState]);
|
|
233
|
-
return ((0, jsx_runtime_1.jsx)(TableState_1.
|
|
233
|
+
return ((0, jsx_runtime_1.jsx)(TableState_1.TableStateContext.Provider, Object.assign({ value: rowStateContext }, { children: (0, jsx_runtime_1.jsxs)(PresentationContext_1.PresentationProvider, Object.assign({ fieldProps: fieldProps, wrap: (_c = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _c === void 0 ? void 0 : _c.wrap }, { children: [(0, jsx_runtime_1.jsx)("div", { ref: resizeRef, css: Css_1.Css.w100.if(as === "virtual").w("calc(100% - 20px)").$ }, void 0), renders[_as](style, id, columns, headerRows, totalsRows, visibleDataRows, firstRowMessage, stickyHeader, xss, virtuosoRef)] }), void 0) }), void 0));
|
|
234
234
|
}
|
|
235
235
|
exports.GridTable = GridTable;
|
|
236
236
|
// Determine which HTML element to use to build the GridTable
|
|
@@ -8,7 +8,7 @@ const hooks_1 = require("../../../hooks");
|
|
|
8
8
|
/** Provides a chevron icons to collapse/un-collapse for parent/child tables. */
|
|
9
9
|
function CollapseToggle(props) {
|
|
10
10
|
const { row, compact } = props;
|
|
11
|
-
const { tableState } = (0, react_1.useContext)(index_1.
|
|
11
|
+
const { tableState } = (0, react_1.useContext)(index_1.TableStateContext);
|
|
12
12
|
const isCollapsed = (0, hooks_1.useComputed)(() => tableState.isCollapsed(row.id), [tableState]);
|
|
13
13
|
const iconKey = isCollapsed ? "chevronRight" : "chevronDown";
|
|
14
14
|
const headerIconKey = isCollapsed ? "chevronsRight" : "chevronsDown";
|
|
@@ -34,7 +34,7 @@ const shallowEqual_1 = require("../../../utils/shallowEqual");
|
|
|
34
34
|
function RowImpl(props) {
|
|
35
35
|
var _a;
|
|
36
36
|
const { as, columns, row, style, rowStyles, stickyHeader, stickyOffset, sortOn, columnSizes, level, getCount, api, cellHighlight, omitRowHover, ...others } = props;
|
|
37
|
-
const { tableState } = (0, react_1.useContext)(TableState_1.
|
|
37
|
+
const { tableState } = (0, react_1.useContext)(TableState_1.TableStateContext);
|
|
38
38
|
const rowId = `${row.kind}_${row.id}`;
|
|
39
39
|
const isActive = (0, hooks_1.useComputed)(() => tableState.activeRowId === rowId, [rowId, tableState]);
|
|
40
40
|
// We treat the "header" and "totals" kind as special for "good defaults" styling
|
|
@@ -87,7 +87,7 @@ function RowImpl(props) {
|
|
|
87
87
|
(sortOn === "server" && !!column.serverSideSortKey);
|
|
88
88
|
const alignment = (0, utils_1.getAlignment)(column, maybeContent);
|
|
89
89
|
const justificationCss = (0, utils_1.getJustification)(column, maybeContent, as, alignment);
|
|
90
|
-
const content = (0, utils_1.toContent)(maybeContent, isHeader, canSortColumn, sortOn === "client", style, as, alignment);
|
|
90
|
+
const content = (0, utils_1.toContent)(maybeContent, isHeader, canSortColumn, sortOn === "client", style, as, alignment, column);
|
|
91
91
|
(0, sortRows_1.ensureClientSideSortValueIsSortable)(sortOn, isHeader, column, columnIndex, maybeContent);
|
|
92
92
|
const maybeSticky = (_b = (((0, utils_1.isGridCellContent)(maybeContent) && maybeContent.sticky) || column.sticky)) !== null && _b !== void 0 ? _b : undefined;
|
|
93
93
|
const maybeStickyColumnStyles = maybeSticky && columnSizes
|
|
@@ -154,7 +154,7 @@ function RowImpl(props) {
|
|
|
154
154
|
const renderFn = ((rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.renderCell) || (rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.rowLink)) && wrapAction
|
|
155
155
|
? (0, cell_1.rowLinkRenderFn)(as)
|
|
156
156
|
: isHeader
|
|
157
|
-
? (0, cell_1.headerRenderFn)(
|
|
157
|
+
? (0, cell_1.headerRenderFn)(column, as)
|
|
158
158
|
: (rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.onClick) && wrapAction
|
|
159
159
|
? (0, cell_1.rowClickRenderFn)(as, api)
|
|
160
160
|
: (0, cell_1.defaultRenderFn)(as);
|
|
@@ -8,7 +8,7 @@ const hooks_1 = require("../../../hooks");
|
|
|
8
8
|
const inputs_1 = require("../../../inputs");
|
|
9
9
|
/** Provides a checkbox to show/drive this row's selected state. */
|
|
10
10
|
function SelectToggle({ id, disabled }) {
|
|
11
|
-
const { tableState } = (0, react_1.useContext)(TableState_1.
|
|
11
|
+
const { tableState } = (0, react_1.useContext)(TableState_1.TableStateContext);
|
|
12
12
|
const state = (0, hooks_1.useComputed)(() => tableState.getSelected(id), [tableState]);
|
|
13
13
|
const selected = state === "checked" ? true : state === "unchecked" ? false : "indeterminate";
|
|
14
14
|
return ((0, jsx_runtime_1.jsx)(inputs_1.Checkbox, { checkboxOnly: true, disabled: disabled, label: "Select", onChange: (selected) => {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import { GridColumnWithId } from "../types";
|
|
1
2
|
import { Properties } from "../../../Css";
|
|
3
|
+
interface SortHeaderProps {
|
|
4
|
+
content: string;
|
|
5
|
+
xss?: Properties;
|
|
6
|
+
iconOnLeft?: boolean;
|
|
7
|
+
column: GridColumnWithId<any>;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* Wraps column header names with up/down sorting icons.
|
|
4
11
|
*
|
|
@@ -10,8 +17,5 @@ import { Properties } from "../../../Css";
|
|
|
10
17
|
* - Write their own component that uses `GridSortContext` to access the column's
|
|
11
18
|
* current sort state + `toggleSort` function
|
|
12
19
|
*/
|
|
13
|
-
export declare function SortHeader(props:
|
|
14
|
-
|
|
15
|
-
xss?: Properties;
|
|
16
|
-
iconOnLeft?: boolean;
|
|
17
|
-
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function SortHeader(props: SortHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -4,7 +4,7 @@ exports.SortHeader = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const Icon_1 = require("../../Icon");
|
|
7
|
-
const
|
|
7
|
+
const TableState_1 = require("../utils/TableState");
|
|
8
8
|
const Css_1 = require("../../../Css");
|
|
9
9
|
const hooks_1 = require("../../../hooks");
|
|
10
10
|
const useTestIds_1 = require("../../../utils/useTestIds");
|
|
@@ -20,9 +20,13 @@ const useTestIds_1 = require("../../../utils/useTestIds");
|
|
|
20
20
|
* current sort state + `toggleSort` function
|
|
21
21
|
*/
|
|
22
22
|
function SortHeader(props) {
|
|
23
|
-
const { content, xss, iconOnLeft = false } = props;
|
|
23
|
+
const { content, xss, iconOnLeft = false, column } = props;
|
|
24
24
|
const { isHovered, hoverProps } = (0, hooks_1.useHover)({});
|
|
25
|
-
const
|
|
25
|
+
const ourSortKey = column.serverSideSortKey || column.id;
|
|
26
|
+
const { tableState } = (0, react_1.useContext)(TableState_1.TableStateContext);
|
|
27
|
+
const current = (0, hooks_1.useComputed)(() => { var _a; return (_a = tableState.sortState) === null || _a === void 0 ? void 0 : _a.current; }, [tableState]);
|
|
28
|
+
const sorted = ourSortKey === (current === null || current === void 0 ? void 0 : current.columnId) ? current === null || current === void 0 ? void 0 : current.direction : undefined;
|
|
29
|
+
const toggleSort = (0, react_1.useCallback)(() => tableState.setSortKey(ourSortKey), [ourSortKey, tableState]);
|
|
26
30
|
const tid = (0, useTestIds_1.useTestIds)(props, "sortHeader");
|
|
27
31
|
const icon = ((0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.fs0.$ }, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, Object.assign({ icon: sorted === "DESC" ? "sortDown" : "sortUp", color: sorted !== undefined ? Css_1.Palette.LightBlue700 : Css_1.Palette.Gray400, xss: {
|
|
28
32
|
...Css_1.Css.ml1.if(iconOnLeft).mr1.ml0.$,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { GridTableApi } from "../GridTableApi";
|
|
3
3
|
import { RowStyle } from "../TableStyles";
|
|
4
|
-
import { GridCellAlignment,
|
|
4
|
+
import { GridCellAlignment, GridColumnWithId, Kinded, MaybeFn, RenderAs } from "../types";
|
|
5
5
|
import { Properties, Typography } from "../../../Css";
|
|
6
6
|
/**
|
|
7
7
|
* Allows a cell to be more than just a RectNode, i.e. declare its alignment or
|
|
@@ -33,7 +33,7 @@ export declare type RenderCellFn<R extends Kinded> = (idx: number, css: Properti
|
|
|
33
33
|
/** Renders our default cell element, i.e. if no row links and no custom renderCell are used. */
|
|
34
34
|
export declare const defaultRenderFn: (as: RenderAs) => RenderCellFn<any>;
|
|
35
35
|
/** Sets up the `GridContext` so that header cells can access the current sort settings. */
|
|
36
|
-
export declare const headerRenderFn: (
|
|
36
|
+
export declare const headerRenderFn: (column: GridColumnWithId<any>, as: RenderAs) => RenderCellFn<any>;
|
|
37
37
|
/** Renders a cell element when a row link is in play. */
|
|
38
38
|
export declare const rowLinkRenderFn: (as: RenderAs) => RenderCellFn<any>;
|
|
39
39
|
/** Renders a cell that will fire the RowStyle.onClick. */
|
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rowClickRenderFn = exports.rowLinkRenderFn = exports.headerRenderFn = exports.defaultRenderFn = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
5
|
const react_router_dom_1 = require("react-router-dom");
|
|
7
6
|
const CssReset_1 = require("../../CssReset");
|
|
8
7
|
const TableStyles_1 = require("../TableStyles");
|
|
9
|
-
const GridSortContext_1 = require("../utils/GridSortContext");
|
|
10
|
-
const TableState_1 = require("../utils/TableState");
|
|
11
8
|
const Css_1 = require("../../../Css");
|
|
12
|
-
const hooks_1 = require("../../../hooks");
|
|
13
9
|
/** Renders our default cell element, i.e. if no row links and no custom renderCell are used. */
|
|
14
10
|
const defaultRenderFn = (as) => (key, css, content, row, rowStyle, classNames, onClick) => {
|
|
15
11
|
const Cell = as === "table" ? "td" : "div";
|
|
@@ -17,17 +13,9 @@ const defaultRenderFn = (as) => (key, css, content, row, rowStyle, classNames, o
|
|
|
17
13
|
};
|
|
18
14
|
exports.defaultRenderFn = defaultRenderFn;
|
|
19
15
|
/** Sets up the `GridContext` so that header cells can access the current sort settings. */
|
|
20
|
-
const headerRenderFn = (
|
|
21
|
-
const { tableState } = (0, react_1.useContext)(TableState_1.RowStateContext);
|
|
22
|
-
const current = (0, hooks_1.useComputed)(() => { var _a; return (_a = tableState.sortState) === null || _a === void 0 ? void 0 : _a.current; }, [tableState]);
|
|
23
|
-
// If server-side sorting, use the user's key for this column; client-side sorting, use the index.
|
|
24
|
-
const ourSortKey = column.serverSideSortKey || column.id;
|
|
25
|
-
const context = {
|
|
26
|
-
sorted: ourSortKey === (current === null || current === void 0 ? void 0 : current.columnId) ? current === null || current === void 0 ? void 0 : current.direction : undefined,
|
|
27
|
-
toggleSort: () => tableState.setSortKey(ourSortKey),
|
|
28
|
-
};
|
|
16
|
+
const headerRenderFn = (column, as) => (key, css, content, row, rowStyle, classNames) => {
|
|
29
17
|
const Cell = as === "table" ? "th" : "div";
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(Cell, Object.assign({ css: { ...css, ...(0, TableStyles_1.tableRowStyles)(as, column) }, className: classNames }, { children: content }), void 0));
|
|
31
19
|
};
|
|
32
20
|
exports.headerRenderFn = headerRenderFn;
|
|
33
21
|
/** Renders a cell element when a row link is in play. */
|
|
@@ -17,13 +17,10 @@ export * from "./types";
|
|
|
17
17
|
export * from "./utils/columns";
|
|
18
18
|
export { createRowLookup } from "./utils/GridRowLookup";
|
|
19
19
|
export type { GridRowLookup } from "./utils/GridRowLookup";
|
|
20
|
-
export * from "./utils/GridSortContext";
|
|
21
|
-
export { GridSortContext } from "./utils/GridSortContext";
|
|
22
|
-
export type { GridSortContextProps } from "./utils/GridSortContext";
|
|
23
20
|
export { simpleDataRows, simpleHeader } from "./utils/simpleHelpers";
|
|
24
21
|
export type { SimpleHeaderAndData } from "./utils/simpleHelpers";
|
|
25
22
|
export * from "./utils/sortRows";
|
|
26
|
-
export {
|
|
23
|
+
export { TableState, TableStateContext } from "./utils/TableState";
|
|
27
24
|
export type { SelectedState, SortOn, SortState } from "./utils/TableState";
|
|
28
25
|
export * from "./utils/utils";
|
|
29
26
|
export * from "./utils/visitor";
|
|
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.setGridTableDefaults = exports.setDefaultStyle = exports.GridTable = exports.
|
|
13
|
+
exports.setGridTableDefaults = exports.setDefaultStyle = exports.GridTable = exports.TableStateContext = exports.TableState = exports.simpleHeader = exports.simpleDataRows = exports.createRowLookup = exports.getTableStyles = exports.defaultStyle = exports.condensedStyle = exports.cardStyle = exports.useGridTableApi = exports.SortHeader = exports.Row = exports.EditColumnsButton = exports.rowLinkRenderFn = exports.rowClickRenderFn = exports.headerRenderFn = exports.defaultRenderFn = void 0;
|
|
14
14
|
var cell_1 = require("./components/cell");
|
|
15
15
|
Object.defineProperty(exports, "defaultRenderFn", { enumerable: true, get: function () { return cell_1.defaultRenderFn; } });
|
|
16
16
|
Object.defineProperty(exports, "headerRenderFn", { enumerable: true, get: function () { return cell_1.headerRenderFn; } });
|
|
@@ -38,16 +38,13 @@ __exportStar(require("./types"), exports);
|
|
|
38
38
|
__exportStar(require("./utils/columns"), exports);
|
|
39
39
|
var GridRowLookup_1 = require("./utils/GridRowLookup");
|
|
40
40
|
Object.defineProperty(exports, "createRowLookup", { enumerable: true, get: function () { return GridRowLookup_1.createRowLookup; } });
|
|
41
|
-
__exportStar(require("./utils/GridSortContext"), exports);
|
|
42
|
-
var GridSortContext_1 = require("./utils/GridSortContext");
|
|
43
|
-
Object.defineProperty(exports, "GridSortContext", { enumerable: true, get: function () { return GridSortContext_1.GridSortContext; } });
|
|
44
41
|
var simpleHelpers_1 = require("./utils/simpleHelpers");
|
|
45
42
|
Object.defineProperty(exports, "simpleDataRows", { enumerable: true, get: function () { return simpleHelpers_1.simpleDataRows; } });
|
|
46
43
|
Object.defineProperty(exports, "simpleHeader", { enumerable: true, get: function () { return simpleHelpers_1.simpleHeader; } });
|
|
47
44
|
__exportStar(require("./utils/sortRows"), exports);
|
|
48
45
|
var TableState_1 = require("./utils/TableState");
|
|
49
|
-
Object.defineProperty(exports, "RowStateContext", { enumerable: true, get: function () { return TableState_1.RowStateContext; } });
|
|
50
46
|
Object.defineProperty(exports, "TableState", { enumerable: true, get: function () { return TableState_1.TableState; } });
|
|
47
|
+
Object.defineProperty(exports, "TableStateContext", { enumerable: true, get: function () { return TableState_1.TableStateContext; } });
|
|
51
48
|
__exportStar(require("./utils/utils"), exports);
|
|
52
49
|
__exportStar(require("./utils/visitor"), exports);
|
|
53
50
|
var GridTable_1 = require("./GridTable");
|
|
@@ -50,8 +50,8 @@ export declare class TableState {
|
|
|
50
50
|
private getMatchedChildrenStates;
|
|
51
51
|
private setNestedSelectedStates;
|
|
52
52
|
}
|
|
53
|
-
/** Provides a context for rows to access their table's `
|
|
54
|
-
export declare const
|
|
53
|
+
/** Provides a context for rows to access their table's `TableState`. */
|
|
54
|
+
export declare const TableStateContext: React.Context<{
|
|
55
55
|
tableState: TableState;
|
|
56
56
|
}>;
|
|
57
57
|
export declare function deriveSortState(currentSortState: SortState, clickedKey: string, initialSortState: SortState | undefined): SortState | undefined;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.deriveSortState = exports.
|
|
6
|
+
exports.deriveSortState = exports.TableStateContext = exports.TableState = void 0;
|
|
7
7
|
const mobx_1 = require("mobx");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const utils_1 = require("./utils");
|
|
@@ -308,10 +308,10 @@ class TableState {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
exports.TableState = TableState;
|
|
311
|
-
/** Provides a context for rows to access their table's `
|
|
312
|
-
exports.
|
|
311
|
+
/** Provides a context for rows to access their table's `TableState`. */
|
|
312
|
+
exports.TableStateContext = react_1.default.createContext({
|
|
313
313
|
get tableState() {
|
|
314
|
-
throw new Error("No
|
|
314
|
+
throw new Error("No TableStateContext provider");
|
|
315
315
|
},
|
|
316
316
|
});
|
|
317
317
|
// Get the rows that are already in the toggled state, so we can keep them toggled
|
|
@@ -6,7 +6,7 @@ import { GridStyle, RowStyle } from "../TableStyles";
|
|
|
6
6
|
import { GridCellAlignment, GridColumnWithId, Kinded, RenderAs } from "../types";
|
|
7
7
|
import { Properties } from "../../../Css";
|
|
8
8
|
/** If a column def return just string text for a given row, apply some default styling. */
|
|
9
|
-
export declare function toContent(maybeContent: ReactNode | GridCellContent, isHeader: boolean, canSortColumn: boolean, isClientSideSorting: boolean, style: GridStyle, as: RenderAs, alignment: GridCellAlignment): ReactNode;
|
|
9
|
+
export declare function toContent(maybeContent: ReactNode | GridCellContent, isHeader: boolean, canSortColumn: boolean, isClientSideSorting: boolean, style: GridStyle, as: RenderAs, alignment: GridCellAlignment, column: GridColumnWithId<any>): ReactNode;
|
|
10
10
|
export declare function isGridCellContent(content: ReactNode | GridCellContent): content is GridCellContent;
|
|
11
11
|
/** Return the content for a given column def applied to a given row. */
|
|
12
12
|
export declare function applyRowFn<R extends Kinded>(column: GridColumnWithId<R>, row: GridDataRow<R>, api: GridTableApi<R>, level: number): ReactNode | GridCellContent;
|
|
@@ -6,7 +6,7 @@ const SortHeader_1 = require("../components/SortHeader");
|
|
|
6
6
|
const Css_1 = require("../../../Css");
|
|
7
7
|
const getInteractiveElement_1 = require("../../../utils/getInteractiveElement");
|
|
8
8
|
/** If a column def return just string text for a given row, apply some default styling. */
|
|
9
|
-
function toContent(maybeContent, isHeader, canSortColumn, isClientSideSorting, style, as, alignment) {
|
|
9
|
+
function toContent(maybeContent, isHeader, canSortColumn, isClientSideSorting, style, as, alignment, column) {
|
|
10
10
|
var _a, _b;
|
|
11
11
|
let content = isGridCellContent(maybeContent) ? maybeContent.content : maybeContent;
|
|
12
12
|
if (typeof content === "function") {
|
|
@@ -32,7 +32,7 @@ function toContent(maybeContent, isHeader, canSortColumn, isClientSideSorting, s
|
|
|
32
32
|
})
|
|
33
33
|
: content;
|
|
34
34
|
if (content && typeof content === "string" && isHeader && canSortColumn) {
|
|
35
|
-
return (0, jsx_runtime_1.jsx)(SortHeader_1.SortHeader, { content: content, iconOnLeft: alignment === "right" }, void 0);
|
|
35
|
+
return (0, jsx_runtime_1.jsx)(SortHeader_1.SortHeader, { content: content, iconOnLeft: alignment === "right", column: column }, void 0);
|
|
36
36
|
}
|
|
37
37
|
else if (content && ((_b = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _b === void 0 ? void 0 : _b.wrap) === false && typeof content === "string") {
|
|
38
38
|
// In order to truncate the text properly, then we need to wrap it in another element
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Provides the sorting settings to headers.
|
|
4
|
-
*
|
|
5
|
-
* This is broken out into it's own context (i.e. separate from `GridCollapseContextProps`)
|
|
6
|
-
* so that we can have sort changes only re-render the header row, and not trigger a re-render
|
|
7
|
-
* of every row in the table.
|
|
8
|
-
*/
|
|
9
|
-
export declare type GridSortContextProps = {
|
|
10
|
-
sorted: "ASC" | "DESC" | undefined;
|
|
11
|
-
toggleSort(): void;
|
|
12
|
-
};
|
|
13
|
-
export declare const GridSortContext: React.Context<GridSortContextProps>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GridSortContext = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
exports.GridSortContext = react_1.default.createContext({
|
|
9
|
-
sorted: undefined,
|
|
10
|
-
toggleSort: () => { },
|
|
11
|
-
});
|