@ballistix.digital/react-components 0.5.3 → 0.5.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/index.js CHANGED
@@ -716,7 +716,7 @@ var InputGroupForm = function (props) {
716
716
  var styles = handleGenerateStyle();
717
717
  var invalidIcon = (jsxRuntime.jsx(solid.ExclamationCircleIcon, { className: "h-5 w-5 text-red-500", "aria-hidden": "true" }));
718
718
  return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: styles.head, children: [label && (jsxRuntime.jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsxRuntime.jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxRuntime.jsxs("div", { className: styles.body, children: [leading && jsxRuntime.jsx("div", { className: styles.leading, children: leading }), !htmlType ||
719
- (htmlType !== 'area' && (jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx("input", { type: mask$1 !== undefined ? 'text' : htmlType, ref: mask$1 && ref, name: name, id: name, className: toClassName(styles.input, htmlType === 'color' && '!h-10'), placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, min: min, max: max, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur }), htmlType === 'text' && !trailing && isValid && onClear && (jsxRuntime.jsx("div", { className: "right-5 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsxRuntime.jsx(IconElement, { accessor: "times", className: "text-gray-500" }) }))] }))), htmlType === 'area' && (jsxRuntime.jsx("textarea", { rows: rows, name: name, id: name, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur })), type === 'floored' && (jsxRuntime.jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && jsxRuntime.jsx("p", { className: styles.error, children: error })] })] }));
719
+ (htmlType !== 'area' && (jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx("input", { type: mask$1 !== undefined ? 'text' : htmlType, ref: mask$1 && ref, name: name, id: name, className: toClassName(styles.input, htmlType === 'color' && '!h-10'), placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, min: min, max: max, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur }), htmlType === 'text' && !trailing && isValid && onClear && (jsxRuntime.jsx("div", { className: "right-5 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsxRuntime.jsx(IconElement, { accessor: "times", className: "text-gray-500" }) })), htmlType === 'date' && !trailing && isValid && onClear && (jsxRuntime.jsx("div", { className: "right-10 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsxRuntime.jsx(IconElement, { accessor: "times", className: "text-gray-500" }) }))] }))), htmlType === 'area' && (jsxRuntime.jsx("textarea", { rows: rows, name: name, id: name, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur })), type === 'floored' && (jsxRuntime.jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && jsxRuntime.jsx("p", { className: styles.error, children: error })] })] }));
720
720
  };
721
721
 
722
722
  var base$k = {
@@ -1516,8 +1516,16 @@ var styles$g = {
1516
1516
 
1517
1517
  var getTableState = function (tableName) {
1518
1518
  var savedState = localStorage.getItem("TableList.".concat(tableName, ".state"));
1519
- if (savedState && isValidState(JSON.parse(savedState))) {
1520
- return JSON.parse(savedState);
1519
+ try {
1520
+ if (savedState && isValidState(JSON.parse(savedState))) {
1521
+ return JSON.parse(savedState);
1522
+ }
1523
+ }
1524
+ catch (e) {
1525
+ // Something went wrong with parsing the saved state; remove it and let the table use the default state
1526
+ console.error(e);
1527
+ localStorage.removeItem("TableList.".concat(tableName, ".state"));
1528
+ return undefined;
1521
1529
  }
1522
1530
  };
1523
1531
  var setTableState = function (tableName, state) {
@@ -1545,9 +1553,7 @@ var isValidState = function (state) {
1545
1553
 
1546
1554
  var TableList2 = function (props) {
1547
1555
  var _a, _b, _c, _d;
1548
- var id = props.id, config = props.table, head = props.head, foot = props.foot, isLoading = props.isLoading,
1549
- //onRowClick,
1550
- onChange = props.onChange, stylesOverrides = props.styles;
1556
+ var id = props.id, config = props.table, head = props.head, foot = props.foot, isLoading = props.isLoading, onRowClick = props.onRowClick, onChange = props.onChange, stylesOverrides = props.styles;
1551
1557
  var _e = React.useState([]), sorting = _e[0], setSorting = _e[1];
1552
1558
  var _f = React.useState({}), columnVisibility = _f[0], setColumnVisibility = _f[1];
1553
1559
  var _g = React.useState([]), columnOrder = _g[0], setColumnOrder = _g[1];
@@ -1667,9 +1673,7 @@ var TableList2 = function (props) {
1667
1673
  .icon.container), "aria-hidden": "true" }) }))] }) }, header.id));
1668
1674
  }) }, headerGroup.id)); }) }), !isLoading && (jsxRuntime.jsx("tbody", { className: "border", children: table === null || table === void 0 ? void 0 : table.getRowModel().rows.map(function (row, index) {
1669
1675
  var _a;
1670
- return (jsxRuntime.jsx("tr", {
1671
- //onClick={() => onRowClick && onRowClick(row)}
1672
- className: toClassName(styles.body.table.body.row, ((_a = config.options) === null || _a === void 0 ? void 0 : _a.isStriped) &&
1676
+ return (jsxRuntime.jsx("tr", { onClick: function () { return onRowClick && onRowClick(row); }, className: toClassName(styles.body.table.body.row, ((_a = config.options) === null || _a === void 0 ? void 0 : _a.isStriped) &&
1673
1677
  index % 2 === 0 &&
1674
1678
  'bg-gray-50'), children: row.getVisibleCells().map(function (cell) {
1675
1679
  var _a, _b, _c;