@ews-admin/global-design-system 1.33.0 → 1.34.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.
@@ -24,7 +24,12 @@ interface SearchAutocompleteProps<T extends SearchableEntity> {
24
24
  * callers that do not pass it keep today's placeholder.
25
25
  */
26
26
  getMinCharactersHint?: (minSearchLength: number) => string | null;
27
+ /**
28
+ * MED-1690: message shown when the search returns nothing. Defaults to the English
29
+ * "No results found. Try a different search term.", so callers that do not pass it are unchanged.
30
+ */
31
+ noResultsText?: string;
27
32
  }
28
- export declare function SearchAutocomplete<T extends SearchableEntity>({ onSelect, selectedId, searchFunction, getEntityById, getDisplayValue, getSecondaryText, placeholder, icon, disabled, minSearchLength, debounceTime, error, getMinCharactersHint, }: SearchAutocompleteProps<T>): React.JSX.Element;
33
+ export declare function SearchAutocomplete<T extends SearchableEntity>({ onSelect, selectedId, searchFunction, getEntityById, getDisplayValue, getSecondaryText, placeholder, icon, disabled, minSearchLength, debounceTime, error, getMinCharactersHint, noResultsText, }: SearchAutocompleteProps<T>): React.JSX.Element;
29
34
  export {};
30
35
  //# sourceMappingURL=SearchAutocomplete.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchAutocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/SearchAutocomplete/SearchAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,cAAc,CAAC;AACrD,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,uBAAuB,CAAC,CAAC,SAAS,gBAAgB;IAC1D,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAClD,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IACvD,eAAe,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACnE;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,EAAE,EAC7D,QAAQ,EACR,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,IAAa,EACb,QAAgB,EAChB,eAAmB,EACnB,YAAkB,EAClB,KAAK,EACL,oBAA0D,GAC3D,EAAE,uBAAuB,CAAC,CAAC,CAAC,qBAsR5B"}
1
+ {"version":3,"file":"SearchAutocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/SearchAutocomplete/SearchAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,cAAc,CAAC;AACrD,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,uBAAuB,CAAC,CAAC,SAAS,gBAAgB;IAC1D,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAClD,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IACvD,eAAe,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAClE;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,EAAE,EAC7D,QAAQ,EACR,UAAU,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,IAAa,EACb,QAAgB,EAChB,eAAmB,EACnB,YAAkB,EAClB,KAAK,EACL,oBAA0D,EAC1D,aAAgE,GACjE,EAAE,uBAAuB,CAAC,CAAC,CAAC,qBAsR5B"}
package/dist/index.d.ts CHANGED
@@ -243,8 +243,13 @@ interface SearchAutocompleteProps<T extends SearchableEntity> {
243
243
  * callers that do not pass it keep today's placeholder.
244
244
  */
245
245
  getMinCharactersHint?: (minSearchLength: number) => string | null;
246
+ /**
247
+ * MED-1690: message shown when the search returns nothing. Defaults to the English
248
+ * "No results found. Try a different search term.", so callers that do not pass it are unchanged.
249
+ */
250
+ noResultsText?: string;
246
251
  }
247
- declare function SearchAutocomplete<T extends SearchableEntity>({ onSelect, selectedId, searchFunction, getEntityById, getDisplayValue, getSecondaryText, placeholder, icon, disabled, minSearchLength, debounceTime, error, getMinCharactersHint, }: SearchAutocompleteProps<T>): React__default.JSX.Element;
252
+ declare function SearchAutocomplete<T extends SearchableEntity>({ onSelect, selectedId, searchFunction, getEntityById, getDisplayValue, getSecondaryText, placeholder, icon, disabled, minSearchLength, debounceTime, error, getMinCharactersHint, noResultsText, }: SearchAutocompleteProps<T>): React__default.JSX.Element;
248
253
 
249
254
  interface MultiSearchAutocompleteProps<T extends SearchableEntity> {
250
255
  items: T[];
package/dist/index.esm.js CHANGED
@@ -33260,7 +33260,7 @@ function useSelectField({ name, control, options: _options, rules, defaultValue,
33260
33260
  };
33261
33261
  }
33262
33262
 
33263
- function SearchAutocomplete({ onSelect, selectedId, searchFunction, getEntityById, getDisplayValue, getSecondaryText, placeholder, icon = Search, disabled = false, minSearchLength = 2, debounceTime = 300, error, getMinCharactersHint = (min) => `(min. ${min} characters)`, }) {
33263
+ function SearchAutocomplete({ onSelect, selectedId, searchFunction, getEntityById, getDisplayValue, getSecondaryText, placeholder, icon = Search, disabled = false, minSearchLength = 2, debounceTime = 300, error, getMinCharactersHint = (min) => `(min. ${min} characters)`, noResultsText = "No results found. Try a different search term.", }) {
33264
33264
  const [searchTerm, setSearchTerm] = useState("");
33265
33265
  const [entities, setEntities] = useState([]);
33266
33266
  const [isLoading, setIsLoading] = useState(false);
@@ -33390,7 +33390,7 @@ function SearchAutocomplete({ onSelect, selectedId, searchFunction, getEntityByI
33390
33390
  !searchError &&
33391
33391
  !error && (jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg", children: debouncedSearchTerm.length < minSearchLength
33392
33392
  ? `Type at least ${minSearchLength} characters to search`
33393
- : "No results found. Try a different search term." })), isLoading && showDropdown && (jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg", children: jsxs("div", { className: "flex justify-center items-center", children: [jsx("div", { className: "mr-2 w-4 h-4 rounded-full border-b-2 animate-spin border-ews-primary" }), "Loading..."] }) }))] }));
33393
+ : noResultsText })), isLoading && showDropdown && (jsx("div", { className: "absolute z-10 p-4 mt-1 w-full text-center text-gray-500 bg-white rounded-md shadow-lg", children: jsxs("div", { className: "flex justify-center items-center", children: [jsx("div", { className: "mr-2 w-4 h-4 rounded-full border-b-2 animate-spin border-ews-primary" }), "Loading..."] }) }))] }));
33394
33394
  }
33395
33395
 
33396
33396
  function MultiSearchAutocomplete({ items, selectedItems, onSelectionChange, onSearch, getEntityById: _getEntityById, getPrimaryText, getSecondaryText, placeholder, disabled = false, loading = false, multiple = true, className, renderSelectedItem, renderListItem, keepOpenOnSelect = true, error, minSearchLength = 2, debounceTime = 300, }) {