@xqmsg/ui-core 0.16.6 → 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/theme/components/form.d.ts +1 -3
- package/dist/ui-core.cjs.development.js +16 -15
- 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 +16 -15
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/input/Input.stories.tsx +1 -0
- package/src/components/input/StackedMultiSelect/index.tsx +2 -4
- package/src/components/input/StackedPilledInput/index.tsx +20 -8
- package/src/components/input/components/label/index.tsx +1 -1
- package/src/theme/components/form.ts +1 -3
|
@@ -1029,10 +1029,6 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1029
1029
|
debouncedSearchValue = _useState9[0],
|
|
1030
1030
|
setDebouncedSearchValue = _useState9[1];
|
|
1031
1031
|
|
|
1032
|
-
console.log({
|
|
1033
|
-
searchValue: searchValue,
|
|
1034
|
-
debouncedSearchValue: debouncedSearchValue
|
|
1035
|
-
});
|
|
1036
1032
|
var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
|
|
1037
1033
|
React.useEffect(function () {
|
|
1038
1034
|
if (window.innerHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
|
|
@@ -1046,12 +1042,12 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1046
1042
|
}); // gets latest watched form value (common delimited) from RHF state and creates a list
|
|
1047
1043
|
|
|
1048
1044
|
React.useEffect(function () {
|
|
1049
|
-
if (watchedValue !== undefined && !watchedValue.length) {
|
|
1045
|
+
if (watchedValue !== undefined && !watchedValue.length && !isInit) {
|
|
1050
1046
|
setLocalValues([]);
|
|
1051
1047
|
setIsInit(true);
|
|
1052
1048
|
}
|
|
1053
1049
|
|
|
1054
|
-
if (watchedValue !== undefined && watchedValue != null && watchedValue.length) {
|
|
1050
|
+
if (watchedValue !== undefined && watchedValue != null && watchedValue.length && !isInit) {
|
|
1055
1051
|
if (shouldSideScroll) {
|
|
1056
1052
|
var _scrollRef$current;
|
|
1057
1053
|
|
|
@@ -1351,7 +1347,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1351
1347
|
}, [latestTokenElement, watchedValue]);
|
|
1352
1348
|
|
|
1353
1349
|
var onHandleKeyDown = function onHandleKeyDown(e) {
|
|
1354
|
-
if (
|
|
1350
|
+
if (e.key === ' ' || e.key === 'Enter' || e.key === ',' || e.key === 'Tab') {
|
|
1355
1351
|
if (e.key === 'Enter' && !localValue.trim().length && tokenIndex !== null) {
|
|
1356
1352
|
setLocalValue(lastestFormValueToArray[tokenIndex]);
|
|
1357
1353
|
|
|
@@ -1455,7 +1451,10 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1455
1451
|
|
|
1456
1452
|
react.useOutsideClick({
|
|
1457
1453
|
ref: inputWrapperRef,
|
|
1458
|
-
handler:
|
|
1454
|
+
handler: function handler() {
|
|
1455
|
+
onBlur();
|
|
1456
|
+
console.log('hi');
|
|
1457
|
+
}
|
|
1459
1458
|
});
|
|
1460
1459
|
return /*#__PURE__*/React__default.createElement(react.Box, {
|
|
1461
1460
|
position: "relative"
|
|
@@ -1468,6 +1467,10 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1468
1467
|
alignItems: "center",
|
|
1469
1468
|
justifyContent: "space-between",
|
|
1470
1469
|
onClick: function onClick() {
|
|
1470
|
+
if (isFocussed && tokenIndex !== null) {
|
|
1471
|
+
setTokenIndex(null);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1471
1474
|
if (!disabled) {
|
|
1472
1475
|
var _inputRef$current;
|
|
1473
1476
|
|
|
@@ -1502,7 +1505,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1502
1505
|
border: tokenIndex === index ? "1px solid " + colors.border.focus : 'none',
|
|
1503
1506
|
borderRadius: "full",
|
|
1504
1507
|
onClick: function onClick() {
|
|
1505
|
-
return
|
|
1508
|
+
return setTokenIndex(index);
|
|
1506
1509
|
},
|
|
1507
1510
|
width: "100%",
|
|
1508
1511
|
id: name + "_token_" + index
|
|
@@ -1541,7 +1544,8 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1541
1544
|
return setIsFocussed(true);
|
|
1542
1545
|
},
|
|
1543
1546
|
onBlur: function onBlur() {
|
|
1544
|
-
|
|
1547
|
+
setIsFocussed(false);
|
|
1548
|
+
return setTokenIndex(null);
|
|
1545
1549
|
}
|
|
1546
1550
|
}))));
|
|
1547
1551
|
});
|
|
@@ -1581,8 +1585,7 @@ var Label$1 = function Label(_ref) {
|
|
|
1581
1585
|
isRequired = _ref.isRequired,
|
|
1582
1586
|
label = _ref.label;
|
|
1583
1587
|
return /*#__PURE__*/React__default.createElement(react.FormLabel, {
|
|
1584
|
-
display: "flex"
|
|
1585
|
-
alignItems: "center"
|
|
1588
|
+
display: "flex"
|
|
1586
1589
|
}, label, isRequired && /*#__PURE__*/React__default.createElement(react.Box, {
|
|
1587
1590
|
ml: 1,
|
|
1588
1591
|
color: colors.label.error
|
|
@@ -2459,11 +2462,9 @@ function baseStyleRequiredIndicator() {
|
|
|
2459
2462
|
|
|
2460
2463
|
function baseStyleHelperText() {
|
|
2461
2464
|
return {
|
|
2462
|
-
position: 'absolute',
|
|
2463
|
-
color: colors.label.secondary.light,
|
|
2464
2465
|
mt: 1,
|
|
2465
2466
|
ml: 1,
|
|
2466
|
-
|
|
2467
|
+
color: colors.label.secondary.light,
|
|
2467
2468
|
fontSize: '13px'
|
|
2468
2469
|
};
|
|
2469
2470
|
}
|