gd-bs 5.0.7 → 5.0.8
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/build/components/listBox/index.js +16 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +1 -0
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/listBox/index.ts +16 -0
- package/src/components/listBox/types.d.ts +1 -0
package/package.json
CHANGED
|
@@ -81,6 +81,22 @@ class _ListBox extends Base<IListBoxProps> implements IListBox {
|
|
|
81
81
|
|
|
82
82
|
// Configures the events
|
|
83
83
|
private configureEvents() {
|
|
84
|
+
// Execute the load event
|
|
85
|
+
let returnVal: any = this.props.onLoadData ? this.props.onLoadData() : null;
|
|
86
|
+
if (returnVal) {
|
|
87
|
+
// See if a promise was returned
|
|
88
|
+
if (typeof (returnVal.then) === "function") {
|
|
89
|
+
// Wait for the promise to complete
|
|
90
|
+
returnVal.then(items => {
|
|
91
|
+
// Set the options
|
|
92
|
+
this.setOptions(items);
|
|
93
|
+
});
|
|
94
|
+
} else {
|
|
95
|
+
// Set the options
|
|
96
|
+
this.setOptions(returnVal);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
84
100
|
// Set the change event on the search box
|
|
85
101
|
this._elSearchBox.addEventListener("input", ev => {
|
|
86
102
|
let value = this._elSearchBox.value;
|
|
@@ -30,6 +30,7 @@ export interface IListBoxProps {
|
|
|
30
30
|
items: Array<IDropdownItem>;
|
|
31
31
|
multi?: boolean;
|
|
32
32
|
placeholder?: string;
|
|
33
|
+
onLoadData?: () => Array<IDropdownItem> | PromiseLike<Array<IDropdownItem>>;
|
|
33
34
|
onChange?: (items: IDropdownItem | Array<IDropdownItem>, ev?: Event) => void;
|
|
34
35
|
value?: string | Array<string>;
|
|
35
36
|
}
|