@economic/taco 2.63.0 → 2.63.2-combobox-search.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.
package/dist/taco.d.ts CHANGED
@@ -3034,6 +3034,7 @@ export declare const Table3: (<TType = unknown>(props: Table3Props<TType> & defa
3034
3034
  export declare type Table3ColumnProps<TType = unknown> = TableColumnProps<TType>;
3035
3035
 
3036
3036
  export declare interface Table3CommonProps<TType = unknown> extends Table3FeatureProps<TType> {
3037
+ defaultToggleEditing?: boolean;
3037
3038
  onEditingChange?: Table3EditingChangeHandler<TType>;
3038
3039
  onEditingCreate?: Table3EditingCreateHandler<TType>;
3039
3040
  onEditingDiscard?: Table3EditingDiscardHandler;
@@ -3056,9 +3057,7 @@ export declare interface Table3FeatureProps<TType = unknown> extends TableFeatur
3056
3057
 
3057
3058
  export declare type Table3GroupProps = TableGroupProps;
3058
3059
 
3059
- export declare type Table3Props<TType = unknown> = {
3060
- defaultToggleEditing?: boolean;
3061
- } & (Table3WithoutEditingWithClientProps<TType> | Table3WithoutEditingWithServerProps<TType> | Table3WithEditingWithClientProps<TType> | Table3WithEditingWithServerProps<TType>);
3060
+ export declare type Table3Props<TType = unknown> = Table3WithoutEditingWithClientProps<TType> | Table3WithoutEditingWithServerProps<TType> | Table3WithEditingWithClientProps<TType> | Table3WithEditingWithServerProps<TType>;
3062
3061
 
3063
3062
  export declare type Table3Ref = TableRef & {
3064
3063
  instance: {
package/dist/taco.js CHANGED
@@ -18368,7 +18368,7 @@ const filterData = (data, value = "") => {
18368
18368
  if (value === "" || value === null) {
18369
18369
  return data;
18370
18370
  }
18371
- const filteredOptionValues = /* @__PURE__ */ new Set();
18371
+ const filteredOptions = [];
18372
18372
  const shouldFilterOption = (option) => {
18373
18373
  if (option.disabled) {
18374
18374
  return false;
@@ -18378,13 +18378,22 @@ const filterData = (data, value = "") => {
18378
18378
  data.forEach((option) => {
18379
18379
  if (shouldFilterOption(option)) {
18380
18380
  const parents = getOptionParents(data, option.path);
18381
- filteredOptionValues.add(option.value);
18381
+ const index2 = option.text.toString().toLocaleLowerCase().indexOf(value.toString().toLocaleLowerCase());
18382
+ filteredOptions.push({ value: option.value, score: index2 });
18382
18383
  if (parents !== null) {
18383
- parents.forEach((option2) => filteredOptionValues.add(option2 == null ? void 0 : option2.value));
18384
+ parents.forEach((option2) => filteredOptions.push({ value: option2 == null ? void 0 : option2.value }));
18384
18385
  }
18385
18386
  }
18386
18387
  });
18387
- return data.filter(({ value: value2 }) => filteredOptionValues.has(value2));
18388
+ return data.filter(({ value: value2 }) => filteredOptions.find((x2) => x2.value === value2)).toSorted((a2, b2) => {
18389
+ var _a, _b;
18390
+ const scoreA = (_a = filteredOptions.find((x2) => x2.value === a2.value)) == null ? void 0 : _a.score;
18391
+ const scoreB = (_b = filteredOptions.find((x2) => x2.value === b2.value)) == null ? void 0 : _b.score;
18392
+ if (scoreA !== void 0 && scoreB !== void 0) {
18393
+ return scoreA - scoreB;
18394
+ }
18395
+ return 0;
18396
+ });
18388
18397
  };
18389
18398
  const debouncer = debounce$1((f2) => f2(), 200);
18390
18399
  const convertToInputValue = (value) => String(value ?? "");