oolib 2.21.3 → 2.23.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.
Files changed (46) hide show
  1. package/dist/components/ActionMenu/index.d.ts +3 -1
  2. package/dist/components/ActionMenu/index.js +22 -5
  3. package/dist/components/ActionMenu/styled.d.ts +1 -0
  4. package/dist/components/ActionMenu/styled.js +43 -14
  5. package/dist/components/ActionMenu/utils/useHandleClickOutside.d.ts +1 -0
  6. package/dist/components/ActionMenu/{utils.js → utils/useHandleClickOutside.js} +3 -3
  7. package/dist/components/ActionMenu/utils/usePopOutOfOverflowHiddenParent.d.ts +6 -0
  8. package/dist/components/ActionMenu/utils/usePopOutOfOverflowHiddenParent.js +65 -0
  9. package/dist/components/Buttons/index.js +2 -2
  10. package/dist/components/Buttons/index.styled.js +4 -4
  11. package/dist/components/LoadersAndProgress/{CircleLoader → LoaderCircle}/index.d.ts +1 -1
  12. package/dist/components/LoadersAndProgress/{CircleLoader → LoaderCircle}/index.js +3 -3
  13. package/dist/components/LoadersAndProgress/index.d.ts +1 -1
  14. package/dist/components/LoadersAndProgress/index.js +3 -3
  15. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +4 -4
  16. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +7 -13
  17. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/styled.js +7 -1
  18. package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.d.ts +4 -2
  19. package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.js +78 -32
  20. package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.d.ts +1 -0
  21. package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.js +6 -2
  22. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.d.ts +2 -3
  23. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +5 -5
  24. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.js +14 -2
  25. package/dist/components/RadioAndCheckbox/comps/RadioList/index.d.ts +4 -1
  26. package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +67 -27
  27. package/dist/components/RadioAndCheckbox/styled.d.ts +1 -0
  28. package/dist/components/RadioAndCheckbox/styled.js +24 -8
  29. package/dist/components/RadioAndCheckbox/utils.d.ts +12 -0
  30. package/dist/components/RadioAndCheckbox/utils.js +27 -3
  31. package/dist/components/Tags/index.d.ts +2 -1
  32. package/dist/components/Tags/index.js +2 -2
  33. package/dist/components/TextInputs/index.js +1 -1
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.js +3 -3
  36. package/dist/utils/_EXPORTS/index.d.ts +3 -1
  37. package/dist/utils/_EXPORTS/index.js +8 -3
  38. package/dist/utils/customHooks/useScroll.d.ts +1 -0
  39. package/dist/utils/customHooks/useScroll.js +16 -0
  40. package/dist/utils/formatTextToCamelCase.d.ts +1 -0
  41. package/dist/utils/{genValueFromDisplay.js → formatTextToCamelCase.js} +4 -4
  42. package/dist/utils/toArray.d.ts +1 -0
  43. package/dist/utils/toArray.js +13 -0
  44. package/package.json +1 -1
  45. package/dist/components/ActionMenu/utils.d.ts +0 -1
  46. package/dist/utils/genValueFromDisplay.d.ts +0 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genValueFromDisplay = exports.injectHttps = exports.getBlockLabelProps = exports.deleteVal = exports.setVal = exports.getVal = void 0;
3
+ exports.useScroll = exports.toArray = 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; } });
@@ -13,5 +13,10 @@ var getBlockLabelProps_1 = require("../getBlockLabelProps");
13
13
  Object.defineProperty(exports, "getBlockLabelProps", { enumerable: true, get: function () { return getBlockLabelProps_1.getBlockLabelProps; } });
14
14
  var injectHttps_1 = require("../injectHttps");
15
15
  Object.defineProperty(exports, "injectHttps", { enumerable: true, get: function () { return injectHttps_1.injectHttps; } });
16
- var genValueFromDisplay_1 = require("../genValueFromDisplay");
17
- Object.defineProperty(exports, "genValueFromDisplay", { enumerable: true, get: function () { return genValueFromDisplay_1.genValueFromDisplay; } });
16
+ var formatTextToCamelCase_1 = require("../formatTextToCamelCase");
17
+ Object.defineProperty(exports, "formatTextToCamelCase", { enumerable: true, get: function () { return formatTextToCamelCase_1.formatTextToCamelCase; } });
18
+ var toArray_1 = require("../toArray");
19
+ Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return toArray_1.toArray; } });
20
+ //custom hooks
21
+ var useScroll_1 = require("../customHooks/useScroll");
22
+ Object.defineProperty(exports, "useScroll", { enumerable: true, get: function () { return useScroll_1.useScroll; } });
@@ -0,0 +1 @@
1
+ export function useScroll(scrollFn: any, options?: {}): void;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useScroll = void 0;
4
+ var lodash_1 = require("lodash");
5
+ var react_1 = require("react");
6
+ var useScroll = function (scrollFn, options) {
7
+ if (options === void 0) { options = {}; }
8
+ (0, react_1.useLayoutEffect)(function () {
9
+ scrollFn(); //run the scroll fn once before any scroll to set initial states
10
+ var throttledScrollFn = (0, lodash_1.throttle)(scrollFn, 100);
11
+ var fnToUse = options.noThrottle ? scrollFn : throttledScrollFn;
12
+ window.addEventListener('scroll', fnToUse);
13
+ return function () { return window.removeEventListener('scroll', fnToUse); };
14
+ }, [options.loading]);
15
+ };
16
+ exports.useScroll = useScroll;
@@ -0,0 +1 @@
1
+ export function formatTextToCamelCase(text: any): any;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genValueFromDisplay = void 0;
4
- var genValueFromDisplay = function (text) {
3
+ exports.formatTextToCamelCase = void 0;
4
+ var formatTextToCamelCase = function (text) {
5
5
  var value_desc = ( // genrating a value text abiding js conventions (camelCased)
6
6
  text
7
7
  .trim()
8
- .replace(/[,\/]/g, '') // removing comas and forward slashes
8
+ .replace(/[-\.,\/\\_'":;]/g, '') // regex removes hyphens, dots, slashes, underscores, quotes, colons and semicolons
9
9
  .split(' ')
10
10
  .filter(Boolean)
11
11
  .map(function (word, idx) { return word[0]["to".concat(idx === 0 ? 'Lower' : 'Upper', "Case")]() + word.slice(1); })
12
12
  .join(""));
13
13
  return value_desc;
14
14
  };
15
- exports.genValueFromDisplay = genValueFromDisplay;
15
+ exports.formatTextToCamelCase = formatTextToCamelCase;
@@ -0,0 +1 @@
1
+ export function toArray(property: any): any[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toArray = void 0;
4
+ var toArray = function (property) {
5
+ if (!property &&
6
+ (property !== false && property !== 0))
7
+ return []; //return an empty array if the property is falsy. ( except for an explicity 'false' or '0' value )
8
+ if (property.constructor === Array)
9
+ return property;
10
+ //else
11
+ return [property];
12
+ };
13
+ exports.toArray = toArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.21.3",
3
+ "version": "2.23.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1 +0,0 @@
1
- export function useTrackFocus(ref: any, setShowOptions: any, options?: {}): void;
@@ -1 +0,0 @@
1
- export function genValueFromDisplay(text: any): any;