oolib 2.199.6 → 2.199.8
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/DropdownMulti/index.js +2 -1
- package/dist/v2/components/Dropdowns/utils/getValue.js +3 -2
- package/dist/v2/components/Dropdowns/utils/keywordSearchOptions.js +2 -2
- package/dist/v2/components/List/index.d.ts +1 -0
- package/dist/v2/components/List/index.js +4 -6
- package/dist/v2/components/cards/CardContent/styled.js +1 -1
- package/package.json +1 -1
|
@@ -65,6 +65,7 @@ var genTagComp_1 = require("../utils/genTagComp");
|
|
|
65
65
|
var styled_1 = require("../styled");
|
|
66
66
|
var BlockLabel_1 = require("../../BlockLabel");
|
|
67
67
|
var getBlockLabelProps_1 = require("../../../../utils/getBlockLabelProps");
|
|
68
|
+
var List_1 = require("../../List");
|
|
68
69
|
function DropdownMulti(_a) {
|
|
69
70
|
var saveValueAsString = _a.saveValueAsString, valueProp = _a.value, id = _a.id, parentOnChange = _a.onChange, className = _a.className,
|
|
70
71
|
// injectOtherOption,
|
|
@@ -101,7 +102,7 @@ function DropdownMulti(_a) {
|
|
|
101
102
|
// rm the selectedOps from ops list (since they are shown anyway in the selectedops list)
|
|
102
103
|
var selectedValues = currentValue.map(function (v) { return v.value; });
|
|
103
104
|
// Check if we're dealing with grouped data
|
|
104
|
-
var isGrouped = (0,
|
|
105
|
+
var isGrouped = (0, List_1.isGroupedData)(ops);
|
|
105
106
|
if (isGrouped) {
|
|
106
107
|
// For grouped data, filter out selected options from each group
|
|
107
108
|
return ops.map(function (group) {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.getValue_MULTI = exports.getValue_SINGLE = void 0;
|
|
11
11
|
var toArray_1 = require("../../../../utils/toArray");
|
|
12
|
+
var List_1 = require("../../List");
|
|
12
13
|
var getAllOptionsFns_1 = require("./getAllOptionsFns");
|
|
13
14
|
// Note: - saveValueAsString can be misleading here, because the value could be a string, integer, boolean values
|
|
14
15
|
// maybe we can rename to saveValueOnly, or some better name
|
|
@@ -28,7 +29,7 @@ var getValue_SINGLE = function (_a) {
|
|
|
28
29
|
if (!saveValueAsString)
|
|
29
30
|
return valueProp;
|
|
30
31
|
var allOptions = optionsFn ? (_b = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_b, ((0, toArray_1.toArray)(optionsFn.args) || [])) : options;
|
|
31
|
-
if (isGroupedData(allOptions)) {
|
|
32
|
+
if ((0, List_1.isGroupedData)(allOptions)) {
|
|
32
33
|
// For grouped data, search through all options in all groups
|
|
33
34
|
for (var _i = 0, allOptions_1 = allOptions; _i < allOptions_1.length; _i++) {
|
|
34
35
|
var group = allOptions_1[_i];
|
|
@@ -51,7 +52,7 @@ var getValue_MULTI = function (_a) {
|
|
|
51
52
|
return valueProp;
|
|
52
53
|
var allOptions = optionsFn
|
|
53
54
|
? (_b = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_b, ((0, toArray_1.toArray)(optionsFn.args) || [])) : options;
|
|
54
|
-
if (isGroupedData(allOptions)) {
|
|
55
|
+
if ((0, List_1.isGroupedData)(allOptions)) {
|
|
55
56
|
// For grouped data, map each value and search through all options in all groups
|
|
56
57
|
return valueProp.map(function (vProp) {
|
|
57
58
|
for (var _i = 0, allOptions_2 = allOptions; _i < allOptions_2.length; _i++) {
|
|
@@ -13,14 +13,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.keywordSearchOptions = void 0;
|
|
15
15
|
var isStringMatch_1 = require("../../../../utils/isStringMatch");
|
|
16
|
-
var
|
|
16
|
+
var List_1 = require("../../List");
|
|
17
17
|
var keywordSearchOptions = function (_a) {
|
|
18
18
|
var options = _a.options, searchString = _a.searchString, searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptionsInParent;
|
|
19
19
|
// If any options are loading, return the original options
|
|
20
20
|
if (options.some(function (d) { return d.loading === true; }))
|
|
21
21
|
return options;
|
|
22
22
|
// Check if we're dealing with grouped data
|
|
23
|
-
var isGrouped = (0,
|
|
23
|
+
var isGrouped = (0, List_1.isGroupedData)(options);
|
|
24
24
|
if (isGrouped) {
|
|
25
25
|
// Handle grouped data
|
|
26
26
|
var filteredGroups = options.map(function (group) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const StyledListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export function isGroupedData(options: any): boolean;
|
|
2
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 }: {
|
|
3
4
|
id: any;
|
|
4
5
|
options?: any[];
|
|
@@ -37,7 +37,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
};
|
|
38
38
|
})();
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.List = exports.StyledListWrapper = void 0;
|
|
40
|
+
exports.List = exports.isGroupedData = exports.StyledListWrapper = void 0;
|
|
41
41
|
var react_1 = __importStar(require("react"));
|
|
42
42
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
43
43
|
var NoOptionResultsComp_1 = require("../Dropdowns/comps/NoOptionResultsComp");
|
|
@@ -62,11 +62,9 @@ var isGroupedData = function (options) {
|
|
|
62
62
|
}
|
|
63
63
|
// Check the first item in the array
|
|
64
64
|
// If it has an 'options' property that is an array, it's grouped data
|
|
65
|
-
return (options
|
|
66
|
-
typeof options[0] === "object" &&
|
|
67
|
-
Array.isArray(options[0].options) &&
|
|
68
|
-
options[0].options.length > 0);
|
|
65
|
+
return (Array.isArray(options) && options.every(function (op) { return !!(op === null || op === void 0 ? void 0 : op.options) && Array.isArray(op.options); }));
|
|
69
66
|
};
|
|
67
|
+
exports.isGroupedData = isGroupedData;
|
|
70
68
|
var List = function (_a) {
|
|
71
69
|
// const theme = useTheme();
|
|
72
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;
|
|
@@ -74,7 +72,7 @@ var List = function (_a) {
|
|
|
74
72
|
if (options.length === 0) {
|
|
75
73
|
return react_1.default.createElement(NoOptionResultsComp_1.NoOptionResultsComp, { S: S });
|
|
76
74
|
}
|
|
77
|
-
if (isGroupedData(options)) {
|
|
75
|
+
if ((0, exports.isGroupedData)(options)) {
|
|
78
76
|
return (react_1.default.createElement(react_1.Fragment, null, options.map(function (group, index) { return (react_1.default.createElement(ListGroup_1.ListGroup, { id: id, key: "group-".concat(index), group: group, index: index, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName: optionsClassName, invert: invert, S: S, observerRef: observerRef, isMulti: isMulti, isTagsStyle: isTagsStyle, setFocusSelectTagsInput: setFocusSelectTagsInput, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus, disableShadow: disableShadow })); })));
|
|
79
77
|
}
|
|
80
78
|
return options.map(function (option, index) { return (react_1.default.createElement(ListItem_1.ListItem, { key: option.value, option: option, isSelected: (!option.loading && (value === null || value === void 0 ? void 0 : value.value) === option.value), isFocussed: focussedOp === index, index: index, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: function () {
|
|
@@ -81,5 +81,5 @@ exports.StyledStarWrapper = styled_components_1.default.div(templateObject_8 ||
|
|
|
81
81
|
var highlight = _a.highlight;
|
|
82
82
|
return highlight === "secondary" ? yellow : highlight === "primary" ? green : white;
|
|
83
83
|
});
|
|
84
|
-
exports.StyledMetaBlockWrapper = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: ", ";\n
|
|
84
|
+
exports.StyledMetaBlockWrapper = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: ", ";\n padding-top: 0.2rem;\n"], ["\n color: ", ";\n padding-top: 0.2rem;\n"])), grey50);
|
|
85
85
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|