Skip to content

Commit 987fee3

Browse files
committed
Drop Vue dynamic lookup as not supported by Vue v3 Fomantic-UI
1 parent ddd18de commit 987fee3

12 files changed

+11
-204
lines changed

js/src/vue-components/share/atk-lookup.js

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import atk from 'atk';
55
*
66
* Properties:
77
* config:
8-
* url: the callback URL. Callback should return model data in form of { key: modelId, text: modelTitle, value: modelId }
98
* reference: the reference field name associate with model or hasOne name. This field name will be sent along with URL callback parameter as of 'field=name'.
109
* Note: The remaining config object may contain any or SuiDropdown { props: value } pair.
1110
*
@@ -19,9 +18,7 @@ export default {
1918
v-bind="dropdownProps"
2019
ref="drop"
2120
:modelValue="getDropdownValue(modelValue)"
22-
` /* :loading="isLoading" */
23-
+ `@update:modelValue="onUpdate"
24-
@filtered="onFiltered"
21+
@update:modelValue="onUpdate"
2522
></SuiDropdown>`,
2623
props: ['config', 'modelValue', 'optionalValue'],
2724
data: function () {
@@ -33,7 +30,6 @@ export default {
3330
return {
3431
dropdownProps: otherConfig,
3532
url: url || null,
36-
isLoading: false,
3733
field: reference,
3834
query: '',
3935
temp: '',
@@ -51,44 +47,6 @@ export default {
5147
},
5248
onUpdate: function (value) {
5349
this.$emit('update:modelValue', value.value);
54-
},
55-
/**
56-
* Receive user input text for search.
57-
*/
58-
onFiltered: function (inputValue) {
59-
if (inputValue) {
60-
this.isLoading = true;
61-
}
62-
63-
if (!this.onFiltered.debouncedFx) {
64-
this.onFiltered.debouncedFx = atk.createDebouncedFx(() => {
65-
this.onFiltered.debouncedFx = null;
66-
if (this.query !== this.temp) {
67-
this.query = this.temp;
68-
if (this.query) {
69-
this.fetchItems(this.query);
70-
}
71-
}
72-
}, 250);
73-
}
74-
this.temp = inputValue;
75-
this.onFiltered.debouncedFx(this);
76-
},
77-
/**
78-
* Fetch new data from server.
79-
*/
80-
fetchItems: async function (q) {
81-
try {
82-
const data = { atkVueLookupQuery: q, atkVueLookupField: this.field };
83-
const response = await atk.apiService.suiFetch(this.url, { method: 'get', data: data });
84-
if (response.success) {
85-
this.dropdownProps.options = response.results;
86-
}
87-
} catch (e) {
88-
console.error(e);
89-
} finally {
90-
this.isLoading = false;
91-
}
92-
},
93-
},
50+
}
51+
}
9452
};

public/js/atk-vue-multiline.js

Lines changed: 1 addition & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/atk-vue-multiline.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)