@vectara/vectara-ui 14.0.1 → 14.1.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.
@@ -78,6 +78,9 @@ export const VuiSearchInput = (_a) => {
78
78
  break;
79
79
  }
80
80
  case "Enter": {
81
+ // Prevent form submission from triggering a page refresh.
82
+ if (!onSubmit)
83
+ e.preventDefault();
81
84
  break;
82
85
  }
83
86
  }
@@ -33,6 +33,7 @@ type BodyStyle = {
33
33
  };
34
34
  type Selection<T> = {
35
35
  bulkActions?: TableBulkActionProps<T[]>["actions"];
36
+ isRowSelectable?: (row: T) => boolean;
36
37
  onSelectRow?: (selectedRows: T[]) => void;
37
38
  selectedRows?: T[];
38
39
  };
@@ -45,7 +45,7 @@ export const VuiTable = (_a) => {
45
45
  const [rowBeingActedUpon, setRowBeingActedUpon] = useState(undefined);
46
46
  const [sortColumn, setSortColumn] = useState(null);
47
47
  const [sortDirection, setSortDirection] = useState("none");
48
- const { bulkActions, onSelectRow, selectedRows } = selection || {};
48
+ const { bulkActions, isRowSelectable, onSelectRow, selectedRows } = selection || {};
49
49
  const { value: searchValue } = search || {};
50
50
  const handleSort = (columnName, direction) => {
51
51
  if (direction === "none") {
@@ -98,7 +98,7 @@ export const VuiTable = (_a) => {
98
98
  "vuiTableRow--hasActions": Boolean(actions),
99
99
  "vuiTableRow--isSelectable": Boolean(onSelectRow)
100
100
  });
101
- return (_jsxs("tr", Object.assign({ className: rowClassName }, restRowAttributes, { children: [onSelectRow && (_jsx("td", Object.assign({ className: "vuiTableRowSelect" }, { children: _jsx(VuiTableCell, { children: _jsx(VuiCheckbox, { checked: (_b = selectedIds[rowId]) !== null && _b !== void 0 ? _b : false, onChange: () => {
101
+ return (_jsxs("tr", Object.assign({ className: rowClassName }, restRowAttributes, { children: [onSelectRow && (_jsx("td", Object.assign({ className: "vuiTableRowSelect" }, { children: _jsx(VuiTableCell, { children: _jsx(VuiCheckbox, { disabled: isRowSelectable ? !isRowSelectable(row) : undefined, checked: (_b = selectedIds[rowId]) !== null && _b !== void 0 ? _b : false, onChange: () => {
102
102
  if (selectedIds[rowId]) {
103
103
  delete selectedIds[rowId];
104
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "14.0.1",
3
+ "version": "14.1.0",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",