oolib 2.89.0 → 2.89.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/SimpleTable/handlers/handleToggleColHeader.d.ts +5 -0
- package/dist/components/SimpleTable/handlers/handleToggleColHeader.js +21 -0
- package/dist/components/SimpleTable/index.js +85 -62
- package/dist/components/SimpleTable/styled.d.ts +1 -0
- package/dist/components/SimpleTable/styled.js +6 -4
- package/dist/components/SimpleTable/useResizeTableColumns.d.ts +9 -2
- package/dist/components/SimpleTable/useResizeTableColumns.js +7 -5
- package/dist/components/SimpleTable/utils/convertRowHeaderConfigToCellData.d.ts +10 -0
- package/dist/components/SimpleTable/utils/convertRowHeaderConfigToCellData.js +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleToggleColHeader = void 0;
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
5
|
+
var handleToggleColHeader = function (_a) {
|
|
6
|
+
var value = _a.value, onChange = _a.onChange, id = _a.id;
|
|
7
|
+
var data = value.data, colWidthConfig = value.colWidthConfig;
|
|
8
|
+
var newData = data.map(function (row) {
|
|
9
|
+
var newRowData = (0, lodash_1.cloneDeep)(row);
|
|
10
|
+
if (newRowData.cellData[0].isRowHeader) { //then remove
|
|
11
|
+
delete newRowData.cellData[0].isRowHeader;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
newRowData.cellData[0].isRowHeader = true;
|
|
15
|
+
}
|
|
16
|
+
return newRowData;
|
|
17
|
+
});
|
|
18
|
+
onChange &&
|
|
19
|
+
onChange(id, { data: newData, colWidthConfig: colWidthConfig });
|
|
20
|
+
};
|
|
21
|
+
exports.handleToggleColHeader = handleToggleColHeader;
|
|
@@ -60,9 +60,11 @@ var handleColActions_1 = require("./handlers/handleColActions");
|
|
|
60
60
|
var handleRowActions_1 = require("./handlers/handleRowActions");
|
|
61
61
|
var handleStretchToFullWidth_1 = require("./handlers/handleStretchToFullWidth");
|
|
62
62
|
var handleToggleRowHeader_1 = require("./handlers/handleToggleRowHeader");
|
|
63
|
+
var handleToggleColHeader_1 = require("./handlers/handleToggleColHeader");
|
|
63
64
|
var styled_1 = require("./styled");
|
|
64
65
|
var useResizeTableColumns_1 = require("./useResizeTableColumns");
|
|
65
66
|
var convertColHeaderConfigToRowData_1 = require("./utils/convertColHeaderConfigToRowData");
|
|
67
|
+
var convertRowHeaderConfigToCellData_1 = require("./utils/convertRowHeaderConfigToCellData");
|
|
66
68
|
var prepInitValueFromConfigIfNoValue_1 = require("./utils/prepInitValueFromConfigIfNoValue");
|
|
67
69
|
var greyColor100 = themes_1.colors.greyColor100;
|
|
68
70
|
/*pending:
|
|
@@ -168,6 +170,75 @@ function SimpleTable(_a) {
|
|
|
168
170
|
var colActionsButtonHeight = 15;
|
|
169
171
|
var primaryTableActionsMenuHeight = 30;
|
|
170
172
|
var primaryTableActionsMenuGap = 5;
|
|
173
|
+
var genCell = function (_a) {
|
|
174
|
+
var cell = _a.cell, cellIdx = _a.cellIdx, rowIdx = _a.rowIdx;
|
|
175
|
+
var CellComp = RichTextEditor //cuz in oolib, richtexteditor will not be there for now
|
|
176
|
+
? CellContentBlocks["RichTextEditor"]
|
|
177
|
+
: function () { return react_1.default.createElement("div", null, "RTE Doesnt Exist"); };
|
|
178
|
+
var cellProps = __assign({}, CellContentBlockDefaultProps["RichTextEditor"]);
|
|
179
|
+
var cellValue = CellValueGetters["RichTextEditor"](cell.value);
|
|
180
|
+
var cellWidth = value.colWidthConfig["col_".concat(cellIdx)];
|
|
181
|
+
//(100% - totalExplicitWidths)/(totalColumns - noOfColsWithExplicitWidths)
|
|
182
|
+
// let cellProps = {
|
|
183
|
+
// ...CellContentBlockDefaultProps[cell.comp],
|
|
184
|
+
// ...(cell.props ? cell.props : {}),
|
|
185
|
+
// }
|
|
186
|
+
if (cell.isRowHeader)
|
|
187
|
+
console.log({ cell: cell });
|
|
188
|
+
var StyledCellWrapper = cell.isRowHeader
|
|
189
|
+
? styled_1.StyledSimpleTableHeaderCell
|
|
190
|
+
: styled_1.StyledSimpleTableCell;
|
|
191
|
+
return (react_1.default.createElement(StyledCellWrapper, { key: cell.id, id: "kp_table__cell__".concat(cell.id), readOnly: readOnly || cell.readOnly, style: {
|
|
192
|
+
color: greyColor100,
|
|
193
|
+
width: "".concat(cellWidth),
|
|
194
|
+
borderRight: (colResizeState === null || colResizeState === void 0 ? void 0 : colResizeState.colId) === "col_".concat(cellIdx) &&
|
|
195
|
+
"2px solid ".concat((0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors)),
|
|
196
|
+
}, actionsActiveOnRow: actionsActiveOnRow, colIdx: cellIdx, rowIdx: rowIdx, totRows: value.data.length, actionsActiveOnCol: actionsActiveOnCol, onMouseEnter: function (e) {
|
|
197
|
+
setHoveredRowAndCol({
|
|
198
|
+
rowIdx: rowIdx,
|
|
199
|
+
colIdx: cellIdx,
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
// onMouseOver={e => {
|
|
203
|
+
// setHoveredRowAndCol(e.target.getBoundingClientRect())
|
|
204
|
+
// }}
|
|
205
|
+
onMouseDown: function (e) {
|
|
206
|
+
initColResizeState(e, { colId: "col_".concat(cellIdx) });
|
|
207
|
+
}, onMouseOut: function (e) { return resetDragZoneIndicator(__assign({ e: e }, (cell.isRowHeader ? { borderStyleInactive: "2px solid ".concat(themes_1.colors.greyColor10) } : {}))); }, onMouseMove: function (e) { return hideShowDragZoneIndicator(__assign({ e: e }, (cell.isRowHeader ? {
|
|
208
|
+
borderStyleInactive: "2px solid ".concat(themes_1.colors.greyColor10),
|
|
209
|
+
borderStyleActive: "2px solid ".concat((0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors))
|
|
210
|
+
} : {}))); }, tabIndex: 0 },
|
|
211
|
+
react_1.default.createElement(ColActionsMenu_1.ColActionsMenu, __assign({}, {
|
|
212
|
+
value: value,
|
|
213
|
+
colIdx: cellIdx,
|
|
214
|
+
onChange: onChange,
|
|
215
|
+
id: id,
|
|
216
|
+
defaultColWidth: defaultColWidth,
|
|
217
|
+
setActionsActiveOnCol: setActionsActiveOnCol,
|
|
218
|
+
colActionsButtonHeight: colActionsButtonHeight,
|
|
219
|
+
conditionsToRender: !readOnly &&
|
|
220
|
+
enableColActions &&
|
|
221
|
+
rowIdx === 0 &&
|
|
222
|
+
hoveredRowAndCol.colIdx === cellIdx,
|
|
223
|
+
})),
|
|
224
|
+
react_1.default.createElement(RowActionsMenu_1.RowActionsMenu, __assign({}, {
|
|
225
|
+
value: value,
|
|
226
|
+
rowIdx: rowIdx,
|
|
227
|
+
onChange: onChange,
|
|
228
|
+
id: id,
|
|
229
|
+
setActionsActiveOnRow: setActionsActiveOnRow,
|
|
230
|
+
rowActionsButtonWidth: rowActionsButtonWidth,
|
|
231
|
+
conditionsToRender: !readOnly &&
|
|
232
|
+
enableRowActions &&
|
|
233
|
+
cellIdx === 0 &&
|
|
234
|
+
rowIdx !== undefined && //cuz for fixed col headers, rowIdx is undefined
|
|
235
|
+
hoveredRowAndCol.rowIdx === rowIdx,
|
|
236
|
+
})),
|
|
237
|
+
react_1.default.createElement("div", { style: { marginRight: dragZoneWidth + "px" } },
|
|
238
|
+
react_1.default.createElement(CellComp, __assign({}, cellProps, { id: "kp_table_cell__".concat(cell.id, "__rich_input") /*dont mess with this id nomenclature. it needs to stay this way. check out the handleCellInputChange fn to understand */, value: cellValue, readOnly: readOnly || cell.readOnly, onChange: function (k, v) {
|
|
239
|
+
return handleCellInputChange({ v: v, rowIdx: rowIdx, cellIdx: cellIdx });
|
|
240
|
+
} })))));
|
|
241
|
+
};
|
|
171
242
|
var genRow = function (_a) {
|
|
172
243
|
var row = _a.row, rowIdx = _a.rowIdx;
|
|
173
244
|
var StyledWrapper = row.isColHeader
|
|
@@ -175,66 +246,16 @@ function SimpleTable(_a) {
|
|
|
175
246
|
: styled_1.StyledSimpleTableRow;
|
|
176
247
|
return (react_1.default.createElement(StyledWrapper, { actionsActiveOnRow: actionsActiveOnRow,
|
|
177
248
|
// onClick={() => row.link && history.push(row.link)}
|
|
178
|
-
style: { display: "flex" }, readOnly: readOnly, rowIdx: rowIdx, key: row.id },
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
// ...(cell.props ? cell.props : {}),
|
|
189
|
-
// }
|
|
190
|
-
return (react_1.default.createElement(styled_1.StyledSimpleTableCell, { key: cell.id, id: "kp_table__cell__".concat(cell.id), readOnly: readOnly || cell.readOnly, style: {
|
|
191
|
-
color: greyColor100,
|
|
192
|
-
width: "".concat(cellWidth),
|
|
193
|
-
borderRight: (colResizeState === null || colResizeState === void 0 ? void 0 : colResizeState.colId) === "col_".concat(cellIdx) &&
|
|
194
|
-
"2px solid ".concat((0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors)),
|
|
195
|
-
}, actionsActiveOnRow: actionsActiveOnRow, colIdx: cellIdx, rowIdx: rowIdx, totRows: value.data.length, actionsActiveOnCol: actionsActiveOnCol, onMouseEnter: function (e) {
|
|
196
|
-
setHoveredRowAndCol({
|
|
197
|
-
rowIdx: rowIdx,
|
|
198
|
-
colIdx: cellIdx,
|
|
199
|
-
});
|
|
200
|
-
},
|
|
201
|
-
// onMouseOver={e => {
|
|
202
|
-
// setHoveredRowAndCol(e.target.getBoundingClientRect())
|
|
203
|
-
// }}
|
|
204
|
-
onMouseDown: function (e) {
|
|
205
|
-
initColResizeState(e, { colId: "col_".concat(cellIdx) });
|
|
206
|
-
}, onMouseOut: resetDragZoneIndicator, onMouseMove: hideShowDragZoneIndicator, tabIndex: 0 },
|
|
207
|
-
react_1.default.createElement(ColActionsMenu_1.ColActionsMenu, __assign({}, {
|
|
208
|
-
value: value,
|
|
209
|
-
colIdx: cellIdx,
|
|
210
|
-
onChange: onChange,
|
|
211
|
-
id: id,
|
|
212
|
-
defaultColWidth: defaultColWidth,
|
|
213
|
-
setActionsActiveOnCol: setActionsActiveOnCol,
|
|
214
|
-
colActionsButtonHeight: colActionsButtonHeight,
|
|
215
|
-
conditionsToRender: !readOnly &&
|
|
216
|
-
enableColActions &&
|
|
217
|
-
rowIdx === 0 &&
|
|
218
|
-
hoveredRowAndCol.colIdx === cellIdx,
|
|
219
|
-
})),
|
|
220
|
-
react_1.default.createElement(RowActionsMenu_1.RowActionsMenu, __assign({}, {
|
|
221
|
-
value: value,
|
|
222
|
-
rowIdx: rowIdx,
|
|
223
|
-
onChange: onChange,
|
|
224
|
-
id: id,
|
|
225
|
-
setActionsActiveOnRow: setActionsActiveOnRow,
|
|
226
|
-
rowActionsButtonWidth: rowActionsButtonWidth,
|
|
227
|
-
conditionsToRender: !readOnly &&
|
|
228
|
-
enableRowActions &&
|
|
229
|
-
cellIdx === 0 &&
|
|
230
|
-
rowIdx !== undefined && //cuz for fixed col headers, rowIdx is undefined
|
|
231
|
-
hoveredRowAndCol.rowIdx === rowIdx,
|
|
232
|
-
})),
|
|
233
|
-
react_1.default.createElement("div", { style: { marginRight: dragZoneWidth + "px" } },
|
|
234
|
-
react_1.default.createElement(CellComp, __assign({}, cellProps, { id: "kp_table_cell__".concat(cell.id, "__rich_input") /*dont mess with this id nomenclature. it needs to stay this way. check out the handleCellInputChange fn to understand */, value: cellValue, readOnly: readOnly || cell.readOnly, onChange: function (k, v) {
|
|
235
|
-
return handleCellInputChange({ v: v, rowIdx: rowIdx, cellIdx: cellIdx });
|
|
236
|
-
} })))));
|
|
237
|
-
})));
|
|
249
|
+
style: { display: "flex" }, readOnly: readOnly, rowIdx: rowIdx, key: row.id },
|
|
250
|
+
config.rowHeaderData &&
|
|
251
|
+
genCell({
|
|
252
|
+
cell: (0, convertRowHeaderConfigToCellData_1.convertRowHeaderConfigToCellData)({
|
|
253
|
+
rowHeaderData: config.rowHeaderData,
|
|
254
|
+
convertToRichText: convertToRichText,
|
|
255
|
+
rowIdx: rowIdx
|
|
256
|
+
}),
|
|
257
|
+
}),
|
|
258
|
+
row.cellData.map(function (cell, cellIdx) { return genCell({ cell: cell, cellIdx: cellIdx, rowIdx: rowIdx }); })));
|
|
238
259
|
};
|
|
239
260
|
var fullWidthCompWrapper = (0, react_1.useRef)(null);
|
|
240
261
|
return (react_1.default.createElement("div", null,
|
|
@@ -275,8 +296,10 @@ function SimpleTable(_a) {
|
|
|
275
296
|
? [
|
|
276
297
|
{
|
|
277
298
|
icon: "SquareHalf",
|
|
278
|
-
display:
|
|
279
|
-
|
|
299
|
+
display: value.data[0].cellData[0].isRowHeader
|
|
300
|
+
? UIContent_1.UIContent.SimpleTable.removeHeaderCol
|
|
301
|
+
: UIContent_1.UIContent.SimpleTable.addHeaderCol,
|
|
302
|
+
onClick: function () { return (0, handleToggleColHeader_1.handleToggleColHeader)({ value: value, onChange: onChange, id: id }); },
|
|
280
303
|
},
|
|
281
304
|
]
|
|
282
305
|
: []), true), (enableColActions
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const StyledSimpleTable: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export const StyledSimpleTableRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
export const StyledSimpleTableCell: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export const StyledSimpleTableHeaderCell: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
5
|
export const StyledSimpleTableHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.StyledSimpleTableHeader = exports.StyledSimpleTableCell = exports.StyledSimpleTableRow = exports.StyledSimpleTable = void 0;
|
|
30
|
+
exports.StyledSimpleTableHeader = exports.StyledSimpleTableHeaderCell = exports.StyledSimpleTableCell = exports.StyledSimpleTableRow = exports.StyledSimpleTable = void 0;
|
|
31
31
|
var themes_1 = require("../../themes");
|
|
32
32
|
var transitions_1 = require("../../themes/mixins/transitions");
|
|
33
33
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
@@ -50,9 +50,11 @@ var genActiveColBorder = function (_a) {
|
|
|
50
50
|
? (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["border-bottom: none;"], ["border-bottom: none;"]))) : !isFirstRow && !isLastRow
|
|
51
51
|
? (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-bottom: none;\n border-top: none;\n "], ["\n border-bottom: none;\n border-top: none;\n "]))) : isLastRow && (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["border-top:none;"], ["border-top:none;"]))));
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
var tableCellStyling = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\nmin-height: 4rem;\n position: relative;\n border-right: 1px solid ", ";\n border-bottom: 1px solid ", ";\n ", ";\n \n ", "\n"], ["\nmin-height: 4rem;\n position: relative;\n border-right: 1px solid ", ";\n border-bottom: 1px solid ", ";\n ", ";\n \n ", "\n"])), themes_1.colors.greyColor10, themes_1.colors.greyColor10, (0, transitions_1.transition)("background-color"), function (_a) {
|
|
54
54
|
var readOnly = _a.readOnly, theme = _a.theme, actionsActiveOnRow = _a.actionsActiveOnRow, actionsActiveOnCol = _a.actionsActiveOnCol, rowIdx = _a.rowIdx, totRows = _a.totRows, colIdx = _a.colIdx;
|
|
55
55
|
return !readOnly && (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n ", ";\n \n ", "\n\n ", "\n "], ["\n ", ";\n \n ", "\n\n ", "\n "])), globalVariables_1.globalHoverOnWhiteBG, !actionsActiveOnRow && !actionsActiveOnCol && (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n :focus-within{\n &::before{\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n outline: 1px solid ", ";\n border: 1px solid ", ";\n }\n background-color: ", ";\n } \n "], ["\n :focus-within{\n &::before{\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n outline: 1px solid ", ";\n border: 1px solid ", ";\n }\n background-color: ", ";\n } \n "])), (0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors), (0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors), themes_1.colors.none), genActiveColBorder({ theme: theme, actionsActiveOnCol: actionsActiveOnCol, rowIdx: rowIdx, totRows: totRows, colIdx: colIdx }));
|
|
56
56
|
});
|
|
57
|
-
exports.
|
|
58
|
-
|
|
57
|
+
exports.StyledSimpleTableCell = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), tableCellStyling);
|
|
58
|
+
exports.StyledSimpleTableHeaderCell = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n .public-DraftEditor-content {\n font-weight: 600;\n }\n border-right: 2px solid ", ";\n"], ["\n ", "\n .public-DraftEditor-content {\n font-weight: 600;\n }\n border-right: 2px solid ", ";\n"])), tableCellStyling, themes_1.colors.greyColor10);
|
|
59
|
+
exports.StyledSimpleTableHeader = styled_components_1.default.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n .public-DraftEditor-content {\n font-weight: 600;\n }\n border-bottom: 2px solid ", ";\n"], ["\n .public-DraftEditor-content {\n font-weight: 600;\n }\n border-bottom: 2px solid ", ";\n"])), themes_1.colors.greyColor10);
|
|
60
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
@@ -5,9 +5,16 @@ export function useResizeTableColumns({ setColWidthConfig, colWidthConfig, theme
|
|
|
5
5
|
builderProps: any;
|
|
6
6
|
}): {
|
|
7
7
|
resetColResizeState: (e: any) => void;
|
|
8
|
-
hideShowDragZoneIndicator: (e
|
|
8
|
+
hideShowDragZoneIndicator: ({ e, borderStyleActive, borderStyleInactive }: {
|
|
9
|
+
e: any;
|
|
10
|
+
borderStyleActive?: string;
|
|
11
|
+
borderStyleInactive?: string;
|
|
12
|
+
}) => void;
|
|
9
13
|
initColResizeState: (e: any, d: any) => void;
|
|
10
|
-
resetDragZoneIndicator: (e
|
|
14
|
+
resetDragZoneIndicator: ({ e, borderStyleInactive }: {
|
|
15
|
+
e: any;
|
|
16
|
+
borderStyleInactive?: string;
|
|
17
|
+
}) => void;
|
|
11
18
|
handleResizeColumn: (e: any) => void;
|
|
12
19
|
colResizeState: any;
|
|
13
20
|
dragZoneWidth: number;
|
|
@@ -29,10 +29,11 @@ var useResizeTableColumns = function (_a) {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
var resetDragZoneIndicator = function (
|
|
32
|
+
var resetDragZoneIndicator = function (_a) {
|
|
33
|
+
var e = _a.e, _b = _a.borderStyleInactive, borderStyleInactive = _b === void 0 ? "1px solid ".concat(themes_1.colors.greyColor10) : _b;
|
|
33
34
|
if (colResizeState || e.currentTarget.id !== e.target.id)
|
|
34
35
|
return;
|
|
35
|
-
e.currentTarget.style.borderRight =
|
|
36
|
+
e.currentTarget.style.borderRight = borderStyleInactive;
|
|
36
37
|
e.currentTarget.style.cursor = 'pointer';
|
|
37
38
|
};
|
|
38
39
|
var isInDragZone = function (e) {
|
|
@@ -51,18 +52,19 @@ var useResizeTableColumns = function (_a) {
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
|
-
var hideShowDragZoneIndicator = function (
|
|
55
|
+
var hideShowDragZoneIndicator = function (_a) {
|
|
56
|
+
var e = _a.e, _b = _a.borderStyleActive, borderStyleActive = _b === void 0 ? "1px solid ".concat((0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors)) : _b, _c = _a.borderStyleInactive, borderStyleInactive = _c === void 0 ? "1px solid ".concat(themes_1.colors.greyColor10) : _c;
|
|
55
57
|
e.preventDefault();
|
|
56
58
|
/** currentTarget is the element that this event is bound to */
|
|
57
59
|
if (e.currentTarget.id !== e.target.id)
|
|
58
60
|
return; //very important, else the indicator shows in some cases, when its not supposed to. we don't completely understand why...
|
|
59
61
|
if (!colResizeState) {
|
|
60
62
|
if (isInDragZone(e)) {
|
|
61
|
-
e.currentTarget.style.borderRight =
|
|
63
|
+
e.currentTarget.style.borderRight = borderStyleActive;
|
|
62
64
|
e.currentTarget.style.cursor = 'col-resize';
|
|
63
65
|
}
|
|
64
66
|
else {
|
|
65
|
-
e.currentTarget.style.borderRight =
|
|
67
|
+
e.currentTarget.style.borderRight = borderStyleInactive;
|
|
66
68
|
e.currentTarget.style.cursor = 'pointer';
|
|
67
69
|
}
|
|
68
70
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertRowHeaderConfigToCellData = void 0;
|
|
4
|
+
var convertRowHeaderConfigToCellData = function (_a) {
|
|
5
|
+
var rowHeaderData = _a.rowHeaderData, rowIdx = _a.rowIdx, convertToRichText = _a.convertToRichText;
|
|
6
|
+
return ({
|
|
7
|
+
value: convertToRichText ? convertToRichText(rowHeaderData[rowIdx]) : rowHeaderData[rowIdx],
|
|
8
|
+
readOnly: true,
|
|
9
|
+
id: "rowHeaderCell_".concat(rowIdx),
|
|
10
|
+
isRowHeader: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
exports.convertRowHeaderConfigToCellData = convertRowHeaderConfigToCellData;
|