oolib 2.208.3 → 2.208.4
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/v2/components/Dropdowns/comps/OptionsMulti/index.js +1 -1
- package/dist/v2/components/Dropdowns/comps/OptionsSingle/index.js +1 -1
- package/dist/v2/components/List/index.d.ts +3 -1
- package/dist/v2/components/List/index.js +5 -2
- package/dist/v2/components/Tags/Comps/Tag/index.js +3 -1
- package/package.json +1 -1
|
@@ -98,7 +98,7 @@ var OptionsMulti = function (_a) {
|
|
|
98
98
|
react_1.default.createElement(List_1.List, { options: options, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: function (id, v) {
|
|
99
99
|
console.log({ id: id, v: v });
|
|
100
100
|
handleSelect(v);
|
|
101
|
-
}, optionsClassName: optionsClassName, S: S, isMulti: true, disableShadow: true, isSearchable: isSearchable, searchbarPlaceholder: searchbarPlaceholder, searchBarFocus: searchBarFocus, searchString: searchString, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus, children: !isTagsStyle && createSelectedOptions() }),
|
|
101
|
+
}, optionsClassName: optionsClassName, S: S, isMulti: true, disableShadow: true, isSearchable: isSearchable, searchbarPlaceholder: searchbarPlaceholder, searchBarFocus: searchBarFocus, searchString: searchString, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus, children: !isTagsStyle && createSelectedOptions(), showList: showOptions, usedIn: "dropdown" }),
|
|
102
102
|
genCreateTagButton && genCreateTagButton(options)));
|
|
103
103
|
};
|
|
104
104
|
exports.OptionsMulti = OptionsMulti;
|
|
@@ -74,7 +74,7 @@ var OptionsSingle = function (_a) {
|
|
|
74
74
|
}, [showOptions]);
|
|
75
75
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
76
76
|
react_1.default.createElement(OptionsShell_1.OptionsShell, { ref: optionsRef, yOrientation: yOrientation, lightboxHeight: lightboxHeight, lightboxStyle: lightboxStyle, options: options, optionsAnchor: optionsAnchor, showOptions: showOptions, SelectComp: SelectComp, handleHideOptions: handleHideOptions, label: label, optionsModalLabel: optionsModalLabel, relativeToRef: relativeToRef, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, alignDropdown: alignDropdown, matchSelectInputWidth: matchSelectInputWidth, S: S },
|
|
77
|
-
react_1.default.createElement(List_1.List, { options: options, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: function (id, v) { return handleSelect(v); }, optionsClassName: optionsClassName, S: S, observerRef: observerRef, isSearchable: isSearchable, searchbarPlaceholder: searchbarPlaceholder, searchBarFocus: searchBarFocus, searchString: searchString, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus }),
|
|
77
|
+
react_1.default.createElement(List_1.List, { options: options, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: function (id, v) { return handleSelect(v); }, optionsClassName: optionsClassName, S: S, observerRef: observerRef, isSearchable: isSearchable, searchbarPlaceholder: searchbarPlaceholder, searchBarFocus: searchBarFocus, searchString: searchString, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus, showList: showOptions, usedIn: "dropdown" }),
|
|
78
78
|
genCreateTagButton && genCreateTagButton(options))));
|
|
79
79
|
};
|
|
80
80
|
exports.OptionsSingle = OptionsSingle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const StyledListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
2
|
export function isGroupedData(options: any): boolean;
|
|
3
|
-
export function List({ id, options, value, focussedOp, scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName, invert, S, observerRef, isMulti, isTagsStyle, setFocusSelectTagsInput, disableShadow, isSearchable, searchbarPlaceholder, searchBarFocus, searchString, setSearchString, setSearchBarFocus, children, enableBorder, style, groupHeaderStickyTop }: {
|
|
3
|
+
export function List({ id, options, value, focussedOp, scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName, invert, S, observerRef, isMulti, isTagsStyle, setFocusSelectTagsInput, disableShadow, isSearchable, searchbarPlaceholder, searchBarFocus, searchString, setSearchString, setSearchBarFocus, children, enableBorder, style, groupHeaderStickyTop, showList: showListInParent, usedIn }: {
|
|
4
4
|
id: any;
|
|
5
5
|
options?: any[];
|
|
6
6
|
value: any;
|
|
@@ -25,5 +25,7 @@ export function List({ id, options, value, focussedOp, scrollFocussedOpIntoView,
|
|
|
25
25
|
enableBorder: any;
|
|
26
26
|
style: any;
|
|
27
27
|
groupHeaderStickyTop: any;
|
|
28
|
+
showList: any;
|
|
29
|
+
usedIn: any;
|
|
28
30
|
}): React.JSX.Element;
|
|
29
31
|
import React from 'react';
|
|
@@ -67,7 +67,7 @@ var isGroupedData = function (options) {
|
|
|
67
67
|
exports.isGroupedData = isGroupedData;
|
|
68
68
|
var List = function (_a) {
|
|
69
69
|
// const theme = useTheme();
|
|
70
|
-
var id = _a.id, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, focussedOp = _a.focussedOp, scrollFocussedOpIntoView = _a.scrollFocussedOpIntoView, parentOnChange = _a.onChange, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S, observerRef = _a.observerRef, _c = _a.isMulti, isMulti = _c === void 0 ? false : _c, isTagsStyle = _a.isTagsStyle, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, disableShadow = _a.disableShadow, isSearchable = _a.isSearchable, searchbarPlaceholder = _a.searchbarPlaceholder, searchBarFocus = _a.searchBarFocus, searchString = _a.searchString, setSearchString = _a.setSearchString, setSearchBarFocus = _a.setSearchBarFocus, children = _a.children, enableBorder = _a.enableBorder, style = _a.style, groupHeaderStickyTop = _a.groupHeaderStickyTop;
|
|
70
|
+
var id = _a.id, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, focussedOp = _a.focussedOp, scrollFocussedOpIntoView = _a.scrollFocussedOpIntoView, parentOnChange = _a.onChange, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S, observerRef = _a.observerRef, _c = _a.isMulti, isMulti = _c === void 0 ? false : _c, isTagsStyle = _a.isTagsStyle, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, disableShadow = _a.disableShadow, isSearchable = _a.isSearchable, searchbarPlaceholder = _a.searchbarPlaceholder, searchBarFocus = _a.searchBarFocus, searchString = _a.searchString, setSearchString = _a.setSearchString, setSearchBarFocus = _a.setSearchBarFocus, children = _a.children, enableBorder = _a.enableBorder, style = _a.style, groupHeaderStickyTop = _a.groupHeaderStickyTop, showListInParent = _a.showList, usedIn = _a.usedIn;
|
|
71
71
|
var renderListItems = function () {
|
|
72
72
|
if (options.length === 0) {
|
|
73
73
|
return react_1.default.createElement(NoOptionResultsComp_1.NoOptionResultsComp, { S: S });
|
|
@@ -88,7 +88,10 @@ var List = function (_a) {
|
|
|
88
88
|
}, optionsClassName: optionsClassName, invert: invert, S: S, observerRef: options.length === index + 1 ? observerRef : null, isMulti: isMulti, isTagsStyle: isTagsStyle, value: value })); });
|
|
89
89
|
};
|
|
90
90
|
return (react_1.default.createElement(exports.StyledListWrapper, { disableShadow: disableShadow, style: style, isSearchable: isSearchable, enableBorder: enableBorder },
|
|
91
|
-
isSearchable && (react_1.default.createElement(SearchBar_1.SearchBar, { searchbarPlaceholder: searchbarPlaceholder,
|
|
91
|
+
isSearchable && (react_1.default.createElement(SearchBar_1.SearchBar, { searchbarPlaceholder: searchbarPlaceholder, searchString: searchString, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus,
|
|
92
|
+
// In dropdowns searchBarFocus is only called from search bar component when dropdowns is opened
|
|
93
|
+
// because in Dropdown - List and searchBar is present in DOM even when the dropdown is closed
|
|
94
|
+
searchBarFocus: usedIn !== "dropdown" ? searchBarFocus : usedIn === "dropdown" && showListInParent ? searchBarFocus : false })),
|
|
92
95
|
children,
|
|
93
96
|
" ",
|
|
94
97
|
renderListItems()));
|
|
@@ -10,17 +10,19 @@ var icons_1 = require("../../../../../icons");
|
|
|
10
10
|
var styled_2 = require("./styled");
|
|
11
11
|
var styled_components_1 = require("styled-components");
|
|
12
12
|
var themes_1 = require("../../../../themes");
|
|
13
|
+
var utilsOolib_1 = require("../../../../../utilsOolib");
|
|
13
14
|
var grey40 = themes_1.colors.grey40;
|
|
14
15
|
var Tag = function (_a) {
|
|
15
16
|
var id = _a.id, _b = _a.fill, fill = _b === void 0 ? "solid" : _b, _c = _a.size, size = _c === void 0 ? "S" : _c, display = _a.display, icon = _a.icon, weight = _a.weight, onClick = _a.onClick, variant = _a.variant, typo = _a.typo, badgeColor = _a.badgeColor, style = _a.style;
|
|
16
17
|
var Icon = icons_1.icons[icon];
|
|
17
18
|
var theme = (0, styled_components_1.useTheme)();
|
|
18
19
|
var Typo = typo || styled_2.Styled_UI_CAPTION_DF;
|
|
20
|
+
var localize = (0, utilsOolib_1.useLocale)();
|
|
19
21
|
return (react_1.default.createElement(styled_1.StyledTag, { id: id, fill: fill, size: size, icon: icon, onClick: onClick, variant: variant, colors: theme === null || theme === void 0 ? void 0 : theme.colors, style: style },
|
|
20
22
|
badgeColor && react_1.default.createElement("div", { style: { background: badgeColor, width: "1rem", height: "1rem", borderRadius: "50%", marginRight: "0.2rem" } }),
|
|
21
23
|
react_1.default.createElement(Typo, { weight: weight },
|
|
22
24
|
" ",
|
|
23
|
-
display,
|
|
25
|
+
localize(display),
|
|
24
26
|
" "),
|
|
25
27
|
icon &&
|
|
26
28
|
react_1.default.createElement(styled_2.StyledIconWrapper, { weight: weight },
|