@fixefy/fixefy-ui-components 0.3.55 → 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,6 +112,7 @@ function _object_spread_props(target, source) {
|
|
|
112
112
|
return target;
|
|
113
113
|
}
|
|
114
114
|
const FxAsyncDropdown = (props)=>{
|
|
115
|
+
var _fetcher_query;
|
|
115
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;
|
|
116
117
|
const ref = (0, _react.useRef)(null);
|
|
117
118
|
const { method_name } = variables !== null && variables !== void 0 ? variables : {};
|
|
@@ -119,6 +120,8 @@ const FxAsyncDropdown = (props)=>{
|
|
|
119
120
|
const { where, sort } = (_fetcher_queryOptions_variables = fetcher.queryOptions.variables) !== null && _fetcher_queryOptions_variables !== void 0 ? _fetcher_queryOptions_variables : {};
|
|
120
121
|
var _parseCookies;
|
|
121
122
|
const { ws } = (_parseCookies = (0, _nookies.parseCookies)()) !== null && _parseCookies !== void 0 ? _parseCookies : {};
|
|
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;
|
|
122
125
|
const [defaultValueWhere, setDefaultValueWhere] = (0, _react.useState)(where);
|
|
123
126
|
const [displayed, setDisplayed] = (0, _react.useState)(multiple ? [] : '');
|
|
124
127
|
const [options, setOptions] = (0, _react.useState)([]);
|
|
@@ -153,7 +156,7 @@ const FxAsyncDropdown = (props)=>{
|
|
|
153
156
|
setPage((prevPage)=>prevPage + 1);
|
|
154
157
|
setPrevPage((prevPage)=>prevPage + 1);
|
|
155
158
|
};
|
|
156
|
-
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), {
|
|
157
160
|
variables: {
|
|
158
161
|
where: getWhere(),
|
|
159
162
|
skip: page * pageSize - pageSize,
|
|
@@ -161,7 +164,7 @@ const FxAsyncDropdown = (props)=>{
|
|
|
161
164
|
sort: sort || {}
|
|
162
165
|
}
|
|
163
166
|
}));
|
|
164
|
-
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), {
|
|
165
168
|
variables: {
|
|
166
169
|
where: defaultValueWhere,
|
|
167
170
|
sort: sort || {}
|
package/package.json
CHANGED