@fixefy/fixefy-ui-components 0.2.15 → 0.2.17

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.
@@ -120,7 +120,7 @@ const checkedIcon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBox,
120
120
  fontSize: "small"
121
121
  });
122
122
  const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
123
- const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder } = props;
123
+ const { onAdd, onRemoveOne, onRemoveAll, fetcher, disabled, type = 'text', variables, search_path, modal_type, multiple, name, query, isInitialOpen, placeholder, title_path } = props;
124
124
  const ref = (0, _react.useRef)(null);
125
125
  const theme = (0, _material.useTheme)();
126
126
  const [displayed, setDisplayed] = (0, _react.useState)(multiple ? [] : '');
@@ -234,11 +234,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
234
234
  storedDisplayed = JSON.parse(storedDisplayed);
235
235
  if (multiple) {
236
236
  const newDisplayed = storedDisplayed[name].filter((opt)=>{
237
- if (search_path.includes('workspace')) {
238
- return opt['title'] !== option['title'];
239
- } else {
240
- return opt[search_path] !== option[search_path];
241
- }
237
+ opt[title_path] !== option[title_path];
242
238
  });
243
239
  storedDisplayed[name] = newDisplayed;
244
240
  } else {
@@ -252,11 +248,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
252
248
  switch(multiple){
253
249
  case true:
254
250
  if (displayed.map((item)=>{
255
- if (search_path.includes('workspace')) {
256
- return item['title'];
257
- } else {
258
- return item[search_path];
259
- }
251
+ return item[title_path];
260
252
  }).includes(clicked)) {
261
253
  deleteOneItem(option);
262
254
  } else {
@@ -276,11 +268,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
276
268
  };
277
269
  const deleteOneItem = (item)=>{
278
270
  if (multiple) {
279
- if (search_path.includes('workspace')) {
280
- setDisplayed((prev)=>prev.filter((val)=>val['title'] !== item['title']));
281
- } else {
282
- setDisplayed((prev)=>prev.filter((val)=>val[search_path] !== item[search_path]));
283
- }
271
+ setDisplayed((prev)=>prev.filter((val)=>val[title_path] !== item[title_path]));
284
272
  } else {
285
273
  setDisplayed('');
286
274
  }
@@ -294,11 +282,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
294
282
  } else {
295
283
  if (multiple) {
296
284
  return displayed.map((item)=>{
297
- if (search_path.includes('workspace')) {
298
- return item['title'];
299
- } else {
300
- return item[search_path];
301
- }
285
+ return item[title_path];
302
286
  }).includes(clicked);
303
287
  } else {
304
288
  return displayed[search_path] === clicked;
@@ -354,7 +338,7 @@ const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props)=>{
354
338
  };
355
339
  const getOption = (option)=>{
356
340
  if (option != '') {
357
- let curOption = (0, _helpers.getJPart)(option, search_path, 0) || option.title;
341
+ let curOption = (0, _helpers.getJPart)(option, title_path, 0);
358
342
  if (curOption !== null && (0, _helpers.isArrayValid)(curOption)) {
359
343
  curOption = curOption[0];
360
344
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "@apollo/client": "^3.10.4",
8
- "@fixefy/fixefy-ui-utils": "0.0.338",
8
+ "@fixefy/fixefy-ui-utils": "^0.2.11",
9
9
  "@mui/icons-material": "^5.15.19",
10
10
  "@mui/material": "^5.15.19",
11
11
  "@mui/styled-engine": "^5.15.14",
@@ -49,14 +49,14 @@
49
49
  "release17:config": "node version-check.js 17 && yarn pre_release && npm publish --userconfig ./.npmrc",
50
50
  "release18": "node version-check.js 18 && yarn pre_release && npm pack && npm publish",
51
51
  "release18:config": "node version-check.js 18 && yarn pre_release && npm publish --userconfig ./.npmrc",
52
- "raw_publish": "npm publish --userconfig ./.npmrc --otp=000000",
52
+ "raw_publish": "npm publish --userconfig ./.npmrc --otp 000000",
53
53
  "clean": "rm -rf build && rm -rf dist-* && yarn clean:node",
54
54
  "clean:node": "rm -rf node_modules",
55
55
  "lint": "eslint \"{**/*,*}.{js,ts,jsx,tsx}\"",
56
56
  "prettier": "prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\""
57
57
  },
58
58
  "engines": {
59
- "node": "18.17.1 || ^20.14"
59
+ "node": "20"
60
60
  },
61
61
  "files": [
62
62
  "dist/**/*"
@@ -70,5 +70,5 @@
70
70
  "require": "./dist/index.js"
71
71
  }
72
72
  },
73
- "version": "0.2.15"
73
+ "version": "0.2.17"
74
74
  }