oolib 2.207.1 → 2.208.1

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 (161) hide show
  1. package/dist/components/DateRangePicker/index.js +2 -2
  2. package/dist/components/GroupQuestionsInputSingle/index.js +2 -2
  3. package/dist/components/IFrameInput/index.js +1 -1
  4. package/dist/components/ImageInput/comps/Placeholder/index.js +1 -1
  5. package/dist/components/SimpleTable/index.js +2 -2
  6. package/dist/components/VideoInput/comps/EmbedLinkModal.js +1 -1
  7. package/dist/components/cards/ListProfile/index.js +1 -1
  8. package/dist/index.d.ts +8 -9
  9. package/dist/index.js +25 -33
  10. package/dist/stories/Oolib/components/Modal.stories.js +2 -2
  11. package/dist/stories/Oolib/components/TagsInput.stories.js +1 -1
  12. package/dist/stories/v2/components/visualization/HeatMapGrid.stories.d.ts +1 -0
  13. package/dist/stories/v2/components/visualization/HeatMapGrid.stories.js +83 -1
  14. package/dist/v2/components/DateRangePicker/index.js +1 -2
  15. package/dist/v2/components/TabBar/index.js +3 -3
  16. package/dist/v2/components/TextInputs/index.js +0 -7
  17. package/dist/v2/components/TextInputs/index.styled.js +1 -1
  18. package/dist/v2/components/dataviz/HeatMapGrid/index.js +23 -28
  19. package/dist/v2/components/dataviz/HeatMapGrid/utils/usePrepareHeatMapData.d.ts +33 -0
  20. package/dist/v2/components/dataviz/HeatMapGrid/utils/usePrepareHeatMapData.js +117 -0
  21. package/package.json +1 -1
  22. package/dist/components/BlockLabel/index.d.ts +0 -2
  23. package/dist/components/BlockLabel/index.js +0 -75
  24. package/dist/components/BlockLabel/index.styled.d.ts +0 -2
  25. package/dist/components/BlockLabel/index.styled.js +0 -14
  26. package/dist/components/Dropdowns/DropdownMulti/index.d.ts +0 -38
  27. package/dist/components/Dropdowns/DropdownMulti/index.js +0 -179
  28. package/dist/components/Dropdowns/DropdownSingle/index.d.ts +0 -40
  29. package/dist/components/Dropdowns/DropdownSingle/index.js +0 -163
  30. package/dist/components/Dropdowns/comps/Caret/index.d.ts +0 -6
  31. package/dist/components/Dropdowns/comps/Caret/index.js +0 -19
  32. package/dist/components/Dropdowns/comps/Caret/styled.d.ts +0 -2
  33. package/dist/components/Dropdowns/comps/Caret/styled.js +0 -14
  34. package/dist/components/Dropdowns/comps/DisplayCompSingle/index.d.ts +0 -7
  35. package/dist/components/Dropdowns/comps/DisplayCompSingle/index.js +0 -39
  36. package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.d.ts +0 -4
  37. package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.js +0 -15
  38. package/dist/components/Dropdowns/comps/OptionContent/index.d.ts +0 -8
  39. package/dist/components/Dropdowns/comps/OptionContent/index.js +0 -34
  40. package/dist/components/Dropdowns/comps/OptionsMulti/index.d.ts +0 -28
  41. package/dist/components/Dropdowns/comps/OptionsMulti/index.js +0 -159
  42. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.d.ts +0 -14
  43. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.js +0 -81
  44. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.d.ts +0 -2
  45. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.js +0 -25
  46. package/dist/components/Dropdowns/comps/OptionsShell/index.d.ts +0 -2
  47. package/dist/components/Dropdowns/comps/OptionsShell/index.js +0 -101
  48. package/dist/components/Dropdowns/comps/OptionsShell/styled.d.ts +0 -5
  49. package/dist/components/Dropdowns/comps/OptionsShell/styled.js +0 -45
  50. package/dist/components/Dropdowns/comps/OptionsSingle/index.d.ts +0 -28
  51. package/dist/components/Dropdowns/comps/OptionsSingle/index.js +0 -105
  52. package/dist/components/Dropdowns/comps/OptionsSingle/styled.d.ts +0 -1
  53. package/dist/components/Dropdowns/comps/OptionsSingle/styled.js +0 -61
  54. package/dist/components/Dropdowns/comps/SelectDropdown/index.d.ts +0 -13
  55. package/dist/components/Dropdowns/comps/SelectDropdown/index.js +0 -54
  56. package/dist/components/Dropdowns/comps/SelectDropdown/styled.d.ts +0 -1
  57. package/dist/components/Dropdowns/comps/SelectDropdown/styled.js +0 -71
  58. package/dist/components/Dropdowns/comps/SelectTagsInput/index.d.ts +0 -18
  59. package/dist/components/Dropdowns/comps/SelectTagsInput/index.js +0 -124
  60. package/dist/components/Dropdowns/comps/SelectTagsInput/styled.d.ts +0 -2
  61. package/dist/components/Dropdowns/comps/SelectTagsInput/styled.js +0 -54
  62. package/dist/components/Dropdowns/handlers/index.d.ts +0 -14
  63. package/dist/components/Dropdowns/handlers/index.js +0 -52
  64. package/dist/components/Dropdowns/styled.d.ts +0 -2
  65. package/dist/components/Dropdowns/styled.js +0 -49
  66. package/dist/components/Dropdowns/utils/genColor.d.ts +0 -4
  67. package/dist/components/Dropdowns/utils/genColor.js +0 -15
  68. package/dist/components/Dropdowns/utils/genIcon.d.ts +0 -6
  69. package/dist/components/Dropdowns/utils/genIcon.js +0 -18
  70. package/dist/components/Dropdowns/utils/genLinkOrText.d.ts +0 -1
  71. package/dist/components/Dropdowns/utils/genLinkOrText.js +0 -48
  72. package/dist/components/Dropdowns/utils/genProfileImg.d.ts +0 -6
  73. package/dist/components/Dropdowns/utils/genProfileImg.js +0 -14
  74. package/dist/components/Dropdowns/utils/genTagComp.d.ts +0 -2
  75. package/dist/components/Dropdowns/utils/genTagComp.js +0 -27
  76. package/dist/components/Dropdowns/utils/generateOptions.d.ts +0 -5
  77. package/dist/components/Dropdowns/utils/generateOptions.js +0 -20
  78. package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.d.ts +0 -1
  79. package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.js +0 -40
  80. package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.d.ts +0 -4
  81. package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.js +0 -11
  82. package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.d.ts +0 -4
  83. package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.js +0 -62
  84. package/dist/components/Dropdowns/utils/getAllOptionsFns/index.d.ts +0 -1
  85. package/dist/components/Dropdowns/utils/getAllOptionsFns/index.js +0 -19
  86. package/dist/components/Dropdowns/utils/getValue.d.ts +0 -14
  87. package/dist/components/Dropdowns/utils/getValue.js +0 -32
  88. package/dist/components/Dropdowns/utils/isDynamicOtherOption.d.ts +0 -0
  89. package/dist/components/Dropdowns/utils/isDynamicOtherOption.js +0 -0
  90. package/dist/components/Dropdowns/utils/keywordSearchOptions.d.ts +0 -6
  91. package/dist/components/Dropdowns/utils/keywordSearchOptions.js +0 -18
  92. package/dist/components/Dropdowns/utils/setDropdownSelectText.d.ts +0 -12
  93. package/dist/components/Dropdowns/utils/setDropdownSelectText.js +0 -19
  94. package/dist/components/Dropdowns/utils/useCreateDropdownRefs.d.ts +0 -5
  95. package/dist/components/Dropdowns/utils/useCreateDropdownRefs.js +0 -15
  96. package/dist/components/Dropdowns/utils/useHideShowOptions.d.ts +0 -5
  97. package/dist/components/Dropdowns/utils/useHideShowOptions.js +0 -20
  98. package/dist/components/Dropdowns/utils/useKeyboardControl.d.ts +0 -12
  99. package/dist/components/Dropdowns/utils/useKeyboardControl.js +0 -73
  100. package/dist/components/Dropdowns/utils/useSearchString.d.ts +0 -4
  101. package/dist/components/Dropdowns/utils/useSearchString.js +0 -20
  102. package/dist/components/Dropdowns/utils/useSetYOrientation.d.ts +0 -9
  103. package/dist/components/Dropdowns/utils/useSetYOrientation.js +0 -46
  104. package/dist/components/Hints/contextApi.d.ts +0 -6
  105. package/dist/components/Hints/contextApi.js +0 -48
  106. package/dist/components/Hints/index.d.ts +0 -9
  107. package/dist/components/Hints/index.js +0 -127
  108. package/dist/components/Hints/styled.d.ts +0 -6
  109. package/dist/components/Hints/styled.js +0 -54
  110. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.d.ts +0 -11
  111. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.js +0 -30
  112. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.d.ts +0 -1
  113. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.js +0 -70
  114. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +0 -11
  115. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +0 -50
  116. package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.d.ts +0 -20
  117. package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.js +0 -124
  118. package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.d.ts +0 -2
  119. package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.js +0 -17
  120. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.d.ts +0 -18
  121. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +0 -53
  122. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.d.ts +0 -2
  123. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.js +0 -84
  124. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.d.ts +0 -1
  125. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.js +0 -6
  126. package/dist/components/RadioAndCheckbox/comps/RadioList/index.d.ts +0 -17
  127. package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +0 -109
  128. package/dist/components/RadioAndCheckbox/index.d.ts +0 -5
  129. package/dist/components/RadioAndCheckbox/index.js +0 -14
  130. package/dist/components/RadioAndCheckbox/styled.d.ts +0 -5
  131. package/dist/components/RadioAndCheckbox/styled.js +0 -84
  132. package/dist/components/RadioAndCheckbox/utils.d.ts +0 -22
  133. package/dist/components/RadioAndCheckbox/utils.js +0 -49
  134. package/dist/components/Switches/index.d.ts +0 -21
  135. package/dist/components/Switches/index.js +0 -102
  136. package/dist/components/Switches/styled.d.ts +0 -5
  137. package/dist/components/Switches/styled.js +0 -63
  138. package/dist/components/TextInputs/index.d.ts +0 -24
  139. package/dist/components/TextInputs/index.js +0 -367
  140. package/dist/components/TextInputs/index.styled.d.ts +0 -3
  141. package/dist/components/TextInputs/index.styled.js +0 -77
  142. package/dist/components/cards/CardContent/index.d.ts +0 -11
  143. package/dist/components/cards/CardContent/index.js +0 -76
  144. package/dist/components/cards/CardContent/styled.d.ts +0 -7
  145. package/dist/components/cards/CardContent/styled.js +0 -63
  146. package/dist/components/cards/ListContent/index.d.ts +0 -12
  147. package/dist/components/cards/ListContent/index.js +0 -87
  148. package/dist/components/cards/ListContent/styled.d.ts +0 -7
  149. package/dist/components/cards/ListContent/styled.js +0 -26
  150. package/dist/stories/Oolib/components/BlockLabel.stories.d.ts +0 -71
  151. package/dist/stories/Oolib/components/BlockLabel.stories.js +0 -106
  152. package/dist/stories/Oolib/components/Checkbox.stories.d.ts +0 -248
  153. package/dist/stories/Oolib/components/Checkbox.stories.js +0 -249
  154. package/dist/stories/Oolib/components/Dropdowns.stories.d.ts +0 -127
  155. package/dist/stories/Oolib/components/Dropdowns.stories.js +0 -298
  156. package/dist/stories/Oolib/components/RadioButton.stories.d.ts +0 -260
  157. package/dist/stories/Oolib/components/RadioButton.stories.js +0 -264
  158. package/dist/stories/Oolib/components/Switches.stories.d.ts +0 -106
  159. package/dist/stories/Oolib/components/Switches.stories.js +0 -146
  160. package/dist/stories/Oolib/components/TextInputs.stories.d.ts +0 -124
  161. package/dist/stories/Oolib/components/TextInputs.stories.js +0 -188
@@ -1,14 +0,0 @@
1
- export function getValue_SINGLE({ valueProp, optionsFn, options, theme, saveValueAsString }: {
2
- valueProp: any;
3
- optionsFn: any;
4
- options: any;
5
- theme: any;
6
- saveValueAsString: any;
7
- }): any;
8
- export function getValue_MULTI({ valueProp, optionsFn, options, theme, saveValueAsString }: {
9
- valueProp: any;
10
- optionsFn: any;
11
- options: any;
12
- theme: any;
13
- saveValueAsString: any;
14
- }): any;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /**
3
- * if value has been saved as a string ( tci usecase )
4
- * then the appropriate option needs to be found and set as
5
- * value in the format of { display: ..., value: ... }
6
- *
7
- * Because thats the only format our dropdowns understand
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.getValue_MULTI = exports.getValue_SINGLE = void 0;
11
- var toArray_1 = require("../../../utils/toArray");
12
- var getAllOptionsFns_1 = require("./getAllOptionsFns");
13
- // Note: - saveValueAsString can be misleading here, because the value could be a string, integer, boolean values
14
- // maybe we can rename to saveValueOnly, or some better name
15
- var getValue_SINGLE = function (_a) {
16
- var _b;
17
- var valueProp = _a.valueProp, optionsFn = _a.optionsFn, options = _a.options, theme = _a.theme, saveValueAsString = _a.saveValueAsString;
18
- return saveValueAsString
19
- ? (optionsFn ? (_b = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_b, ((0, toArray_1.toArray)(optionsFn.args) || [])) : options).find(function (d) { return d.value === valueProp; })
20
- : valueProp;
21
- };
22
- exports.getValue_SINGLE = getValue_SINGLE;
23
- var getValue_MULTI = function (_a) {
24
- var valueProp = _a.valueProp, optionsFn = _a.optionsFn, options = _a.options, theme = _a.theme, saveValueAsString = _a.saveValueAsString;
25
- return saveValueAsString
26
- ? valueProp === null || valueProp === void 0 ? void 0 : valueProp.map(function (vProp) {
27
- var _a;
28
- return (optionsFn ? (_a = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_a, ((0, toArray_1.toArray)(optionsFn.args) || [])) : options).find(function (d) { return d.value === vProp; });
29
- })
30
- : valueProp;
31
- };
32
- exports.getValue_MULTI = getValue_MULTI;
@@ -1,6 +0,0 @@
1
- export function keywordSearchOptions({ options, searchString, searchFieldsConfig, setFilteredOptionsInParent }: {
2
- options: any;
3
- searchString: any;
4
- searchFieldsConfig: any;
5
- setFilteredOptionsInParent: any;
6
- }): any;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.keywordSearchOptions = void 0;
4
- var isStringMatch_1 = require("../../../utils/isStringMatch");
5
- var keywordSearchOptions = function (_a) {
6
- var options = _a.options, searchString = _a.searchString, searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptionsInParent;
7
- if (options.some(function (d) { return d.loading === true; }))
8
- return options; //if any of the options are still loading, then dont even try to do this filter thing
9
- //else
10
- var toReturn = options.filter(function (d) {
11
- return (0, isStringMatch_1.isStringMatch)({ data: d, toMatchPath: searchFieldsConfig || 'display', subString: searchString });
12
- });
13
- //we want to track filtered options only if a search is being conducted
14
- //this will help us to select the most relevant option if user hits 'enter' instead of clicking on option.
15
- setFilteredOptionsInParent && searchString && setFilteredOptionsInParent(toReturn);
16
- return toReturn;
17
- };
18
- exports.keywordSearchOptions = keywordSearchOptions;
@@ -1,12 +0,0 @@
1
- export function setDropdownSelectText({ placeholder, disableSelectTextUpdate, value, isTagsStyle }: {
2
- placeholder: any;
3
- disableSelectTextUpdate: any;
4
- value: any;
5
- isTagsStyle: any;
6
- }): {
7
- display: any;
8
- desc?: undefined;
9
- } | {
10
- display: any;
11
- desc: any;
12
- };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setDropdownSelectText = void 0;
4
- var setDropdownSelectText = function (_a) {
5
- var placeholder = _a.placeholder, disableSelectTextUpdate = _a.disableSelectTextUpdate, value = _a.value, isTagsStyle = _a.isTagsStyle;
6
- if (disableSelectTextUpdate)
7
- return { display: placeholder || "Select" };
8
- if (!value ||
9
- (Array.isArray(value) && value.length === 0))
10
- return { display: placeholder || "Select" }; //else
11
- // we dont show 'x' selected or the selected text in tagsStyle
12
- if (!isTagsStyle) {
13
- return {
14
- display: Array.isArray(value) ? "".concat(value.length, " Selected") : value.display,
15
- desc: value.desc
16
- };
17
- }
18
- };
19
- exports.setDropdownSelectText = setDropdownSelectText;
@@ -1,5 +0,0 @@
1
- export function useCreateDropdownRefs(): {
2
- selectRef: import("react").MutableRefObject<any>;
3
- searchInputRef: import("react").MutableRefObject<any>;
4
- dropdownRef: import("react").MutableRefObject<any>;
5
- };
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCreateDropdownRefs = void 0;
4
- var react_1 = require("react");
5
- var useCreateDropdownRefs = function () {
6
- var selectRef = (0, react_1.useRef)(null);
7
- var dropdownRef = (0, react_1.useRef)(null);
8
- var searchInputRef = (0, react_1.useRef)(null);
9
- return {
10
- selectRef: selectRef,
11
- searchInputRef: searchInputRef,
12
- dropdownRef: dropdownRef
13
- };
14
- };
15
- exports.useCreateDropdownRefs = useCreateDropdownRefs;
@@ -1,5 +0,0 @@
1
- export function useHideShowOptions(options?: {}): {
2
- showOptions: boolean;
3
- handleHideOptions: () => void;
4
- handleShowOptions: () => void;
5
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useHideShowOptions = void 0;
4
- var react_1 = require("react");
5
- var useHideShowOptions = function (options) {
6
- if (options === void 0) { options = {}; }
7
- var broadcastShowOptions = options.broadcastShowOptions;
8
- var _a = (0, react_1.useState)(false), showOptions = _a[0], setShowOptions = _a[1];
9
- var handleHideOptions = function () {
10
- setShowOptions(false);
11
- };
12
- var handleShowOptions = function () { return setShowOptions(true); };
13
- var isFirstMount = (0, react_1.useRef)(true);
14
- (0, react_1.useEffect)(function () {
15
- !isFirstMount.current && broadcastShowOptions && broadcastShowOptions(showOptions);
16
- }, [showOptions]);
17
- (0, react_1.useEffect)(function () { isFirstMount.current = false; }, []);
18
- return { showOptions: showOptions, handleHideOptions: handleHideOptions, handleShowOptions: handleShowOptions };
19
- };
20
- exports.useHideShowOptions = useHideShowOptions;
@@ -1,12 +0,0 @@
1
- export function useKeyboardControl({ showOptions, handleHideOptions, optionsWrapperRef, handleSelect, options, searchString, id }: {
2
- showOptions: any;
3
- handleHideOptions: any;
4
- optionsWrapperRef: any;
5
- handleSelect: any;
6
- options: any;
7
- searchString: any;
8
- id: any;
9
- }): {
10
- scrollFocussedOpIntoView: (el: any) => void;
11
- focussedOp: number;
12
- };
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useKeyboardControl = void 0;
4
- var react_1 = require("react");
5
- var getKeyCode_1 = require("../../../utils/getKeyCode");
6
- var useKeyboardControl = function (_a) {
7
- var showOptions = _a.showOptions, handleHideOptions = _a.handleHideOptions, optionsWrapperRef = _a.optionsWrapperRef, handleSelect = _a.handleSelect, options = _a.options, searchString = _a.searchString, id = _a.id;
8
- var _b = (0, react_1.useState)(-1), focussedOp = _b[0], setFocussedOp = _b[1];
9
- // if search string is not empty, then reset focussedOp to first op
10
- // else set it to minus 1
11
- (0, react_1.useEffect)(function () {
12
- if ((searchString === null || searchString === void 0 ? void 0 : searchString.length) > 0)
13
- setFocussedOp(0);
14
- else if (focussedOp !== -1)
15
- setFocussedOp(-1);
16
- }, [searchString]);
17
- (0, react_1.useEffect)(function () {
18
- //update only when options are shut
19
- if (!showOptions)
20
- setFocussedOp(-1);
21
- }, [showOptions]);
22
- (0, react_1.useEffect)(function () {
23
- var handleKeyDown = function (e) {
24
- if (!showOptions)
25
- return;
26
- /**
27
- * dont prevent default outside the condition, else
28
- * all other key actions stop working..
29
- */
30
- var code = (0, getKeyCode_1.getKeyCode)(e);
31
- if (code === 'Enter') {
32
- if (options[focussedOp])
33
- handleSelect(options[focussedOp]);
34
- }
35
- else if (code === 'ArrowDown') {
36
- if (showOptions)
37
- e.preventDefault(); //basically disabled page scroll by arrow keys
38
- focussedOp !== options.length - 1 && setFocussedOp(function (p) { return p + 1; });
39
- }
40
- else if (code === 'ArrowUp') {
41
- if (showOptions)
42
- e.preventDefault(); //basically disabled page scroll by arrow keys
43
- focussedOp !== -1 && setFocussedOp(function (p) { return p - 1; });
44
- }
45
- else if (code === 'Escape' /*esc*/) {
46
- handleHideOptions();
47
- }
48
- };
49
- window.addEventListener('keydown', handleKeyDown);
50
- return function () { return window.removeEventListener('keydown', handleKeyDown); };
51
- });
52
- var scrollFocussedOpIntoView = function (el) {
53
- var _a = el.getBoundingClientRect(), elBottom = _a.bottom, elTop = _a.top;
54
- var _b = optionsWrapperRef.current.getBoundingClientRect(), opsWrapperBottom = _b.bottom, opsWrapperTop = _b.top;
55
- if (elBottom > opsWrapperBottom) {
56
- el.scrollIntoView({
57
- behaviour: 'smooth',
58
- block: 'nearest',
59
- });
60
- }
61
- else if (elTop < opsWrapperTop) {
62
- el.scrollIntoView({
63
- behaviour: 'smooth',
64
- block: 'nearest',
65
- });
66
- }
67
- };
68
- return {
69
- scrollFocussedOpIntoView: scrollFocussedOpIntoView,
70
- focussedOp: focussedOp
71
- };
72
- };
73
- exports.useKeyboardControl = useKeyboardControl;
@@ -1,4 +0,0 @@
1
- export function useSearchString({ searchStringInParent, setSearchStringInParent, }: {
2
- searchStringInParent: any;
3
- setSearchStringInParent: any;
4
- }): any[];
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSearchString = void 0;
4
- var react_1 = require("react");
5
- var useSearchString = function (_a) {
6
- var
7
- // showOptions,
8
- searchStringInParent = _a.searchStringInParent, setSearchStringInParent = _a.setSearchStringInParent;
9
- var _b = (0, react_1.useState)(searchStringInParent || ""), searchString = _b[0], _setSearchString = _b[1];
10
- var setSearchString = function (string) {
11
- _setSearchString(string);
12
- setSearchStringInParent && setSearchStringInParent(string);
13
- };
14
- // useEffect(() => {
15
- // if(searchStringInParent !== searchString){
16
- // }
17
- // }, [searchStringInParent]); /**if value is changed from outside the dropdown by the parent, then search string needs to be updated */
18
- return [searchString, setSearchString];
19
- };
20
- exports.useSearchString = useSearchString;
@@ -1,9 +0,0 @@
1
- export function useSetYOrientation({ showOptions, optionsRef, relativeToRef, enabled }: {
2
- showOptions: any;
3
- optionsRef: any;
4
- relativeToRef: any;
5
- enabled: any;
6
- }): {
7
- yOrientation: string;
8
- };
9
- export function handleSetYOrientation(elemRef: any, anchorRef: any, setYOrientation: any): void;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleSetYOrientation = exports.useSetYOrientation = void 0;
4
- var react_1 = require("react");
5
- var useScroll_1 = require("../../../utils/customHooks/useScroll");
6
- var useSetYOrientation = function (_a) {
7
- var showOptions = _a.showOptions, optionsRef = _a.optionsRef, relativeToRef = _a.relativeToRef, enabled = _a.enabled;
8
- var _b = (0, react_1.useState)("bottom"), yOrientation = _b[0], setYOrientation = _b[1];
9
- var _handleSetYOrientation = function () {
10
- if (!enabled)
11
- return;
12
- (0, exports.handleSetYOrientation)(optionsRef, relativeToRef, setYOrientation);
13
- };
14
- (0, useScroll_1.useScroll)(_handleSetYOrientation, { detectScrollInAllDivs: true });
15
- (0, react_1.useLayoutEffect)(function () {
16
- if (showOptions) {
17
- _handleSetYOrientation(); //set y orientation
18
- }
19
- }, [showOptions]);
20
- return { yOrientation: yOrientation };
21
- };
22
- exports.useSetYOrientation = useSetYOrientation;
23
- var handleSetYOrientation = function (elemRef, anchorRef, setYOrientation) {
24
- if (!anchorRef.current || !elemRef.current)
25
- return;
26
- // - - we calculate the bottom edge y pos of the options, if it opens downward
27
- var viewportHeight = window.innerHeight;
28
- var _a = anchorRef.current.getBoundingClientRect(), anchorPoint_YPos_BOTTOM = _a.bottom, anchorPoint_YPos_TOP = _a.top;
29
- var elemHeight = elemRef.current.getBoundingClientRect().height;
30
- var elemBottomEdge = anchorPoint_YPos_BOTTOM + elemHeight;
31
- // - - then we calculate the top edge y pos of the options, if it opens upward
32
- var elemTopEdge = anchorPoint_YPos_TOP - elemHeight;
33
- // - - if bottom is not popping out of the screen, set open downward (default)
34
- if (elemBottomEdge < viewportHeight) {
35
- setYOrientation("bottom");
36
- }
37
- // - - if both of them are popping out the screen, then set open downward (default)
38
- else if (elemBottomEdge >= viewportHeight && elemTopEdge <= 0) {
39
- setYOrientation("bottom");
40
- }
41
- // - - only one option left, bottom is popping out of screen, but top is NOT. so set open upward
42
- else {
43
- setYOrientation("top");
44
- }
45
- };
46
- exports.handleSetYOrientation = handleSetYOrientation;
@@ -1,6 +0,0 @@
1
- export const HintsContext: React.Context<any>;
2
- export function HintsProvider({ children }: {
3
- children: any;
4
- }): React.JSX.Element;
5
- export function useHintsContext(): any;
6
- import React from "react";
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.useHintsContext = exports.HintsProvider = exports.HintsContext = void 0;
37
- var react_1 = __importStar(require("react"));
38
- exports.HintsContext = (0, react_1.createContext)();
39
- var HintsProvider = function (_a) {
40
- var children = _a.children;
41
- var _b = (0, react_1.useState)(""), active = _b[0], setActive = _b[1];
42
- return (react_1.default.createElement(exports.HintsContext.Provider, { value: { active: active, setActive: setActive } }, children));
43
- };
44
- exports.HintsProvider = HintsProvider;
45
- var useHintsContext = function () {
46
- return (0, react_1.useContext)(exports.HintsContext);
47
- };
48
- exports.useHintsContext = useHintsContext;
@@ -1,9 +0,0 @@
1
- export default Hints;
2
- declare function Hints({ id, hints, title, btnlabel, subtitle }: {
3
- id: any;
4
- hints: any;
5
- title?: string;
6
- btnlabel?: string;
7
- subtitle: any;
8
- }): React.JSX.Element;
9
- import React from "react";
@@ -1,127 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
- Object.defineProperty(exports, "__esModule", { value: true });
47
- var styled_1 = require("./styled");
48
- var Typo_1 = require("../Typo");
49
- var react_1 = __importStar(require("react"));
50
- var contextApi_1 = require("../Hints/contextApi");
51
- var colors_1 = require("../../themes/colors");
52
- var DisplayIcon_1 = require("../../utils/comps/DisplayIcon");
53
- var Buttons_1 = require("../Buttons");
54
- var Modal_1 = require("../Modals/Modal");
55
- var mixins_1 = require("../../themes/mixins");
56
- var useScreenWidth_1 = require("../../utils/customHooks/useScreenWidth");
57
- var styled_2 = require("../Modals/Modal/styled");
58
- var OKELink_1 = require("../OKELink");
59
- var greyColor80 = colors_1.colors.greyColor80, greyColor15 = colors_1.colors.greyColor15, greyColor100 = colors_1.colors.greyColor100;
60
- var TriangleIconComp = function (props) { return (react_1.default.createElement("svg", __assign({ width: 20, height: 13, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
61
- react_1.default.createElement("path", { d: "m8.894 1.206-7.59 8.28C.422 10.448 1.104 12 2.41 12h15.18c1.305 0 1.988-1.552 1.106-2.514l-7.59-8.28a1.5 1.5 0 0 0-2.212 0Z", fill: "#fff", stroke: greyColor15 }))); };
62
- var getPositionStyles = function (position) {
63
- var styles = {
64
- left: {
65
- lightBox: { top: "-2rem", left: "-31.5rem" },
66
- arrow: { top: ".7rem", left: "-2rem", transform: "rotate(45deg)" },
67
- },
68
- bottom: {
69
- lightBox: { top: "4.5rem", left: "-2rem" },
70
- arrow: { top: "3.9rem", left: "6rem", transform: "rotate(-45deg)" },
71
- },
72
- };
73
- return styles[position];
74
- };
75
- var BulletIcon = function () { return (
76
- // line height of SANS_3 is 21px. Dot is 8px tall. so below css (21/2 - 8/2) makes the circle perfectly aligned with the first line
77
- react_1.default.createElement("div", { style: { fontSize: 0, marginTop: '6.5px', lineHeight: 0 } },
78
- react_1.default.createElement(DisplayIcon_1.DisplayIcon, { color: greyColor100, weight: "fill", icon: "Circle", size: 8 }))); };
79
- var Hints = function (_a) {
80
- var id = _a.id, hints = _a.hints, _b = _a.title, title = _b === void 0 ? "Hints" : _b, _c = _a.btnlabel, btnlabel = _c === void 0 ? "Hints" : _c, subtitle = _a.subtitle;
81
- //get the context state
82
- var _d = (0, contextApi_1.useHintsContext)(), active = _d.active, setActive = _d.setActive;
83
- var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
84
- var lightBoxRef = (0, react_1.useRef)();
85
- var _e = (0, react_1.useState)(getPositionStyles("left")), styles = _e[0], setStyles = _e[1];
86
- //isStorybook is temporary hack to get correct with on storybook, since a story is getting renderend within an iframe, screen.width gives the incorrect width
87
- var isDesktop = screenWidth > (0, mixins_1.getBreakPoint)("md");
88
- (0, react_1.useEffect)(function () {
89
- if (!lightBoxRef.current)
90
- return;
91
- var lightBoxRect = lightBoxRef.current.getBoundingClientRect();
92
- // by default open on leftside, if the below condition is true than open at the bottom of hints
93
- //note for future: arrow comp is fixed and lightbox will move to place itself within the visible area
94
- if (lightBoxRect.left < 0) {
95
- setStyles(getPositionStyles("bottom"));
96
- // setStyles({
97
- // lightBox: { top: "4rem", right: "0" },
98
- // arrow: { top: `none`, right: "3.5rem", transform: "none" },
99
- // });
100
- }
101
- }, [active]);
102
- return (react_1.default.createElement("div", null,
103
- " ",
104
- react_1.default.createElement(styled_1.StyledHints, { onClick: function () { return setActive(id); } },
105
- react_1.default.createElement(Typo_1.SANS_3, { semibold: true },
106
- react_1.default.createElement(OKELink_1.OKELink, { icon: "LightbulbFilament", linkType: "action", onClick: function () { return setActive(id); }, iconSize: 16, invertUnderline: true }, btnlabel))),
107
- active === id ? (isDesktop ? (react_1.default.createElement("div", null,
108
- react_1.default.createElement(styled_1.StyledTriangle, { style: styles.arrow, id: id }),
109
- react_1.default.createElement(styled_1.StyledLightbox, { style: styles.lightBox, ref: lightBoxRef, id: id },
110
- react_1.default.createElement(styled_2.StyledModalHeaderStyle2Container, null,
111
- react_1.default.createElement("div", { style: { position: "absolute", top: "-2.5rem", fontSize: 0 } },
112
- react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: "ModalBulbIcon" })),
113
- react_1.default.createElement(styled_2.StyledModalHeaderStyle2Title, null,
114
- react_1.default.createElement(Typo_1.SANS_3, { semibold: true, capitalize: true }, title),
115
- subtitle ? (react_1.default.createElement(Typo_1.SANS_3_4, { capitalize: true, semibold: true, style: { flexGrow: "1" }, color: greyColor80 }, subtitle)) : null,
116
- react_1.default.createElement(Buttons_1.ButtonGhost, { onClick: function () { return setActive(""); }, icon: "X" }))),
117
- react_1.default.createElement(styled_1.StyledLightBoxContent, null,
118
- react_1.default.createElement(styled_1.StyledLightBoxList, null, hints.map(function (d) { return (react_1.default.createElement("li", null,
119
- react_1.default.createElement(BulletIcon, null),
120
- react_1.default.createElement(Typo_1.SANS_3, null, d))); })))))) : (react_1.default.createElement(Modal_1.Modal, { isStorybook: true, headerStyle: "style2", id: "modal", title: title, onClose: function () { return setActive(""); } },
121
- react_1.default.createElement("div", { style: { padding: ".5rem 2rem" } },
122
- react_1.default.createElement(styled_1.StyledLightBoxList, null, hints.map(function (d) { return (react_1.default.createElement("li", null,
123
- react_1.default.createElement("div", { style: { marginTop: ".5rem", lineHeight: 0 } },
124
- react_1.default.createElement(DisplayIcon_1.DisplayIcon, { color: greyColor100, weight: "fill", icon: "Circle", size: 8 })),
125
- react_1.default.createElement(Typo_1.SANS_3, null, d))); })))))) : null));
126
- };
127
- exports.default = Hints;
@@ -1,6 +0,0 @@
1
- export const StyledHints: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export const StyledLightbox: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export const StyledLightBoxHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export const StyledLightBoxContent: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export const StyledLightBoxList: import("styled-components").StyledComponent<"ul", any, {}, never>;
6
- export const StyledTriangle: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,54 +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 __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.StyledTriangle = exports.StyledLightBoxList = exports.StyledLightBoxContent = exports.StyledLightBoxHeader = exports.StyledLightbox = exports.StyledHints = void 0;
11
- var styled_components_1 = __importDefault(require("styled-components"));
12
- var themes_1 = require("../../themes");
13
- var globalVariables_1 = require("../../globalStyles/globalVariables");
14
- var white = themes_1.colors.white, greyColor15 = themes_1.colors.greyColor15, greyColor100 = themes_1.colors.greyColor100;
15
- exports.StyledHints = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
16
- exports.StyledLightbox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: 1000;\n background: ", ";\n position: absolute;\n width: 30rem;\n height: 35rem;\n ", "\n /* top: ", "; */\n /* right: ", "; */\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n\n display: flex;\n flex-direction: column;\n"], ["\n z-index: 1000;\n background: ", ";\n position: absolute;\n width: 30rem;\n height: 35rem;\n ", "\n /* top: ", "; */\n /* right: ", "; */\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n\n display: flex;\n flex-direction: column;\n"])), white, globalVariables_1.globalLightboxStyle, function (_a) {
17
- var style = _a.style;
18
- return ((style === null || style === void 0 ? void 0 : style.top) ? style.top : "-1rem");
19
- }, function (_a) {
20
- var style = _a.style;
21
- return ((style === null || style === void 0 ? void 0 : style.right) ? style.right : "-31.5rem");
22
- }, function (_a) {
23
- var top = _a.style.top;
24
- return top;
25
- }, function (_a) {
26
- var left = _a.style.left;
27
- return left;
28
- }, function (_a) {
29
- var bottom = _a.style.bottom;
30
- return bottom;
31
- }, function (_a) {
32
- var right = _a.style.right;
33
- return right;
34
- });
35
- exports.StyledLightBoxHeader = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 4rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: 2px;\n gap: 1rem;\n\n padding: 1rem 1.5rem;\n"], ["\n height: 4rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: 2px;\n gap: 1rem;\n\n padding: 1rem 1.5rem;\n"])));
36
- exports.StyledLightBoxContent = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 0.5rem 2rem 2rem 1.5rem;\n overflow-y: auto;\n"], ["\n padding: 0.5rem 2rem 2rem 1.5rem;\n overflow-y: auto;\n"])));
37
- exports.StyledLightBoxList = styled_components_1.default.ul(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: 0;\n li {\n list-style-type: none;\n padding: 0.5rem 0;\n display: flex;\n gap: 1rem;\n /* align-items: center; */\n /* ::before {\n content: \"\";\n margin-top: 0.5rem;\n flex: 0 0 .5rem;\n width: .5rem;\n padding: 0%.5r;\n height: .5rem;\n background-color: ", ";\n border-radius: 50%;\n flex-shrink: 0;\n } */\n }\n"], ["\n padding: 0;\n li {\n list-style-type: none;\n padding: 0.5rem 0;\n display: flex;\n gap: 1rem;\n /* align-items: center; */\n /* ::before {\n content: \"\";\n margin-top: 0.5rem;\n flex: 0 0 .5rem;\n width: .5rem;\n padding: 0%.5r;\n height: .5rem;\n background-color: ", ";\n border-radius: 50%;\n flex-shrink: 0;\n } */\n }\n"])), greyColor100);
38
- exports.StyledTriangle = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n\n width: 10px;\n height: 10px;\n border-style: solid;\n\n border-width: 1px;\n border-color: ", " ", " transparent transparent;\n /* transform:rotate(-45deg); */\n z-index: 10001;\n background-color: white;\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n transform: ", ";\n\n /* position:absolute; */\n /* top:.7rem; */\n /* left:-2rem; */\n /* transform :rotate(90deg); */\n"], ["\n position: absolute;\n\n width: 10px;\n height: 10px;\n border-style: solid;\n\n border-width: 1px;\n border-color: ", " ", " transparent transparent;\n /* transform:rotate(-45deg); */\n z-index: 10001;\n background-color: white;\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n transform: ", ";\n\n /* position:absolute; */\n /* top:.7rem; */\n /* left:-2rem; */\n /* transform :rotate(90deg); */\n"])), greyColor15, greyColor15, function (_a) {
39
- var top = _a.style.top;
40
- return top;
41
- }, function (_a) {
42
- var left = _a.style.left;
43
- return left;
44
- }, function (_a) {
45
- var bottom = _a.style.bottom;
46
- return bottom;
47
- }, function (_a) {
48
- var right = _a.style.right;
49
- return right;
50
- }, function (_a) {
51
- var transform = _a.style.transform;
52
- return transform;
53
- });
54
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -1,11 +0,0 @@
1
- export function CheckboxButton({ id, className, isSelected: _isSelected, value, onChange, disabled, invert, S }: {
2
- id: any;
3
- className: any;
4
- isSelected: any;
5
- value: any;
6
- onChange: any;
7
- disabled: any;
8
- invert: any;
9
- S: any;
10
- }): React.JSX.Element;
11
- import React from 'react';