@sebgroup/green-core 1.0.0-beta.8 → 1.0.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.
@@ -1,7 +1,7 @@
1
1
  import 'reflect-metadata';
2
- import 'primitives/listbox';
3
- import type { GdsOption, OptionsContainer } from 'primitives/listbox';
4
- import 'primitives/popover';
2
+ import '../../primitives/listbox';
3
+ import type { GdsOption, OptionsContainer } from '../../primitives/listbox';
4
+ import '../../primitives/popover';
5
5
  import { GdsFormControlElement } from '../form-control';
6
6
  /**
7
7
  * @element gds-dropdown
@@ -40,6 +40,33 @@ export declare class GdsDropdown<ValueT = any> extends GdsFormControlElement<Val
40
40
  * The value of the dropdown will be an array of the selected values.
41
41
  */
42
42
  multiple: boolean;
43
+ /**
44
+ * Delegate function for comparing option values.
45
+ * By default the option values are compared using strict equality.
46
+ * If you want to compare objects by field values, you can provide
47
+ * a custom compare function here. The function should return true
48
+ * if the values are considered equal.
49
+ *
50
+ * Example:
51
+ * ```ts
52
+ * dropdown.compareWith = (a, b) => a.id === b.id
53
+ * ```
54
+ */
55
+ compareWith: (a: ValueT, b: ValueT) => boolean;
56
+ /**
57
+ * Delegate function for customizing the search filtering.
58
+ * By default, the search filter will just check if the option label
59
+ * contains the search string using [String.includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes).
60
+ *
61
+ * This property allows you to provide a custom filter function to use instead.
62
+ *
63
+ * For example, to filter on value instead of label:
64
+ * ```ts
65
+ * dropdown.searchFilter = (query, option) =>
66
+ * option.value.toLowerCase().includes(query.toLowerCase())
67
+ * ```
68
+ */
69
+ searchFilter: (q: string, o: GdsOption) => boolean;
43
70
  constructor();
44
71
  connectedCallback(): void;
45
72
  /**