@xqmsg/ui-core 0.24.11 → 0.25.0

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.
@@ -1266,6 +1266,7 @@ var Close = function Close(_ref) {
1266
1266
  return /*#__PURE__*/React__default.createElement(Memo$7, {
1267
1267
  width: boxSize,
1268
1268
  height: boxSize,
1269
+ flexBasis: boxSize,
1269
1270
  onClick: onClick,
1270
1271
  cursor: "pointer"
1271
1272
  });
@@ -1278,7 +1279,11 @@ var Token = function Token(_ref) {
1278
1279
  _ref$isMobile = _ref.isMobile,
1279
1280
  isMobile = _ref$isMobile === void 0 ? false : _ref$isMobile,
1280
1281
  _ref$truncateLength = _ref.truncateLength,
1281
- truncateLength = _ref$truncateLength === void 0 ? 15 : _ref$truncateLength;
1282
+ truncateLength = _ref$truncateLength === void 0 ? 15 : _ref$truncateLength,
1283
+ _ref$showClose = _ref.showClose,
1284
+ showClose = _ref$showClose === void 0 ? true : _ref$showClose,
1285
+ _ref$maxWidth = _ref.maxWidth,
1286
+ maxWidth = _ref$maxWidth === void 0 ? 'auto' : _ref$maxWidth;
1282
1287
  return /*#__PURE__*/React__default.createElement(Flex, {
1283
1288
  key: label,
1284
1289
  borderRadius: 'full',
@@ -1286,6 +1291,7 @@ var Token = function Token(_ref) {
1286
1291
  alignItems: "center",
1287
1292
  width: "fit-content",
1288
1293
  w: "auto",
1294
+ maxWidth: maxWidth,
1289
1295
  h: isMobile ? '18px' : '16px',
1290
1296
  pl: "6px",
1291
1297
  pr: "2px",
@@ -1293,13 +1299,17 @@ var Token = function Token(_ref) {
1293
1299
  position: "relative"
1294
1300
  }, /*#__PURE__*/React__default.createElement(Text$2, {
1295
1301
  whiteSpace: "nowrap",
1302
+ wordBreak: "break-word",
1296
1303
  color: colors.label.primary.light,
1297
1304
  fontSize: isMobile ? '17px' : '13px',
1298
- pr: "4px"
1305
+ pr: "4px",
1306
+ maxWidth: maxWidth,
1307
+ overflow: "hidden",
1308
+ textOverflow: "ellipsis"
1299
1309
  }, truncate(label.trim(), {
1300
1310
  length: truncateLength,
1301
1311
  omission: '...'
1302
- })), /*#__PURE__*/React__default.createElement(Close, {
1312
+ })), showClose && /*#__PURE__*/React__default.createElement(Close, {
1303
1313
  boxSize: isMobile ? '17px' : '11px',
1304
1314
  onClick: onDelete
1305
1315
  }));
@@ -1613,7 +1623,9 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1613
1623
  separators = _ref2$separators === void 0 ? ['Enter', ' ', ',', ';', 'Tab'] : _ref2$separators,
1614
1624
  variant = _ref2.variant,
1615
1625
  label = _ref2.label,
1616
- truncatePillLength = _ref2.truncatePillLength;
1626
+ truncatePillLength = _ref2.truncatePillLength,
1627
+ _ref2$mode = _ref2.mode,
1628
+ mode = _ref2$mode === void 0 ? 'scroll' : _ref2$mode;
1617
1629
  var watchedValue = useWatch({
1618
1630
  control: control,
1619
1631
  name: name
@@ -1634,6 +1646,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1634
1646
  localValue = _useState4[0],
1635
1647
  setLocalValue = _useState4[1];
1636
1648
  var latestTokenElement = document.getElementById(name + "_token_" + (lastestFormValueToArray.length - 1));
1649
+ var scrollMode = mode === 'scroll';
1637
1650
  // gets latest watched form value (common delimited) from RHF state and creates a list
1638
1651
  useEffect(function () {
1639
1652
  if (watchedValue !== undefined && !watchedValue.length) {
@@ -1785,11 +1798,13 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1785
1798
  bg: disabled ? colors.fill.light.quaternary : '#ffffff',
1786
1799
  cursor: disabled ? 'not-allowed' : 'pointer',
1787
1800
  ref: inputWrapperRef,
1788
- h: isMobile ? '48px' : '26px'
1801
+ h: isMobile ? '48px' : scrollMode ? '26px' : 'auto',
1802
+ minH: isMobile ? '48px' : '26px'
1789
1803
  }, /*#__PURE__*/React__default.createElement(Flex, {
1790
1804
  h: "100%",
1791
1805
  alignItems: "center",
1792
- overflowX: "scroll",
1806
+ overflowX: scrollMode ? 'scroll' : 'hidden',
1807
+ flexWrap: scrollMode ? 'nowrap' : 'wrap',
1793
1808
  overflowY: "hidden",
1794
1809
  maxWidth: isFocussed ? '80%' : '100%',
1795
1810
  style: {
@@ -1813,10 +1828,13 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1813
1828
  onClick: function onClick() {
1814
1829
  return setTokenIndex(index);
1815
1830
  },
1816
- width: "100%",
1831
+ width: scrollMode ? '100%' : 'auto',
1832
+ maxWidth: '100%',
1817
1833
  id: name + "_token_" + index
1818
1834
  }, /*#__PURE__*/React__default.createElement(Token, {
1835
+ maxWidth: '100%',
1819
1836
  label: label,
1837
+ showClose: !isFocussed || tokenIndex === index,
1820
1838
  onDelete: function onDelete(e) {
1821
1839
  e.stopPropagation();
1822
1840
  e.preventDefault();
@@ -1944,7 +1962,9 @@ function Input(_ref) {
1944
1962
  _ref$loadingOptions = _ref.loadingOptions,
1945
1963
  loadingOptions = _ref$loadingOptions === void 0 ? false : _ref$loadingOptions,
1946
1964
  truncatePillLength = _ref.truncatePillLength,
1947
- searchable = _ref.searchable;
1965
+ searchable = _ref.searchable,
1966
+ _ref$overflowMode = _ref.overflowMode,
1967
+ overflowMode = _ref$overflowMode === void 0 ? 'scroll' : _ref$overflowMode;
1948
1968
  function selectedInputField(onChange, onBlur, ref, value) {
1949
1969
  switch (inputType) {
1950
1970
  case 'text':
@@ -2075,7 +2095,8 @@ function Input(_ref) {
2075
2095
  variant: variant,
2076
2096
  label: label,
2077
2097
  separators: separators,
2078
- truncatePillLength: truncatePillLength
2098
+ truncatePillLength: truncatePillLength,
2099
+ mode: overflowMode
2079
2100
  });
2080
2101
  case 'switch':
2081
2102
  return /*#__PURE__*/React__default.createElement(StackedSwitch, {
@@ -3581,7 +3602,10 @@ function SimpleTable(_ref) {
3581
3602
  headers = _ref.headers,
3582
3603
  body = _ref.body,
3583
3604
  loading = _ref.loading,
3584
- loadMore = _ref.loadMore;
3605
+ loadMore = _ref.loadMore,
3606
+ _ref$layout = _ref.layout,
3607
+ layout = _ref$layout === void 0 ? 'auto' : _ref$layout,
3608
+ columnsWidths = _ref.columnsWidths;
3585
3609
  var columnsAsConst = generateTableColumnsAsConst(columns);
3586
3610
  return /*#__PURE__*/React__default.createElement(TableContainer, {
3587
3611
  border: "none",
@@ -3593,20 +3617,18 @@ function SimpleTable(_ref) {
3593
3617
  width: "100%",
3594
3618
  style: {
3595
3619
  borderCollapse: 'separate',
3596
- borderSpacing: '0px'
3620
+ borderSpacing: '0px',
3621
+ tableLayout: layout
3597
3622
  }
3598
- }, headers && /*#__PURE__*/React__default.createElement(Thead, null, /*#__PURE__*/React__default.createElement(Tr, {
3623
+ }, (headers || columnsWidths) && /*#__PURE__*/React__default.createElement(Thead, null, /*#__PURE__*/React__default.createElement(Tr, {
3599
3624
  _odd: {
3600
3625
  bg: colors.label.primary.dark
3601
3626
  }
3602
3627
  }, columnsAsConst.map(function (column, idx) {
3603
- return (
3604
- /*#__PURE__*/
3605
- // @ts-ignore
3606
- React__default.createElement(Th, {
3607
- key: idx
3608
- }, headers[column])
3609
- );
3628
+ return /*#__PURE__*/React__default.createElement(Th, {
3629
+ key: idx,
3630
+ width: columnsWidths == null ? void 0 : columnsWidths[column]
3631
+ }, headers && headers[column]);
3610
3632
  }))), /*#__PURE__*/React__default.createElement(Tbody, null, body.map(function (row, idx) {
3611
3633
  return /*#__PURE__*/React__default.createElement(Tr, {
3612
3634
  key: idx