@fixefy/fixefy-ui-components 0.3.56 → 0.3.57
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.
|
@@ -112,7 +112,7 @@ function _object_spread_props(target, source) {
|
|
|
112
112
|
return target;
|
|
113
113
|
}
|
|
114
114
|
const FxAsyncDropdown = (props)=>{
|
|
115
|
-
var _fetcher_query
|
|
115
|
+
var _fetcher_query;
|
|
116
116
|
const { onAdd, onRemoveAll, onUnselectAll, fetcher, disabled, defaultValue, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path, rootStylesOverride, options_path, _id } = props;
|
|
117
117
|
const ref = (0, _react.useRef)(null);
|
|
118
118
|
const { method_name } = variables !== null && variables !== void 0 ? variables : {};
|
|
@@ -121,6 +121,7 @@ const FxAsyncDropdown = (props)=>{
|
|
|
121
121
|
var _parseCookies;
|
|
122
122
|
const { ws } = (_parseCookies = (0, _nookies.parseCookies)()) !== null && _parseCookies !== void 0 ? _parseCookies : {};
|
|
123
123
|
const isLocal = fetcher === null || fetcher === void 0 ? void 0 : (_fetcher_query = fetcher.query) === null || _fetcher_query === void 0 ? void 0 : _fetcher_query.loc;
|
|
124
|
+
const gqlQuery = isLocal ? fetcher.query.loc.source.body : fetcher.query;
|
|
124
125
|
const [defaultValueWhere, setDefaultValueWhere] = (0, _react.useState)(where);
|
|
125
126
|
const [displayed, setDisplayed] = (0, _react.useState)(multiple ? [] : '');
|
|
126
127
|
const [options, setOptions] = (0, _react.useState)([]);
|
|
@@ -155,7 +156,7 @@ const FxAsyncDropdown = (props)=>{
|
|
|
155
156
|
setPage((prevPage)=>prevPage + 1);
|
|
156
157
|
setPrevPage((prevPage)=>prevPage + 1);
|
|
157
158
|
};
|
|
158
|
-
const [fetch, { data, loading }] = (0, _client.useLazyQuery)((0, _graphqltag.gql)(
|
|
159
|
+
const [fetch, { data, loading }] = (0, _client.useLazyQuery)((0, _graphqltag.gql)(gqlQuery), _object_spread_props(_object_spread({}, fetcher.queryOptions), {
|
|
159
160
|
variables: {
|
|
160
161
|
where: getWhere(),
|
|
161
162
|
skip: page * pageSize - pageSize,
|
|
@@ -163,7 +164,7 @@ const FxAsyncDropdown = (props)=>{
|
|
|
163
164
|
sort: sort || {}
|
|
164
165
|
}
|
|
165
166
|
}));
|
|
166
|
-
const [defaultValueFetch, { data: defaultValueData }] = (0, _client.useLazyQuery)((0, _graphqltag.gql)(
|
|
167
|
+
const [defaultValueFetch, { data: defaultValueData }] = (0, _client.useLazyQuery)((0, _graphqltag.gql)(gqlQuery), _object_spread_props(_object_spread({}, fetcher.queryOptions), {
|
|
167
168
|
variables: {
|
|
168
169
|
where: defaultValueWhere,
|
|
169
170
|
sort: sort || {}
|
package/package.json
CHANGED