@xqmsg/ui-core 0.14.4 → 0.14.5

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.
@@ -1,5 +1,5 @@
1
1
  import React__default, { useMemo, useCallback, useRef, useEffect, useState, memo, forwardRef, createElement } from 'react';
2
- import { Image, Alert as Alert$1, AlertDescription, Box, Flex, Button as Button$2, Text as Text$2, Icon as Icon$1, Spinner, InputGroup, Checkbox, Input as Input$2, RadioGroup, Radio, useOutsideClick, InputRightElement, Textarea as Textarea$1, Switch as Switch$1, FormLabel as FormLabel$1, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, TableContainer, Table as Table$2, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, extendTheme } from '@chakra-ui/react';
2
+ import { Image, Alert as Alert$1, AlertDescription, Box, Flex, Button as Button$2, Text as Text$2, Icon as Icon$1, Spinner, Checkbox, Input as Input$2, InputGroup, RadioGroup, Radio, useOutsideClick, InputRightElement, Textarea as Textarea$1, Switch as Switch$1, FormLabel as FormLabel$1, FormControl, FormErrorMessage, FormHelperText, SimpleGrid, useMediaQuery, Grid, GridItem, IconButton, Collapse, TableContainer, Table as Table$2, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, extendTheme } from '@chakra-ui/react';
3
3
  import { FormProvider, useWatch, Controller } from 'react-hook-form';
4
4
  import { truncate } from 'lodash-es';
5
5
  import { CloseIcon, HamburgerIcon } from '@chakra-ui/icons';
@@ -402,18 +402,15 @@ function Form(_ref) {
402
402
  * A functional React component utilized to render the `StackedCheckbox` component.
403
403
  */
404
404
 
405
- var StackedCheckboxGroup = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
406
- var options = _ref2.options;
407
- return /*#__PURE__*/React__default.createElement(InputGroup, null, options.map(function (option) {
408
- return /*#__PURE__*/React__default.createElement(Flex, {
409
- mr: "30px",
410
- alignItems: "center",
411
- key: option.value
412
- }, /*#__PURE__*/React__default.createElement(Checkbox, {
413
- ref: _ref,
414
- value: option.value
415
- }, option.label));
416
- }));
405
+ var StackedCheckbox = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref) {
406
+ var value = _ref2.value,
407
+ label = _ref2.label,
408
+ defaultValue = _ref2.defaultValue;
409
+ return /*#__PURE__*/React__default.createElement(Checkbox, {
410
+ ref: _ref,
411
+ value: String(value),
412
+ defaultChecked: Boolean(defaultValue)
413
+ }, label);
417
414
  });
418
415
 
419
416
  function _extends() {
@@ -1100,6 +1097,7 @@ var StackedSwitch = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
1100
1097
  var isRequired = _ref2.isRequired,
1101
1098
  _onChange = _ref2.onChange,
1102
1099
  value = _ref2.value;
1100
+ if (value === null) return null;
1103
1101
  return /*#__PURE__*/React__default.createElement(Switch$1, {
1104
1102
  size: "lg",
1105
1103
  ref: _ref,
@@ -1218,17 +1216,18 @@ function Input(_ref) {
1218
1216
  });
1219
1217
 
1220
1218
  case 'checkbox':
1221
- return /*#__PURE__*/React__default.createElement(StackedCheckboxGroup, {
1219
+ return /*#__PURE__*/React__default.createElement(StackedCheckbox, {
1222
1220
  className: "input-" + inputType + " " + (className != null ? className : ''),
1223
1221
  name: name,
1224
1222
  id: name,
1225
1223
  isInvalid: isInvalid,
1226
- options: options,
1227
1224
  onChange: onChange,
1228
1225
  onBlur: onBlur,
1229
1226
  ref: ref,
1230
1227
  disabled: disabled,
1231
- value: value
1228
+ value: value,
1229
+ defaultValue: defaultValue,
1230
+ label: label
1232
1231
  });
1233
1232
 
1234
1233
  case 'multi-select':
@@ -1279,7 +1278,8 @@ function Input(_ref) {
1279
1278
  onChange: onChange,
1280
1279
  onBlur: onBlur,
1281
1280
  ref: ref,
1282
- value: value
1281
+ value: value,
1282
+ defaultValue: defaultValue
1283
1283
  });
1284
1284
 
1285
1285
  default:
@@ -1602,10 +1602,10 @@ function Table(_ref) {
1602
1602
  border: "none",
1603
1603
  overflowX: "auto",
1604
1604
  bg: "white",
1605
- width: "fit-content"
1605
+ width: "100%"
1606
1606
  }, /*#__PURE__*/React__default.createElement(Table$2, {
1607
1607
  variant: "unstyled",
1608
- width: "fit-content",
1608
+ width: "100%",
1609
1609
  style: {
1610
1610
  borderCollapse: 'separate',
1611
1611
  borderSpacing: '0px'