oolib 2.227.6 → 2.227.8

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.
Files changed (41) hide show
  1. package/dist/UIContent/index.d.ts +0 -15
  2. package/dist/UIContent/index.js +0 -14
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +2 -4
  5. package/dist/v2/components/TextInputs/index.d.ts +3 -2
  6. package/dist/v2/components/TextInputs/index.js +6 -6
  7. package/package.json +1 -1
  8. package/dist/components/SimpleTable/comps/AddRowColButtons/index.d.ts +0 -9
  9. package/dist/components/SimpleTable/comps/AddRowColButtons/index.js +0 -77
  10. package/dist/components/SimpleTable/comps/rowColActionMenus/ColActionsMenu/index.d.ts +0 -11
  11. package/dist/components/SimpleTable/comps/rowColActionMenus/ColActionsMenu/index.js +0 -95
  12. package/dist/components/SimpleTable/comps/rowColActionMenus/RowActionsMenu/index.d.ts +0 -12
  13. package/dist/components/SimpleTable/comps/rowColActionMenus/RowActionsMenu/index.js +0 -120
  14. package/dist/components/SimpleTable/comps/rowColActionMenus/styled.d.ts +0 -1
  15. package/dist/components/SimpleTable/comps/rowColActionMenus/styled.js +0 -18
  16. package/dist/components/SimpleTable/handlers/handleColActions.d.ts +0 -38
  17. package/dist/components/SimpleTable/handlers/handleColActions.js +0 -155
  18. package/dist/components/SimpleTable/handlers/handleRowActions.d.ts +0 -34
  19. package/dist/components/SimpleTable/handlers/handleRowActions.js +0 -96
  20. package/dist/components/SimpleTable/handlers/handleStretchToFullWidth.d.ts +0 -8
  21. package/dist/components/SimpleTable/handlers/handleStretchToFullWidth.js +0 -34
  22. package/dist/components/SimpleTable/handlers/handleToggleColHeader.d.ts +0 -5
  23. package/dist/components/SimpleTable/handlers/handleToggleColHeader.js +0 -21
  24. package/dist/components/SimpleTable/handlers/handleToggleRowHeader.d.ts +0 -5
  25. package/dist/components/SimpleTable/handlers/handleToggleRowHeader.js +0 -31
  26. package/dist/components/SimpleTable/index.d.ts +0 -31
  27. package/dist/components/SimpleTable/index.js +0 -366
  28. package/dist/components/SimpleTable/styled.d.ts +0 -5
  29. package/dist/components/SimpleTable/styled.js +0 -80
  30. package/dist/components/SimpleTable/useResizeTableColumns.d.ts +0 -21
  31. package/dist/components/SimpleTable/useResizeTableColumns.js +0 -88
  32. package/dist/components/SimpleTable/utils/convertColHeaderConfigToRowData.d.ts +0 -8
  33. package/dist/components/SimpleTable/utils/convertColHeaderConfigToRowData.js +0 -16
  34. package/dist/components/SimpleTable/utils/convertRowHeaderConfigToCellData.d.ts +0 -10
  35. package/dist/components/SimpleTable/utils/convertRowHeaderConfigToCellData.js +0 -13
  36. package/dist/components/SimpleTable/utils/genHash.d.ts +0 -1
  37. package/dist/components/SimpleTable/utils/genHash.js +0 -13
  38. package/dist/components/SimpleTable/utils/prepInitValueFromConfigIfNoValue.d.ts +0 -10
  39. package/dist/components/SimpleTable/utils/prepInitValueFromConfigIfNoValue.js +0 -79
  40. package/dist/stories/Oolib/components/SimpleTable.stories.d.ts +0 -67
  41. package/dist/stories/Oolib/components/SimpleTable.stories.js +0 -128
@@ -11,19 +11,4 @@ export namespace UIContent {
11
11
  let uploadError_1: string;
12
12
  export { uploadError_1 as uploadError };
13
13
  }
14
- namespace SimpleTable {
15
- let _delete: string;
16
- export { _delete as delete };
17
- export let duplicate: string;
18
- export let insertRowAfter: string;
19
- export let insertRowBefore: string;
20
- export let clearContent: string;
21
- export let insertColAfter: string;
22
- export let insertColBefore: string;
23
- export let addHeaderCol: string;
24
- export let removeHeaderCol: string;
25
- export let addHeaderRow: string;
26
- export let removeHeaderRow: string;
27
- export let stretchToFullWidth: string;
28
- }
29
14
  }
@@ -12,19 +12,5 @@ exports.UIContent = {
12
12
  },
13
13
  Pdf: {
14
14
  uploadError: "Unable to upload file"
15
- },
16
- SimpleTable: {
17
- delete: 'Delete',
18
- duplicate: 'Duplicate',
19
- insertRowAfter: 'Insert Below',
20
- insertRowBefore: 'Insert Above',
21
- clearContent: 'Clear Content',
22
- insertColAfter: 'Insert Right',
23
- insertColBefore: 'Insert Left',
24
- addHeaderCol: 'Add Header Column',
25
- removeHeaderCol: 'Remove Header Column',
26
- addHeaderRow: 'Add Header Row',
27
- removeHeaderRow: 'Remove Header Row',
28
- stretchToFullWidth: 'Stretch to Full Width'
29
15
  }
30
16
  };
package/dist/index.d.ts CHANGED
@@ -53,7 +53,6 @@ export { default as IFrameInput } from "./components/IFrameInput";
53
53
  export { ResourceInput } from "./components/ResourceInput";
54
54
  export { default as GroupQuestionsInputSingle } from "./components/GroupQuestionsInputSingle";
55
55
  export { ModalConfirmAction } from "./components/Modals/derivedComps/ModalConfirmAction";
56
- export { SimpleTable } from "./components/SimpleTable";
57
56
  export { styledOKELinkCSS } from "./components/OKELink/styled";
58
57
  export { default as TableCellResizerPlugin } from "./components/Lexical/Plugins/TableCellResizer";
59
58
  export { CardContent } from "./v2/components/cards/CardContent";
package/dist/index.js CHANGED
@@ -40,8 +40,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.BannerInfo = exports.BannerAlert = exports.GroupQuestionsInputSingle = exports.ResourceInput = exports.IFrameInput = exports.PDFInput = exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.Modal = exports.ModalForms = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.TagDisplay = exports.TagSelect = exports.TagLink = exports.TagClear = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.applyBlackOverlayOnHover = exports.icons = exports.colors = exports.GlobalStyles = void 0;
43
- exports.List = exports.SwitchDouble = exports.SwitchSingle = exports.RadioButton = exports.RadioInput = exports.RadioList = exports.CheckboxButton = exports.CheckboxInput = exports.CheckboxList = exports.AccordionV2 = exports.HomeCoverV2 = exports.DateRangePickerV2 = exports.MetaBlockV2 = exports.typoV2_CSS = exports.colors2 = exports.TabBarV2 = exports.ButtonUpload = exports.ButtonGhostCompact = exports.ButtonTertiaryCompact = exports.ButtonSecondaryCompact = exports.ButtonPrimaryCompact = exports.ButtonGhostV2 = exports.ButtonTertiaryV2 = exports.ButtonSecondaryV2 = exports.ButtonPrimaryV2 = exports.TagClearV2 = exports.TagLinkV2 = exports.TagDisplayV2 = exports.generateOptions = exports.genTagComp = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.HintsProvider = exports.BlockLabel = exports.ListContent = exports.CardContent = exports.URLInput = exports.PasswordInput = exports.PhoneInput = exports.NumberInput = exports.EmailInput = exports.TextInput = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = void 0;
44
- exports.FloatingPortal = exports.FloatingFocusManager = exports.useFloatingPosition = exports.baseStyling = exports.TooltipV2 = exports.ListItem = void 0;
43
+ exports.ListItem = exports.List = exports.SwitchDouble = exports.SwitchSingle = exports.RadioButton = exports.RadioInput = exports.RadioList = exports.CheckboxButton = exports.CheckboxInput = exports.CheckboxList = exports.AccordionV2 = exports.HomeCoverV2 = exports.DateRangePickerV2 = exports.MetaBlockV2 = exports.typoV2_CSS = exports.colors2 = exports.TabBarV2 = exports.ButtonUpload = exports.ButtonGhostCompact = exports.ButtonTertiaryCompact = exports.ButtonSecondaryCompact = exports.ButtonPrimaryCompact = exports.ButtonGhostV2 = exports.ButtonTertiaryV2 = exports.ButtonSecondaryV2 = exports.ButtonPrimaryV2 = exports.TagClearV2 = exports.TagLinkV2 = exports.TagDisplayV2 = exports.generateOptions = exports.genTagComp = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.HintsProvider = exports.BlockLabel = exports.ListContent = exports.CardContent = exports.URLInput = exports.PasswordInput = exports.PhoneInput = exports.NumberInput = exports.EmailInput = exports.TextInput = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = void 0;
44
+ exports.FloatingPortal = exports.FloatingFocusManager = exports.useFloatingPosition = exports.baseStyling = exports.TooltipV2 = void 0;
45
45
  //css and styling related ( styled-components )
46
46
  var globalStyles_1 = require("./globalStyles");
47
47
  Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
@@ -165,8 +165,6 @@ Object.defineProperty(exports, "useBannerContext", { enumerable: true, get: func
165
165
  Object.defineProperty(exports, "BannerProvider", { enumerable: true, get: function () { return bannerContext_1.BannerProvider; } });
166
166
  var ModalConfirmAction_1 = require("./components/Modals/derivedComps/ModalConfirmAction");
167
167
  Object.defineProperty(exports, "ModalConfirmAction", { enumerable: true, get: function () { return ModalConfirmAction_1.ModalConfirmAction; } });
168
- var SimpleTable_1 = require("./components/SimpleTable");
169
- Object.defineProperty(exports, "SimpleTable", { enumerable: true, get: function () { return SimpleTable_1.SimpleTable; } });
170
168
  //styled-components css for use in lexical, since lexical uses classes primarily
171
169
  var styled_1 = require("./components/OKELink/styled");
172
170
  Object.defineProperty(exports, "styledOKELinkCSS", { enumerable: true, get: function () { return styled_1.styledOKELinkCSS; } });
@@ -1,4 +1,4 @@
1
- export function TextInput({ S, id, disabled, icon, type, placeholder, value, onChange, onFocus, onBlur, readOnly, iconOnClick, iconAfter, handleValidation, validateOnMount, actionBtn, clearBtn, className, maxLength, maxNumLimiter: DEPRECATED_maxNumLimiter, forceFocus, validateOnlyOnBlur, validationStatus: _validationStatus, displayValidationMsg, content, passValidationErrorToFormValidation, plugin, }: {
1
+ export function TextInput({ S, id, disabled, icon, type, placeholder, value, onChange, onFocus, onBlur, readOnly, iconOnClick, iconAfter, handleValidation, validateOnMount, actionBtn, clearBtn, className, style, maxLength, maxNumLimiter: DEPRECATED_maxNumLimiter, forceFocus, validateOnlyOnBlur, validationStatus: _validationStatus, displayValidationMsg, content, passValidationErrorToFormValidation, plugin, }: {
2
2
  S: any;
3
3
  id: any;
4
4
  disabled: any;
@@ -16,7 +16,8 @@ export function TextInput({ S, id, disabled, icon, type, placeholder, value, onC
16
16
  validateOnMount?: boolean;
17
17
  actionBtn: any;
18
18
  clearBtn: any;
19
- className: any;
19
+ className?: string;
20
+ style?: {};
20
21
  maxLength: any;
21
22
  maxNumLimiter: any;
22
23
  forceFocus: any;
@@ -110,13 +110,13 @@ var BadgeVetted = icons_1.icons.BadgeVetted;
110
110
  function TextInput(_a) {
111
111
  var _this = this;
112
112
  var S = _a.S, id = _a.id, disabled = _a.disabled, icon = _a.icon, type = _a.type, _b = _a.placeholder, placeholder = _b === void 0 ? "Enter Text..." : _b, _c = _a.value, value = _c === void 0 ? "" : _c, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, readOnly = _a.readOnly, iconOnClick = _a.iconOnClick, iconAfter = _a.iconAfter, handleValidation = _a.handleValidation, _d = _a.validateOnMount, validateOnMount = _d === void 0 ? true : _d, // i think it makes sense to always run validation the minute the comp mounts, but we will see if this has sideeffects
113
- actionBtn = _a.actionBtn, clearBtn = _a.clearBtn, className = _a.className, maxLength = _a.maxLength, DEPRECATED_maxNumLimiter = _a.maxNumLimiter, forceFocus = _a.forceFocus, //sometimes, when some other elem is clicked, we wanna trigger focus on the textinput. eg. when on mobile, the search icon is clicked on the listingpage
114
- _e = _a.validateOnlyOnBlur, //sometimes, when some other elem is clicked, we wanna trigger focus on the textinput. eg. when on mobile, the search icon is clicked on the listingpage
115
- validateOnlyOnBlur = _e === void 0 ? false : _e, //for example, in the login form we want validation to only run, once the text input is blurred. else it can be irritating
116
- _validationStatus = _a.validationStatus, _f = _a.displayValidationMsg, displayValidationMsg = _f === void 0 ? true : _f, content = _a.content, passValidationErrorToFormValidation = _a.passValidationErrorToFormValidation, plugin = _a.plugin;
113
+ actionBtn = _a.actionBtn, clearBtn = _a.clearBtn, _e = _a.className, className = _e === void 0 ? '' : _e, _f = _a.style, style = _f === void 0 ? {} : _f, maxLength = _a.maxLength, DEPRECATED_maxNumLimiter = _a.maxNumLimiter, forceFocus = _a.forceFocus, //sometimes, when some other elem is clicked, we wanna trigger focus on the textinput. eg. when on mobile, the search icon is clicked on the listingpage
114
+ _g = _a.validateOnlyOnBlur, //sometimes, when some other elem is clicked, we wanna trigger focus on the textinput. eg. when on mobile, the search icon is clicked on the listingpage
115
+ validateOnlyOnBlur = _g === void 0 ? false : _g, //for example, in the login form we want validation to only run, once the text input is blurred. else it can be irritating
116
+ _validationStatus = _a.validationStatus, _h = _a.displayValidationMsg, displayValidationMsg = _h === void 0 ? true : _h, content = _a.content, passValidationErrorToFormValidation = _a.passValidationErrorToFormValidation, plugin = _a.plugin;
117
117
  var props = arguments[0];
118
118
  var theme = (0, styled_components_1.useTheme)();
119
- var _g = (0, react_1.useState)(_validationStatus), validationStatus = _g[0], setValidationStatus = _g[1];
119
+ var _j = (0, react_1.useState)(_validationStatus), validationStatus = _j[0], setValidationStatus = _j[1];
120
120
  (0, react_1.useEffect)(function () {
121
121
  setValidationStatus(_validationStatus);
122
122
  }, [_validationStatus]);
@@ -193,7 +193,7 @@ function TextInput(_a) {
193
193
  forceFocus && inputRef.current && inputRef.current.focus();
194
194
  }, [forceFocus]);
195
195
  var localize = (0, utilsOolib_1.useLocale)();
196
- return (react_1.default.createElement("div", { className: className },
196
+ return (react_1.default.createElement("div", { style: style, className: className },
197
197
  react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
198
198
  readOnly ? (type === "url"
199
199
  ? react_1.default.createElement(OKELink_1.OKELink, { text: value, to: value })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.227.6",
3
+ "version": "2.227.8",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,9 +0,0 @@
1
- export function AddRowButton({ onClick }: {
2
- onClick: any;
3
- }): React.JSX.Element;
4
- export function AddColButton({ onClick, addColButtonWidth, enableRowActions }: {
5
- onClick: any;
6
- addColButtonWidth: any;
7
- enableRowActions: any;
8
- }): React.JSX.Element;
9
- import React from "react";
@@ -1,77 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || (function () {
34
- var ownKeys = function(o) {
35
- ownKeys = Object.getOwnPropertyNames || function (o) {
36
- var ar = [];
37
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
38
- return ar;
39
- };
40
- return ownKeys(o);
41
- };
42
- return function (mod) {
43
- if (mod && mod.__esModule) return mod;
44
- var result = {};
45
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
46
- __setModuleDefault(result, mod);
47
- return result;
48
- };
49
- })();
50
- var __importDefault = (this && this.__importDefault) || function (mod) {
51
- return (mod && mod.__esModule) ? mod : { "default": mod };
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.AddColButton = exports.AddRowButton = void 0;
55
- var react_1 = __importDefault(require("react"));
56
- var icons_1 = require("../../../../icons");
57
- var themes_1 = require("../../../../themes");
58
- var styled_components_1 = __importStar(require("styled-components"));
59
- var mixins_1 = require("../../../../themes/mixins");
60
- var Plus = icons_1.icons.Plus;
61
- var commonStyles = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border: none;\n ", "\n &:hover {\n background-color: ", ";\n }\n cursor: pointer;\n"], ["\n background-color: ", ";\n border: none;\n ", "\n &:hover {\n background-color: ", ";\n }\n cursor: pointer;\n"])), themes_1.colors.greyColor5, (0, mixins_1.transition)("background-color"), themes_1.colors.greyColor10);
62
- var StyledRowButton = styled_components_1.default.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 2rem;\n text-align: center;\n width: 100%;\n ", "\n"], ["\n height: 2rem;\n text-align: center;\n width: 100%;\n ", "\n"])), commonStyles);
63
- var StyledColButton = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n ", "\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n ", "\n"])), commonStyles);
64
- var AddRowButton = function (_a) {
65
- var onClick = _a.onClick;
66
- return (react_1.default.createElement(StyledRowButton, { onClick: onClick },
67
- react_1.default.createElement(Plus, { size: 12, weight: "bold" })));
68
- };
69
- exports.AddRowButton = AddRowButton;
70
- var AddColButton = function (_a) {
71
- var onClick = _a.onClick, addColButtonWidth = _a.addColButtonWidth, enableRowActions = _a.enableRowActions;
72
- return (react_1.default.createElement(StyledColButton, { style: __assign({ width: addColButtonWidth + 'px' }, (enableRowActions ? { marginBottom: '2rem' } : {}) //should be same as height of StyledRowButton
73
- ), onClick: onClick },
74
- react_1.default.createElement(Plus, { size: 12, weight: "bold" })));
75
- };
76
- exports.AddColButton = AddColButton;
77
- var templateObject_1, templateObject_2, templateObject_3;
@@ -1,11 +0,0 @@
1
- export function ColActionsMenu({ value, colIdx, onChange, id, defaultColWidth, setActionsActiveOnCol, colActionsButtonHeight, conditionsToRender }: {
2
- value: any;
3
- colIdx: any;
4
- onChange: any;
5
- id: any;
6
- defaultColWidth: any;
7
- setActionsActiveOnCol: any;
8
- colActionsButtonHeight: any;
9
- conditionsToRender?: boolean;
10
- }): React.JSX.Element;
11
- import React from "react";
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
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 () {
23
- var ownKeys = function(o) {
24
- ownKeys = Object.getOwnPropertyNames || function (o) {
25
- var ar = [];
26
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
- return ar;
28
- };
29
- return ownKeys(o);
30
- };
31
- return function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
- __setModuleDefault(result, mod);
36
- return result;
37
- };
38
- })();
39
- var __importDefault = (this && this.__importDefault) || function (mod) {
40
- return (mod && mod.__esModule) ? mod : { "default": mod };
41
- };
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.ColActionsMenu = void 0;
44
- var react_1 = __importStar(require("react"));
45
- var ActionMenu_1 = require("../../../../ActionMenu");
46
- var handleColActions_1 = require("../../../handlers/handleColActions");
47
- var UIContent_1 = require("../../../../../UIContent");
48
- var styled_1 = require("../styled");
49
- var DisplayIcon_1 = require("../../../../../utils/comps/DisplayIcon");
50
- var styled_components_1 = __importDefault(require("styled-components"));
51
- 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);
52
- var ColActionsMenu = function (_a) {
53
- 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;
54
- var _c = (0, react_1.useState)(false), actionMenuIsOpen = _c[0], setActionMenuIsOpen = _c[1];
55
- var isFirstMount = (0, react_1.useRef)(true);
56
- (0, react_1.useEffect)(function () {
57
- if (!isFirstMount.current) {
58
- setActionsActiveOnCol(actionMenuIsOpen ? colIdx : undefined);
59
- }
60
- else {
61
- isFirstMount.current = false;
62
- }
63
- }, [actionMenuIsOpen]);
64
- // cuz if an actionmenu is open we want it to continue showing
65
- // on screen irrespective of other factors such as hover and such
66
- return (conditionsToRender || actionMenuIsOpen) && (react_1.default.createElement("div", { style: { zIndex: 2, position: 'absolute', top: 0, left: '50%', transform: 'translate(-50%, -50%)' } },
67
- react_1.default.createElement(ActionMenu_1.ActionMenu, { popOutOfOverflowHiddenParent: true, setShowActions: function (bool) { return setActionMenuIsOpen(bool); }, align: "left", CustomSelectComp: function (_a) {
68
- var active = _a.active, onClick = _a.onClick;
69
- return (react_1.default.createElement(StyledCustomSelectCompWrapper, { style: { height: colActionsButtonHeight + 'px' }, onClick: onClick, active: active },
70
- react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: "DotsThree", size: 16 })));
71
- }, actions: [
72
- {
73
- display: UIContent_1.UIContent.SimpleTable.delete,
74
- onClick: function () { return (0, handleColActions_1.handleDeleteCol)({ value: value, colIdx: colIdx, onChange: onChange, id: id }); },
75
- },
76
- {
77
- display: UIContent_1.UIContent.SimpleTable.duplicate,
78
- onClick: function () { return (0, handleColActions_1.handleDuplicateCol)({ value: value, colIdx: colIdx, onChange: onChange, id: id }); },
79
- },
80
- {
81
- display: UIContent_1.UIContent.SimpleTable.insertColAfter,
82
- onClick: function () { return (0, handleColActions_1.handleInsertColAfter)({ value: value, colIdx: colIdx, onChange: onChange, id: id, defaultColWidth: defaultColWidth }); },
83
- },
84
- {
85
- display: UIContent_1.UIContent.SimpleTable.insertColBefore,
86
- onClick: function () { return (0, handleColActions_1.handleInsertColBefore)({ value: value, colIdx: colIdx, onChange: onChange, id: id, defaultColWidth: defaultColWidth }); },
87
- },
88
- {
89
- display: UIContent_1.UIContent.SimpleTable.clearContent,
90
- onClick: function () { return (0, handleColActions_1.handleClearColContent)({ value: value, colIdx: colIdx, onChange: onChange, id: id, defaultColWidth: defaultColWidth }); },
91
- }
92
- ] })));
93
- };
94
- exports.ColActionsMenu = ColActionsMenu;
95
- var templateObject_1;
@@ -1,12 +0,0 @@
1
- export function RowActionsMenu({ value, rowIdx, onChange, id, disableAddRow, setActionsActiveOnRow, rowActionsButtonWidth, conditionsToRender, blockConfig }: {
2
- value: any;
3
- rowIdx: any;
4
- onChange: any;
5
- id: any;
6
- disableAddRow: any;
7
- setActionsActiveOnRow: any;
8
- rowActionsButtonWidth: any;
9
- conditionsToRender?: boolean;
10
- blockConfig: any;
11
- }): React.JSX.Element;
12
- import React from "react";
@@ -1,120 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
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 () {
23
- var ownKeys = function(o) {
24
- ownKeys = Object.getOwnPropertyNames || function (o) {
25
- var ar = [];
26
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
- return ar;
28
- };
29
- return ownKeys(o);
30
- };
31
- return function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
- __setModuleDefault(result, mod);
36
- return result;
37
- };
38
- })();
39
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
40
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
41
- if (ar || !(i in from)) {
42
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
43
- ar[i] = from[i];
44
- }
45
- }
46
- return to.concat(ar || Array.prototype.slice.call(from));
47
- };
48
- var __importDefault = (this && this.__importDefault) || function (mod) {
49
- return (mod && mod.__esModule) ? mod : { "default": mod };
50
- };
51
- Object.defineProperty(exports, "__esModule", { value: true });
52
- exports.RowActionsMenu = void 0;
53
- var react_1 = __importStar(require("react"));
54
- var styled_components_1 = __importDefault(require("styled-components"));
55
- var UIContent_1 = require("../../../../../UIContent");
56
- var DisplayIcon_1 = require("../../../../../utils/comps/DisplayIcon");
57
- var ActionMenu_1 = require("../../../../ActionMenu");
58
- var handleRowActions_1 = require("../../../handlers/handleRowActions");
59
- var styled_1 = require("../styled");
60
- 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);
61
- // const CustomSelectComp =
62
- var RowActionsMenu = function (_a) {
63
- var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, disableAddRow = _a.disableAddRow, setActionsActiveOnRow = _a.setActionsActiveOnRow, rowActionsButtonWidth = _a.rowActionsButtonWidth, _b = _a.conditionsToRender, conditionsToRender = _b === void 0 ? true : _b, blockConfig = _a.blockConfig;
64
- var _c = (0, react_1.useState)(false), actionMenuIsOpen = _c[0], setActionMenuIsOpen = _c[1];
65
- var isFirstMount = (0, react_1.useRef)(true);
66
- (0, react_1.useEffect)(function () {
67
- if (!isFirstMount.current) {
68
- setActionsActiveOnRow(actionMenuIsOpen ? rowIdx : undefined);
69
- }
70
- else {
71
- isFirstMount.current = false;
72
- }
73
- }, [actionMenuIsOpen]);
74
- // cuz if an actionmenu is open we want it to continue showing
75
- // on screen irrespective of other factors such as hover and such
76
- return (conditionsToRender || actionMenuIsOpen) && (react_1.default.createElement("div", { style: {
77
- zIndex: 2,
78
- position: "absolute",
79
- top: "50%",
80
- left: 0,
81
- transform: "translate(-50%, -50%)",
82
- } },
83
- react_1.default.createElement(ActionMenu_1.ActionMenu, { popOutOfOverflowHiddenParent: true, align: "left", setShowActions: function (showActions) {
84
- setActionMenuIsOpen(showActions);
85
- }, CustomSelectComp: function (_a) {
86
- var active = _a.active, onClick = _a.onClick;
87
- return (react_1.default.createElement(StyledCustomSelectCompWrapper, { style: { width: rowActionsButtonWidth + "px" }, onClick: onClick, active: active },
88
- react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: "DotsThreeVertical", size: 16 })));
89
- }, actions: __spreadArray(__spreadArray([], (!disableAddRow ? [
90
- {
91
- display: UIContent_1.UIContent.SimpleTable.delete,
92
- onClick: function () { return (0, handleRowActions_1.handleDeleteRow)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id }); },
93
- },
94
- {
95
- display: UIContent_1.UIContent.SimpleTable.duplicate,
96
- onClick: function () { return (0, handleRowActions_1.handleDuplicateRow)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id }); },
97
- },
98
- {
99
- display: UIContent_1.UIContent.SimpleTable.insertRowBefore,
100
- onClick: function () {
101
- return (0, handleRowActions_1.handleInsertRowBefore)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id, blockConfig: blockConfig });
102
- },
103
- },
104
- {
105
- display: UIContent_1.UIContent.SimpleTable.insertRowAfter,
106
- onClick: function () {
107
- return (0, handleRowActions_1.handleInsertRowAfter)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id, blockConfig: blockConfig });
108
- },
109
- },
110
- ] : []), true), [
111
- {
112
- display: UIContent_1.UIContent.SimpleTable.clearContent,
113
- onClick: function () {
114
- return (0, handleRowActions_1.handleClearRowContent)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id, blockConfig: blockConfig });
115
- },
116
- },
117
- ], false) })));
118
- };
119
- exports.RowActionsMenu = RowActionsMenu;
120
- var templateObject_1;
@@ -1 +0,0 @@
1
- export const commonRowColActionMenuStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.commonRowColActionMenuStyles = void 0;
8
- var styled_components_1 = require("styled-components");
9
- var utilsOolib_1 = require("../../../../utilsOolib");
10
- var globalVariables_1 = require("../../../../globalStyles/globalVariables");
11
- var mixins_1 = require("../../../../themes/mixins");
12
- var themes_1 = require("../../../../themes");
13
- exports.commonRowColActionMenuStyles = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n ", ";\n border-radius: 4px;\n ", "\n cursor: pointer;\n ", "\n"], ["\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n ", ";\n border-radius: 4px;\n ", "\n cursor: pointer;\n ", "\n"])), (0, mixins_1.transition)("background-color", "border-color"), function (_a) {
14
- var active = _a.active, theme = _a.theme;
15
- return active
16
- ? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid;\n border-color: ", ";\n "], ["\n background-color: ", ";\n border: 1px solid;\n border-color: ", ";\n "])), (0, utilsOolib_1.getPrimaryColor40)(theme === null || theme === void 0 ? void 0 : theme.colors), (0, utilsOolib_1.getPrimaryColor100)(theme === null || theme === void 0 ? void 0 : theme.colors)) : (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid;\n border-color: ", ";\n ", ";\n "], ["\n background-color: ", ";\n border: 1px solid;\n border-color: ", ";\n ", ";\n "])), themes_1.colors.white, themes_1.colors.greyColor15, globalVariables_1.globalHoverOnWhiteBG);
17
- }, mixins_1.boxShadow1);
18
- var templateObject_1, templateObject_2, templateObject_3;
@@ -1,38 +0,0 @@
1
- export function handleAddCol({ value, onChange, id, defaultColWidth }: {
2
- value: any;
3
- onChange: any;
4
- id: any;
5
- defaultColWidth: any;
6
- }): void;
7
- export function handleDeleteCol({ value, colIdx, onChange, id }: {
8
- value: any;
9
- colIdx: any;
10
- onChange: any;
11
- id: any;
12
- }): void;
13
- export function handleDuplicateCol({ value, colIdx, onChange, id }: {
14
- value: any;
15
- colIdx: any;
16
- onChange: any;
17
- id: any;
18
- }): void;
19
- export function handleInsertColAfter({ value, colIdx, onChange, id, defaultColWidth }: {
20
- value: any;
21
- colIdx: any;
22
- onChange: any;
23
- id: any;
24
- defaultColWidth: any;
25
- }): void;
26
- export function handleInsertColBefore({ value, colIdx, onChange, id, defaultColWidth }: {
27
- value: any;
28
- colIdx: any;
29
- onChange: any;
30
- id: any;
31
- defaultColWidth: any;
32
- }): void;
33
- export function handleClearColContent({ value, colIdx, onChange, id }: {
34
- value: any;
35
- colIdx: any;
36
- onChange: any;
37
- id: any;
38
- }): void;