oolib 2.83.1 → 2.83.2
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 +1 -3
- package/dist/components/Dropdowns/DropdownMulti/index.js +3 -20
- package/dist/components/Dropdowns/DropdownSingle/index.d.ts +1 -3
- package/dist/components/Dropdowns/DropdownSingle/index.js +2 -18
- package/dist/components/Dropdowns/comps/Caret/index.d.ts +1 -2
- package/dist/components/Dropdowns/comps/Caret/index.js +2 -2
- package/dist/components/Dropdowns/comps/SelectDropdown/index.d.ts +1 -2
- package/dist/components/Dropdowns/comps/SelectDropdown/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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, genCustomSelectComp, disableSelectTextUpdate, selectConfig, lightboxHeight, lightboxStyle, optionsAnchor, popOutOfOverflowHiddenParent, S, disabled, broadcastShowOptions }: {
|
|
2
2
|
saveValueAsString: any;
|
|
3
3
|
value: any;
|
|
4
4
|
id: any;
|
|
@@ -21,7 +21,6 @@ export function DropdownMulti({ saveValueAsString, value: valueProp, id, onChang
|
|
|
21
21
|
optionsModalLabel: any;
|
|
22
22
|
genCreateTagButton: any;
|
|
23
23
|
placeholder: any;
|
|
24
|
-
caretColor: any;
|
|
25
24
|
genCustomSelectComp: any;
|
|
26
25
|
disableSelectTextUpdate: any;
|
|
27
26
|
selectConfig: any;
|
|
@@ -29,7 +28,6 @@ export function DropdownMulti({ saveValueAsString, value: valueProp, id, onChang
|
|
|
29
28
|
lightboxStyle: any;
|
|
30
29
|
optionsAnchor: any;
|
|
31
30
|
popOutOfOverflowHiddenParent: any;
|
|
32
|
-
displayCompStyle: any;
|
|
33
31
|
S: any;
|
|
34
32
|
disabled: any;
|
|
35
33
|
broadcastShowOptions: any;
|
|
@@ -60,10 +60,9 @@ function DropdownMulti(_a) {
|
|
|
60
60
|
// injectOtherOption,
|
|
61
61
|
readOnly = _a.readOnly, invert = _a.invert, selectClassName = _a.selectClassName, //used to override font size in priimary header
|
|
62
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,
|
|
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, genCustomSelectComp = _a.genCustomSelectComp, disableSelectTextUpdate = _a.disableSelectTextUpdate, selectConfig = _a.selectConfig,
|
|
64
64
|
//props whose existence needs to be questioned:
|
|
65
|
-
lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle, optionsAnchor = _a.optionsAnchor, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent,
|
|
66
|
-
S = _a.S, disabled = _a.disabled, broadcastShowOptions = _a.broadcastShowOptions;
|
|
65
|
+
lightboxHeight = _a.lightboxHeight, lightboxStyle = _a.lightboxStyle, optionsAnchor = _a.optionsAnchor, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, disabled = _a.disabled, broadcastShowOptions = _a.broadcastShowOptions;
|
|
67
66
|
var theme = (0, styled_components_1.useTheme)();
|
|
68
67
|
var props = arguments[0];
|
|
69
68
|
var value = (0, getValue_1.getValue_MULTI)({ valueProp: valueProp, optionsFn: optionsFn, options: optionsProp, theme: theme, saveValueAsString: saveValueAsString });
|
|
@@ -137,23 +136,8 @@ function DropdownMulti(_a) {
|
|
|
137
136
|
var genDisplayComp = function () {
|
|
138
137
|
if (!(value === null || value === void 0 ? void 0 : value.length) > 0)
|
|
139
138
|
return null;
|
|
140
|
-
|
|
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,
|
|
139
|
+
return isTagsStyle ? (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 }); }))) : (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
140
|
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
141
|
};
|
|
158
142
|
var _e = (0, react_1.useState)(false), focusSelectTagsInput = _e[0], setFocusSelectTagsInput = _e[1];
|
|
159
143
|
var genSelectTagsInput = function () { return (react_1.default.createElement(SelectTagsInput_1.SelectTagsInput, __assign({}, {
|
|
@@ -185,7 +169,6 @@ function DropdownMulti(_a) {
|
|
|
185
169
|
selectClassName: selectClassName,
|
|
186
170
|
selectStyleOverride: selectStyleOverride,
|
|
187
171
|
showOptions: showOptions,
|
|
188
|
-
caretColor: caretColor,
|
|
189
172
|
genCustomSelectComp: genCustomSelectComp,
|
|
190
173
|
disableSelectTextUpdate: disableSelectTextUpdate,
|
|
191
174
|
selectConfig: selectConfig,
|
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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, genCreateTagButton, popOutOfOverflowHiddenParent, S, disabled }: {
|
|
2
2
|
optionsAnchor: any;
|
|
3
3
|
lightboxHeight: any;
|
|
4
4
|
lightboxStyle: any;
|
|
@@ -28,10 +28,8 @@ export function DropdownSingle({ optionsAnchor, lightboxHeight, lightboxStyle, s
|
|
|
28
28
|
searchString: any;
|
|
29
29
|
genCustomSelectComp: any;
|
|
30
30
|
placeholder: any;
|
|
31
|
-
caretColor: any;
|
|
32
31
|
genCreateTagButton: any;
|
|
33
32
|
popOutOfOverflowHiddenParent: any;
|
|
34
|
-
displayCompStyle: any;
|
|
35
33
|
S: any;
|
|
36
34
|
disabled: any;
|
|
37
35
|
}, ...args: any[]): React.JSX.Element;
|
|
@@ -70,7 +70,7 @@ function DropdownSingle(_a) {
|
|
|
70
70
|
//combobox specific
|
|
71
71
|
isSearchable = _a.isSearchable, //
|
|
72
72
|
searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptions, setSearchStringInParent = _a.setSearchString, searchStringInParent = _a.searchString, genCustomSelectComp = _a.genCustomSelectComp, placeholder = _a.placeholder, //
|
|
73
|
-
|
|
73
|
+
genCreateTagButton = _a.genCreateTagButton, popOutOfOverflowHiddenParent = _a.popOutOfOverflowHiddenParent, S = _a.S, //
|
|
74
74
|
disabled = _a.disabled //
|
|
75
75
|
;
|
|
76
76
|
var theme = (0, styled_components_1.useTheme)();
|
|
@@ -143,7 +143,6 @@ function DropdownSingle(_a) {
|
|
|
143
143
|
invert: invert,
|
|
144
144
|
value: value,
|
|
145
145
|
placeholder: placeholder,
|
|
146
|
-
caretColor: caretColor,
|
|
147
146
|
genCustomSelectComp: genCustomSelectComp,
|
|
148
147
|
selectClassName: selectClassName,
|
|
149
148
|
selectStyleOverride: selectStyleOverride,
|
|
@@ -160,22 +159,7 @@ function DropdownSingle(_a) {
|
|
|
160
159
|
var genDisplayComp = function () {
|
|
161
160
|
if (!value)
|
|
162
161
|
return null;
|
|
163
|
-
|
|
164
|
-
var commaSeparatedStyle = react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, __assign({}, { value: value, invert: invert }));
|
|
165
|
-
//if an explicit displayComp style is specified then listen to it.
|
|
166
|
-
//else apply tagsStyle to 'tagStyle' inputs & commaseparatedstyle to
|
|
167
|
-
//regular plain dropdowns.
|
|
168
|
-
if (!!displayCompStyle) {
|
|
169
|
-
return displayCompStyle === 'tagsStyle'
|
|
170
|
-
? tagsStyle
|
|
171
|
-
: displayCompStyle === 'commaSeparatedStyle'
|
|
172
|
-
&& commaSeparatedStyle;
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
return isTagsStyle
|
|
176
|
-
? tagsStyle
|
|
177
|
-
: commaSeparatedStyle;
|
|
178
|
-
}
|
|
162
|
+
return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, (0, genTagComp_1.genTagComp)(id, value, { display: true, invert: invert, theme: theme }))) : (react_1.default.createElement(DisplayCompSingle_1.DisplayCompSingle, __assign({}, { value: value, invert: invert })));
|
|
179
163
|
};
|
|
180
164
|
return (react_1.default.createElement("div", { className: "OKE-Dropdown ".concat(className, " OKE-Dropdown--").concat(readOnly ? "displayComp" : "inputComp", " ").concat(invert ? "-invert-" : ""), style: style },
|
|
181
165
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(props) /** in other words, props. */)),
|
|
@@ -11,9 +11,9 @@ var styled_1 = require("./styled");
|
|
|
11
11
|
var white = colors_1.colors.white, greyColor100 = colors_1.colors.greyColor100, greyColor40 = colors_1.colors.greyColor40;
|
|
12
12
|
var CaretDown = icons_1.icons.CaretDown, CaretUp = icons_1.icons.CaretUp;
|
|
13
13
|
var Caret = function (_a) {
|
|
14
|
-
var invert = _a.invert,
|
|
14
|
+
var invert = _a.invert, showOptions = _a.showOptions, disabled = _a.disabled;
|
|
15
15
|
return (react_1.default.createElement(styled_1.StyledCaret, null,
|
|
16
|
-
showOptions ? (react_1.default.createElement(CaretUp, { size: 12, color: invert ? white :
|
|
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
17
|
react_1.default.createElement(styled_1.StyledCaretClickArea, null)));
|
|
18
18
|
};
|
|
19
19
|
exports.Caret = Caret;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export function SelectDropdown({ invert, value, placeholder,
|
|
1
|
+
export function SelectDropdown({ invert, value, placeholder, genCustomSelectComp, selectClassName, showOptions, disableSelectTextUpdate, selectConfig, selectStyleOverride, S, disabled, }: {
|
|
2
2
|
invert: any;
|
|
3
3
|
value: any;
|
|
4
4
|
placeholder: any;
|
|
5
|
-
caretColor: any;
|
|
6
5
|
genCustomSelectComp: any;
|
|
7
6
|
selectClassName: any;
|
|
8
7
|
showOptions: any;
|
|
@@ -24,7 +24,7 @@ var styled_1 = require("./styled");
|
|
|
24
24
|
var SelectDropdown = function (_a) {
|
|
25
25
|
var
|
|
26
26
|
//from root
|
|
27
|
-
invert = _a.invert, value = _a.value, placeholder = _a.placeholder,
|
|
27
|
+
invert = _a.invert, value = _a.value, placeholder = _a.placeholder, genCustomSelectComp = _a.genCustomSelectComp, selectClassName = _a.selectClassName,
|
|
28
28
|
//from Dropdown
|
|
29
29
|
showOptions = _a.showOptions,
|
|
30
30
|
//used only for filters, where we dont remove the placeholder even when an option is selected, instead we sustain the blue underline
|
|
@@ -57,7 +57,7 @@ var SelectDropdown = function (_a) {
|
|
|
57
57
|
// dropdownSelectText.desc && showElem("desc") ? true : undefined
|
|
58
58
|
// }
|
|
59
59
|
className: "".concat(selectClassName || "", " ").concat(!value && placeholder) }, dropdownSelectText.display)))),
|
|
60
|
-
react_1.default.createElement(Caret_1.Caret, __assign({}, {
|
|
60
|
+
react_1.default.createElement(Caret_1.Caret, __assign({}, { showOptions: showOptions, invert: invert, disabled: disabled })))); };
|
|
61
61
|
return genCustomSelectComp ? genCustomSelectComp() : genSelectComp();
|
|
62
62
|
};
|
|
63
63
|
exports.SelectDropdown = SelectDropdown;
|