@xqmsg/ui-core 0.16.7 → 0.16.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/ui-core.cjs.development.js +14 -10
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +14 -10
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/input/Input.stories.tsx +2 -55
- package/src/components/input/StackedMultiSelect/index.tsx +2 -4
- package/src/components/input/StackedPilledInput/index.tsx +20 -8
package/dist/ui-core.esm.js
CHANGED
|
@@ -1022,10 +1022,6 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1022
1022
|
debouncedSearchValue = _useState9[0],
|
|
1023
1023
|
setDebouncedSearchValue = _useState9[1];
|
|
1024
1024
|
|
|
1025
|
-
console.log({
|
|
1026
|
-
searchValue: searchValue,
|
|
1027
|
-
debouncedSearchValue: debouncedSearchValue
|
|
1028
|
-
});
|
|
1029
1025
|
var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
|
|
1030
1026
|
useEffect(function () {
|
|
1031
1027
|
if (window.innerHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
|
|
@@ -1039,12 +1035,12 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1039
1035
|
}); // gets latest watched form value (common delimited) from RHF state and creates a list
|
|
1040
1036
|
|
|
1041
1037
|
useEffect(function () {
|
|
1042
|
-
if (watchedValue !== undefined && !watchedValue.length) {
|
|
1038
|
+
if (watchedValue !== undefined && !watchedValue.length && !isInit) {
|
|
1043
1039
|
setLocalValues([]);
|
|
1044
1040
|
setIsInit(true);
|
|
1045
1041
|
}
|
|
1046
1042
|
|
|
1047
|
-
if (watchedValue !== undefined && watchedValue != null && watchedValue.length) {
|
|
1043
|
+
if (watchedValue !== undefined && watchedValue != null && watchedValue.length && !isInit) {
|
|
1048
1044
|
if (shouldSideScroll) {
|
|
1049
1045
|
var _scrollRef$current;
|
|
1050
1046
|
|
|
@@ -1344,7 +1340,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1344
1340
|
}, [latestTokenElement, watchedValue]);
|
|
1345
1341
|
|
|
1346
1342
|
var onHandleKeyDown = function onHandleKeyDown(e) {
|
|
1347
|
-
if (
|
|
1343
|
+
if (e.key === ' ' || e.key === 'Enter' || e.key === ',' || e.key === 'Tab') {
|
|
1348
1344
|
if (e.key === 'Enter' && !localValue.trim().length && tokenIndex !== null) {
|
|
1349
1345
|
setLocalValue(lastestFormValueToArray[tokenIndex]);
|
|
1350
1346
|
|
|
@@ -1448,7 +1444,10 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1448
1444
|
|
|
1449
1445
|
useOutsideClick({
|
|
1450
1446
|
ref: inputWrapperRef,
|
|
1451
|
-
handler:
|
|
1447
|
+
handler: function handler() {
|
|
1448
|
+
onBlur();
|
|
1449
|
+
console.log('hi');
|
|
1450
|
+
}
|
|
1452
1451
|
});
|
|
1453
1452
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
1454
1453
|
position: "relative"
|
|
@@ -1461,6 +1460,10 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1461
1460
|
alignItems: "center",
|
|
1462
1461
|
justifyContent: "space-between",
|
|
1463
1462
|
onClick: function onClick() {
|
|
1463
|
+
if (isFocussed && tokenIndex !== null) {
|
|
1464
|
+
setTokenIndex(null);
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1464
1467
|
if (!disabled) {
|
|
1465
1468
|
var _inputRef$current;
|
|
1466
1469
|
|
|
@@ -1495,7 +1498,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1495
1498
|
border: tokenIndex === index ? "1px solid " + colors.border.focus : 'none',
|
|
1496
1499
|
borderRadius: "full",
|
|
1497
1500
|
onClick: function onClick() {
|
|
1498
|
-
return
|
|
1501
|
+
return setTokenIndex(index);
|
|
1499
1502
|
},
|
|
1500
1503
|
width: "100%",
|
|
1501
1504
|
id: name + "_token_" + index
|
|
@@ -1534,7 +1537,8 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1534
1537
|
return setIsFocussed(true);
|
|
1535
1538
|
},
|
|
1536
1539
|
onBlur: function onBlur() {
|
|
1537
|
-
|
|
1540
|
+
setIsFocussed(false);
|
|
1541
|
+
return setTokenIndex(null);
|
|
1538
1542
|
}
|
|
1539
1543
|
}))));
|
|
1540
1544
|
});
|