akeyless-client-commons 1.1.112 → 1.1.114

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.
@@ -463,6 +463,7 @@ interface TableProps {
463
463
  containerClassName?: string;
464
464
  containerHeaderClassName?: string;
465
465
  includeSearch?: boolean;
466
+ autoFocus?: boolean;
466
467
  searchInputStyle?: React.CSSProperties;
467
468
  searchInputClassName?: string;
468
469
  searchContainerClassName?: string;
@@ -463,6 +463,7 @@ interface TableProps {
463
463
  containerClassName?: string;
464
464
  containerHeaderClassName?: string;
465
465
  includeSearch?: boolean;
466
+ autoFocus?: boolean;
466
467
  searchInputStyle?: React.CSSProperties;
467
468
  searchInputClassName?: string;
468
469
  searchContainerClassName?: string;
@@ -2113,7 +2113,7 @@ var TableProvider = function(props) {
2113
2113
  rowStyles, rowStyles = _props_rowStyles === void 0 ? {} : _props_rowStyles, rowClassName = props.rowClassName, // cell style
2114
2114
  cellClassName = props.cellClassName, _props_cellStyle = props.cellStyle, cellStyle = _props_cellStyle === void 0 ? {} : _props_cellStyle, _props_headerStyle = props.// header styles
2115
2115
  headerStyle, headerStyle = _props_headerStyle === void 0 ? {} : _props_headerStyle, headerCellStyle = props.headerCellStyle, _props_searchInputStyle = props.searchInputStyle, searchInputStyle = _props_searchInputStyle === void 0 ? {} : _props_searchInputStyle, _props_searchInputClassName = props.// search
2116
- searchInputClassName, searchInputClassName = _props_searchInputClassName === void 0 ? "" : _props_searchInputClassName, includeSearch = props.includeSearch, searchPlaceHolder = props.searchPlaceHolder, // sort
2116
+ searchInputClassName, searchInputClassName = _props_searchInputClassName === void 0 ? "" : _props_searchInputClassName, includeSearch = props.includeSearch, searchPlaceHolder = props.searchPlaceHolder, _props_autoFocus = props.autoFocus, autoFocus = _props_autoFocus === void 0 ? true : _props_autoFocus, // sort
2117
2117
  sortKeys = props.sortKeys, _props_sortLabel = props.sortLabel, sortLabel = _props_sortLabel === void 0 ? "Sort by" : _props_sortLabel, _props_filterableColumns = props.// filter
2118
2118
  filterableColumns, filterableColumns = _props_filterableColumns === void 0 ? [] : _props_filterableColumns, _props_filterLabel = props.filterLabel, filterLabel = _props_filterLabel === void 0 ? "Filter by" : _props_filterLabel, // export to excel
2119
2119
  exportToExcelKeys = props.exportToExcelKeys, dataToAddToExcelTable = props.dataToAddToExcelTable, _props_exportExcelTitle = props.exportExcelTitle, exportExcelTitle = _props_exportExcelTitle === void 0 ? "Export to excel" : _props_exportExcelTitle, excelFileName = props.excelFileName, // summary
@@ -2138,17 +2138,22 @@ var TableProvider = function(props) {
2138
2138
  ]);
2139
2139
  var dataToRender = (0, import_react5.useMemo)(function() {
2140
2140
  var filtered = data;
2141
- if (includeSearch && debouncedSearchQuery.length > 0) {
2141
+ if (includeSearch && debouncedSearchQuery.trim().length > 0) {
2142
2142
  var cleanString = function(str) {
2143
- return str.toLowerCase().trim();
2143
+ return String(str).toLowerCase().trim();
2144
2144
  };
2145
- var normalizedSearchQuery = cleanString(debouncedSearchQuery);
2146
2145
  var keys = allKeys.filter(function(val) {
2147
2146
  return !noneSearchKeys.includes(val);
2148
2147
  });
2148
+ var terms = debouncedSearchQuery.split("+").map(function(t) {
2149
+ return cleanString(t);
2150
+ }).filter(Boolean);
2149
2151
  filtered = data.filter(function(item) {
2150
- return keys.some(function(key) {
2151
- return cleanString(String(item[key])).includes(normalizedSearchQuery);
2152
+ return terms.every(function(term) {
2153
+ return keys.some(function(key) {
2154
+ var _item_key;
2155
+ return cleanString((_item_key = item === null || item === void 0 ? void 0 : item[key]) !== null && _item_key !== void 0 ? _item_key : "").includes(term);
2156
+ });
2152
2157
  });
2153
2158
  });
2154
2159
  }
@@ -2204,6 +2209,7 @@ var TableProvider = function(props) {
2204
2209
  searchQuery: searchQuery,
2205
2210
  deferredSearchQuery: debouncedSearchQuery,
2206
2211
  handleSearch: handleSearch,
2212
+ autoFocus: autoFocus,
2207
2213
  dataToRender: dataToRender,
2208
2214
  filters: filters,
2209
2215
  filterPopupsDisplay: filterPopupsDisplay,
@@ -5700,14 +5706,15 @@ var ExportToExcel = (0, import_react11.memo)(function() {
5700
5706
  });
5701
5707
  }, renderOnce);
5702
5708
  var Search = (0, import_react11.memo)(function() {
5703
- var _useTableContext = useTableContext(), searchQuery = _useTableContext.searchQuery, handleSearch = _useTableContext.handleSearch, searchPlaceHolder = _useTableContext.searchPlaceHolder, searchInputClassName = _useTableContext.searchInputClassName, searchInputStyle = _useTableContext.searchInputStyle;
5709
+ var _useTableContext = useTableContext(), searchQuery = _useTableContext.searchQuery, handleSearch = _useTableContext.handleSearch, searchPlaceHolder = _useTableContext.searchPlaceHolder, searchInputClassName = _useTableContext.searchInputClassName, searchInputStyle = _useTableContext.searchInputStyle, autoFocus = _useTableContext.autoFocus;
5704
5710
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", {
5705
5711
  className: cn("border-black border-[1px] text-lg px-2 w-11/12", searchInputClassName),
5706
5712
  type: "search",
5707
5713
  placeholder: searchPlaceHolder,
5708
5714
  value: searchQuery,
5709
5715
  onChange: handleSearch,
5710
- style: searchInputStyle
5716
+ style: searchInputStyle,
5717
+ autoFocus: autoFocus
5711
5718
  });
5712
5719
  }, renderOnce);
5713
5720
  var TableHead = (0, import_react11.memo)(function() {
@@ -1885,7 +1885,7 @@ var TableProvider = function(props) {
1885
1885
  rowStyles, rowStyles = _props_rowStyles === void 0 ? {} : _props_rowStyles, rowClassName = props.rowClassName, // cell style
1886
1886
  cellClassName = props.cellClassName, _props_cellStyle = props.cellStyle, cellStyle = _props_cellStyle === void 0 ? {} : _props_cellStyle, _props_headerStyle = props.// header styles
1887
1887
  headerStyle, headerStyle = _props_headerStyle === void 0 ? {} : _props_headerStyle, headerCellStyle = props.headerCellStyle, _props_searchInputStyle = props.searchInputStyle, searchInputStyle = _props_searchInputStyle === void 0 ? {} : _props_searchInputStyle, _props_searchInputClassName = props.// search
1888
- searchInputClassName, searchInputClassName = _props_searchInputClassName === void 0 ? "" : _props_searchInputClassName, includeSearch = props.includeSearch, searchPlaceHolder = props.searchPlaceHolder, // sort
1888
+ searchInputClassName, searchInputClassName = _props_searchInputClassName === void 0 ? "" : _props_searchInputClassName, includeSearch = props.includeSearch, searchPlaceHolder = props.searchPlaceHolder, _props_autoFocus = props.autoFocus, autoFocus = _props_autoFocus === void 0 ? true : _props_autoFocus, // sort
1889
1889
  sortKeys = props.sortKeys, _props_sortLabel = props.sortLabel, sortLabel = _props_sortLabel === void 0 ? "Sort by" : _props_sortLabel, _props_filterableColumns = props.// filter
1890
1890
  filterableColumns, filterableColumns = _props_filterableColumns === void 0 ? [] : _props_filterableColumns, _props_filterLabel = props.filterLabel, filterLabel = _props_filterLabel === void 0 ? "Filter by" : _props_filterLabel, // export to excel
1891
1891
  exportToExcelKeys = props.exportToExcelKeys, dataToAddToExcelTable = props.dataToAddToExcelTable, _props_exportExcelTitle = props.exportExcelTitle, exportExcelTitle = _props_exportExcelTitle === void 0 ? "Export to excel" : _props_exportExcelTitle, excelFileName = props.excelFileName, // summary
@@ -1910,17 +1910,22 @@ var TableProvider = function(props) {
1910
1910
  ]);
1911
1911
  var dataToRender = useMemo(function() {
1912
1912
  var filtered = data;
1913
- if (includeSearch && debouncedSearchQuery.length > 0) {
1913
+ if (includeSearch && debouncedSearchQuery.trim().length > 0) {
1914
1914
  var cleanString = function(str) {
1915
- return str.toLowerCase().trim();
1915
+ return String(str).toLowerCase().trim();
1916
1916
  };
1917
- var normalizedSearchQuery = cleanString(debouncedSearchQuery);
1918
1917
  var keys = allKeys.filter(function(val) {
1919
1918
  return !noneSearchKeys.includes(val);
1920
1919
  });
1920
+ var terms = debouncedSearchQuery.split("+").map(function(t) {
1921
+ return cleanString(t);
1922
+ }).filter(Boolean);
1921
1923
  filtered = data.filter(function(item) {
1922
- return keys.some(function(key) {
1923
- return cleanString(String(item[key])).includes(normalizedSearchQuery);
1924
+ return terms.every(function(term) {
1925
+ return keys.some(function(key) {
1926
+ var _item_key;
1927
+ return cleanString((_item_key = item === null || item === void 0 ? void 0 : item[key]) !== null && _item_key !== void 0 ? _item_key : "").includes(term);
1928
+ });
1924
1929
  });
1925
1930
  });
1926
1931
  }
@@ -1976,6 +1981,7 @@ var TableProvider = function(props) {
1976
1981
  searchQuery: searchQuery,
1977
1982
  deferredSearchQuery: debouncedSearchQuery,
1978
1983
  handleSearch: handleSearch,
1984
+ autoFocus: autoFocus,
1979
1985
  dataToRender: dataToRender,
1980
1986
  filters: filters,
1981
1987
  filterPopupsDisplay: filterPopupsDisplay,
@@ -5472,14 +5478,15 @@ var ExportToExcel = memo(function() {
5472
5478
  });
5473
5479
  }, renderOnce);
5474
5480
  var Search = memo(function() {
5475
- var _useTableContext = useTableContext(), searchQuery = _useTableContext.searchQuery, handleSearch = _useTableContext.handleSearch, searchPlaceHolder = _useTableContext.searchPlaceHolder, searchInputClassName = _useTableContext.searchInputClassName, searchInputStyle = _useTableContext.searchInputStyle;
5481
+ var _useTableContext = useTableContext(), searchQuery = _useTableContext.searchQuery, handleSearch = _useTableContext.handleSearch, searchPlaceHolder = _useTableContext.searchPlaceHolder, searchInputClassName = _useTableContext.searchInputClassName, searchInputStyle = _useTableContext.searchInputStyle, autoFocus = _useTableContext.autoFocus;
5476
5482
  return /* @__PURE__ */ jsx18("input", {
5477
5483
  className: cn("border-black border-[1px] text-lg px-2 w-11/12", searchInputClassName),
5478
5484
  type: "search",
5479
5485
  placeholder: searchPlaceHolder,
5480
5486
  value: searchQuery,
5481
5487
  onChange: handleSearch,
5482
- style: searchInputStyle
5488
+ style: searchInputStyle,
5489
+ autoFocus: autoFocus
5483
5490
  });
5484
5491
  }, renderOnce);
5485
5492
  var TableHead = memo(function() {
@@ -1144,7 +1144,7 @@ var useSetUserCountry = function(setUserCountry, changLang) {
1144
1144
  case 1:
1145
1145
  country = _state.sent();
1146
1146
  if (!lang) {
1147
- changLang === null || changLang === void 0 ? void 0 : changLang(country === import_akeyless_types_commons2.CountryOptions.IL ? "he" : "en");
1147
+ changLang === null || changLang === void 0 ? void 0 : changLang(country === import_akeyless_types_commons2.CountryOptions.IL ? "he" : country === import_akeyless_types_commons2.CountryOptions.TH ? "th" : "en");
1148
1148
  }
1149
1149
  setUserCountry(country);
1150
1150
  localStorage.setItem("userCountry", country);
@@ -1048,7 +1048,7 @@ var useSetUserCountry = function(setUserCountry, changLang) {
1048
1048
  case 1:
1049
1049
  country = _state.sent();
1050
1050
  if (!lang) {
1051
- changLang === null || changLang === void 0 ? void 0 : changLang(country === CountryOptions2.IL ? "he" : "en");
1051
+ changLang === null || changLang === void 0 ? void 0 : changLang(country === CountryOptions2.IL ? "he" : country === CountryOptions2.TH ? "th" : "en");
1052
1052
  }
1053
1053
  setUserCountry(country);
1054
1054
  localStorage.setItem("userCountry", country);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akeyless-client-commons",
3
- "version": "1.1.112",
3
+ "version": "1.1.114",
4
4
  "scripts": {
5
5
  "build": "tsup",
6
6
  "deploy": "npm run build && npm version patch --no-git-tag-version && npm publish",
@@ -18,7 +18,7 @@
18
18
  "@radix-ui/react-progress": "^1.1.1",
19
19
  "@radix-ui/react-slot": "^1.1.2",
20
20
  "@types/lodash": "^4.17.13",
21
- "akeyless-types-commons": "^1.0.57",
21
+ "akeyless-types-commons": "^1.0.86",
22
22
  "assets": "^3.0.1",
23
23
  "axios": "^1.7.9",
24
24
  "class-variance-authority": "^0.7.0",