oolib 2.57.2 → 2.57.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dropdowns/DropdownMulti/index.d.ts +36 -0
- package/dist/components/Dropdowns/DropdownMulti/index.js +201 -0
- package/dist/components/Dropdowns/DropdownSingle/index.d.ts +37 -0
- package/dist/components/Dropdowns/DropdownSingle/index.js +183 -0
- package/dist/components/Dropdowns/comps/Caret/index.d.ts +6 -0
- package/dist/components/Dropdowns/comps/Caret/index.js +19 -0
- package/dist/components/Dropdowns/comps/Caret/styled.d.ts +2 -0
- package/dist/components/Dropdowns/comps/Caret/styled.js +14 -0
- package/dist/components/Dropdowns/comps/DisplayCompSingle/index.d.ts +5 -0
- package/dist/components/Dropdowns/comps/DisplayCompSingle/index.js +39 -0
- package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.d.ts +3 -0
- package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.js +15 -0
- package/dist/components/Dropdowns/comps/OptionContent/index.d.ts +6 -0
- package/dist/components/Dropdowns/comps/OptionContent/index.js +30 -0
- package/dist/components/Dropdowns/comps/OptionsMulti/index.d.ts +25 -0
- package/dist/components/Dropdowns/comps/OptionsMulti/index.js +173 -0
- package/dist/components/Dropdowns/comps/OptionsShell/index.d.ts +1 -0
- package/dist/components/Dropdowns/comps/OptionsShell/index.js +81 -0
- package/dist/components/Dropdowns/comps/OptionsShell/styled.d.ts +1 -0
- package/dist/components/Dropdowns/comps/OptionsShell/styled.js +17 -0
- package/dist/components/Dropdowns/comps/OptionsSingle/index.d.ts +24 -0
- package/dist/components/Dropdowns/comps/OptionsSingle/index.js +117 -0
- package/dist/components/Dropdowns/comps/OptionsSingle/styled.d.ts +2 -0
- package/dist/components/Dropdowns/comps/OptionsSingle/styled.js +71 -0
- package/dist/components/Dropdowns/comps/SelectDropdown/index.d.ts +14 -0
- package/dist/components/Dropdowns/comps/SelectDropdown/index.js +56 -0
- package/dist/components/Dropdowns/comps/SelectDropdown/styled.d.ts +1 -0
- package/dist/components/Dropdowns/comps/SelectDropdown/styled.js +61 -0
- package/dist/components/Dropdowns/comps/SelectTagsInput/index.d.ts +15 -0
- package/dist/components/Dropdowns/comps/SelectTagsInput/index.js +113 -0
- package/dist/components/Dropdowns/comps/SelectTagsInput/styled.d.ts +2 -0
- package/dist/components/Dropdowns/comps/SelectTagsInput/styled.js +54 -0
- package/dist/components/Dropdowns/handlers/index.d.ts +15 -0
- package/dist/components/Dropdowns/handlers/index.js +50 -0
- package/dist/components/Dropdowns/styled.d.ts +2 -0
- package/dist/components/Dropdowns/styled.js +39 -0
- package/dist/components/Dropdowns/utils/genIcon.d.ts +1 -0
- package/dist/components/Dropdowns/utils/genIcon.js +17 -0
- package/dist/components/Dropdowns/utils/genLinkOrText.d.ts +1 -0
- package/dist/components/Dropdowns/utils/genLinkOrText.js +48 -0
- package/dist/components/Dropdowns/utils/genProfileImg.d.ts +7 -0
- package/dist/components/Dropdowns/utils/genProfileImg.js +36 -0
- package/dist/components/Dropdowns/utils/genTagComp.d.ts +1 -0
- package/dist/components/Dropdowns/utils/genTagComp.js +27 -0
- package/dist/components/Dropdowns/utils/generateOptions.d.ts +5 -0
- package/dist/components/Dropdowns/utils/generateOptions.js +19 -0
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.d.ts +1 -0
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.js +40 -0
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.d.ts +4 -0
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.js +11 -0
- package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.d.ts +4 -0
- package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.js +62 -0
- package/dist/components/Dropdowns/utils/getAllOptionsFns/index.d.ts +1 -0
- package/dist/components/Dropdowns/utils/getAllOptionsFns/index.js +19 -0
- package/dist/components/Dropdowns/utils/getValue.d.ts +12 -0
- package/dist/components/Dropdowns/utils/getValue.js +29 -0
- package/dist/components/Dropdowns/utils/keywordSearchOptions.d.ts +6 -0
- package/dist/components/Dropdowns/utils/keywordSearchOptions.js +18 -0
- package/dist/components/Dropdowns/utils/setDropdownSelectText.d.ts +12 -0
- package/dist/components/Dropdowns/utils/setDropdownSelectText.js +19 -0
- package/dist/components/Dropdowns/utils/useCreateDropdownRefs.d.ts +5 -0
- package/dist/components/Dropdowns/utils/useCreateDropdownRefs.js +15 -0
- package/dist/components/Dropdowns/utils/useHideShowOptions.d.ts +5 -0
- package/dist/components/Dropdowns/utils/useHideShowOptions.js +20 -0
- package/dist/components/Dropdowns/utils/useKeyboardControl.d.ts +12 -0
- package/dist/components/Dropdowns/utils/useKeyboardControl.js +73 -0
- package/dist/components/Dropdowns/utils/useSearchString.d.ts +4 -0
- package/dist/components/Dropdowns/utils/useSearchString.js +20 -0
- package/dist/components/Dropdowns/utils/useSetYOrientation.d.ts +9 -0
- package/dist/components/Dropdowns/utils/useSetYOrientation.js +46 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export function DropdownMulti({ saveValueAsString, value: valueProp, id, onChange: parentOnChange, className, readOnly, invert, selectClassName, optionsClassName, selectStyleOverride, optionsFn, options: optionsProp, isTagsStyle, isSearchable, searchFieldsConfig, setFilteredOptions: setFilteredOptionsInParent, setSearchString: setSearchStringInParent, searchString: searchStringInParent, label, optionsModalLabel, genCreateTagButton, placeholder, caretColor, genCustomSelectComp, disableSelectTextUpdate, selectConfig, lightboxHeight, lightboxStyle, optionsAnchor, popOutOfOverflowHiddenParent, displayCompStyle, S, disabled, broadcastShowOptions }: {
|
|
2
|
+
saveValueAsString: any;
|
|
3
|
+
value: any;
|
|
4
|
+
id: any;
|
|
5
|
+
onChange: any;
|
|
6
|
+
className: any;
|
|
7
|
+
readOnly: any;
|
|
8
|
+
invert: any;
|
|
9
|
+
selectClassName: any;
|
|
10
|
+
optionsClassName: any;
|
|
11
|
+
selectStyleOverride: any;
|
|
12
|
+
optionsFn: any;
|
|
13
|
+
options: any;
|
|
14
|
+
isTagsStyle: any;
|
|
15
|
+
isSearchable: any;
|
|
16
|
+
searchFieldsConfig: any;
|
|
17
|
+
setFilteredOptions: any;
|
|
18
|
+
setSearchString: any;
|
|
19
|
+
searchString: any;
|
|
20
|
+
label: any;
|
|
21
|
+
optionsModalLabel: any;
|
|
22
|
+
genCreateTagButton: any;
|
|
23
|
+
placeholder: any;
|
|
24
|
+
caretColor: any;
|
|
25
|
+
genCustomSelectComp: any;
|
|
26
|
+
disableSelectTextUpdate: any;
|
|
27
|
+
selectConfig: any;
|
|
28
|
+
lightboxHeight: any;
|
|
29
|
+
lightboxStyle: any;
|
|
30
|
+
optionsAnchor: any;
|
|
31
|
+
popOutOfOverflowHiddenParent: any;
|
|
32
|
+
displayCompStyle: any;
|
|
33
|
+
S: any;
|
|
34
|
+
disabled: any;
|
|
35
|
+
broadcastShowOptions: any;
|
|
36
|
+
}, ...args: any[]): any;
|
|
@@ -0,0 +1,201 @@
|
|
|
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 (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.DropdownMulti = void 0;
|
|
38
|
+
var BlockLabel_1 = require("../../BlockLabel");
|
|
39
|
+
var getBlockLabelProps_1 = require("../../../utils/getBlockLabelProps");
|
|
40
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
41
|
+
var useHandleClickOutside_1 = require("../../../utils/customHooks/useHandleClickOutside");
|
|
42
|
+
var useScreenWidth_1 = require("../../../utils/customHooks/useScreenWidth");
|
|
43
|
+
var react_1 = __importStar(require("react"));
|
|
44
|
+
var SelectTagsInput_1 = require("../comps/SelectTagsInput");
|
|
45
|
+
var SelectDropdown_1 = require("../comps/SelectDropdown");
|
|
46
|
+
var OptionsMulti_1 = require("../comps/OptionsMulti");
|
|
47
|
+
var DisplayCompSingle_1 = require("../comps/DisplayCompSingle");
|
|
48
|
+
var handlers_1 = require("../handlers");
|
|
49
|
+
var useHideShowOptions_1 = require("../utils/useHideShowOptions");
|
|
50
|
+
var useCreateDropdownRefs_1 = require("../utils/useCreateDropdownRefs");
|
|
51
|
+
var keywordSearchOptions_1 = require("../utils/keywordSearchOptions");
|
|
52
|
+
var getValue_1 = require("../utils/getValue");
|
|
53
|
+
var generateOptions_1 = require("../utils/generateOptions");
|
|
54
|
+
var useSearchString_1 = require("../utils/useSearchString");
|
|
55
|
+
var styled_components_1 = require("styled-components");
|
|
56
|
+
var genTagComp_1 = require("../utils/genTagComp");
|
|
57
|
+
var styled_1 = require("../styled");
|
|
58
|
+
function DropdownMulti(_a) {
|
|
59
|
+
var saveValueAsString = _a.saveValueAsString, valueProp = _a.value, id = _a.id, parentOnChange = _a.onChange, className = _a.className,
|
|
60
|
+
// injectOtherOption,
|
|
61
|
+
readOnly = _a.readOnly, invert = _a.invert, selectClassName = _a.selectClassName, //used to override font size in priimary header
|
|
62
|
+
optionsClassName = _a.optionsClassName, //used to override font size in priimary header
|
|
63
|
+
selectStyleOverride = _a.selectStyleOverride, optionsFn = _a.optionsFn, optionsProp = _a.options, isTagsStyle = _a.isTagsStyle, isSearchable = _a.isSearchable, searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptions, setSearchStringInParent = _a.setSearchString, searchStringInParent = _a.searchString, label = _a.label, optionsModalLabel = _a.optionsModalLabel, genCreateTagButton = _a.genCreateTagButton, placeholder = _a.placeholder, caretColor = _a.caretColor, genCustomSelectComp = _a.genCustomSelectComp, disableSelectTextUpdate = _a.disableSelectTextUpdate, selectConfig = _a.selectConfig,
|
|
64
|
+
//props whose existence needs to be questioned:
|
|
65
|
+
lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle, optionsAnchor = _a.optionsAnchor, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, displayCompStyle = _a.displayCompStyle, //can be either tagsStyle OR commaSeparatedStyle
|
|
66
|
+
S = _a.S, disabled = _a.disabled, broadcastShowOptions = _a.broadcastShowOptions;
|
|
67
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
68
|
+
var props = arguments[0];
|
|
69
|
+
var value = (0, getValue_1.getValue_MULTI)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme });
|
|
70
|
+
//1 INIT REFS
|
|
71
|
+
var _b = (0, useCreateDropdownRefs_1.useCreateDropdownRefs)(), selectRef = _b.selectRef, dropdownRef = _b.dropdownRef;
|
|
72
|
+
//2 INIT SHOW OPTIONS STATE
|
|
73
|
+
var _c = (0, useHideShowOptions_1.useHideShowOptions)({
|
|
74
|
+
broadcastShowOptions: broadcastShowOptions
|
|
75
|
+
}), showOptions = _c.showOptions, handleHideOptions = _c.handleHideOptions, handleShowOptions = _c.handleShowOptions;
|
|
76
|
+
var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
|
|
77
|
+
//3 INIT DD FOCUS CUSTOM HOOK
|
|
78
|
+
(0, useHandleClickOutside_1.useHandleClickOutside)(dropdownRef, handleHideOptions, { enabled: screenWidth >= (0, mixins_1.getBreakPoint)('sm') });
|
|
79
|
+
//-- TAG INPUT SPECIFIC
|
|
80
|
+
var _d = (0, useSearchString_1.useSearchString)({
|
|
81
|
+
setSearchStringInParent: setSearchStringInParent,
|
|
82
|
+
searchStringInParent: searchStringInParent
|
|
83
|
+
}), searchString = _d[0], setSearchString = _d[1];
|
|
84
|
+
var options = (0, react_1.useMemo)(function () {
|
|
85
|
+
var ops = (0, generateOptions_1.generateOptions)({
|
|
86
|
+
options: optionsProp,
|
|
87
|
+
optionsFn: optionsFn,
|
|
88
|
+
theme: theme
|
|
89
|
+
// injectOtherOption,
|
|
90
|
+
});
|
|
91
|
+
var currentValue = value || [];
|
|
92
|
+
// rm the selectedOps from ops list (since they are shown anyway in the selectedops list)
|
|
93
|
+
return /*isTagsStyle ? ops : */ ops.filter(function (op) { return currentValue.every(function (v) { return v.value !== op.value; }); });
|
|
94
|
+
}, [
|
|
95
|
+
JSON.stringify(optionsProp),
|
|
96
|
+
// showOptions
|
|
97
|
+
value
|
|
98
|
+
]);
|
|
99
|
+
options = (0, react_1.useMemo)(function () {
|
|
100
|
+
return (!isSearchable && !isTagsStyle)
|
|
101
|
+
? options
|
|
102
|
+
: (0, keywordSearchOptions_1.keywordSearchOptions)({
|
|
103
|
+
options: options,
|
|
104
|
+
searchString: searchString,
|
|
105
|
+
searchFieldsConfig: searchFieldsConfig,
|
|
106
|
+
setFilteredOptionsInParent: setFilteredOptionsInParent,
|
|
107
|
+
});
|
|
108
|
+
}, [
|
|
109
|
+
searchString,
|
|
110
|
+
// showOptions,
|
|
111
|
+
options,
|
|
112
|
+
value
|
|
113
|
+
]);
|
|
114
|
+
/**
|
|
115
|
+
* very importnant to understand:
|
|
116
|
+
* Assume this second useMemo didnt have 'options' in its dependency array
|
|
117
|
+
* Lets assume initial state of options from previous render is length = 8
|
|
118
|
+
* If options change because of the first useMemo, (and lets say become of length 5)
|
|
119
|
+
* and lets say second memo doesnt fire cuz showOptions or searchString dont change,
|
|
120
|
+
* then the second useMemo sets the 'options' to its previous value in previous render (which is length = 8)
|
|
121
|
+
*
|
|
122
|
+
* obviously this causes bugs.
|
|
123
|
+
* so by putting options in the second useMemo dependency, we force the second one to fire
|
|
124
|
+
* if the options change
|
|
125
|
+
*/
|
|
126
|
+
//--
|
|
127
|
+
//5 PRIMARY CHANGE HANDLER
|
|
128
|
+
var handleSelect = function (newVal) { return (0, handlers_1.handleSelect_MULTI)({
|
|
129
|
+
parentOnChange: parentOnChange,
|
|
130
|
+
id: id,
|
|
131
|
+
newVal: newVal,
|
|
132
|
+
prevVal: value,
|
|
133
|
+
parentOnChange: parentOnChange,
|
|
134
|
+
// hideShowOtherTextInputOnSelect_MULTI,
|
|
135
|
+
saveValueAsString: saveValueAsString
|
|
136
|
+
}); };
|
|
137
|
+
var genDisplayComp = function () {
|
|
138
|
+
if (!(value === null || value === void 0 ? void 0 : value.length) > 0)
|
|
139
|
+
return null;
|
|
140
|
+
var tagsStyle = (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, value.map(function (d) { return (0, genTagComp_1.genTagComp)(id, d, { display: true, invert: invert, theme: theme }); })));
|
|
141
|
+
var commaSeparatedStyle = (react_1.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: '0.5rem' } }, value.map(function (v, i) { return (react_1.default.createElement(react_1.Fragment, null,
|
|
142
|
+
react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, { value: v, invert: invert, injectComma: i !== value.length - 1 }))); })));
|
|
143
|
+
//if an explicit displayComp style is specified then listen to it.
|
|
144
|
+
//else apply tagsStyle to 'tagStyle' inputs & commaseparatedstyle to
|
|
145
|
+
//regular plain dropdowns.
|
|
146
|
+
if (!!displayCompStyle) {
|
|
147
|
+
return displayCompStyle === 'tagsStyle'
|
|
148
|
+
? tagsStyle
|
|
149
|
+
: displayCompStyle === 'commaSeparatedStyle'
|
|
150
|
+
&& commaSeparatedStyle;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
return isTagsStyle
|
|
154
|
+
? tagsStyle
|
|
155
|
+
: commaSeparatedStyle;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
var _e = (0, react_1.useState)(false), focusSelectTagsInput = _e[0], setFocusSelectTagsInput = _e[1];
|
|
159
|
+
var genSelectTagsInput = function () { return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, __assign({}, {
|
|
160
|
+
id: id,
|
|
161
|
+
value: value,
|
|
162
|
+
invert: invert,
|
|
163
|
+
handleSelect: handleSelect,
|
|
164
|
+
searchString: searchString,
|
|
165
|
+
setSearchString: setSearchString,
|
|
166
|
+
single_multi: "multi",
|
|
167
|
+
placeholder: placeholder,
|
|
168
|
+
focusSelectTagsInput: focusSelectTagsInput,
|
|
169
|
+
setFocusSelectTagsInput: setFocusSelectTagsInput,
|
|
170
|
+
showOptions: showOptions,
|
|
171
|
+
S: S,
|
|
172
|
+
disabled: disabled
|
|
173
|
+
}))); };
|
|
174
|
+
var genInputComp = function () {
|
|
175
|
+
// const SelectComp = isTagsStyle ? SelectTagsInput : SelectDropdown
|
|
176
|
+
return (react_1.default.createElement(styled_1.StyledDropdownRefWrapper, { ref: dropdownRef },
|
|
177
|
+
react_1.default.createElement("div", { ref: selectRef, className: "OKE-Dropdown__Select-wrapper", onClick: disabled ? function () { } : function () {
|
|
178
|
+
isTagsStyle
|
|
179
|
+
? !showOptions && handleShowOptions() //if tagsStyle, then click always shows options
|
|
180
|
+
: showOptions ? handleHideOptions() : handleShowOptions(); //if dropdowns, then click toggles show/hide
|
|
181
|
+
} }, isTagsStyle ? genSelectTagsInput() : (react_1.default.createElement(SelectDropdown_1.SelectDropdown, __assign({}, {
|
|
182
|
+
invert: invert,
|
|
183
|
+
value: value,
|
|
184
|
+
placeholder: placeholder,
|
|
185
|
+
selectClassName: selectClassName,
|
|
186
|
+
selectStyleOverride: selectStyleOverride,
|
|
187
|
+
showOptions: showOptions,
|
|
188
|
+
caretColor: caretColor,
|
|
189
|
+
genCustomSelectComp: genCustomSelectComp,
|
|
190
|
+
disableSelectTextUpdate: disableSelectTextUpdate,
|
|
191
|
+
selectConfig: selectConfig,
|
|
192
|
+
S: S,
|
|
193
|
+
disabled: disabled
|
|
194
|
+
})))),
|
|
195
|
+
react_1.default.createElement(OptionsMulti_1.OptionsMulti, { id: id, value: value, relativeToRef: selectRef, showOptions: showOptions, handleSelect: handleSelect, handleHideOptions: handleHideOptions, optionsClassName: optionsClassName, options: options, optionsFn: optionsFn, isSearchable: isTagsStyle ? false : isSearchable, searchString: searchString, setSearchString: setSearchString, label: label, optionsModalLabel: optionsModalLabel, isTagsStyle: isTagsStyle, genCreateTagButton: genCreateTagButton, lightboxHeight: lightboxHeight, lightboxStyle: lightboxStyle, optionsAnchor: optionsAnchor, SelectComp: isTagsStyle && genSelectTagsInput(), invert: invert, setFocusSelectTagsInput: setFocusSelectTagsInput, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, S: S })));
|
|
196
|
+
};
|
|
197
|
+
return (react_1.default.createElement("div", { className: "OKE-Dropdown ".concat(className, " OKE-Dropdown--").concat(readOnly ? "displayComp" : "inputComp", " ").concat(invert ? "-invert-" : "") },
|
|
198
|
+
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(props))),
|
|
199
|
+
readOnly ? genDisplayComp() : genInputComp()));
|
|
200
|
+
}
|
|
201
|
+
exports.DropdownMulti = DropdownMulti;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function DropdownSingle({ optionsAnchor, lightboxHeight, lightboxStyle, selectClassName, optionsClassName, disableSelectTextUpdate, selectStyleOverride, value: valueProp, id, onChange: parentOnChange, className, style, readOnly, invert, optionsFn, options: optionsProp, saveValueAsString, isTagsStyle, selectConfig, label, optionsModalLabel, broadcastShowOptions, isSearchable, searchFieldsConfig, setFilteredOptions: setFilteredOptionsInParent, setSearchString: setSearchStringInParent, searchString: searchStringInParent, genCustomSelectComp, placeholder, caretColor, genCreateTagButton, popOutOfOverflowHiddenParent, displayCompStyle, S, disabled }: {
|
|
2
|
+
optionsAnchor: any;
|
|
3
|
+
lightboxHeight: any;
|
|
4
|
+
lightboxStyle: any;
|
|
5
|
+
selectClassName: any;
|
|
6
|
+
optionsClassName: any;
|
|
7
|
+
disableSelectTextUpdate: any;
|
|
8
|
+
selectStyleOverride: any;
|
|
9
|
+
value: any;
|
|
10
|
+
id: any;
|
|
11
|
+
onChange: any;
|
|
12
|
+
className: any;
|
|
13
|
+
style: any;
|
|
14
|
+
readOnly: any;
|
|
15
|
+
invert: any;
|
|
16
|
+
optionsFn: any;
|
|
17
|
+
options: any;
|
|
18
|
+
saveValueAsString: any;
|
|
19
|
+
isTagsStyle: any;
|
|
20
|
+
selectConfig: any;
|
|
21
|
+
label: any;
|
|
22
|
+
optionsModalLabel: any;
|
|
23
|
+
broadcastShowOptions: any;
|
|
24
|
+
isSearchable: any;
|
|
25
|
+
searchFieldsConfig: any;
|
|
26
|
+
setFilteredOptions: any;
|
|
27
|
+
setSearchString: any;
|
|
28
|
+
searchString: any;
|
|
29
|
+
genCustomSelectComp: any;
|
|
30
|
+
placeholder: any;
|
|
31
|
+
caretColor: any;
|
|
32
|
+
genCreateTagButton: any;
|
|
33
|
+
popOutOfOverflowHiddenParent: any;
|
|
34
|
+
displayCompStyle: any;
|
|
35
|
+
S: any;
|
|
36
|
+
disabled: any;
|
|
37
|
+
}, ...args: any[]): any;
|
|
@@ -0,0 +1,183 @@
|
|
|
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 (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.DropdownSingle = void 0;
|
|
38
|
+
var react_1 = __importStar(require("react"));
|
|
39
|
+
var OptionsSingle_1 = require("../comps/OptionsSingle");
|
|
40
|
+
var SelectDropdown_1 = require("../comps/SelectDropdown");
|
|
41
|
+
var SelectTagsInput_1 = require("../comps/SelectTagsInput");
|
|
42
|
+
var DisplayCompSingle_1 = require("../comps/DisplayCompSingle");
|
|
43
|
+
var handlers_1 = require("../handlers");
|
|
44
|
+
var useHideShowOptions_1 = require("../utils/useHideShowOptions");
|
|
45
|
+
var useCreateDropdownRefs_1 = require("../utils/useCreateDropdownRefs");
|
|
46
|
+
var keywordSearchOptions_1 = require("../utils/keywordSearchOptions");
|
|
47
|
+
var getValue_1 = require("../utils/getValue");
|
|
48
|
+
var generateOptions_1 = require("../utils/generateOptions");
|
|
49
|
+
var useSearchString_1 = require("../utils/useSearchString");
|
|
50
|
+
var styled_components_1 = require("styled-components");
|
|
51
|
+
var genTagComp_1 = require("../utils/genTagComp");
|
|
52
|
+
var BlockLabel_1 = require("../../BlockLabel");
|
|
53
|
+
var getBlockLabelProps_1 = require("../../../utils/getBlockLabelProps");
|
|
54
|
+
var mixins_1 = require("../../../themes/mixins");
|
|
55
|
+
var useHandleClickOutside_1 = require("../../../utils/customHooks/useHandleClickOutside");
|
|
56
|
+
var useScreenWidth_1 = require("../../../utils/customHooks/useScreenWidth");
|
|
57
|
+
var styled_1 = require("../styled");
|
|
58
|
+
// single_multi
|
|
59
|
+
// static_dynamic
|
|
60
|
+
function DropdownSingle(_a) {
|
|
61
|
+
var optionsAnchor = _a.optionsAnchor, lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle,
|
|
62
|
+
//to restructure: rename to TYPO = 'SANS_3' or something. which can be overridden
|
|
63
|
+
selectClassName = _a.selectClassName, //used to override font size in priimary header
|
|
64
|
+
optionsClassName = _a.optionsClassName, //used to override font size in priimary header
|
|
65
|
+
//used by filters topbar. this is a hack. find another way
|
|
66
|
+
disableSelectTextUpdate = _a.disableSelectTextUpdate, selectStyleOverride = _a.selectStyleOverride, valueProp = _a.value, id = _a.id, parentOnChange = _a.onChange, className = _a.className, style = _a.style, readOnly = _a.readOnly, //
|
|
67
|
+
invert = _a.invert, //
|
|
68
|
+
optionsFn = _a.optionsFn, optionsProp = _a.options, saveValueAsString = _a.saveValueAsString, // used in tci
|
|
69
|
+
isTagsStyle = _a.isTagsStyle, selectConfig = _a.selectConfig, label = _a.label, optionsModalLabel = _a.optionsModalLabel, broadcastShowOptions = _a.broadcastShowOptions,
|
|
70
|
+
//combobox specific
|
|
71
|
+
isSearchable = _a.isSearchable, //
|
|
72
|
+
searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptions, setSearchStringInParent = _a.setSearchString, searchStringInParent = _a.searchString, genCustomSelectComp = _a.genCustomSelectComp, placeholder = _a.placeholder, //
|
|
73
|
+
caretColor = _a.caretColor, genCreateTagButton = _a.genCreateTagButton, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, displayCompStyle = _a.displayCompStyle, S = _a.S, //
|
|
74
|
+
disabled = _a.disabled //
|
|
75
|
+
;
|
|
76
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
77
|
+
var props = arguments[0];
|
|
78
|
+
var value = (0, getValue_1.getValue_SINGLE)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme });
|
|
79
|
+
//1 INIT REFS
|
|
80
|
+
var _b = (0, useCreateDropdownRefs_1.useCreateDropdownRefs)(), selectRef = _b.selectRef, dropdownRef = _b.dropdownRef;
|
|
81
|
+
//2 INIT SHOW OPTIONS STATE
|
|
82
|
+
var _c = (0, useHideShowOptions_1.useHideShowOptions)({
|
|
83
|
+
broadcastShowOptions: broadcastShowOptions
|
|
84
|
+
}), showOptions = _c.showOptions, handleHideOptions = _c.handleHideOptions, handleShowOptions = _c.handleShowOptions;
|
|
85
|
+
var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
|
|
86
|
+
//3 INIT DD FOCUS CUSTOM HOOK
|
|
87
|
+
(0, useHandleClickOutside_1.useHandleClickOutside)(dropdownRef, handleHideOptions, { enabled: screenWidth >= (0, mixins_1.getBreakPoint)('sm') });
|
|
88
|
+
//5 PRIMARY CHANGE HANDLER
|
|
89
|
+
var handleSelect = function (newVal) {
|
|
90
|
+
setSearchString('');
|
|
91
|
+
(0, handlers_1.handleSelect_SINGLE)({
|
|
92
|
+
id: id,
|
|
93
|
+
newVal: newVal,
|
|
94
|
+
prevVal: value,
|
|
95
|
+
// hideShowOtherTextInputOnSelect_SINGLE,
|
|
96
|
+
handleHideOptions: handleHideOptions,
|
|
97
|
+
saveValueAsString: saveValueAsString,
|
|
98
|
+
parentOnChange: parentOnChange
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
//-- TAG INPUT SPECIFIC
|
|
102
|
+
var _d = (0, useSearchString_1.useSearchString)({
|
|
103
|
+
searchStringInParent: searchStringInParent,
|
|
104
|
+
setSearchStringInParent: setSearchStringInParent
|
|
105
|
+
}), searchString = _d[0], setSearchString = _d[1];
|
|
106
|
+
var options = (0, react_1.useMemo)(function () {
|
|
107
|
+
var ops = (0, generateOptions_1.generateOptions)({
|
|
108
|
+
options: optionsProp,
|
|
109
|
+
optionsFn: optionsFn,
|
|
110
|
+
});
|
|
111
|
+
return (!isSearchable && !isTagsStyle)
|
|
112
|
+
? ops
|
|
113
|
+
: (0, keywordSearchOptions_1.keywordSearchOptions)({
|
|
114
|
+
options: ops,
|
|
115
|
+
searchString: searchString,
|
|
116
|
+
searchFieldsConfig: searchFieldsConfig,
|
|
117
|
+
setFilteredOptionsInParent: setFilteredOptionsInParent,
|
|
118
|
+
});
|
|
119
|
+
}, [optionsProp, searchString]);
|
|
120
|
+
var genSelectTagsInput = function () { return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, __assign({}, {
|
|
121
|
+
id: id,
|
|
122
|
+
value: value,
|
|
123
|
+
invert: invert,
|
|
124
|
+
handleSelect: handleSelect,
|
|
125
|
+
searchString: searchString,
|
|
126
|
+
setSearchString: setSearchString,
|
|
127
|
+
single_multi: 'single',
|
|
128
|
+
placeholder: placeholder,
|
|
129
|
+
S: S,
|
|
130
|
+
disabled: disabled,
|
|
131
|
+
showOptions: showOptions,
|
|
132
|
+
S: S
|
|
133
|
+
// forceFocus, comp is expecting this
|
|
134
|
+
}))); };
|
|
135
|
+
var genInputComp = function () {
|
|
136
|
+
return (react_1.default.createElement(styled_1.StyledDropdownRefWrapper, { ref: dropdownRef },
|
|
137
|
+
react_1.default.createElement("div", { ref: selectRef, className: "OKE-Dropdown__Select-wrapper", onClick: disabled ? function () { } : function () {
|
|
138
|
+
isTagsStyle
|
|
139
|
+
? !showOptions && handleShowOptions() //if tagsStyle, then click always shows options
|
|
140
|
+
: showOptions ? handleHideOptions() : handleShowOptions(); //if dropdowns, then click toggles show/hide
|
|
141
|
+
} }, isTagsStyle ? genSelectTagsInput() : (react_1.default.createElement(SelectDropdown_1.SelectDropdown, __assign({}, {
|
|
142
|
+
invert: invert,
|
|
143
|
+
value: value,
|
|
144
|
+
placeholder: placeholder,
|
|
145
|
+
caretColor: caretColor,
|
|
146
|
+
genCustomSelectComp: genCustomSelectComp,
|
|
147
|
+
selectClassName: selectClassName,
|
|
148
|
+
selectStyleOverride: selectStyleOverride,
|
|
149
|
+
showOptions: showOptions,
|
|
150
|
+
disableSelectTextUpdate: disableSelectTextUpdate,
|
|
151
|
+
selectConfig: selectConfig,
|
|
152
|
+
S: S,
|
|
153
|
+
disabled: disabled
|
|
154
|
+
})))),
|
|
155
|
+
react_1.default.createElement(OptionsSingle_1.OptionsSingle, { 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,
|
|
156
|
+
//combobox specific
|
|
157
|
+
isSearchable: isTagsStyle ? false : isSearchable, genCreateTagButton: genCreateTagButton, SelectComp: isTagsStyle && genSelectTagsInput(), S: S, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent })));
|
|
158
|
+
};
|
|
159
|
+
var genDisplayComp = function () {
|
|
160
|
+
if (!value)
|
|
161
|
+
return null;
|
|
162
|
+
var tagsStyle = (react_1.default.createElement(StyledTagsInputWrapper, null, (0, genTagComp_1.genTagComp)(id, value, { display: true, invert: invert, theme: theme })));
|
|
163
|
+
var commaSeparatedStyle = react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, __assign({}, { value: value, invert: invert }));
|
|
164
|
+
//if an explicit displayComp style is specified then listen to it.
|
|
165
|
+
//else apply tagsStyle to 'tagStyle' inputs & commaseparatedstyle to
|
|
166
|
+
//regular plain dropdowns.
|
|
167
|
+
if (!!displayCompStyle) {
|
|
168
|
+
return displayCompStyle === 'tagsStyle'
|
|
169
|
+
? tagsStyle
|
|
170
|
+
: displayCompStyle === 'commaSeparatedStyle'
|
|
171
|
+
&& commaSeparatedStyle;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
return isTagsStyle
|
|
175
|
+
? tagsStyle
|
|
176
|
+
: commaSeparatedStyle;
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return (react_1.default.createElement("div", { className: "OKE-Dropdown ".concat(className, " OKE-Dropdown--").concat(readOnly ? "displayComp" : "inputComp", " ").concat(invert ? "-invert-" : ""), style: style },
|
|
180
|
+
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(props) /** in other words, props. */)),
|
|
181
|
+
readOnly ? genDisplayComp() : genInputComp()));
|
|
182
|
+
}
|
|
183
|
+
exports.DropdownSingle = DropdownSingle;
|
|
@@ -0,0 +1,19 @@
|
|
|
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, caretColor = _a.caretColor, 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 : caretColor || greyColor100, weight: "bold" })) : (react_1.default.createElement(CaretDown, { size: 12, color: disabled ? greyColor40 : invert ? white : caretColor || greyColor100, weight: "bold" })),
|
|
17
|
+
react_1.default.createElement(styled_1.StyledCaretClickArea, null)));
|
|
18
|
+
};
|
|
19
|
+
exports.Caret = Caret;
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -0,0 +1,39 @@
|
|
|
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;
|
|
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)(value === null || value === void 0 ? void 0 : value.icon),
|
|
32
|
+
(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, null,
|
|
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;
|
|
@@ -0,0 +1,15 @@
|
|
|
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;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 OptionContent = function (_a) {
|
|
14
|
+
var option = _a.option, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S;
|
|
15
|
+
var theme = (0, styled_components_1.useTheme)();
|
|
16
|
+
var TypoComp = S ? Typo_1.SANS_2 : Typo_1.SANS_3;
|
|
17
|
+
var image = option.image, display = option.display, icon = option.icon, desc = option.desc;
|
|
18
|
+
return (react_1.default.createElement("div", { style: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
gap: "1rem",
|
|
22
|
+
maxWidth: "36rem",
|
|
23
|
+
} },
|
|
24
|
+
(0, genProfileImg_1.genProfileImg)({ image: image, display: display, invert: invert, theme: theme }),
|
|
25
|
+
icon && (0, genIcon_1.genIcon)(icon),
|
|
26
|
+
react_1.default.createElement("div", null,
|
|
27
|
+
react_1.default.createElement(TypoComp, { invert: invert, semibold: desc ? true : false, className: "OKE-Dropdown__optionText ".concat(optionsClassName || "") }, (0, getText_1.getText)(display)),
|
|
28
|
+
desc && (react_1.default.createElement(TypoComp, { invert: invert, className: "OKE-Dropdown__optionDesc" }, (0, getText_1.getText)(desc))))));
|
|
29
|
+
};
|
|
30
|
+
exports.OptionContent = OptionContent;
|
|
@@ -0,0 +1,25 @@
|
|
|
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, }: {
|
|
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
|
+
}): any;
|