@ballistix.digital/react-components 0.5.2 → 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.d.ts CHANGED
@@ -182,13 +182,13 @@ type TInputGroupFormProps = {
182
182
  onClear?: never;
183
183
  trailing?: string | ReactNode;
184
184
  } | {
185
- htmlType: 'text';
185
+ htmlType: 'text' | 'date';
186
186
  onChange: ChangeEventHandler<HTMLInputElement>;
187
187
  onBlur: FocusEventHandler<HTMLInputElement>;
188
188
  onClear?: () => void;
189
189
  trailing?: never;
190
190
  } | {
191
- htmlType: Exclude<HTMLInputTypeAttribute, 'text'>;
191
+ htmlType: Exclude<HTMLInputTypeAttribute, 'text' | 'date'>;
192
192
  onChange: ChangeEventHandler<HTMLInputElement>;
193
193
  onBlur: FocusEventHandler<HTMLInputElement>;
194
194
  onClear?: never;
package/dist/index.esm.js CHANGED
@@ -714,7 +714,7 @@ var InputGroupForm = function (props) {
714
714
  var styles = handleGenerateStyle();
715
715
  var invalidIcon = (jsx(ExclamationCircleIcon, { className: "h-5 w-5 text-red-500", "aria-hidden": "true" }));
716
716
  return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxs("div", { className: styles.body, children: [leading && jsx("div", { className: styles.leading, children: leading }), !htmlType ||
717
- (htmlType !== 'area' && (jsxs("div", { className: "flex items-center", children: [jsx("input", { type: mask !== undefined ? 'text' : htmlType, ref: mask && 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 && (jsx("div", { className: "right-5 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsx(IconElement, { accessor: "times", className: "text-gray-500" }) }))] }))), htmlType === 'area' && (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' && (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 && (jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && jsx("p", { className: styles.error, children: error })] })] }));
717
+ (htmlType !== 'area' && (jsxs("div", { className: "flex items-center", children: [jsx("input", { type: mask !== undefined ? 'text' : htmlType, ref: mask && 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 && (jsx("div", { className: "right-5 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsx(IconElement, { accessor: "times", className: "text-gray-500" }) })), htmlType === 'date' && !trailing && isValid && onClear && (jsx("div", { className: "right-10 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsx(IconElement, { accessor: "times", className: "text-gray-500" }) }))] }))), htmlType === 'area' && (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' && (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 && (jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && jsx("p", { className: styles.error, children: error })] })] }));
718
718
  };
719
719
 
720
720
  var base$k = {
@@ -1514,8 +1514,16 @@ var styles$g = {
1514
1514
 
1515
1515
  var getTableState = function (tableName) {
1516
1516
  var savedState = localStorage.getItem("TableList.".concat(tableName, ".state"));
1517
- if (savedState && isValidState(JSON.parse(savedState))) {
1518
- return JSON.parse(savedState);
1517
+ try {
1518
+ if (savedState && isValidState(JSON.parse(savedState))) {
1519
+ return JSON.parse(savedState);
1520
+ }
1521
+ }
1522
+ catch (e) {
1523
+ // Something went wrong with parsing the saved state; remove it and let the table use the default state
1524
+ console.error(e);
1525
+ localStorage.removeItem("TableList.".concat(tableName, ".state"));
1526
+ return undefined;
1519
1527
  }
1520
1528
  };
1521
1529
  var setTableState = function (tableName, state) {