oolib 2.87.1 → 2.88.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/UIContent/index.d.ts +1 -0
- package/dist/UIContent/index.js +2 -1
- package/dist/components/Dropdowns/comps/OptionContent/index.js +3 -1
- package/dist/components/Dropdowns/comps/SelectDropdown/index.js +2 -0
- package/dist/components/Dropdowns/utils/genColor.d.ts +4 -0
- package/dist/components/Dropdowns/utils/genColor.js +13 -0
- package/dist/components/SimpleTable/comps/rowColActionMenus/ColActionsMenu/index.d.ts +3 -1
- package/dist/components/SimpleTable/comps/rowColActionMenus/ColActionsMenu/index.js +39 -4
- package/dist/components/SimpleTable/comps/rowColActionMenus/RowActionsMenu/index.d.ts +2 -1
- package/dist/components/SimpleTable/comps/rowColActionMenus/RowActionsMenu/index.js +43 -6
- package/dist/components/SimpleTable/index.js +26 -19
- package/dist/components/SimpleTable/styled.js +14 -5
- package/dist/components/Switches/index.d.ts +2 -1
- package/dist/components/Switches/index.js +8 -2
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +2 -0
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export namespace UIContent {
|
|
|
14
14
|
export const insertColAfter: string;
|
|
15
15
|
export const insertColBefore: string;
|
|
16
16
|
export const addHeaderCol: string;
|
|
17
|
+
export const removeHeaderCol: string;
|
|
17
18
|
export const addHeaderRow: string;
|
|
18
19
|
export const removeHeaderRow: string;
|
|
19
20
|
export const stretchToFullWidth: string;
|
package/dist/UIContent/index.js
CHANGED
|
@@ -15,7 +15,8 @@ exports.UIContent = {
|
|
|
15
15
|
clearContent: 'Clear Content',
|
|
16
16
|
insertColAfter: 'Insert Right',
|
|
17
17
|
insertColBefore: 'Insert Left',
|
|
18
|
-
addHeaderCol: 'Header Column',
|
|
18
|
+
addHeaderCol: 'Add Header Column',
|
|
19
|
+
removeHeaderCol: 'Remove Header Column',
|
|
19
20
|
addHeaderRow: 'Add Header Row',
|
|
20
21
|
removeHeaderRow: 'Remove Header Row',
|
|
21
22
|
stretchToFullWidth: 'Stretch to Full Width'
|
|
@@ -10,11 +10,12 @@ var genProfileImg_1 = require("../../utils/genProfileImg");
|
|
|
10
10
|
var genIcon_1 = require("../../utils/genIcon");
|
|
11
11
|
var Typo_1 = require("../../../Typo");
|
|
12
12
|
var styled_components_1 = require("styled-components");
|
|
13
|
+
var genColor_1 = require("../../utils/genColor");
|
|
13
14
|
var OptionContent = function (_a) {
|
|
14
15
|
var option = _a.option, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S;
|
|
15
16
|
var theme = (0, styled_components_1.useTheme)();
|
|
16
17
|
var TypoComp = S ? Typo_1.SANS_2 : Typo_1.SANS_3;
|
|
17
|
-
var image = option.image, display = option.display, icon = option.icon, desc = option.desc;
|
|
18
|
+
var image = option.image, display = option.display, icon = option.icon, desc = option.desc, color = option.color;
|
|
18
19
|
return (react_1.default.createElement("div", { style: {
|
|
19
20
|
display: "flex",
|
|
20
21
|
alignItems: "center",
|
|
@@ -23,6 +24,7 @@ var OptionContent = function (_a) {
|
|
|
23
24
|
} },
|
|
24
25
|
image && (0, genProfileImg_1.genProfileImg)({ image: image, display: display, invert: invert, theme: theme }),
|
|
25
26
|
icon && (0, genIcon_1.genIcon)(icon),
|
|
27
|
+
color && (0, genColor_1.genColor)({ color: color }),
|
|
26
28
|
react_1.default.createElement("div", null,
|
|
27
29
|
react_1.default.createElement(TypoComp, { invert: invert, semibold: desc ? true : false, className: "OKE-Dropdown__optionText ".concat(optionsClassName || "") }, (0, getText_1.getText)(display)),
|
|
28
30
|
desc && (react_1.default.createElement(TypoComp, { invert: invert, className: "OKE-Dropdown__optionDesc" }, (0, getText_1.getText)(desc))))));
|
|
@@ -21,6 +21,7 @@ var Caret_1 = require("../Caret");
|
|
|
21
21
|
var genIcon_1 = require("../../utils/genIcon");
|
|
22
22
|
var Typo_1 = require("../../../Typo");
|
|
23
23
|
var styled_1 = require("./styled");
|
|
24
|
+
var genColor_1 = require("../../utils/genColor");
|
|
24
25
|
var SelectDropdown = function (_a) {
|
|
25
26
|
var
|
|
26
27
|
//from root
|
|
@@ -47,6 +48,7 @@ var SelectDropdown = function (_a) {
|
|
|
47
48
|
var genSelectComp = function () { return (react_1.default.createElement(styled_1.StyledSelectWrapper, { invert: invert, S: S, disabled: disabled, style: selectStyleOverride },
|
|
48
49
|
react_1.default.createElement("div", null,
|
|
49
50
|
react_1.default.createElement("div", { style: { display: "flex", gap: "1rem", alignItems: "center" } },
|
|
51
|
+
showElem('color') && (0, genColor_1.genColor)({ color: value === null || value === void 0 ? void 0 : value.color }),
|
|
50
52
|
showElem("icon") && (0, genIcon_1.genIcon)(value === null || value === void 0 ? void 0 : value.icon),
|
|
51
53
|
showElem("display") && (react_1.default.createElement(TypoComp
|
|
52
54
|
// semibold={
|
|
@@ -0,0 +1,13 @@
|
|
|
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.genColor = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var genColor = function (_a) {
|
|
9
|
+
var color = _a.color;
|
|
10
|
+
return (react_1.default.createElement("div", { style: { flex: "0 0 auto" } },
|
|
11
|
+
react_1.default.createElement("div", { style: { width: '2rem', height: '2rem', background: color, borderRadius: '10%' } })));
|
|
12
|
+
};
|
|
13
|
+
exports.genColor = genColor;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export function ColActionsMenu({ value, colIdx, onChange, id, defaultColWidth, colActionsButtonHeight }: {
|
|
1
|
+
export function ColActionsMenu({ value, colIdx, onChange, id, defaultColWidth, setActionsActiveOnCol, colActionsButtonHeight, conditionsToRender }: {
|
|
2
2
|
value: any;
|
|
3
3
|
colIdx: any;
|
|
4
4
|
onChange: any;
|
|
5
5
|
id: any;
|
|
6
6
|
defaultColWidth: any;
|
|
7
|
+
setActionsActiveOnCol: any;
|
|
7
8
|
colActionsButtonHeight: any;
|
|
9
|
+
conditionsToRender?: boolean;
|
|
8
10
|
}): React.JSX.Element;
|
|
9
11
|
import React from "react";
|
|
@@ -3,12 +3,35 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
6
29
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
31
|
};
|
|
9
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
33
|
exports.ColActionsMenu = void 0;
|
|
11
|
-
var react_1 =
|
|
34
|
+
var react_1 = __importStar(require("react"));
|
|
12
35
|
var ActionMenu_1 = require("../../../../ActionMenu");
|
|
13
36
|
var handleColActions_1 = require("../../../handlers/handleColActions");
|
|
14
37
|
var UIContent_1 = require("../../../../../UIContent");
|
|
@@ -17,9 +40,21 @@ var DisplayIcon_1 = require("../../../../../utils/comps/DisplayIcon");
|
|
|
17
40
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
18
41
|
var StyledCustomSelectCompWrapper = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n width: 2.5rem;\n"], ["\n ", "\n width: 2.5rem;\n"])), styled_1.commonRowColActionMenuStyles);
|
|
19
42
|
var ColActionsMenu = function (_a) {
|
|
20
|
-
var value = _a.value, colIdx = _a.colIdx, onChange = _a.onChange, id = _a.id, defaultColWidth = _a.defaultColWidth, colActionsButtonHeight = _a.colActionsButtonHeight;
|
|
21
|
-
|
|
22
|
-
|
|
43
|
+
var value = _a.value, colIdx = _a.colIdx, onChange = _a.onChange, id = _a.id, defaultColWidth = _a.defaultColWidth, setActionsActiveOnCol = _a.setActionsActiveOnCol, colActionsButtonHeight = _a.colActionsButtonHeight, _b = _a.conditionsToRender, conditionsToRender = _b === void 0 ? true : _b;
|
|
44
|
+
var _c = (0, react_1.useState)(false), actionMenuIsOpen = _c[0], setActionMenuIsOpen = _c[1];
|
|
45
|
+
var isFirstMount = (0, react_1.useRef)(true);
|
|
46
|
+
(0, react_1.useEffect)(function () {
|
|
47
|
+
if (!isFirstMount.current) {
|
|
48
|
+
setActionsActiveOnCol(actionMenuIsOpen ? colIdx : undefined);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
isFirstMount.current = false;
|
|
52
|
+
}
|
|
53
|
+
}, [actionMenuIsOpen]);
|
|
54
|
+
// cuz if an actionmenu is open we want it to continue showing
|
|
55
|
+
// on screen irrespective of other factors such as hover and such
|
|
56
|
+
return (conditionsToRender || actionMenuIsOpen) && (react_1.default.createElement("div", { style: { zIndex: 2, position: 'absolute', top: 0, left: '50%', transform: 'translate(-50%, -50%)' } },
|
|
57
|
+
react_1.default.createElement(ActionMenu_1.ActionMenu, { setShowActions: function (bool) { return setActionMenuIsOpen(bool); }, align: "left", CustomSelectComp: function (_a) {
|
|
23
58
|
var active = _a.active, onClick = _a.onClick;
|
|
24
59
|
return (react_1.default.createElement(StyledCustomSelectCompWrapper, { style: { height: colActionsButtonHeight + 'px' }, onClick: onClick, active: active },
|
|
25
60
|
react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: "DotsThree", size: 16 })));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export function RowActionsMenu({ value, rowIdx, onChange, id, setActionsActiveOnRow, rowActionsButtonWidth }: {
|
|
1
|
+
export function RowActionsMenu({ value, rowIdx, onChange, id, setActionsActiveOnRow, rowActionsButtonWidth, conditionsToRender }: {
|
|
2
2
|
value: any;
|
|
3
3
|
rowIdx: any;
|
|
4
4
|
onChange: any;
|
|
5
5
|
id: any;
|
|
6
6
|
setActionsActiveOnRow: any;
|
|
7
7
|
rowActionsButtonWidth: any;
|
|
8
|
+
conditionsToRender?: boolean;
|
|
8
9
|
}): React.JSX.Element;
|
|
9
10
|
import React from "react";
|
|
@@ -3,12 +3,35 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
6
29
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
31
|
};
|
|
9
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
33
|
exports.RowActionsMenu = void 0;
|
|
11
|
-
var react_1 =
|
|
34
|
+
var react_1 = __importStar(require("react"));
|
|
12
35
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
36
|
var UIContent_1 = require("../../../../../UIContent");
|
|
14
37
|
var DisplayIcon_1 = require("../../../../../utils/comps/DisplayIcon");
|
|
@@ -16,19 +39,33 @@ var ActionMenu_1 = require("../../../../ActionMenu");
|
|
|
16
39
|
var handleRowActions_1 = require("../../../handlers/handleRowActions");
|
|
17
40
|
var styled_1 = require("../styled");
|
|
18
41
|
var StyledCustomSelectCompWrapper = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n /* width: 1.5rem; */\n height: 2.5rem;\n"], ["\n ", "\n /* width: 1.5rem; */\n height: 2.5rem;\n"])), styled_1.commonRowColActionMenuStyles);
|
|
19
|
-
// const CustomSelectComp =
|
|
42
|
+
// const CustomSelectComp =
|
|
20
43
|
var RowActionsMenu = function (_a) {
|
|
21
|
-
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, setActionsActiveOnRow = _a.setActionsActiveOnRow, rowActionsButtonWidth = _a.rowActionsButtonWidth;
|
|
22
|
-
|
|
44
|
+
var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, setActionsActiveOnRow = _a.setActionsActiveOnRow, rowActionsButtonWidth = _a.rowActionsButtonWidth, _b = _a.conditionsToRender, conditionsToRender = _b === void 0 ? true : _b;
|
|
45
|
+
var _c = (0, react_1.useState)(false), actionMenuIsOpen = _c[0], setActionMenuIsOpen = _c[1];
|
|
46
|
+
var isFirstMount = (0, react_1.useRef)(true);
|
|
47
|
+
(0, react_1.useEffect)(function () {
|
|
48
|
+
if (!isFirstMount.current) {
|
|
49
|
+
setActionsActiveOnRow(actionMenuIsOpen ? rowIdx : undefined);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
isFirstMount.current = false;
|
|
53
|
+
}
|
|
54
|
+
}, [actionMenuIsOpen]);
|
|
55
|
+
// cuz if an actionmenu is open we want it to continue showing
|
|
56
|
+
// on screen irrespective of other factors such as hover and such
|
|
57
|
+
return (conditionsToRender || actionMenuIsOpen) && (react_1.default.createElement("div", { style: {
|
|
23
58
|
zIndex: 1,
|
|
24
59
|
position: "absolute",
|
|
25
60
|
top: "50%",
|
|
26
61
|
left: 0,
|
|
27
62
|
transform: "translate(-50%, -50%)",
|
|
28
63
|
} },
|
|
29
|
-
react_1.default.createElement(ActionMenu_1.ActionMenu, { align: "left", setShowActions: function (showActions) {
|
|
64
|
+
react_1.default.createElement(ActionMenu_1.ActionMenu, { align: "left", setShowActions: function (showActions) {
|
|
65
|
+
setActionMenuIsOpen(showActions);
|
|
66
|
+
}, CustomSelectComp: function (_a) {
|
|
30
67
|
var active = _a.active, onClick = _a.onClick;
|
|
31
|
-
return (react_1.default.createElement(StyledCustomSelectCompWrapper, { style: { width: rowActionsButtonWidth +
|
|
68
|
+
return (react_1.default.createElement(StyledCustomSelectCompWrapper, { style: { width: rowActionsButtonWidth + "px" }, onClick: onClick, active: active },
|
|
32
69
|
react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: "DotsThreeVertical", size: 16 })));
|
|
33
70
|
}, actions: [
|
|
34
71
|
{
|
|
@@ -142,10 +142,11 @@ function SimpleTable(_a) {
|
|
|
142
142
|
// },
|
|
143
143
|
};
|
|
144
144
|
var _g = (0, react_1.useState)(undefined), actionsActiveOnRow = _g[0], setActionsActiveOnRow = _g[1];
|
|
145
|
-
var _h = (0, react_1.useState)(
|
|
145
|
+
var _h = (0, react_1.useState)(undefined), actionsActiveOnCol = _h[0], setActionsActiveOnCol = _h[1];
|
|
146
|
+
var _j = (0, react_1.useState)({
|
|
146
147
|
rowIdx: undefined,
|
|
147
148
|
colIdx: undefined,
|
|
148
|
-
}), hoveredRowAndCol =
|
|
149
|
+
}), hoveredRowAndCol = _j[0], setHoveredRowAndCol = _j[1];
|
|
149
150
|
var CellValueGetters = {
|
|
150
151
|
RichTextEditor: function (v) { return (convertToRichText ? convertToRichText(v) : v); },
|
|
151
152
|
}; //prob dont need this..
|
|
@@ -191,7 +192,7 @@ function SimpleTable(_a) {
|
|
|
191
192
|
width: "".concat(cellWidth),
|
|
192
193
|
borderRight: (colResizeState === null || colResizeState === void 0 ? void 0 : colResizeState.colId) === "col_".concat(cellIdx) &&
|
|
193
194
|
"2px solid ".concat((0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors)),
|
|
194
|
-
}, actionsActiveOnRow: actionsActiveOnRow, onMouseEnter: function (e) {
|
|
195
|
+
}, actionsActiveOnRow: actionsActiveOnRow, colIdx: cellIdx, rowIdx: rowIdx, totRows: value.data.length, actionsActiveOnCol: actionsActiveOnCol, onMouseEnter: function (e) {
|
|
195
196
|
setHoveredRowAndCol({
|
|
196
197
|
rowIdx: rowIdx,
|
|
197
198
|
colIdx: cellIdx,
|
|
@@ -203,32 +204,36 @@ function SimpleTable(_a) {
|
|
|
203
204
|
onMouseDown: function (e) {
|
|
204
205
|
initColResizeState(e, { colId: "col_".concat(cellIdx) });
|
|
205
206
|
}, onMouseOut: resetDragZoneIndicator, onMouseMove: hideShowDragZoneIndicator, tabIndex: 0 },
|
|
206
|
-
|
|
207
|
-
enableColActions &&
|
|
208
|
-
rowIdx === 0 &&
|
|
209
|
-
hoveredRowAndCol.colIdx === cellIdx && (react_1.default.createElement(ColActionsMenu_1.ColActionsMenu, __assign({}, {
|
|
207
|
+
react_1.default.createElement(ColActionsMenu_1.ColActionsMenu, __assign({}, {
|
|
210
208
|
value: value,
|
|
211
209
|
colIdx: cellIdx,
|
|
212
210
|
onChange: onChange,
|
|
213
211
|
id: id,
|
|
214
212
|
defaultColWidth: defaultColWidth,
|
|
213
|
+
setActionsActiveOnCol: setActionsActiveOnCol,
|
|
215
214
|
colActionsButtonHeight: colActionsButtonHeight,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
conditionsToRender: !readOnly &&
|
|
216
|
+
enableColActions &&
|
|
217
|
+
rowIdx === 0 &&
|
|
218
|
+
hoveredRowAndCol.colIdx === cellIdx,
|
|
219
|
+
})),
|
|
220
|
+
react_1.default.createElement(RowActionsMenu_1.RowActionsMenu, __assign({}, {
|
|
222
221
|
value: value,
|
|
223
222
|
rowIdx: rowIdx,
|
|
224
223
|
onChange: onChange,
|
|
225
224
|
id: id,
|
|
226
225
|
setActionsActiveOnRow: setActionsActiveOnRow,
|
|
227
226
|
rowActionsButtonWidth: rowActionsButtonWidth,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
+
} })))));
|
|
232
237
|
})));
|
|
233
238
|
};
|
|
234
239
|
var fullWidthCompWrapper = (0, react_1.useRef)(null);
|
|
@@ -238,7 +243,7 @@ function SimpleTable(_a) {
|
|
|
238
243
|
overflowX: "auto",
|
|
239
244
|
paddingLeft: rowActionsButtonWidth / 2 + "px",
|
|
240
245
|
marginLeft: "-" + rowActionsButtonWidth / 2 + "px",
|
|
241
|
-
paddingTop: primaryTableActionsMenuGap + primaryTableActionsMenuHeight +
|
|
246
|
+
paddingTop: primaryTableActionsMenuGap + primaryTableActionsMenuHeight + "px",
|
|
242
247
|
} },
|
|
243
248
|
react_1.default.createElement("div", { ref: fullWidthCompWrapper, style: {
|
|
244
249
|
display: "flex",
|
|
@@ -250,7 +255,7 @@ function SimpleTable(_a) {
|
|
|
250
255
|
right: 0,
|
|
251
256
|
top: "-" + primaryTableActionsMenuGap + "px",
|
|
252
257
|
transform: "translateY(-100%)",
|
|
253
|
-
zIndex:
|
|
258
|
+
zIndex: 10,
|
|
254
259
|
} },
|
|
255
260
|
react_1.default.createElement(ActionMenu_1.ActionMenu, { ButtonComp: "ButtonPrimary", actions: __spreadArray(__spreadArray([
|
|
256
261
|
{
|
|
@@ -269,6 +274,7 @@ function SimpleTable(_a) {
|
|
|
269
274
|
], (enableRowActions
|
|
270
275
|
? [
|
|
271
276
|
{
|
|
277
|
+
icon: "SquareHalf",
|
|
272
278
|
display: UIContent_1.UIContent.SimpleTable.addHeaderCol,
|
|
273
279
|
onClick: function () { },
|
|
274
280
|
},
|
|
@@ -276,6 +282,7 @@ function SimpleTable(_a) {
|
|
|
276
282
|
: []), true), (enableColActions
|
|
277
283
|
? [
|
|
278
284
|
{
|
|
285
|
+
icon: "SquareHalfBottom",
|
|
279
286
|
display: value.data[0].isColHeader
|
|
280
287
|
? UIContent_1.UIContent.SimpleTable.removeHeaderRow
|
|
281
288
|
: UIContent_1.UIContent.SimpleTable.addHeaderRow,
|
|
@@ -41,9 +41,18 @@ exports.StyledSimpleTableRow = styled_components_1.default.div(templateObject_3
|
|
|
41
41
|
var actionsActiveOnRow = _a.actionsActiveOnRow, rowIdx = _a.rowIdx, theme = _a.theme;
|
|
42
42
|
return actionsActiveOnRow === rowIdx && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &::before{\n content: '';\n position: absolute;\n width: calc(100% - 1px);\n height: calc(100% - 1px);\n outline: 1px solid ", ";\n border: 1px solid ", ";\n z-index: 1;\n }\n "], ["\n &::before{\n content: '';\n position: absolute;\n width: calc(100% - 1px);\n height: calc(100% - 1px);\n outline: 1px solid ", ";\n border: 1px solid ", ";\n z-index: 1;\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));
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
|
|
44
|
+
var genActiveColBorder = function (_a) {
|
|
45
|
+
var actionsActiveOnCol = _a.actionsActiveOnCol, colIdx = _a.colIdx, rowIdx = _a.rowIdx, totRows = _a.totRows, theme = _a.theme;
|
|
46
|
+
var isActiveCol = actionsActiveOnCol === colIdx;
|
|
47
|
+
var isFirstRow = rowIdx === 0;
|
|
48
|
+
var isLastRow = rowIdx === totRows - 1;
|
|
49
|
+
return isActiveCol && (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n &::before{\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n width: calc(100% + 2px);\n height: calc(100% + 2px);\n border: 2px solid ", ";\n z-index: 1;\n ", "\n }\n "], ["\n &::before{\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n width: calc(100% + 2px);\n height: calc(100% + 2px);\n border: 2px solid ", ";\n z-index: 1;\n ", "\n }\n "])), (0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors), isFirstRow
|
|
50
|
+
? (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["border-bottom: none;"], ["border-bottom: none;"]))) : !isFirstRow && !isLastRow
|
|
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
|
+
};
|
|
53
|
+
exports.StyledSimpleTableCell = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n min-height: 4rem;\n position: relative;\n border-right: 1px solid ", ";\n border-bottom: 1px solid ", ";\n ", ";\n \n ", "\n"], ["\n min-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
|
+
var readOnly = _a.readOnly, theme = _a.theme, actionsActiveOnRow = _a.actionsActiveOnRow, actionsActiveOnCol = _a.actionsActiveOnCol, rowIdx = _a.rowIdx, totRows = _a.totRows, colIdx = _a.colIdx;
|
|
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 }));
|
|
47
56
|
});
|
|
48
|
-
exports.StyledSimpleTableHeader = styled_components_1.default.div(
|
|
49
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
57
|
+
exports.StyledSimpleTableHeader = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n .public-DraftEditor-content {\n font-weight: 600;\n }\n background-color: ", ";\n border-bottom: 2px solid ", ";\n"], ["\n .public-DraftEditor-content {\n font-weight: 600;\n }\n background-color: ", ";\n border-bottom: 2px solid ", ";\n"])), themes_1.colors.greyColor, themes_1.colors.greyColor10);
|
|
58
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -7,7 +7,7 @@ export function SwitchDouble({ id, value: valueProp, options, onChange, invert,
|
|
|
7
7
|
saveValueAsString: any;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}, ...args: any[]): React.JSX.Element;
|
|
10
|
-
export function SwitchSingle({ id, value, option, onChange, disabled, invert, saveValueAsString, layoutStyle, }: {
|
|
10
|
+
export function SwitchSingle({ id, value, option, onChange, disabled, invert, saveValueAsString, layoutStyle, infoTooltip, }: {
|
|
11
11
|
id: any;
|
|
12
12
|
value: any;
|
|
13
13
|
option: any;
|
|
@@ -16,5 +16,6 @@ export function SwitchSingle({ id, value, option, onChange, disabled, invert, sa
|
|
|
16
16
|
invert: any;
|
|
17
17
|
saveValueAsString: any;
|
|
18
18
|
layoutStyle?: string;
|
|
19
|
+
infoTooltip: any;
|
|
19
20
|
}, ...args: any[]): React.JSX.Element;
|
|
20
21
|
import React from "react";
|
|
@@ -20,6 +20,7 @@ var themes_1 = require("../../themes");
|
|
|
20
20
|
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
21
21
|
var BlockLabel_1 = require("../BlockLabel");
|
|
22
22
|
var styled_1 = require("./styled");
|
|
23
|
+
var Tooltip_1 = require("../Tooltip");
|
|
23
24
|
var greyColor40 = themes_1.colors.greyColor40, greyColor100 = themes_1.colors.greyColor100, white = themes_1.colors.white;
|
|
24
25
|
function SwitchDouble(_a) {
|
|
25
26
|
var id = _a.id, valueProp = _a.value, options = _a.options, onChange = _a.onChange, invert = _a.invert, saveValueAsString = _a.saveValueAsString, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
@@ -55,7 +56,7 @@ function SwitchDouble(_a) {
|
|
|
55
56
|
}
|
|
56
57
|
exports.SwitchDouble = SwitchDouble;
|
|
57
58
|
function SwitchSingle(_a) {
|
|
58
|
-
var id = _a.id, value = _a.value, option = _a.option, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b, invert = _a.invert, saveValueAsString = _a.saveValueAsString, _c = _a.layoutStyle, layoutStyle = _c === void 0 ? "style1" : _c;
|
|
59
|
+
var id = _a.id, value = _a.value, option = _a.option, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b, invert = _a.invert, saveValueAsString = _a.saveValueAsString, _c = _a.layoutStyle, layoutStyle = _c === void 0 ? "style1" : _c, infoTooltip = _a.infoTooltip;
|
|
59
60
|
var props = arguments[0];
|
|
60
61
|
/**
|
|
61
62
|
* very important that we check this way,
|
|
@@ -75,7 +76,12 @@ function SwitchSingle(_a) {
|
|
|
75
76
|
var genSwitch = function () { return (react_1.default.createElement(styled_1.StyledButtonSlider, { inactive: isInactive, disabled: disabled, invert: invert, onClick: handleClick },
|
|
76
77
|
react_1.default.createElement(styled_1.StyledSwitch, { className: "StyledSwitch" //read in styled.js why we are using an okf-anti-pattern
|
|
77
78
|
, direction: isInactive ? "left" : "right", inactive: isInactive, disabled: disabled, invert: invert }))); };
|
|
78
|
-
var
|
|
79
|
+
var genDisplayText = function () { return react_1.default.createElement(styled_1.STYLED_SANS_3, __assign({}, { invert: invert, lineHeight: 1, semibold: isInactive ? false : true }), option.display); };
|
|
80
|
+
var genSwitchDisplay = function () {
|
|
81
|
+
return infoTooltip ? (react_1.default.createElement("div", { style: { display: "flex", gap: ".5rem", alignItems: "center" } },
|
|
82
|
+
genDisplayText(),
|
|
83
|
+
react_1.default.createElement(Tooltip_1.Tooltip, __assign({ presetTarget: "infoIcon" }, infoTooltip)))) : genDisplayText();
|
|
84
|
+
};
|
|
79
85
|
return (react_1.default.createElement("div", null,
|
|
80
86
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
81
87
|
layoutStyle === "style1" ? (react_1.default.createElement(styled_1.StyledSwitchWrapperStyle1, null,
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export namespace icons {
|
|
|
106
106
|
export { ThumbsUp };
|
|
107
107
|
export { ChatText };
|
|
108
108
|
export { SlackLogo };
|
|
109
|
+
export { SquareHalf };
|
|
110
|
+
export { SquareHalfBottom };
|
|
109
111
|
export { OkeGoogleIcon };
|
|
110
112
|
export { LetterH };
|
|
111
113
|
export { IndexIcon };
|
|
@@ -265,6 +267,8 @@ import { TextAa } from "phosphor-react";
|
|
|
265
267
|
import { ThumbsUp } from "phosphor-react";
|
|
266
268
|
import { ChatText } from "phosphor-react";
|
|
267
269
|
import { SlackLogo } from "phosphor-react";
|
|
270
|
+
import { SquareHalf } from "phosphor-react";
|
|
271
|
+
import { SquareHalfBottom } from "phosphor-react";
|
|
268
272
|
import { OkeGoogleIcon } from "./custom";
|
|
269
273
|
import { LetterH } from "./custom";
|
|
270
274
|
import { IndexIcon } from "./custom";
|
package/dist/icons/index.js
CHANGED
|
@@ -111,6 +111,8 @@ exports.icons = {
|
|
|
111
111
|
ThumbsUp: phosphor_react_1.ThumbsUp,
|
|
112
112
|
ChatText: phosphor_react_1.ChatText,
|
|
113
113
|
SlackLogo: phosphor_react_1.SlackLogo,
|
|
114
|
+
SquareHalf: phosphor_react_1.SquareHalf,
|
|
115
|
+
SquareHalfBottom: phosphor_react_1.SquareHalfBottom,
|
|
114
116
|
//custom
|
|
115
117
|
OkeGoogleIcon: custom_1.OkeGoogleIcon,
|
|
116
118
|
LetterH: custom_1.LetterH,
|