@xqmsg/ui-core 0.19.2 → 0.19.3
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/components/input/StackedSelect/index.d.ts +1 -0
- package/dist/components/input/index.d.ts +2 -1
- package/dist/ui-core.cjs.development.js +10 -14
- 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 +11 -15
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/input/StackedSelect/index.tsx +6 -4
- package/src/components/input/index.tsx +3 -0
package/dist/ui-core.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { memo, forwardRef, createElement, useMemo, useCallback,
|
|
1
|
+
import React__default, { memo, forwardRef, createElement, useMemo, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Button as Button$2, Alert as Alert$1, AlertDescription, Flex, Box, Text as Text$2, Spinner, Checkbox, InputGroup, Input as Input$2, RadioGroup, Radio, InputRightElement, Textarea as Textarea$1, useOutsideClick, Switch as Switch$1, FormLabel as FormLabel$1, Tooltip, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, Link as Link$2, Table as Table$2, Tbody, Tr, Td, TableContainer, Thead, Th, Tabs as Tabs$1, TabList, Tab, extendTheme, ChakraProvider, useToast as useToast$1 } from '@chakra-ui/react';
|
|
3
3
|
import { FormProvider, useWatch, Controller } from 'react-hook-form';
|
|
4
4
|
import { debounce, truncate } from 'lodash-es';
|
|
@@ -801,13 +801,6 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
801
801
|
}, DropdownContent);
|
|
802
802
|
};
|
|
803
803
|
|
|
804
|
-
var useDidMountEffect = function useDidMountEffect(func, deps) {
|
|
805
|
-
var didMount = useRef(false);
|
|
806
|
-
useEffect(function () {
|
|
807
|
-
if (didMount.current) func();else didMount.current = true; // eslint-disable-next-line
|
|
808
|
-
}, deps);
|
|
809
|
-
};
|
|
810
|
-
|
|
811
804
|
function useOnClickOutside(ref, handler) {
|
|
812
805
|
useEffect(function () {
|
|
813
806
|
var listener = function listener(event) {
|
|
@@ -865,7 +858,7 @@ var Dropdown$1 = function Dropdown(_ref) {
|
|
|
865
858
|
});
|
|
866
859
|
};
|
|
867
860
|
|
|
868
|
-
var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange", "disabled", "value"];
|
|
861
|
+
var _excluded$1 = ["isRequired", "options", "name", "setValue", "handleOnChange", "disabled", "value", "fullOptions"];
|
|
869
862
|
/**
|
|
870
863
|
* A functional React component utilized to render the `StackedSelect` component.
|
|
871
864
|
*/
|
|
@@ -880,6 +873,7 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
880
873
|
handleOnChange = _ref2.handleOnChange,
|
|
881
874
|
disabled = _ref2.disabled,
|
|
882
875
|
value = _ref2.value,
|
|
876
|
+
fullOptions = _ref2.fullOptions,
|
|
883
877
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
|
|
884
878
|
|
|
885
879
|
var dropdownRef = useRef(null);
|
|
@@ -923,13 +917,13 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
923
917
|
setPosition('bottom');
|
|
924
918
|
}
|
|
925
919
|
}, [boundingClientRect]);
|
|
926
|
-
|
|
927
|
-
var
|
|
920
|
+
useEffect(function () {
|
|
921
|
+
var _find$label, _find;
|
|
928
922
|
|
|
929
|
-
setSelectedOption((
|
|
923
|
+
setSelectedOption((_find$label = (_find = (fullOptions || options).find(function (option) {
|
|
930
924
|
return option.value === value;
|
|
931
|
-
})) == null ? void 0 :
|
|
932
|
-
}, [value]);
|
|
925
|
+
})) == null ? void 0 : _find.label) != null ? _find$label : '');
|
|
926
|
+
}, [fullOptions, value]);
|
|
933
927
|
useOnClickOutside(dropdownRef, function () {
|
|
934
928
|
return setIsFocussed(false);
|
|
935
929
|
});
|
|
@@ -1803,6 +1797,7 @@ function Input(_ref) {
|
|
|
1803
1797
|
isRequired = _ref.isRequired,
|
|
1804
1798
|
maxLength = _ref.maxLength,
|
|
1805
1799
|
defaultValue = _ref.defaultValue,
|
|
1800
|
+
fullOptions = _ref.fullOptions,
|
|
1806
1801
|
control = _ref.control,
|
|
1807
1802
|
disabled = _ref.disabled,
|
|
1808
1803
|
rightElement = _ref.rightElement,
|
|
@@ -1863,7 +1858,8 @@ function Input(_ref) {
|
|
|
1863
1858
|
disabled: disabled,
|
|
1864
1859
|
value: value,
|
|
1865
1860
|
defaultValue: defaultValue,
|
|
1866
|
-
placeholder: placeholder
|
|
1861
|
+
placeholder: placeholder,
|
|
1862
|
+
fullOptions: fullOptions
|
|
1867
1863
|
});
|
|
1868
1864
|
|
|
1869
1865
|
case 'textarea':
|