oolib 2.208.0 → 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 (156) 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/v2/components/DateRangePicker/index.js +1 -2
  13. package/dist/v2/components/TabBar/index.js +3 -3
  14. package/dist/v2/components/TextInputs/index.js +0 -7
  15. package/dist/v2/components/TextInputs/index.styled.js +1 -1
  16. package/package.json +1 -1
  17. package/dist/components/BlockLabel/index.d.ts +0 -2
  18. package/dist/components/BlockLabel/index.js +0 -75
  19. package/dist/components/BlockLabel/index.styled.d.ts +0 -2
  20. package/dist/components/BlockLabel/index.styled.js +0 -14
  21. package/dist/components/Dropdowns/DropdownMulti/index.d.ts +0 -38
  22. package/dist/components/Dropdowns/DropdownMulti/index.js +0 -179
  23. package/dist/components/Dropdowns/DropdownSingle/index.d.ts +0 -40
  24. package/dist/components/Dropdowns/DropdownSingle/index.js +0 -163
  25. package/dist/components/Dropdowns/comps/Caret/index.d.ts +0 -6
  26. package/dist/components/Dropdowns/comps/Caret/index.js +0 -19
  27. package/dist/components/Dropdowns/comps/Caret/styled.d.ts +0 -2
  28. package/dist/components/Dropdowns/comps/Caret/styled.js +0 -14
  29. package/dist/components/Dropdowns/comps/DisplayCompSingle/index.d.ts +0 -7
  30. package/dist/components/Dropdowns/comps/DisplayCompSingle/index.js +0 -39
  31. package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.d.ts +0 -4
  32. package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.js +0 -15
  33. package/dist/components/Dropdowns/comps/OptionContent/index.d.ts +0 -8
  34. package/dist/components/Dropdowns/comps/OptionContent/index.js +0 -34
  35. package/dist/components/Dropdowns/comps/OptionsMulti/index.d.ts +0 -28
  36. package/dist/components/Dropdowns/comps/OptionsMulti/index.js +0 -159
  37. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.d.ts +0 -14
  38. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.js +0 -81
  39. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.d.ts +0 -2
  40. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.js +0 -25
  41. package/dist/components/Dropdowns/comps/OptionsShell/index.d.ts +0 -2
  42. package/dist/components/Dropdowns/comps/OptionsShell/index.js +0 -101
  43. package/dist/components/Dropdowns/comps/OptionsShell/styled.d.ts +0 -5
  44. package/dist/components/Dropdowns/comps/OptionsShell/styled.js +0 -45
  45. package/dist/components/Dropdowns/comps/OptionsSingle/index.d.ts +0 -28
  46. package/dist/components/Dropdowns/comps/OptionsSingle/index.js +0 -105
  47. package/dist/components/Dropdowns/comps/OptionsSingle/styled.d.ts +0 -1
  48. package/dist/components/Dropdowns/comps/OptionsSingle/styled.js +0 -61
  49. package/dist/components/Dropdowns/comps/SelectDropdown/index.d.ts +0 -13
  50. package/dist/components/Dropdowns/comps/SelectDropdown/index.js +0 -54
  51. package/dist/components/Dropdowns/comps/SelectDropdown/styled.d.ts +0 -1
  52. package/dist/components/Dropdowns/comps/SelectDropdown/styled.js +0 -71
  53. package/dist/components/Dropdowns/comps/SelectTagsInput/index.d.ts +0 -18
  54. package/dist/components/Dropdowns/comps/SelectTagsInput/index.js +0 -124
  55. package/dist/components/Dropdowns/comps/SelectTagsInput/styled.d.ts +0 -2
  56. package/dist/components/Dropdowns/comps/SelectTagsInput/styled.js +0 -54
  57. package/dist/components/Dropdowns/handlers/index.d.ts +0 -14
  58. package/dist/components/Dropdowns/handlers/index.js +0 -52
  59. package/dist/components/Dropdowns/styled.d.ts +0 -2
  60. package/dist/components/Dropdowns/styled.js +0 -49
  61. package/dist/components/Dropdowns/utils/genColor.d.ts +0 -4
  62. package/dist/components/Dropdowns/utils/genColor.js +0 -15
  63. package/dist/components/Dropdowns/utils/genIcon.d.ts +0 -6
  64. package/dist/components/Dropdowns/utils/genIcon.js +0 -18
  65. package/dist/components/Dropdowns/utils/genLinkOrText.d.ts +0 -1
  66. package/dist/components/Dropdowns/utils/genLinkOrText.js +0 -48
  67. package/dist/components/Dropdowns/utils/genProfileImg.d.ts +0 -6
  68. package/dist/components/Dropdowns/utils/genProfileImg.js +0 -14
  69. package/dist/components/Dropdowns/utils/genTagComp.d.ts +0 -2
  70. package/dist/components/Dropdowns/utils/genTagComp.js +0 -27
  71. package/dist/components/Dropdowns/utils/generateOptions.d.ts +0 -5
  72. package/dist/components/Dropdowns/utils/generateOptions.js +0 -20
  73. package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.d.ts +0 -1
  74. package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.js +0 -40
  75. package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.d.ts +0 -4
  76. package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.js +0 -11
  77. package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.d.ts +0 -4
  78. package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.js +0 -62
  79. package/dist/components/Dropdowns/utils/getAllOptionsFns/index.d.ts +0 -1
  80. package/dist/components/Dropdowns/utils/getAllOptionsFns/index.js +0 -19
  81. package/dist/components/Dropdowns/utils/getValue.d.ts +0 -14
  82. package/dist/components/Dropdowns/utils/getValue.js +0 -32
  83. package/dist/components/Dropdowns/utils/isDynamicOtherOption.d.ts +0 -0
  84. package/dist/components/Dropdowns/utils/isDynamicOtherOption.js +0 -0
  85. package/dist/components/Dropdowns/utils/keywordSearchOptions.d.ts +0 -6
  86. package/dist/components/Dropdowns/utils/keywordSearchOptions.js +0 -18
  87. package/dist/components/Dropdowns/utils/setDropdownSelectText.d.ts +0 -12
  88. package/dist/components/Dropdowns/utils/setDropdownSelectText.js +0 -19
  89. package/dist/components/Dropdowns/utils/useCreateDropdownRefs.d.ts +0 -5
  90. package/dist/components/Dropdowns/utils/useCreateDropdownRefs.js +0 -15
  91. package/dist/components/Dropdowns/utils/useHideShowOptions.d.ts +0 -5
  92. package/dist/components/Dropdowns/utils/useHideShowOptions.js +0 -20
  93. package/dist/components/Dropdowns/utils/useKeyboardControl.d.ts +0 -12
  94. package/dist/components/Dropdowns/utils/useKeyboardControl.js +0 -73
  95. package/dist/components/Dropdowns/utils/useSearchString.d.ts +0 -4
  96. package/dist/components/Dropdowns/utils/useSearchString.js +0 -20
  97. package/dist/components/Dropdowns/utils/useSetYOrientation.d.ts +0 -9
  98. package/dist/components/Dropdowns/utils/useSetYOrientation.js +0 -46
  99. package/dist/components/Hints/contextApi.d.ts +0 -6
  100. package/dist/components/Hints/contextApi.js +0 -48
  101. package/dist/components/Hints/index.d.ts +0 -9
  102. package/dist/components/Hints/index.js +0 -127
  103. package/dist/components/Hints/styled.d.ts +0 -6
  104. package/dist/components/Hints/styled.js +0 -54
  105. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.d.ts +0 -11
  106. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.js +0 -30
  107. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.d.ts +0 -1
  108. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.js +0 -70
  109. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +0 -11
  110. package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +0 -50
  111. package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.d.ts +0 -20
  112. package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.js +0 -124
  113. package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.d.ts +0 -2
  114. package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.js +0 -17
  115. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.d.ts +0 -18
  116. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +0 -53
  117. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.d.ts +0 -2
  118. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.js +0 -84
  119. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.d.ts +0 -1
  120. package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.js +0 -6
  121. package/dist/components/RadioAndCheckbox/comps/RadioList/index.d.ts +0 -17
  122. package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +0 -109
  123. package/dist/components/RadioAndCheckbox/index.d.ts +0 -5
  124. package/dist/components/RadioAndCheckbox/index.js +0 -14
  125. package/dist/components/RadioAndCheckbox/styled.d.ts +0 -5
  126. package/dist/components/RadioAndCheckbox/styled.js +0 -84
  127. package/dist/components/RadioAndCheckbox/utils.d.ts +0 -22
  128. package/dist/components/RadioAndCheckbox/utils.js +0 -49
  129. package/dist/components/Switches/index.d.ts +0 -21
  130. package/dist/components/Switches/index.js +0 -102
  131. package/dist/components/Switches/styled.d.ts +0 -5
  132. package/dist/components/Switches/styled.js +0 -63
  133. package/dist/components/TextInputs/index.d.ts +0 -24
  134. package/dist/components/TextInputs/index.js +0 -367
  135. package/dist/components/TextInputs/index.styled.d.ts +0 -3
  136. package/dist/components/TextInputs/index.styled.js +0 -77
  137. package/dist/components/cards/CardContent/index.d.ts +0 -11
  138. package/dist/components/cards/CardContent/index.js +0 -76
  139. package/dist/components/cards/CardContent/styled.d.ts +0 -7
  140. package/dist/components/cards/CardContent/styled.js +0 -63
  141. package/dist/components/cards/ListContent/index.d.ts +0 -12
  142. package/dist/components/cards/ListContent/index.js +0 -87
  143. package/dist/components/cards/ListContent/styled.d.ts +0 -7
  144. package/dist/components/cards/ListContent/styled.js +0 -26
  145. package/dist/stories/Oolib/components/BlockLabel.stories.d.ts +0 -71
  146. package/dist/stories/Oolib/components/BlockLabel.stories.js +0 -106
  147. package/dist/stories/Oolib/components/Checkbox.stories.d.ts +0 -248
  148. package/dist/stories/Oolib/components/Checkbox.stories.js +0 -249
  149. package/dist/stories/Oolib/components/Dropdowns.stories.d.ts +0 -127
  150. package/dist/stories/Oolib/components/Dropdowns.stories.js +0 -298
  151. package/dist/stories/Oolib/components/RadioButton.stories.d.ts +0 -260
  152. package/dist/stories/Oolib/components/RadioButton.stories.js +0 -264
  153. package/dist/stories/Oolib/components/Switches.stories.d.ts +0 -106
  154. package/dist/stories/Oolib/components/Switches.stories.js +0 -146
  155. package/dist/stories/Oolib/components/TextInputs.stories.d.ts +0 -124
  156. package/dist/stories/Oolib/components/TextInputs.stories.js +0 -188
@@ -1,6 +0,0 @@
1
- export function genProfileImg({ image, display, invert }: {
2
- image: any;
3
- display: any;
4
- invert: any;
5
- }): React.JSX.Element;
6
- import React from "react";
@@ -1,14 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.genProfileImg = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var ProfileImageInput_1 = require("../../ImageInput/derivedComps/ProfileImageInput");
9
- var genProfileImg = function (_a) {
10
- var image = _a.image, display = _a.display, invert = _a.invert;
11
- return (react_1.default.createElement("div", { style: { flex: "0 0 auto", display: 'flex', alignItems: 'start' }, id: "test" },
12
- react_1.default.createElement(ProfileImageInput_1.ProfileImageInput, { readOnly: true, value: image, imageTitle: display, size: 20, invert: invert })));
13
- };
14
- exports.genProfileImg = genProfileImg;
@@ -1,2 +0,0 @@
1
- export function genTagComp(id: any, d: any, options?: {}): React.JSX.Element;
2
- import React from "react";
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.genTagComp = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var Tags_1 = require("../../Tags");
9
- var genLinkOrText_1 = require("./genLinkOrText");
10
- var genTagComp = function (id, d, options) {
11
- if (options === void 0) { options = {}; }
12
- var link = (0, genLinkOrText_1.genLinkOrText)(d).link;
13
- var showOptions = options.showOptions;
14
- switch (true) {
15
- case !options.display:
16
- return (react_1.default.createElement("div", { tabIndex: 0, style: { minWidth: 0 }, onFocus: function (e) { return !showOptions && e.stopPropagation(); } },
17
- react_1.default.createElement(Tags_1.TagClear, { XS: options.S, grey: true, invert: options.invert, display: d.display, onClick: function (e) {
18
- e.stopPropagation();
19
- options.handleSelect(options.single_multi === "single" ? undefined : d);
20
- } })));
21
- case !!link:
22
- return react_1.default.createElement(Tags_1.TagLink, { XS: options.S, invert: options.invert, to: link, display: d.display, color: options.color });
23
- default:
24
- return react_1.default.createElement(Tags_1.TagDisplay, { XS: options.S, invert: options.invert, display: d.display });
25
- }
26
- };
27
- exports.genTagComp = genTagComp;
@@ -1,5 +0,0 @@
1
- export function generateOptions({ options, optionsFn, theme }: {
2
- options: any;
3
- optionsFn: any;
4
- theme: any;
5
- }): any;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateOptions = void 0;
4
- var getAllOptionsFns_1 = require("./getAllOptionsFns");
5
- var generateOptions = function (_a) {
6
- var _b;
7
- var options = _a.options, optionsFn = _a.optionsFn, theme = _a.theme /*injectOtherOption*/;
8
- console.log('rerun generate options');
9
- switch (true) {
10
- case !!options:
11
- return options;
12
- // let otherOp = { display: "Other", value: "other" };
13
- // return injectOtherOption ? [...options, otherOp] : options;
14
- case !!optionsFn:
15
- return (_b = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_b, (optionsFn.args || []));
16
- default:
17
- return [{ display: "Options Undefined", value: "undefined" }];
18
- }
19
- };
20
- exports.generateOptions = generateOptions;
@@ -1 +0,0 @@
1
- export function genMonthsArray(nameLength: any): any;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genMonthsArray = void 0;
4
- var genMonthsArray = function (nameLength) {
5
- var form = {
6
- long: [
7
- "January",
8
- "February",
9
- "March",
10
- "April",
11
- "May",
12
- "June",
13
- "July",
14
- "August",
15
- "September",
16
- "October",
17
- "November",
18
- "December",
19
- ],
20
- short: [
21
- "Jan",
22
- "Feb",
23
- "Mar",
24
- "Apr",
25
- "May",
26
- "Jun",
27
- "Jul",
28
- "Aug",
29
- "Sep",
30
- "Oct",
31
- "Nov",
32
- "Dec",
33
- ],
34
- };
35
- var monthsAry = form[nameLength].map(function (d) {
36
- return { display: d, value: d.toLowerCase() };
37
- });
38
- return monthsAry;
39
- };
40
- exports.genMonthsArray = genMonthsArray;
@@ -1,4 +0,0 @@
1
- export function genYearsArray(fromYr: any, toYr: any): {
2
- display: any;
3
- value: any;
4
- }[];
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.genYearsArray = void 0;
4
- var genYearsArray = function (fromYr, toYr) {
5
- var yrsAry = [];
6
- for (var i = fromYr; i <= toYr; i++) {
7
- yrsAry.unshift(i.toString());
8
- }
9
- return yrsAry.map(function (d) { return ({ display: d, value: d }); });
10
- };
11
- exports.genYearsArray = genYearsArray;
@@ -1,4 +0,0 @@
1
- export function getLanguagesArray(): {
2
- value: string;
3
- display: string;
4
- }[];
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLanguagesArray = void 0;
4
- var getLanguagesArray = function () { return [
5
- {
6
- "value": "as",
7
- "display": "Assamese"
8
- },
9
- {
10
- "value": "bn",
11
- "display": "Bengali"
12
- },
13
- {
14
- "value": "en",
15
- "display": "English"
16
- },
17
- {
18
- "value": "gu",
19
- "display": "Gujarati"
20
- },
21
- {
22
- "value": "hi",
23
- "display": "Hindi"
24
- },
25
- {
26
- "value": "kn",
27
- "display": "Kannada"
28
- },
29
- {
30
- "value": "ml",
31
- "display": "Malayalam"
32
- },
33
- {
34
- "value": "mr",
35
- "display": "Marathi"
36
- },
37
- {
38
- "value": "or",
39
- "display": "Odiya"
40
- },
41
- {
42
- "value": "pa",
43
- "display": "Punjabi"
44
- },
45
- {
46
- "value": "sd",
47
- "display": "Sindhi"
48
- },
49
- {
50
- "value": "ta",
51
- "display": "Tamil"
52
- },
53
- {
54
- "value": "te",
55
- "display": "Telugu"
56
- },
57
- {
58
- "value": "ur",
59
- "display": "Urdu"
60
- }
61
- ]; };
62
- exports.getLanguagesArray = getLanguagesArray;
@@ -1 +0,0 @@
1
- export function getAllOptionsFns(theme: any): any;
@@ -1,19 +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
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.getAllOptionsFns = void 0;
15
- var genMonthsArray_1 = require("./genMonthsArray");
16
- var genYearsArray_1 = require("./genYearsArray");
17
- var getLanguagesArray_1 = require("./getLanguagesArray");
18
- var getAllOptionsFns = function (theme) { return (__assign({ genYearsArray: genYearsArray_1.genYearsArray, genMonthsArray: genMonthsArray_1.genMonthsArray, getLanguagesArray: getLanguagesArray_1.getLanguagesArray }, ((theme === null || theme === void 0 ? void 0 : theme.optionsFns) || {}))); };
19
- exports.getAllOptionsFns = getAllOptionsFns;
@@ -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";