@mmb-digital/ds-lilly 0.3.17 → 0.3.18-beta1
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/.DS_Store +0 -0
- package/dist/ds-lilly.css.map +1 -0
- package/dist/ds-lilly.js +11 -9
- package/dist/ds-lilly.js.map +1 -0
- package/package.json +1 -1
package/dist/ds-lilly.js
CHANGED
|
@@ -107074,8 +107074,6 @@ var RadioGroup = function (_a) {
|
|
|
107074
107074
|
|
|
107075
107075
|
|
|
107076
107076
|
// CONCATENATED MODULE: ./src/components/Form/Select2/Select2.tsx
|
|
107077
|
-
// TODO: enable eslint react-hooks/exhaustive-deps
|
|
107078
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
107079
107077
|
var Select2_assign = (undefined && undefined.__assign) || function () {
|
|
107080
107078
|
Select2_assign = Object.assign || function(t) {
|
|
107081
107079
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -107123,8 +107121,8 @@ var Select2 = function (_a) {
|
|
|
107123
107121
|
return Select2_spreadArray([{ item: -1, category: -1 }], map);
|
|
107124
107122
|
}
|
|
107125
107123
|
return map;
|
|
107126
|
-
}, [items, isCategorised]);
|
|
107127
|
-
var getItemIndexByValue = function (val) {
|
|
107124
|
+
}, [items, isCategorised, emptyValueLabel]);
|
|
107125
|
+
var getItemIndexByValue = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function (val) {
|
|
107128
107126
|
if (val === '' || val === undefined) {
|
|
107129
107127
|
return { item: -1, category: -1 };
|
|
107130
107128
|
}
|
|
@@ -107142,14 +107140,18 @@ var Select2 = function (_a) {
|
|
|
107142
107140
|
}
|
|
107143
107141
|
var item = items.findIndex(function (item) { return item.value === val && !item.isDisabled; });
|
|
107144
107142
|
return { item: item, category: -1 };
|
|
107145
|
-
};
|
|
107146
|
-
var getItemIndexPosition = function (index) {
|
|
107143
|
+
}, [isCategorised, items]);
|
|
107144
|
+
var getItemIndexPosition = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function (index) {
|
|
107147
107145
|
return itemsIndex.findIndex(function (_a) {
|
|
107148
107146
|
var category = _a.category, item = _a.item;
|
|
107149
107147
|
return index.item === item && index.category === category;
|
|
107150
107148
|
});
|
|
107151
|
-
};
|
|
107149
|
+
}, [itemsIndex]);
|
|
107152
107150
|
Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
|
|
107151
|
+
if (value === undefined) {
|
|
107152
|
+
setButtonValue(null);
|
|
107153
|
+
return;
|
|
107154
|
+
}
|
|
107153
107155
|
var itemIndex = getItemIndexByValue(value);
|
|
107154
107156
|
var itemIndexPosition = getItemIndexPosition(itemIndex);
|
|
107155
107157
|
setCurrentItemPosition(itemIndexPosition);
|
|
@@ -107160,12 +107162,12 @@ var Select2 = function (_a) {
|
|
|
107160
107162
|
: items[item];
|
|
107161
107163
|
selectedItem && setButtonValue(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(SelectedOption, Select2_assign({ displayDetails: displayDetails }, selectedItem)));
|
|
107162
107164
|
}
|
|
107163
|
-
}, [value, items]);
|
|
107165
|
+
}, [value, items, displayDetails, isCategorised, getItemIndexByValue, getItemIndexPosition]);
|
|
107164
107166
|
Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
|
|
107165
107167
|
var itemIndex = getItemIndexByValue(value);
|
|
107166
107168
|
var itemIndexPosition = getItemIndexPosition(itemIndex);
|
|
107167
107169
|
setCurrentItemPosition(itemIndexPosition);
|
|
107168
|
-
}, [isDropdownVisible]);
|
|
107170
|
+
}, [isDropdownVisible, getItemIndexByValue, value, getItemIndexPosition]);
|
|
107169
107171
|
var scrollToItem = function (item, category) {
|
|
107170
107172
|
var _a;
|
|
107171
107173
|
if (category === void 0) { category = -1; }
|