@fixefy/fixefy-ui-components 0.3.56 → 0.3.58

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, _fetcher_query_loc_source, _fetcher_query_loc, _fetcher_query1;
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)(isLocal ? fetcher === null || fetcher === void 0 ? void 0 : (_fetcher_query1 = fetcher.query) === null || _fetcher_query1 === void 0 ? void 0 : (_fetcher_query_loc = _fetcher_query1.loc) === null || _fetcher_query_loc === void 0 ? void 0 : (_fetcher_query_loc_source = _fetcher_query_loc.source) === null || _fetcher_query_loc_source === void 0 ? void 0 : _fetcher_query_loc_source.body : fetcher.query), _object_spread_props(_object_spread({}, fetcher.queryOptions), {
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)(fetcher.query), _object_spread_props(_object_spread({}, fetcher.queryOptions), {
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 || {}
@@ -18,8 +18,8 @@ function _interop_require_default(obj) {
18
18
  };
19
19
  }
20
20
  const DeleteButton = ({ option, isDisplay, fetchedProps, displayed, setDisplayed })=>{
21
- const { multiple, search_path, getOption, title_path } = fetchedProps !== null && fetchedProps !== void 0 ? fetchedProps : {};
22
- const isDisplayButton = isDisplay && (multiple && (displayed === null || displayed === void 0 ? void 0 : displayed.length) > 0 || !multiple && displayed[search_path] === getOption(option, title_path));
21
+ const { multiple, search_path, title_path } = fetchedProps !== null && fetchedProps !== void 0 ? fetchedProps : {};
22
+ const isDisplayButton = isDisplay && (multiple && (displayed === null || displayed === void 0 ? void 0 : displayed.length) > 0 || !multiple && displayed[search_path] === (0, _helpers.getOption)(option, title_path));
23
23
  switch(isDisplayButton){
24
24
  case true:
25
25
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
package/package.json CHANGED
@@ -69,5 +69,5 @@
69
69
  "require": "./dist/index.js"
70
70
  }
71
71
  },
72
- "version": "0.3.56"
72
+ "version": "0.3.58"
73
73
  }