@xqmsg/ui-core 0.19.2 → 0.19.4
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/icons/index.d.ts +2 -1
- package/dist/components/icons/services/index.d.ts +8 -0
- package/dist/components/input/StackedSelect/index.d.ts +1 -0
- package/dist/components/input/index.d.ts +2 -1
- package/dist/components/navigation/index.d.ts +1 -1
- package/dist/ui-core.cjs.development.js +49 -19
- 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 +50 -21
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/icons/index.tsx +2 -0
- package/src/components/icons/services/index.tsx +13 -0
- package/src/components/icons/services/services.svg +3 -0
- package/src/components/input/StackedSelect/index.tsx +6 -4
- package/src/components/input/index.tsx +3 -0
- package/src/components/navigation/index.tsx +9 -7
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':
|
|
@@ -2715,6 +2711,37 @@ var Trash = function Trash(_ref) {
|
|
|
2715
2711
|
});
|
|
2716
2712
|
};
|
|
2717
2713
|
|
|
2714
|
+
var _path$u;
|
|
2715
|
+
function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$v.apply(this, arguments); }
|
|
2716
|
+
var SvgServices = function SvgServices(props, ref) {
|
|
2717
|
+
return /*#__PURE__*/createElement("svg", _extends$v({
|
|
2718
|
+
width: 14,
|
|
2719
|
+
height: 14,
|
|
2720
|
+
viewBox: "0 0 14 14",
|
|
2721
|
+
fill: "none",
|
|
2722
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2723
|
+
ref: ref
|
|
2724
|
+
}, props), _path$u || (_path$u = /*#__PURE__*/createElement("path", {
|
|
2725
|
+
d: "M8.5 3.058c0-.237.124-.45.267-.64.148-.193.233-.422.233-.668C9 1.06 8.328.5 7.5.5S6 1.06 6 1.75c0 .246.085.475.233.669.143.188.267.402.267.639v0c0 .24-.197.435-.438.428a32.26 32.26 0 0 1-2.775-.2c.124 1.076.195 2.167.21 3.272A.437.437 0 0 1 3.058 7v0c-.237 0-.45-.124-.64-.267A1.098 1.098 0 0 0 1.75 6.5C1.06 6.5.5 7.172.5 8s.56 1.5 1.25 1.5c.246 0 .475-.085.669-.233.188-.143.402-.267.639-.267v0c.206 0 .37.174.355.38a32.022 32.022 0 0 1-.429 3.37 32.23 32.23 0 0 0 3.078.236.427.427 0 0 0 .438-.428v0c0-.237-.124-.45-.267-.64A1.098 1.098 0 0 1 6 11.25c0-.69.672-1.25 1.5-1.25.829 0 1.5.56 1.5 1.25 0 .246-.085.475-.232.669-.144.188-.268.402-.268.639v0c0 .222.185.4.407.386a32.068 32.068 0 0 0 3.618-.42c.18-1.031.31-2.08.388-3.144a.355.355 0 0 0-.355-.38v0c-.237 0-.45.124-.64.268a1.098 1.098 0 0 1-.668.232C10.56 9.5 10 8.828 10 8s.56-1.5 1.25-1.5c.246 0 .476.085.669.233.188.143.402.267.639.267v0a.437.437 0 0 0 .44-.442c-.017-1.209-.1-2.4-.247-3.573a32.06 32.06 0 0 1-3.844.459.385.385 0 0 1-.407-.386v0Z",
|
|
2726
|
+
stroke: "#0082FF",
|
|
2727
|
+
strokeLinecap: "round",
|
|
2728
|
+
strokeLinejoin: "round"
|
|
2729
|
+
})));
|
|
2730
|
+
};
|
|
2731
|
+
var ForwardRef$u = /*#__PURE__*/forwardRef(SvgServices);
|
|
2732
|
+
var Memo$u = /*#__PURE__*/memo(ForwardRef$u);
|
|
2733
|
+
|
|
2734
|
+
/**
|
|
2735
|
+
* A functional React component utilized to render the `Services` icon component
|
|
2736
|
+
*/
|
|
2737
|
+
|
|
2738
|
+
var Services = function Services(_ref) {
|
|
2739
|
+
var boxSize = _ref.boxSize;
|
|
2740
|
+
return /*#__PURE__*/React__default.createElement(Memo$u, {
|
|
2741
|
+
boxSize: boxSize
|
|
2742
|
+
});
|
|
2743
|
+
};
|
|
2744
|
+
|
|
2718
2745
|
/**
|
|
2719
2746
|
* A functional React component utilized to render the `BorderedBox` component
|
|
2720
2747
|
*/
|
|
@@ -2918,18 +2945,20 @@ var NavigationMenuItem = function NavigationMenuItem(_ref) {
|
|
|
2918
2945
|
|
|
2919
2946
|
var NavigationMenu = function NavigationMenu(_ref) {
|
|
2920
2947
|
var groupedMenuItems = _ref.groupedMenuItems,
|
|
2921
|
-
|
|
2922
|
-
defaultSelectedMenuItem = _ref$defaultSelectedM === void 0 ? '' : _ref$defaultSelectedM;
|
|
2948
|
+
selectedMenuItem = _ref.selectedMenuItem;
|
|
2923
2949
|
var sortedGroupedMenuItems = useMemo(function () {
|
|
2924
2950
|
return groupedMenuItems == null ? void 0 : groupedMenuItems.sort(function (a, b) {
|
|
2925
2951
|
return a.groupSortValue - b.groupSortValue;
|
|
2926
2952
|
});
|
|
2927
2953
|
}, [groupedMenuItems]);
|
|
2928
2954
|
|
|
2929
|
-
var _useState = useState(
|
|
2930
|
-
|
|
2955
|
+
var _useState = useState(''),
|
|
2956
|
+
_selectedMenuItem = _useState[0],
|
|
2931
2957
|
setSelectedMenuItem = _useState[1];
|
|
2932
2958
|
|
|
2959
|
+
useEffect(function () {
|
|
2960
|
+
if (selectedMenuItem) setSelectedMenuItem(selectedMenuItem);
|
|
2961
|
+
}, [selectedMenuItem]);
|
|
2933
2962
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
2934
2963
|
bg: "#7474800D",
|
|
2935
2964
|
py: "32px",
|
|
@@ -2948,7 +2977,7 @@ var NavigationMenu = function NavigationMenu(_ref) {
|
|
|
2948
2977
|
}), menuItemGroup.groupMenuItems.map(function (item, idx) {
|
|
2949
2978
|
return /*#__PURE__*/React__default.createElement(NavigationMenuItem, Object.assign({}, item, {
|
|
2950
2979
|
key: idx,
|
|
2951
|
-
isSelected:
|
|
2980
|
+
isSelected: _selectedMenuItem === item.label,
|
|
2952
2981
|
onClick: function onClick() {
|
|
2953
2982
|
return setSelectedMenuItem(item.label);
|
|
2954
2983
|
}
|
|
@@ -4436,5 +4465,5 @@ function formatErrorResponse(error) {
|
|
|
4436
4465
|
};
|
|
4437
4466
|
}
|
|
4438
4467
|
|
|
4439
|
-
export { Banner, Breadcrumbs, Button, Checkmark, ChevronDown, ChevronRight, Clock, Close, Dropdown$1 as Dropdown, Error$1 as Error, FileFill, FileOutline, FolderAddFill, FolderAddOutline, FolderFill, FolderOutline, Form, FormSection, Google, GoogleButton, GoogleDrive, Group, Home, Image, Input, Layout, Link, LoadingIndicator, Menu, Microsoft, MicrosoftButton, MicrosoftOneDrive, NavigationMenu, Neutral, Positive, Search, Settings, SpinnerButton, Table, TableFill, TableOutline, TabsWrapper, Text, Toolbar, Trash, Warning, XQThemeProvider, colors, formatErrorResponse, useToast };
|
|
4468
|
+
export { Banner, Breadcrumbs, Button, Checkmark, ChevronDown, ChevronRight, Clock, Close, Dropdown$1 as Dropdown, Error$1 as Error, FileFill, FileOutline, FolderAddFill, FolderAddOutline, FolderFill, FolderOutline, Form, FormSection, Google, GoogleButton, GoogleDrive, Group, Home, Image, Input, Layout, Link, LoadingIndicator, Menu, Microsoft, MicrosoftButton, MicrosoftOneDrive, NavigationMenu, Neutral, Positive, Search, Services, Settings, SpinnerButton, Table, TableFill, TableOutline, TabsWrapper, Text, Toolbar, Trash, Warning, XQThemeProvider, colors, formatErrorResponse, useToast };
|
|
4440
4469
|
//# sourceMappingURL=ui-core.esm.js.map
|