gbs-add-block 0.0.21 → 0.0.22
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/package.json
CHANGED
|
@@ -27,6 +27,8 @@ interface ItemsProps {
|
|
|
27
27
|
|
|
28
28
|
const Select = forwardRef<any, SelectProps>((props, ref) => {
|
|
29
29
|
const {
|
|
30
|
+
id = "",
|
|
31
|
+
name = "",
|
|
30
32
|
placeholder = "Select an Item...",
|
|
31
33
|
items,
|
|
32
34
|
lazy = false,
|
|
@@ -34,6 +36,7 @@ const Select = forwardRef<any, SelectProps>((props, ref) => {
|
|
|
34
36
|
onSelect,
|
|
35
37
|
selectedItem: initialSelectedItem,
|
|
36
38
|
error = undefined,
|
|
39
|
+
onFiltering,
|
|
37
40
|
} = props;
|
|
38
41
|
|
|
39
42
|
const [showPopover, setShowPopover] = useState(false);
|
|
@@ -146,7 +149,7 @@ const Select = forwardRef<any, SelectProps>((props, ref) => {
|
|
|
146
149
|
}));
|
|
147
150
|
|
|
148
151
|
return (
|
|
149
|
-
<div className="relative w-full" ref={selectRef}>
|
|
152
|
+
<div className="relative w-full" ref={selectRef} id={id}>
|
|
150
153
|
<div className="w-full relative">
|
|
151
154
|
<button
|
|
152
155
|
className={`flex items-center ${
|
|
@@ -192,7 +195,10 @@ const Select = forwardRef<any, SelectProps>((props, ref) => {
|
|
|
192
195
|
className="w-full outline-none dark:bg-black"
|
|
193
196
|
ref={inputRef}
|
|
194
197
|
value={searchTerm}
|
|
195
|
-
onChange={(e) =>
|
|
198
|
+
onChange={(e) => {
|
|
199
|
+
setSearchTerm(e.target.value);
|
|
200
|
+
if (onFiltering) onFiltering(e.target.value);
|
|
201
|
+
}}
|
|
196
202
|
/>
|
|
197
203
|
</div>
|
|
198
204
|
)}
|
|
@@ -4,10 +4,14 @@ interface ItemsProps {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
export type SelectProps = {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
error?: undefined | string;
|
|
7
10
|
placeholder?: string;
|
|
8
11
|
items?: ItemsProps[] | string;
|
|
9
12
|
lazy?: boolean;
|
|
10
13
|
showSearch?: boolean;
|
|
11
14
|
onSelect?: any;
|
|
12
15
|
selectedItem?: string;
|
|
16
|
+
onFiltering?: any;
|
|
13
17
|
};
|