oolib 2.132.1 → 2.132.2
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.
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PENDINGS
|
|
3
|
+
* - Ideally should migrate RichTextEditor to Lexical
|
|
4
|
+
* - Should run a function that converts rich text to plain text and sends that out in onChange. (like how we do for TitleInput)
|
|
5
|
+
* - for backwards compatibility, in the initValueSetting function, we should convert all plain text values to lexical shape & all draftjs shaped values also to lexical shape
|
|
6
|
+
* - memoization of cell comps maybe? there is some commented code for the same below..
|
|
7
|
+
*/
|
|
1
8
|
export function SimpleTable({ id, readOnly, config, value: _value, onChange, defaultColWidth, }: {
|
|
2
9
|
id: any;
|
|
3
10
|
readOnly: any;
|
|
@@ -68,14 +68,13 @@ var convertRowHeaderConfigToCellData_1 = require("./utils/convertRowHeaderConfig
|
|
|
68
68
|
var prepInitValueFromConfigIfNoValue_1 = require("./utils/prepInitValueFromConfigIfNoValue");
|
|
69
69
|
var DropdownSingle_1 = require("../Dropdowns/DropdownSingle");
|
|
70
70
|
var greyColor100 = themes_1.colors.greyColor100;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
*/
|
|
71
|
+
/**
|
|
72
|
+
* PENDINGS
|
|
73
|
+
* - Ideally should migrate RichTextEditor to Lexical
|
|
74
|
+
* - Should run a function that converts rich text to plain text and sends that out in onChange. (like how we do for TitleInput)
|
|
75
|
+
* - for backwards compatibility, in the initValueSetting function, we should convert all plain text values to lexical shape & all draftjs shaped values also to lexical shape
|
|
76
|
+
* - memoization of cell comps maybe? there is some commented code for the same below..
|
|
77
|
+
*/
|
|
79
78
|
function SimpleTable(_a) {
|
|
80
79
|
var id = _a.id, readOnly = _a.readOnly, _b = _a.config, config = _b === void 0 ? {
|
|
81
80
|
noOfCols: 3,
|
|
@@ -128,10 +127,6 @@ function SimpleTable(_a) {
|
|
|
128
127
|
var CellContentBlocks = {
|
|
129
128
|
RichTextEditor: RichTextEditor,
|
|
130
129
|
DropdownSingle: DropdownSingle_1.DropdownSingle
|
|
131
|
-
// KPDropdown,
|
|
132
|
-
// TextInput,
|
|
133
|
-
// RadioList,
|
|
134
|
-
// SANS_3,
|
|
135
130
|
};
|
|
136
131
|
var CellContentBlockDefaultProps = {
|
|
137
132
|
RichTextEditor: {
|
|
@@ -143,21 +138,21 @@ function SimpleTable(_a) {
|
|
|
143
138
|
},
|
|
144
139
|
},
|
|
145
140
|
DropdownSingle: {
|
|
146
|
-
|
|
141
|
+
selectStyleOverride: {
|
|
142
|
+
backgroundColor: themes_1.colors.none,
|
|
143
|
+
},
|
|
144
|
+
popOutOfOverflowHiddenParent: true,
|
|
147
145
|
}
|
|
148
|
-
// KPDropdown: {
|
|
149
|
-
// size: 'small',
|
|
150
|
-
// },
|
|
151
146
|
};
|
|
147
|
+
var CellValueGetters = {
|
|
148
|
+
RichTextEditor: function (v) { return (convertToRichText ? convertToRichText(v) : v); },
|
|
149
|
+
}; //prob dont need this..
|
|
152
150
|
var _g = (0, react_1.useState)(undefined), actionsActiveOnRow = _g[0], setActionsActiveOnRow = _g[1];
|
|
153
151
|
var _h = (0, react_1.useState)(undefined), actionsActiveOnCol = _h[0], setActionsActiveOnCol = _h[1];
|
|
154
152
|
var _j = (0, react_1.useState)({
|
|
155
153
|
rowIdx: undefined,
|
|
156
154
|
colIdx: undefined,
|
|
157
155
|
}), hoveredRowAndCol = _j[0], setHoveredRowAndCol = _j[1];
|
|
158
|
-
var CellValueGetters = {
|
|
159
|
-
RichTextEditor: function (v) { return (convertToRichText ? convertToRichText(v) : v); },
|
|
160
|
-
}; //prob dont need this..
|
|
161
156
|
var handleCellInputChange = function (_a) {
|
|
162
157
|
var cellIdx = _a.cellIdx, rowIdx = _a.rowIdx, v = _a.v;
|
|
163
158
|
var valData = value.data;
|
|
@@ -183,7 +178,7 @@ function SimpleTable(_a) {
|
|
|
183
178
|
var cellCompName = cell.comp || 'RichTextEditor';
|
|
184
179
|
var NoCompPlaceholder = function () { return react_1.default.createElement("div", null, "No comp exists"); };
|
|
185
180
|
var CellComp = CellContentBlocks[cellCompName] || NoCompPlaceholder;
|
|
186
|
-
var cellProps = CellContentBlockDefaultProps[cellCompName] ? __assign(__assign({}, CellContentBlockDefaultProps[
|
|
181
|
+
var cellProps = CellContentBlockDefaultProps[cellCompName] ? __assign(__assign({}, CellContentBlockDefaultProps[cellCompName]), (cell.props || {})) : {};
|
|
187
182
|
var cellValue = CellValueGetters[cellCompName] ? CellValueGetters[cellCompName](cell.value) : cell.value;
|
|
188
183
|
var cellWidth = value.colWidthConfig["col_".concat(cellIdx)] || defaultColWidth + 'px'; //cuz when pre-fixed column is applied via config.rowHeaderData, no colWidthConfig will be there for it in value.colWidthConfig
|
|
189
184
|
//(100% - totalExplicitWidths)/(totalColumns - noOfColsWithExplicitWidths)
|