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.
- package/dist/components/DateRangePicker/index.js +2 -2
- package/dist/components/GroupQuestionsInputSingle/index.js +2 -2
- package/dist/components/IFrameInput/index.js +1 -1
- package/dist/components/ImageInput/comps/Placeholder/index.js +1 -1
- package/dist/components/SimpleTable/index.js +2 -2
- package/dist/components/VideoInput/comps/EmbedLinkModal.js +1 -1
- package/dist/components/cards/ListProfile/index.js +1 -1
- package/dist/index.d.ts +8 -9
- package/dist/index.js +25 -33
- package/dist/stories/Oolib/components/Modal.stories.js +2 -2
- package/dist/stories/Oolib/components/TagsInput.stories.js +1 -1
- package/dist/stories/v2/components/visualization/HeatMapGrid.stories.d.ts +1 -0
- package/dist/stories/v2/components/visualization/HeatMapGrid.stories.js +83 -1
- package/dist/v2/components/DateRangePicker/index.js +1 -2
- package/dist/v2/components/TabBar/index.js +3 -3
- package/dist/v2/components/TextInputs/index.js +0 -7
- package/dist/v2/components/TextInputs/index.styled.js +1 -1
- package/dist/v2/components/dataviz/HeatMapGrid/index.js +23 -28
- package/dist/v2/components/dataviz/HeatMapGrid/utils/usePrepareHeatMapData.d.ts +33 -0
- package/dist/v2/components/dataviz/HeatMapGrid/utils/usePrepareHeatMapData.js +117 -0
- package/package.json +1 -1
- package/dist/components/BlockLabel/index.d.ts +0 -2
- package/dist/components/BlockLabel/index.js +0 -75
- package/dist/components/BlockLabel/index.styled.d.ts +0 -2
- package/dist/components/BlockLabel/index.styled.js +0 -14
- package/dist/components/Dropdowns/DropdownMulti/index.d.ts +0 -38
- package/dist/components/Dropdowns/DropdownMulti/index.js +0 -179
- package/dist/components/Dropdowns/DropdownSingle/index.d.ts +0 -40
- package/dist/components/Dropdowns/DropdownSingle/index.js +0 -163
- package/dist/components/Dropdowns/comps/Caret/index.d.ts +0 -6
- package/dist/components/Dropdowns/comps/Caret/index.js +0 -19
- package/dist/components/Dropdowns/comps/Caret/styled.d.ts +0 -2
- package/dist/components/Dropdowns/comps/Caret/styled.js +0 -14
- package/dist/components/Dropdowns/comps/DisplayCompSingle/index.d.ts +0 -7
- package/dist/components/Dropdowns/comps/DisplayCompSingle/index.js +0 -39
- package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.d.ts +0 -4
- package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.js +0 -15
- package/dist/components/Dropdowns/comps/OptionContent/index.d.ts +0 -8
- package/dist/components/Dropdowns/comps/OptionContent/index.js +0 -34
- package/dist/components/Dropdowns/comps/OptionsMulti/index.d.ts +0 -28
- package/dist/components/Dropdowns/comps/OptionsMulti/index.js +0 -159
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.d.ts +0 -14
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.js +0 -81
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.d.ts +0 -2
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.js +0 -25
- package/dist/components/Dropdowns/comps/OptionsShell/index.d.ts +0 -2
- package/dist/components/Dropdowns/comps/OptionsShell/index.js +0 -101
- package/dist/components/Dropdowns/comps/OptionsShell/styled.d.ts +0 -5
- package/dist/components/Dropdowns/comps/OptionsShell/styled.js +0 -45
- package/dist/components/Dropdowns/comps/OptionsSingle/index.d.ts +0 -28
- package/dist/components/Dropdowns/comps/OptionsSingle/index.js +0 -105
- package/dist/components/Dropdowns/comps/OptionsSingle/styled.d.ts +0 -1
- package/dist/components/Dropdowns/comps/OptionsSingle/styled.js +0 -61
- package/dist/components/Dropdowns/comps/SelectDropdown/index.d.ts +0 -13
- package/dist/components/Dropdowns/comps/SelectDropdown/index.js +0 -54
- package/dist/components/Dropdowns/comps/SelectDropdown/styled.d.ts +0 -1
- package/dist/components/Dropdowns/comps/SelectDropdown/styled.js +0 -71
- package/dist/components/Dropdowns/comps/SelectTagsInput/index.d.ts +0 -18
- package/dist/components/Dropdowns/comps/SelectTagsInput/index.js +0 -124
- package/dist/components/Dropdowns/comps/SelectTagsInput/styled.d.ts +0 -2
- package/dist/components/Dropdowns/comps/SelectTagsInput/styled.js +0 -54
- package/dist/components/Dropdowns/handlers/index.d.ts +0 -14
- package/dist/components/Dropdowns/handlers/index.js +0 -52
- package/dist/components/Dropdowns/styled.d.ts +0 -2
- package/dist/components/Dropdowns/styled.js +0 -49
- package/dist/components/Dropdowns/utils/genColor.d.ts +0 -4
- package/dist/components/Dropdowns/utils/genColor.js +0 -15
- package/dist/components/Dropdowns/utils/genIcon.d.ts +0 -6
- package/dist/components/Dropdowns/utils/genIcon.js +0 -18
- package/dist/components/Dropdowns/utils/genLinkOrText.d.ts +0 -1
- package/dist/components/Dropdowns/utils/genLinkOrText.js +0 -48
- package/dist/components/Dropdowns/utils/genProfileImg.d.ts +0 -6
- package/dist/components/Dropdowns/utils/genProfileImg.js +0 -14
- package/dist/components/Dropdowns/utils/genTagComp.d.ts +0 -2
- package/dist/components/Dropdowns/utils/genTagComp.js +0 -27
- package/dist/components/Dropdowns/utils/generateOptions.d.ts +0 -5
- package/dist/components/Dropdowns/utils/generateOptions.js +0 -20
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.d.ts +0 -1
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.js +0 -40
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.d.ts +0 -4
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.js +0 -11
- package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.d.ts +0 -4
- package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.js +0 -62
- package/dist/components/Dropdowns/utils/getAllOptionsFns/index.d.ts +0 -1
- package/dist/components/Dropdowns/utils/getAllOptionsFns/index.js +0 -19
- package/dist/components/Dropdowns/utils/getValue.d.ts +0 -14
- package/dist/components/Dropdowns/utils/getValue.js +0 -32
- package/dist/components/Dropdowns/utils/isDynamicOtherOption.d.ts +0 -0
- package/dist/components/Dropdowns/utils/isDynamicOtherOption.js +0 -0
- package/dist/components/Dropdowns/utils/keywordSearchOptions.d.ts +0 -6
- package/dist/components/Dropdowns/utils/keywordSearchOptions.js +0 -18
- package/dist/components/Dropdowns/utils/setDropdownSelectText.d.ts +0 -12
- package/dist/components/Dropdowns/utils/setDropdownSelectText.js +0 -19
- package/dist/components/Dropdowns/utils/useCreateDropdownRefs.d.ts +0 -5
- package/dist/components/Dropdowns/utils/useCreateDropdownRefs.js +0 -15
- package/dist/components/Dropdowns/utils/useHideShowOptions.d.ts +0 -5
- package/dist/components/Dropdowns/utils/useHideShowOptions.js +0 -20
- package/dist/components/Dropdowns/utils/useKeyboardControl.d.ts +0 -12
- package/dist/components/Dropdowns/utils/useKeyboardControl.js +0 -73
- package/dist/components/Dropdowns/utils/useSearchString.d.ts +0 -4
- package/dist/components/Dropdowns/utils/useSearchString.js +0 -20
- package/dist/components/Dropdowns/utils/useSetYOrientation.d.ts +0 -9
- package/dist/components/Dropdowns/utils/useSetYOrientation.js +0 -46
- package/dist/components/Hints/contextApi.d.ts +0 -6
- package/dist/components/Hints/contextApi.js +0 -48
- package/dist/components/Hints/index.d.ts +0 -9
- package/dist/components/Hints/index.js +0 -127
- package/dist/components/Hints/styled.d.ts +0 -6
- package/dist/components/Hints/styled.js +0 -54
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.d.ts +0 -11
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.js +0 -30
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.d.ts +0 -1
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.js +0 -70
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +0 -11
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +0 -50
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.d.ts +0 -20
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.js +0 -124
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.d.ts +0 -2
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.js +0 -17
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.d.ts +0 -18
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +0 -53
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.d.ts +0 -2
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.js +0 -84
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.d.ts +0 -1
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.js +0 -6
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.d.ts +0 -17
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +0 -109
- package/dist/components/RadioAndCheckbox/index.d.ts +0 -5
- package/dist/components/RadioAndCheckbox/index.js +0 -14
- package/dist/components/RadioAndCheckbox/styled.d.ts +0 -5
- package/dist/components/RadioAndCheckbox/styled.js +0 -84
- package/dist/components/RadioAndCheckbox/utils.d.ts +0 -22
- package/dist/components/RadioAndCheckbox/utils.js +0 -49
- package/dist/components/Switches/index.d.ts +0 -21
- package/dist/components/Switches/index.js +0 -102
- package/dist/components/Switches/styled.d.ts +0 -5
- package/dist/components/Switches/styled.js +0 -63
- package/dist/components/TextInputs/index.d.ts +0 -24
- package/dist/components/TextInputs/index.js +0 -367
- package/dist/components/TextInputs/index.styled.d.ts +0 -3
- package/dist/components/TextInputs/index.styled.js +0 -77
- package/dist/components/cards/CardContent/index.d.ts +0 -11
- package/dist/components/cards/CardContent/index.js +0 -76
- package/dist/components/cards/CardContent/styled.d.ts +0 -7
- package/dist/components/cards/CardContent/styled.js +0 -63
- package/dist/components/cards/ListContent/index.d.ts +0 -12
- package/dist/components/cards/ListContent/index.js +0 -87
- package/dist/components/cards/ListContent/styled.d.ts +0 -7
- package/dist/components/cards/ListContent/styled.js +0 -26
- package/dist/stories/Oolib/components/BlockLabel.stories.d.ts +0 -71
- package/dist/stories/Oolib/components/BlockLabel.stories.js +0 -106
- package/dist/stories/Oolib/components/Checkbox.stories.d.ts +0 -248
- package/dist/stories/Oolib/components/Checkbox.stories.js +0 -249
- package/dist/stories/Oolib/components/Dropdowns.stories.d.ts +0 -127
- package/dist/stories/Oolib/components/Dropdowns.stories.js +0 -298
- package/dist/stories/Oolib/components/RadioButton.stories.d.ts +0 -260
- package/dist/stories/Oolib/components/RadioButton.stories.js +0 -264
- package/dist/stories/Oolib/components/Switches.stories.d.ts +0 -106
- package/dist/stories/Oolib/components/Switches.stories.js +0 -146
- package/dist/stories/Oolib/components/TextInputs.stories.d.ts +0 -124
- package/dist/stories/Oolib/components/TextInputs.stories.js +0 -188
|
@@ -1,163 +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
|
-
exports.DropdownSingle = DropdownSingle;
|
|
48
|
-
var react_1 = __importStar(require("react"));
|
|
49
|
-
var OptionsSingle_1 = require("../comps/OptionsSingle");
|
|
50
|
-
var SelectDropdown_1 = require("../comps/SelectDropdown");
|
|
51
|
-
var SelectTagsInput_1 = require("../comps/SelectTagsInput");
|
|
52
|
-
var DisplayCompSingle_1 = require("../comps/DisplayCompSingle");
|
|
53
|
-
var handlers_1 = require("../handlers");
|
|
54
|
-
var useHideShowOptions_1 = require("../utils/useHideShowOptions");
|
|
55
|
-
var useCreateDropdownRefs_1 = require("../utils/useCreateDropdownRefs");
|
|
56
|
-
var keywordSearchOptions_1 = require("../utils/keywordSearchOptions");
|
|
57
|
-
var getValue_1 = require("../utils/getValue");
|
|
58
|
-
var generateOptions_1 = require("../utils/generateOptions");
|
|
59
|
-
var useSearchString_1 = require("../utils/useSearchString");
|
|
60
|
-
var styled_components_1 = require("styled-components");
|
|
61
|
-
var genTagComp_1 = require("../utils/genTagComp");
|
|
62
|
-
var BlockLabel_1 = require("../../../v2/components/BlockLabel");
|
|
63
|
-
var getBlockLabelProps_1 = require("../../../utils/getBlockLabelProps");
|
|
64
|
-
var mixins_1 = require("../../../themes/mixins");
|
|
65
|
-
var useHandleClickOutside_1 = require("../../../utils/customHooks/useHandleClickOutside");
|
|
66
|
-
var useScreenWidth_1 = require("../../../utils/customHooks/useScreenWidth");
|
|
67
|
-
var styled_1 = require("../styled");
|
|
68
|
-
// single_multi
|
|
69
|
-
// static_dynamic
|
|
70
|
-
function DropdownSingle(_a) {
|
|
71
|
-
var optionsAnchor = _a.optionsAnchor, lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle,
|
|
72
|
-
//to restructure: rename to TYPO = 'SANS_3' or something. which can be overridden
|
|
73
|
-
selectClassName = _a.selectClassName, //used to override font size in priimary header
|
|
74
|
-
optionsClassName = _a.optionsClassName, //used to override font size in priimary header
|
|
75
|
-
//used by filters topbar. this is a hack. find another way
|
|
76
|
-
disableSelectTextUpdate = _a.disableSelectTextUpdate, selectStyleOverride = _a.selectStyleOverride, valueProp = _a.value, id = _a.id, parentOnChange = _a.onChange, className = _a.className, style = _a.style, readOnly = _a.readOnly, //
|
|
77
|
-
invert = _a.invert, //
|
|
78
|
-
optionsFn = _a.optionsFn, optionsProp = _a.options, saveValueAsString = _a.saveValueAsString, // used in tci
|
|
79
|
-
isTagsStyle = _a.isTagsStyle, selectConfig = _a.selectConfig, label = _a.label, optionsModalLabel = _a.optionsModalLabel, broadcastShowOptions = _a.broadcastShowOptions,
|
|
80
|
-
//combobox specific
|
|
81
|
-
isSearchable = _a.isSearchable, //
|
|
82
|
-
searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptions, setSearchStringInParent = _a.setSearchString, searchStringInParent = _a.searchString, genCustomSelectComp = _a.genCustomSelectComp, placeholder = _a.placeholder, //
|
|
83
|
-
genCreateTagButton = _a.genCreateTagButton, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, //
|
|
84
|
-
disabled = _a.disabled, //
|
|
85
|
-
tagColor = _a.tagColor, observerRef = _a.observerRef, searchbarPlaceholder = _a.searchbarPlaceholder, _b = _a.alignDropdown, alignDropdown = _b === void 0 ? "left" : _b;
|
|
86
|
-
var theme = (0, styled_components_1.useTheme)();
|
|
87
|
-
var props = arguments[0];
|
|
88
|
-
var value = (0, getValue_1.getValue_SINGLE)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme, saveValueAsString: saveValueAsString });
|
|
89
|
-
//1 INIT REFS
|
|
90
|
-
var _c = (0, useCreateDropdownRefs_1.useCreateDropdownRefs)(), selectRef = _c.selectRef, dropdownRef = _c.dropdownRef;
|
|
91
|
-
//2 INIT SHOW OPTIONS STATE
|
|
92
|
-
var _d = (0, useHideShowOptions_1.useHideShowOptions)({
|
|
93
|
-
broadcastShowOptions: broadcastShowOptions
|
|
94
|
-
}), showOptions = _d.showOptions, handleHideOptions = _d.handleHideOptions, handleShowOptions = _d.handleShowOptions;
|
|
95
|
-
var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
|
|
96
|
-
//3 INIT DD FOCUS CUSTOM HOOK
|
|
97
|
-
(0, useHandleClickOutside_1.useHandleClickOutside)(dropdownRef, handleHideOptions, { enabled: screenWidth >= (0, mixins_1.getBreakPoint)('sm') });
|
|
98
|
-
//5 PRIMARY CHANGE HANDLER
|
|
99
|
-
var handleSelect = function (newVal) {
|
|
100
|
-
setSearchString('');
|
|
101
|
-
(0, handlers_1.handleSelect_SINGLE)({
|
|
102
|
-
id: id,
|
|
103
|
-
newVal: newVal,
|
|
104
|
-
// prevVal: value,
|
|
105
|
-
// hideShowOtherTextInputOnSelect_SINGLE,
|
|
106
|
-
handleHideOptions: handleHideOptions,
|
|
107
|
-
saveValueAsString: saveValueAsString,
|
|
108
|
-
parentOnChange: parentOnChange
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
//-- TAG INPUT SPECIFIC
|
|
112
|
-
var _e = (0, useSearchString_1.useSearchString)({
|
|
113
|
-
searchStringInParent: searchStringInParent,
|
|
114
|
-
setSearchStringInParent: setSearchStringInParent
|
|
115
|
-
}), searchString = _e[0], setSearchString = _e[1];
|
|
116
|
-
var options = (0, react_1.useMemo)(function () {
|
|
117
|
-
var ops = (0, generateOptions_1.generateOptions)({
|
|
118
|
-
options: optionsProp,
|
|
119
|
-
optionsFn: optionsFn,
|
|
120
|
-
theme: theme
|
|
121
|
-
});
|
|
122
|
-
return (!isSearchable && !isTagsStyle)
|
|
123
|
-
? ops
|
|
124
|
-
: !!observerRef === true //if this exists that means search is being handled on the backend via elastic search
|
|
125
|
-
? ops
|
|
126
|
-
: (0, keywordSearchOptions_1.keywordSearchOptions)({
|
|
127
|
-
options: ops,
|
|
128
|
-
searchString: searchString,
|
|
129
|
-
searchFieldsConfig: searchFieldsConfig,
|
|
130
|
-
setFilteredOptionsInParent: setFilteredOptionsInParent,
|
|
131
|
-
});
|
|
132
|
-
}, [
|
|
133
|
-
optionsProp,
|
|
134
|
-
optionsFn === null || optionsFn === void 0 ? void 0 : optionsFn.fn,
|
|
135
|
-
optionsFn === null || optionsFn === void 0 ? void 0 : optionsFn.args,
|
|
136
|
-
searchString
|
|
137
|
-
]);
|
|
138
|
-
var genSelectTagsInput = function (ops) {
|
|
139
|
-
if (ops === void 0) { ops = {}; }
|
|
140
|
-
return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, { id: id, value: value, invert: invert, handleSelect: handleSelect, searchString: searchString, setSearchString: setSearchString, single_multi: 'single', placeholder: placeholder, S: S, disabled: disabled, showOptions: showOptions, S: S, style: ops.style
|
|
141
|
-
// forceFocus, comp is expecting this
|
|
142
|
-
}));
|
|
143
|
-
};
|
|
144
|
-
var genInputComp = function () {
|
|
145
|
-
return (react_1.default.createElement(styled_1.StyledDropdownRefWrapper, { ref: dropdownRef, id: "StyledDropdownRefWrapper" },
|
|
146
|
-
react_1.default.createElement("div", { ref: selectRef, className: "OKE-Dropdown__Select-wrapper", onClick: disabled ? function () { } : function () {
|
|
147
|
-
isTagsStyle
|
|
148
|
-
? !showOptions && handleShowOptions() //if tagsStyle, then click always shows options
|
|
149
|
-
: showOptions ? handleHideOptions() : handleShowOptions(); //if dropdowns, then click toggles show/hide
|
|
150
|
-
} }, isTagsStyle ? genSelectTagsInput() : (react_1.default.createElement(SelectDropdown_1.SelectDropdown, { invert: invert, value: value, placeholder: placeholder, genCustomSelectComp: genCustomSelectComp, selectClassName: selectClassName, selectStyleOverride: selectStyleOverride, showOptions: showOptions, disableSelectTextUpdate: disableSelectTextUpdate, selectConfig: selectConfig, S: S, disabled: disabled }))),
|
|
151
|
-
react_1.default.createElement(OptionsSingle_1.OptionsSingle, { searchbarPlaceholder: searchbarPlaceholder, observerRef: observerRef, lightboxHeight: lightboxHeight, lightboxStyle: lightboxStyle, optionsAnchor: optionsAnchor, searchString: searchString, setSearchString: setSearchString, id: id, optionsClassName: optionsClassName, label: label, value: value, relativeToRef: selectRef, invert: invert, showOptions: showOptions, handleHideOptions: handleHideOptions, handleSelect: handleSelect, options: options, optionsFn: optionsFn, optionsModalLabel: optionsModalLabel,
|
|
152
|
-
//combobox specific
|
|
153
|
-
isSearchable: isTagsStyle ? false : isSearchable, alignDropdown: alignDropdown, genCreateTagButton: genCreateTagButton, SelectComp: isTagsStyle && genSelectTagsInput({ style: { position: 'sticky', top: 0, zIndex: 1000 } }), S: S, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent })));
|
|
154
|
-
};
|
|
155
|
-
var genDisplayComp = function () {
|
|
156
|
-
if (!value)
|
|
157
|
-
return null;
|
|
158
|
-
return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, (0, genTagComp_1.genTagComp)(id, value, { display: true, invert: invert, theme: theme, color: tagColor }))) : (react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, { value: value, invert: invert, S: S }));
|
|
159
|
-
};
|
|
160
|
-
return (react_1.default.createElement("div", { className: "OKE-Dropdown ".concat(className, " OKE-Dropdown--").concat(readOnly ? "displayComp" : "inputComp", " ").concat(invert ? "-invert-" : ""), style: style },
|
|
161
|
-
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(props) /** in other words, props. */)),
|
|
162
|
-
readOnly ? genDisplayComp() : genInputComp()));
|
|
163
|
-
}
|
|
@@ -1,19 +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.Caret = void 0;
|
|
7
|
-
var colors_1 = require("../../../../themes/colors");
|
|
8
|
-
var icons_1 = require("../../../../icons");
|
|
9
|
-
var react_1 = __importDefault(require("react"));
|
|
10
|
-
var styled_1 = require("./styled");
|
|
11
|
-
var white = colors_1.colors.white, greyColor100 = colors_1.colors.greyColor100, greyColor40 = colors_1.colors.greyColor40;
|
|
12
|
-
var CaretDown = icons_1.icons.CaretDown, CaretUp = icons_1.icons.CaretUp;
|
|
13
|
-
var Caret = function (_a) {
|
|
14
|
-
var invert = _a.invert, showOptions = _a.showOptions, disabled = _a.disabled;
|
|
15
|
-
return (react_1.default.createElement(styled_1.StyledCaret, null,
|
|
16
|
-
showOptions ? (react_1.default.createElement(CaretUp, { size: 12, color: invert ? white : greyColor100, weight: "bold" })) : (react_1.default.createElement(CaretDown, { size: 12, color: disabled ? greyColor40 : invert ? white : greyColor100, weight: "bold" })),
|
|
17
|
-
react_1.default.createElement(styled_1.StyledCaretClickArea, null)));
|
|
18
|
-
};
|
|
19
|
-
exports.Caret = Caret;
|
|
@@ -1,14 +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.StyledCaretClickArea = exports.StyledCaret = void 0;
|
|
11
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.StyledCaret = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n padding-left: 1rem;\n display: flex;\n align-items: center;\n"], ["\n position: relative;\n padding-left: 1rem;\n display: flex;\n align-items: center;\n"])));
|
|
13
|
-
exports.StyledCaretClickArea = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n"], ["\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n"])));
|
|
14
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,39 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.DisplayCompSingle = void 0;
|
|
18
|
-
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var Typo_1 = require("../../../Typo");
|
|
20
|
-
var OKELink_1 = require("../../../OKELink");
|
|
21
|
-
var genIcon_1 = require("../../utils/genIcon");
|
|
22
|
-
var genLinkOrText_1 = require("../../utils/genLinkOrText");
|
|
23
|
-
var styled_components_1 = require("styled-components");
|
|
24
|
-
var genProfileImg_1 = require("../../utils/genProfileImg");
|
|
25
|
-
var DisplayCompSingle = function (_a) {
|
|
26
|
-
var value = _a.value, invert = _a.invert, injectComma = _a.injectComma, S = _a.S;
|
|
27
|
-
var theme = (0, styled_components_1.useTheme)();
|
|
28
|
-
if (!value)
|
|
29
|
-
return null;
|
|
30
|
-
return (react_1.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: '1rem' } },
|
|
31
|
-
(0, genIcon_1.genIcon)({ icon: value === null || value === void 0 ? void 0 : value.icon, invert: invert, S: S }),
|
|
32
|
-
(value === null || value === void 0 ? void 0 : value.image) && (0, genProfileImg_1.genProfileImg)(__assign(__assign({}, value), { invert: invert, theme: theme })),
|
|
33
|
-
(0, genLinkOrText_1.genLinkOrText)(value, function (display, link) { return (react_1.default.createElement(Typo_1.SANS_3, { invert: invert },
|
|
34
|
-
link
|
|
35
|
-
? react_1.default.createElement(OKELink_1.OKELink, { invert: invert, to: link }, display)
|
|
36
|
-
: display,
|
|
37
|
-
injectComma && react_1.default.createElement("span", null, ","))); }, { invert: invert })));
|
|
38
|
-
};
|
|
39
|
-
exports.DisplayCompSingle = DisplayCompSingle;
|
|
@@ -1,15 +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.NoOptionResultsComp = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var Typo_1 = require("../../../Typo");
|
|
9
|
-
var NoOptionResultsComp = function (_a) {
|
|
10
|
-
var S = _a.S;
|
|
11
|
-
var TYPO_COMP = S ? Typo_1.SANS_2 : Typo_1.SANS_3;
|
|
12
|
-
return (react_1.default.createElement("div", { style: { padding: '1rem 2rem' } },
|
|
13
|
-
react_1.default.createElement(TYPO_COMP, { italic: true }, "No Results!")));
|
|
14
|
-
};
|
|
15
|
-
exports.NoOptionResultsComp = NoOptionResultsComp;
|
|
@@ -1,34 +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.OptionContent = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var getText_1 = require("../../../../utils/getText");
|
|
9
|
-
var genProfileImg_1 = require("../../utils/genProfileImg");
|
|
10
|
-
var genIcon_1 = require("../../utils/genIcon");
|
|
11
|
-
var Typo_1 = require("../../../Typo");
|
|
12
|
-
var styled_components_1 = require("styled-components");
|
|
13
|
-
var genColor_1 = require("../../utils/genColor");
|
|
14
|
-
var OptionContent = function (_a) {
|
|
15
|
-
var option = _a.option, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S, observerRef = _a.observerRef;
|
|
16
|
-
var theme = (0, styled_components_1.useTheme)();
|
|
17
|
-
var TypoComp = S ? Typo_1.SANS_2 : Typo_1.SANS_3;
|
|
18
|
-
var image = option.image, display = option.display, icon = option.icon, desc = option.desc, color = option.color;
|
|
19
|
-
return (react_1.default.createElement("div", { ref: observerRef, style: {
|
|
20
|
-
display: "flex",
|
|
21
|
-
alignItems: "flex-start",
|
|
22
|
-
gap: "1rem",
|
|
23
|
-
maxWidth: "36rem",
|
|
24
|
-
} },
|
|
25
|
-
(image || icon || color) &&
|
|
26
|
-
react_1.default.createElement("div", { style: { marginTop: desc && '0.2rem', display: 'flex', alignContent: 'center' } },
|
|
27
|
-
image && (0, genProfileImg_1.genProfileImg)({ image: image, display: display, invert: invert, theme: theme }),
|
|
28
|
-
icon && (0, genIcon_1.genIcon)({ icon: icon, invert: invert, S: S }),
|
|
29
|
-
color && (0, genColor_1.genColor)({ color: color })),
|
|
30
|
-
react_1.default.createElement("div", null,
|
|
31
|
-
react_1.default.createElement(TypoComp, { invert: invert, semibold: desc ? true : false, className: "OKE-Dropdown__optionText ".concat(optionsClassName || "") }, (0, getText_1.getText)(display)),
|
|
32
|
-
desc && (react_1.default.createElement(TypoComp, { invert: invert, className: "OKE-Dropdown__optionDesc" }, (0, getText_1.getText)(desc))))));
|
|
33
|
-
};
|
|
34
|
-
exports.OptionContent = OptionContent;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export function OptionsMulti({ lightboxHeight, lightboxStyle, optionsAnchor, value, id, optionsClassName, relativeToRef, showOptions, handleHideOptions, handleSelect, options, isSearchable, label, optionsModalLabel, searchString, setSearchString, SelectComp, isTagsStyle, genCreateTagButton, invert, setFocusSelectTagsInput, popOutOfOverflowHiddenParent, S, searchbarPlaceholder, alignDropdown }: {
|
|
2
|
-
lightboxHeight: any;
|
|
3
|
-
lightboxStyle: any;
|
|
4
|
-
optionsAnchor: any;
|
|
5
|
-
value: any;
|
|
6
|
-
id: any;
|
|
7
|
-
optionsClassName: any;
|
|
8
|
-
relativeToRef: any;
|
|
9
|
-
showOptions: any;
|
|
10
|
-
handleHideOptions: any;
|
|
11
|
-
handleSelect: any;
|
|
12
|
-
options: any;
|
|
13
|
-
isSearchable: any;
|
|
14
|
-
label: any;
|
|
15
|
-
optionsModalLabel: any;
|
|
16
|
-
searchString: any;
|
|
17
|
-
setSearchString: any;
|
|
18
|
-
SelectComp: any;
|
|
19
|
-
isTagsStyle: any;
|
|
20
|
-
genCreateTagButton: any;
|
|
21
|
-
invert: any;
|
|
22
|
-
setFocusSelectTagsInput: any;
|
|
23
|
-
popOutOfOverflowHiddenParent: any;
|
|
24
|
-
S: any;
|
|
25
|
-
searchbarPlaceholder: any;
|
|
26
|
-
alignDropdown: any;
|
|
27
|
-
}): React.JSX.Element;
|
|
28
|
-
import React from "react";
|
|
@@ -1,159 +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.OptionsMulti = void 0;
|
|
37
|
-
var react_1 = __importStar(require("react"));
|
|
38
|
-
var OptionsShell_1 = require("../OptionsShell");
|
|
39
|
-
var colors_1 = require("../../../../themes/colors");
|
|
40
|
-
var useSetYOrientation_1 = require("../../utils/useSetYOrientation");
|
|
41
|
-
var useKeyboardControl_1 = require("../../utils/useKeyboardControl");
|
|
42
|
-
var NoOptionResultsComp_1 = require("../NoOptionResultsComp");
|
|
43
|
-
var OptionContent_1 = require("../OptionContent");
|
|
44
|
-
var styled_1 = require("../OptionsSingle/styled");
|
|
45
|
-
var CheckboxButton_1 = require("../../../RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton");
|
|
46
|
-
var Divider_1 = require("../../../Divider");
|
|
47
|
-
var TextInputs_1 = require("../../../TextInputs");
|
|
48
|
-
var Typo_1 = require("../../../Typo");
|
|
49
|
-
var TextLoader_1 = require("../../../LoadersAndProgress/TextLoader");
|
|
50
|
-
var greyColor40 = colors_1.colors.greyColor40, white = colors_1.colors.white;
|
|
51
|
-
var CheckboxButtonShell = function (_a) {
|
|
52
|
-
var children = _a.children, isSelected = _a.isSelected, invert = _a.invert;
|
|
53
|
-
return (react_1.default.createElement("div", { style: {
|
|
54
|
-
display: "flex",
|
|
55
|
-
alignItems: "center",
|
|
56
|
-
position: "relative",
|
|
57
|
-
} },
|
|
58
|
-
react_1.default.createElement(react_1.Fragment, null,
|
|
59
|
-
react_1.default.createElement("div", { className: "OKE-Dropdown__checkboxClickArea" }),
|
|
60
|
-
react_1.default.createElement(CheckboxButton_1.CheckboxButton, { invert: invert, isSelected: isSelected, className: "OKE-Dropdown__checkboxClickArea-box" })),
|
|
61
|
-
children));
|
|
62
|
-
};
|
|
63
|
-
var OptionsMulti = function (_a) {
|
|
64
|
-
var
|
|
65
|
-
//from root
|
|
66
|
-
lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle, optionsAnchor = _a.optionsAnchor, value = _a.value, id = _a.id, optionsClassName = _a.optionsClassName,
|
|
67
|
-
//from Dropdown
|
|
68
|
-
relativeToRef = _a.relativeToRef, //the element that this lightbox is being rendered against. i.e top or bottom
|
|
69
|
-
showOptions = _a.showOptions, handleHideOptions = _a.handleHideOptions, handleSelect = _a.handleSelect, options = _a.options, isSearchable = _a.isSearchable, label = _a.label, optionsModalLabel = _a.optionsModalLabel, //label is just a fallback for optionsModalLabel. Don't know why both are needed
|
|
70
|
-
searchString = _a.searchString, setSearchString = _a.setSearchString, SelectComp = _a.SelectComp, // for mobile
|
|
71
|
-
isTagsStyle = _a.isTagsStyle, genCreateTagButton = _a.genCreateTagButton, invert = _a.invert, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, searchbarPlaceholder = _a.searchbarPlaceholder, alignDropdown = _a.alignDropdown;
|
|
72
|
-
//INIT ORIENTATION STATE AND CUSTOM HOOK
|
|
73
|
-
var optionsRef = (0, react_1.useRef)(null);
|
|
74
|
-
var yOrientation = (0, useSetYOrientation_1.useSetYOrientation)({
|
|
75
|
-
showOptions: showOptions,
|
|
76
|
-
optionsRef: optionsRef,
|
|
77
|
-
relativeToRef: relativeToRef,
|
|
78
|
-
}).yOrientation;
|
|
79
|
-
//RESET SEARCHSTRING WHEN OPTIONS ARE CLOSED
|
|
80
|
-
(0, react_1.useEffect)(function () {
|
|
81
|
-
if (!showOptions && !!searchString === true)
|
|
82
|
-
setSearchString("");
|
|
83
|
-
}, [showOptions]);
|
|
84
|
-
var selectedOptions = (0, react_1.useMemo)(function () {
|
|
85
|
-
return value || [];
|
|
86
|
-
//we need this to update on optionsProp, cuz when tag is created inTagsInputMulti
|
|
87
|
-
//opsProp changes.
|
|
88
|
-
//if we use value as dep, then this will update on every onChange, which we dont want.
|
|
89
|
-
}, [
|
|
90
|
-
// showOptions,
|
|
91
|
-
JSON.stringify(options),
|
|
92
|
-
value,
|
|
93
|
-
]);
|
|
94
|
-
var _b = (0, useKeyboardControl_1.useKeyboardControl)({
|
|
95
|
-
showOptions: showOptions,
|
|
96
|
-
optionsWrapperRef: optionsRef,
|
|
97
|
-
handleHideOptions: handleHideOptions,
|
|
98
|
-
handleSelect: handleSelect,
|
|
99
|
-
options: options,
|
|
100
|
-
searchString: searchString,
|
|
101
|
-
id: id,
|
|
102
|
-
}), scrollFocussedOpIntoView = _b.scrollFocussedOpIntoView, focussedOp = _b.focussedOp;
|
|
103
|
-
var opIsSelected = function (thisOpData) {
|
|
104
|
-
return value === null || value === void 0 ? void 0 : value.some(function (d) { return d.value === thisOpData.value; });
|
|
105
|
-
};
|
|
106
|
-
var _c = (0, react_1.useState)(true), searchBarFocus = _c[0], setSearchBarFocus = _c[1];
|
|
107
|
-
(0, react_1.useEffect)(function () {
|
|
108
|
-
setSearchBarFocus(showOptions);
|
|
109
|
-
}, [showOptions]);
|
|
110
|
-
var createOption = function (d) {
|
|
111
|
-
return isTagsStyle ? (react_1.default.createElement(OptionContent_1.OptionContent, { option: d, optionsClassName: optionsClassName, invert: invert })) : (react_1.default.createElement(CheckboxButtonShell, { invert: invert, isSelected: opIsSelected(d) },
|
|
112
|
-
react_1.default.createElement(OptionContent_1.OptionContent, { option: d, optionsClassName: optionsClassName, invert: invert, S: S })));
|
|
113
|
-
};
|
|
114
|
-
var createSelectedOptions = function () {
|
|
115
|
-
return (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) > 0 && (react_1.default.createElement("div", { style: {
|
|
116
|
-
borderBottom: "1px solid ".concat(greyColor40),
|
|
117
|
-
} },
|
|
118
|
-
react_1.default.createElement(Typo_1.LABEL, { invert: invert, style: { padding: "2rem", paddingBottom: 0 }, color: colors_1.colors.greyColor70 }, "selected"),
|
|
119
|
-
selectedOptions.map(function (d) {
|
|
120
|
-
return (react_1.default.createElement(styled_1.StyledOption, { invert: invert, key: d.value, isSelected: opIsSelected(d), S: S, onClick: function (e) {
|
|
121
|
-
if (!d.loading) {
|
|
122
|
-
handleSelect(d);
|
|
123
|
-
setSearchString("");
|
|
124
|
-
setSearchBarFocus(true); //refocus on searchbar after select
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
//this is important cuz if we dont, then the option will have the light blue background of the 'selected' state
|
|
128
|
-
//is a bit hacky, but will do for now.
|
|
129
|
-
style: { backgroundColor: invert ? colors_1.colors.greyColor90 : white } }, createOption(d)));
|
|
130
|
-
})));
|
|
131
|
-
};
|
|
132
|
-
var genSearchBar = function () { return (react_1.default.createElement("div", { style: {
|
|
133
|
-
position: "sticky",
|
|
134
|
-
top: 0,
|
|
135
|
-
zIndex: 1,
|
|
136
|
-
background: invert ? colors_1.colors.greyColor90 : colors_1.colors.white,
|
|
137
|
-
} },
|
|
138
|
-
react_1.default.createElement("div", { style: { padding: "1rem" }, onBlur: function () { return setSearchBarFocus(false); }, tabIndex: 0 },
|
|
139
|
-
react_1.default.createElement(TextInputs_1.TextInput, { placeholder: searchbarPlaceholder, forceFocus: searchBarFocus, invert: invert, type: "text", icon: "MagnifyingGlass", value: searchString, onChange: function (k, v) { return setSearchString(v); }, S: S })),
|
|
140
|
-
react_1.default.createElement(Divider_1.Divider, { invert: invert }))); };
|
|
141
|
-
console.log({ options: options });
|
|
142
|
-
return (react_1.default.createElement(OptionsShell_1.OptionsShell, { ref: optionsRef, yOrientation: yOrientation, lightboxHeight: lightboxHeight, lightboxStyle: lightboxStyle, options: options, optionsAnchor: optionsAnchor, showOptions: showOptions, handleHideOptions: handleHideOptions, SelectComp: SelectComp, label: label, optionsModalLabel: optionsModalLabel, invert: invert, showDoneButton: true, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, relativeToRef: relativeToRef, S: S, alignDropdown: alignDropdown },
|
|
143
|
-
isSearchable && genSearchBar(),
|
|
144
|
-
!isTagsStyle && createSelectedOptions(),
|
|
145
|
-
options.length === 0 ? (react_1.default.createElement(NoOptionResultsComp_1.NoOptionResultsComp, { S: S })) : (options.map(function (d, i) {
|
|
146
|
-
return (react_1.default.createElement(styled_1.StyledOption, { key: d.value, invert: invert, isSelected: opIsSelected(d), isFocussed: focussedOp === i, className: "OKE-Dropdown__option", ref: function (el) {
|
|
147
|
-
return focussedOp === i && el && scrollFocussedOpIntoView(el);
|
|
148
|
-
}, onClick: function (e) {
|
|
149
|
-
if (!d.loading) {
|
|
150
|
-
handleSelect(d);
|
|
151
|
-
setSearchBarFocus(true);
|
|
152
|
-
setSearchString("");
|
|
153
|
-
setFocusSelectTagsInput && setFocusSelectTagsInput(true);
|
|
154
|
-
}
|
|
155
|
-
}, S: S }, d.loading ? (react_1.default.createElement(TextLoader_1.TextLoader, { style: { width: "8rem", height: "1.5rem" } })) : (createOption(d))));
|
|
156
|
-
})),
|
|
157
|
-
genCreateTagButton && genCreateTagButton(options)));
|
|
158
|
-
};
|
|
159
|
-
exports.OptionsMulti = OptionsMulti;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function OptionsAnimateWrapper({ options, optionsRef, relativeToRef, showOptions, invert, yOrientation, fixPos, optionsAnchor, children, lightboxStyle, alignDropdown }: {
|
|
2
|
-
options: any;
|
|
3
|
-
optionsRef: any;
|
|
4
|
-
relativeToRef: any;
|
|
5
|
-
showOptions: any;
|
|
6
|
-
invert: any;
|
|
7
|
-
yOrientation: any;
|
|
8
|
-
fixPos: any;
|
|
9
|
-
optionsAnchor: any;
|
|
10
|
-
children: any;
|
|
11
|
-
lightboxStyle: any;
|
|
12
|
-
alignDropdown: any;
|
|
13
|
-
}): React.JSX.Element;
|
|
14
|
-
import React from "react";
|
|
@@ -1,81 +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
|
-
exports.OptionsAnimateWrapper = void 0;
|
|
48
|
-
var react_1 = __importStar(require("react"));
|
|
49
|
-
var styled_1 = require("./styled");
|
|
50
|
-
var OptionsAnimateWrapper = function (_a) {
|
|
51
|
-
var _b;
|
|
52
|
-
var _c;
|
|
53
|
-
var options = _a.options, optionsRef = _a.optionsRef, relativeToRef = _a.relativeToRef, showOptions = _a.showOptions, invert = _a.invert, yOrientation = _a.yOrientation, fixPos = _a.fixPos, optionsAnchor = _a.optionsAnchor, children = _a.children, lightboxStyle = _a.lightboxStyle, alignDropdown = _a.alignDropdown;
|
|
54
|
-
var selectCompRect = (_c = relativeToRef === null || relativeToRef === void 0 ? void 0 : relativeToRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect();
|
|
55
|
-
//we need to recalc when ops length change because, in tag comps, when loading a fixed set of 'loading' options are shown
|
|
56
|
-
//before the actual number of options are loaded
|
|
57
|
-
//useMemo wont work cuz it runs before render, and before render ref doesnt exist.
|
|
58
|
-
var _d = (0, react_1.useState)({
|
|
59
|
-
width: undefined,
|
|
60
|
-
openHeight: undefined,
|
|
61
|
-
}), _e = _d[0], width = _e.width, openHeight = _e.openHeight, setWidthAndOpenHeight = _d[1];
|
|
62
|
-
(0, react_1.useEffect)(function () {
|
|
63
|
-
var _a, _b, _c, _d;
|
|
64
|
-
setWidthAndOpenHeight({
|
|
65
|
-
width: (_b = (_a = optionsRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width,
|
|
66
|
-
openHeight: (_d = (_c = optionsRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()) === null || _d === void 0 ? void 0 : _d.height,
|
|
67
|
-
});
|
|
68
|
-
}, [options.length]);
|
|
69
|
-
var viewportWidth = document.documentElement.clientWidth; // excludes scrollbar
|
|
70
|
-
return (react_1.default.createElement(styled_1.StyledOptionsAnimateWrapper, { invert: invert, isOpen: showOptions, width: width, openHeight: openHeight, style: __assign(__assign(__assign({}, (lightboxStyle || {})), { zIndex: 100000 }), (fixPos
|
|
71
|
-
? __assign(__assign({ position: "fixed", top: "".concat(fixPos.y - (yOrientation === "top" ? (selectCompRect === null || selectCompRect === void 0 ? void 0 : selectCompRect.height) || 0 : 0), "px") }, (alignDropdown === "right"
|
|
72
|
-
? {
|
|
73
|
-
right: "".concat(viewportWidth - fixPos.right, "px")
|
|
74
|
-
}
|
|
75
|
-
: {
|
|
76
|
-
left: "".concat(fixPos.x, "px")
|
|
77
|
-
})), (yOrientation === "top" ? { transform: "translateY(-100%)" } : {})) : __assign(__assign({ position: "absolute" }, (optionsAnchor ? (_b = {}, _b[optionsAnchor] = 0, _b) : alignDropdown === "right" ? { right: 0 } : { left: 0 })), (yOrientation === "bottom"
|
|
78
|
-
? { bottom: 0, transform: "translateY(100%)" }
|
|
79
|
-
: { top: 0, transform: "translateY(-100%)" })))) }, children));
|
|
80
|
-
};
|
|
81
|
-
exports.OptionsAnimateWrapper = OptionsAnimateWrapper;
|