oolib 2.30.1 → 2.30.3

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.
@@ -61,7 +61,21 @@ var HeaderStyle1 = function (_a) {
61
61
  react_1.default.createElement(framer_motion_1.motion.div, { animate: { rotate: expand ? -180 : 0 }, transition: { type: "tween", ease: "easeOut" } },
62
62
  react_1.default.createElement(phosphor_react_1.CaretDown, { size: 16 })))));
63
63
  };
64
- var StyledHeaderStyle2Wrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex; \n align-items: center; \n justify-content: space-between; \n padding: 1rem 0; \n background-color: ", ";\n border-bottom: 2px solid ", ";\n cursor: pointer;\n ", ";\n /* &:hover{\n background-color: ", ";\n } */\n"], ["\n display: flex; \n align-items: center; \n justify-content: space-between; \n padding: 1rem 0; \n background-color: ", ";\n border-bottom: 2px solid ", ";\n cursor: pointer;\n ", ";\n /* &:hover{\n background-color: ", ";\n } */\n"
64
+ var StyledHeaderStyle3Wrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex; \n align-items: center; \n justify-content: space-between; \n padding: 1rem 2rem; \n\n background-color: ", ";\n border: 1px solid ", ";\n cursor: pointer;\n ", ";\n &:hover{\n background-color: ", ";\n }\n"], ["\n display: flex; \n align-items: center; \n justify-content: space-between; \n padding: 1rem 2rem; \n\n background-color: ", ";\n border: 1px solid ", ";\n cursor: pointer;\n ", ";\n &:hover{\n background-color: ", ";\n }\n"
65
+ //this is the new grey background, slim one. with the Caret icon on the right
66
+ //used in access control builder and several other places.
67
+ ])), colors_1.colors.none, colors_1.colors.greyColor15, (0, mixins_1.transition)('background-color'), colors_1.colors.greyColor3);
68
+ //this is the new grey background, slim one. with the Caret icon on the right
69
+ //used in access control builder and several other places.
70
+ var HeaderStyle3 = function (_a) {
71
+ var title = _a.title, expand = _a.expand, handleToggle = _a.handleToggle;
72
+ return (react_1.default.createElement(StyledHeaderStyle3Wrapper, { onClick: function () { return handleToggle(!expand); } },
73
+ react_1.default.createElement(Typo_1.SERIF_4_5, null, title),
74
+ react_1.default.createElement(NormalizedButton, null,
75
+ react_1.default.createElement(framer_motion_1.motion.div, { animate: { rotate: expand ? -180 : 0 }, transition: { type: "tween", ease: "easeOut" } },
76
+ react_1.default.createElement(phosphor_react_1.CaretDown, { size: 16 })))));
77
+ };
78
+ var StyledHeaderStyle2Wrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex; \n align-items: center; \n justify-content: space-between; \n padding: 1rem 0; \n background-color: ", ";\n border-bottom: 2px solid ", ";\n cursor: pointer;\n ", ";\n /* &:hover{\n background-color: ", ";\n } */\n"], ["\n display: flex; \n align-items: center; \n justify-content: space-between; \n padding: 1rem 0; \n background-color: ", ";\n border-bottom: 2px solid ", ";\n cursor: pointer;\n ", ";\n /* &:hover{\n background-color: ", ";\n } */\n"
65
79
  //analysis dashboard wordcloud - this is the old accordion header style designed at the time of updates module
66
80
  ])), colors_1.colors.white, colors_1.colors.greyColor10, (0, mixins_1.transition)('background-color'), colors_1.colors.greyColor5);
67
81
  //analysis dashboard wordcloud - this is the old accordion header style designed at the time of updates module
@@ -89,7 +103,8 @@ var Accordion = function (_a) {
89
103
  }, [expandProp]);
90
104
  var HeaderStyles = {
91
105
  HeaderStyle1: HeaderStyle1,
92
- HeaderStyle2: HeaderStyle2
106
+ HeaderStyle2: HeaderStyle2,
107
+ HeaderStyle3: HeaderStyle3
93
108
  };
94
109
  var genHeader = function () {
95
110
  if (CustomHeader)
@@ -108,4 +123,4 @@ var Accordion = function (_a) {
108
123
  react_1.default.createElement("div", null, children))));
109
124
  };
110
125
  exports.Accordion = Accordion;
111
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
126
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -40,7 +40,7 @@ var ButtonComps = __importStar(require("../Buttons"));
40
40
  var Typo_1 = require("../Typo");
41
41
  var icons_1 = require("../../icons");
42
42
  var useHandleClickOutside_1 = require("./utils/useHandleClickOutside");
43
- var usePopOutOfOverflowHiddenParent_1 = require("./utils/usePopOutOfOverflowHiddenParent");
43
+ var usePopOutOfOverflowHiddenParent_1 = require("../../utils/usePopOutOfOverflowHiddenParent");
44
44
  var styled_1 = require("./styled");
45
45
  //
46
46
  var ActionMenu = function (_a) {
@@ -78,6 +78,7 @@ var OKELink = function (_a) {
78
78
  var genIcon = function (icon) {
79
79
  return react_1.default.createElement(comps_1.DisplayIcon, __assign({}, {
80
80
  icon: icon,
81
+ weight: "regular",
81
82
  size: iconSize || 15,
82
83
  color: (0, styled_1.genColor)({ color: color, theme: theme, invert: invert, disabled: disabled })
83
84
  }));
@@ -1,10 +1,11 @@
1
- export function TagDisplay({ display, style, invert, M, XS, color, variant }: {
1
+ export function TagDisplay({ display, style, invert, M, XS, tagColor, textColor, variant }: {
2
2
  display: any;
3
3
  style: any;
4
4
  invert: any;
5
5
  M: any;
6
6
  XS: any;
7
- color: any;
7
+ tagColor: any;
8
+ textColor: any;
8
9
  variant?: string;
9
10
  }): any;
10
11
  export function TagClear({ id, display, value, M, XS, invert, onClick, variant, grey, }: {
@@ -42,11 +42,11 @@ var getTypoComp = function (size) { return size === 'XS' ?
42
42
  function (props) { return react_1.default.createElement(index_styled_1.STYLED_ELLIPSIS_SANS_2, __assign({}, props)); }
43
43
  : function (props) { return react_1.default.createElement(index_styled_1.STYLED_ELLIPSIS_SANS_3, __assign({}, props)); }; };
44
44
  function TagDisplay(_a) {
45
- var display = _a.display, style = _a.style, invert = _a.invert, M = _a.M, XS = _a.XS, color = _a.color, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
45
+ var display = _a.display, style = _a.style, invert = _a.invert, M = _a.M, XS = _a.XS, tagColor = _a.tagColor, textColor = _a.textColor, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
46
46
  var size = M ? 'M' : XS ? 'XS' : 'S';
47
47
  var TYPO_COMP = getTypoComp(size);
48
- return (react_1.default.createElement(index_styled_1.StyledTagDisplay, { variant: variant, invert: invert, size: size, color: color, style: style },
49
- react_1.default.createElement(TYPO_COMP, null, display)));
48
+ return (react_1.default.createElement(index_styled_1.StyledTagDisplay, { variant: variant, invert: invert, textColor: textColor, tagColor: tagColor, size: size, style: style },
49
+ react_1.default.createElement(TYPO_COMP, { semibold: true }, display)));
50
50
  }
51
51
  exports.TagDisplay = TagDisplay;
52
52
  function TagClear(_a) {
@@ -64,10 +64,14 @@ var StyledTagDisplay = styled_components_1.default.div(templateObject_7 || (temp
64
64
  var size = _a.size;
65
65
  return commonStyle({ size: size });
66
66
  }, function (_a) {
67
- var variant = _a.variant, invert = _a.invert, size = _a.size, color = _a.color;
67
+ var variant = _a.variant, invert = _a.invert, size = _a.size, textColor = _a.textColor, tagColor = _a.tagColor;
68
68
  return variant === "primary"
69
- ? (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), !invert ? greyColor15 : greyColor80, !invert ? greyColor80 : greyColor40) : //secondary
70
- (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", !invert ? (color ? color : greyColor15) : greyColor80, !invert ? (color ? color : greyColor80) : greyColor15);
69
+ ? (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), tagColor
70
+ ? tagColor
71
+ : !invert
72
+ ? greyColor15
73
+ : greyColor80, textColor ? textColor : !invert ? greyColor80 : greyColor40) : //secondary
74
+ (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n ", ";\n color: ", ";\n "])), size === "XS" ? "1px" : "2px", tagColor ? tagColor : !invert ? greyColor15 : greyColor80, textColor ? textColor : !invert ? greyColor80 : greyColor15);
71
75
  });
72
76
  exports.StyledTagDisplay = StyledTagDisplay;
73
77
  var StyledTagClear = styled_components_1.default.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n\n \t", "\n\t//overrides of commonStyle\n\tpadding-right: 0;\n\tgap: 0.5rem;\n\t//--\n\n\t", "\n \n\t\n\t", "\n"], ["\n\n \t", "\n\t//overrides of commonStyle\n\tpadding-right: 0;\n\tgap: 0.5rem;\n\t//--\n\n\t", "\n \n\t\n\t", "\n"])), function (_a) {
@@ -7,3 +7,4 @@ export { formatTextToCamelCase } from "../formatTextToCamelCase";
7
7
  export { formatCamelCaseToSentenceCase } from "../formatCamelCaseToSentenceCase";
8
8
  export { toArray } from "../toArray";
9
9
  export { useScroll } from "../customHooks/useScroll";
10
+ export { usePopOutOfOverflowHiddenParent } from "../usePopOutOfOverflowHiddenParent";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useScroll = exports.toArray = exports.formatCamelCaseToSentenceCase = exports.formatTextToCamelCase = exports.injectHttps = exports.getBlockLabelProps = exports.deleteVal = exports.setVal = exports.getVal = void 0;
3
+ exports.usePopOutOfOverflowHiddenParent = exports.useScroll = exports.toArray = exports.formatCamelCaseToSentenceCase = exports.formatTextToCamelCase = exports.injectHttps = exports.getBlockLabelProps = exports.deleteVal = exports.setVal = exports.getVal = void 0;
4
4
  //the holy setter, getter & deleter
5
5
  var getVal_1 = require("../getterSetterDeleter/getVal");
6
6
  Object.defineProperty(exports, "getVal", { enumerable: true, get: function () { return getVal_1.getVal; } });
@@ -22,3 +22,5 @@ Object.defineProperty(exports, "toArray", { enumerable: true, get: function () {
22
22
  //custom hooks
23
23
  var useScroll_1 = require("../customHooks/useScroll");
24
24
  Object.defineProperty(exports, "useScroll", { enumerable: true, get: function () { return useScroll_1.useScroll; } });
25
+ var usePopOutOfOverflowHiddenParent_1 = require("../usePopOutOfOverflowHiddenParent");
26
+ Object.defineProperty(exports, "usePopOutOfOverflowHiddenParent", { enumerable: true, get: function () { return usePopOutOfOverflowHiddenParent_1.usePopOutOfOverflowHiddenParent; } });
@@ -1 +1 @@
1
- export function useScroll(scrollFn: any, options?: {}): void;
1
+ export function useScroll(scrollFn: Function, options?: any): void;
@@ -3,14 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useScroll = void 0;
4
4
  var lodash_1 = require("lodash");
5
5
  var react_1 = require("react");
6
+ /**
7
+ * @param {Function} scrollFn
8
+ * @param {*} options
9
+ * @summary if you dont use options.detectScrollInAllDivs, scroll is detected only at the 'window' level
10
+ */
6
11
  var useScroll = function (scrollFn, options) {
7
12
  if (options === void 0) { options = {}; }
8
13
  (0, react_1.useLayoutEffect)(function () {
9
14
  scrollFn(); //run the scroll fn once before any scroll to set initial states
10
15
  var throttledScrollFn = (0, lodash_1.throttle)(scrollFn, 100);
11
16
  var fnToUse = options.noThrottle ? scrollFn : throttledScrollFn;
12
- window.addEventListener('scroll', fnToUse, true); // <-- why 'true' : https://stackoverflow.com/a/32954565
13
- return function () { return window.removeEventListener('scroll', fnToUse, true); };
17
+ window.addEventListener('scroll', fnToUse, options.detectScrollInAllDivs); // <-- why 'true' : https://stackoverflow.com/a/32954565
18
+ return function () { return window.removeEventListener('scroll', fnToUse, options.detectScrollInAllDivs); };
14
19
  }, [options.loading]);
15
20
  };
16
21
  exports.useScroll = useScroll;
@@ -1,6 +1,6 @@
1
1
  export function usePopOutOfOverflowHiddenParent(popOutOfOverflowHiddenParent: any): {
2
2
  trackerRef: any;
3
- applyFixedPos: () => void;
3
+ applyFixedPos: () => any;
4
4
  removeFixedPos: () => any;
5
5
  fixPos: any;
6
6
  };
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.usePopOutOfOverflowHiddenParent = void 0;
4
4
  var react_1 = require("react");
5
- var useScroll_1 = require("../../../utils/customHooks/useScroll");
5
+ var useScroll_1 = require("./customHooks/useScroll");
6
6
  //HOW TO USE
7
7
  /**
8
8
  * this utility is useful when action menus or dropdowns are
@@ -46,20 +46,17 @@ var usePopOutOfOverflowHiddenParent = function (popOutOfOverflowHiddenParent) {
46
46
  var trackerRef = (0, react_1.useRef)(null);
47
47
  var _a = (0, react_1.useState)(undefined), fixPos = _a[0], setFixPos = _a[1];
48
48
  var getBoundingClientRect = function () { var _a; return (_a = trackerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); };
49
- var applyFixedPos = function () {
50
- setFixPos(getBoundingClientRect());
51
- };
49
+ var applyFixedPos = function () { return setFixPos(getBoundingClientRect()); };
52
50
  var updateFixedPos = function (e) {
53
51
  /**
54
52
  * only if popOut... prop is enabled, AND
55
53
  * if an initial fixedPos has been applied,
56
54
  * then update it
57
55
  */
58
- console.log({ 'BC': getBoundingClientRect() });
59
56
  if (popOutOfOverflowHiddenParent)
60
57
  setFixPos(function (prev) { return prev && getBoundingClientRect(); });
61
58
  };
62
- (0, useScroll_1.useScroll)(updateFixedPos, { noThrottle: true });
59
+ (0, useScroll_1.useScroll)(updateFixedPos, { noThrottle: true, detectScrollInAllDivs: true });
63
60
  var removeFixedPos = function () { return setFixPos(undefined); };
64
61
  return ({ trackerRef: trackerRef, applyFixedPos: applyFixedPos, removeFixedPos: removeFixedPos, fixPos: fixPos });
65
62
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.30.1",
3
+ "version": "2.30.3",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",