@bigbinary/neeto-tags-frontend 2.1.2 → 2.1.4

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.
Files changed (35) hide show
  1. package/dist/NeetoTags.js +23 -36
  2. package/dist/NeetoTags.js.map +1 -1
  3. package/dist/TagsComponent.js +6 -5
  4. package/dist/TagsComponent.js.map +1 -1
  5. package/dist/cjs/NeetoTags.js +91 -131
  6. package/dist/cjs/NeetoTags.js.map +1 -1
  7. package/dist/cjs/TagsComponent.js +29 -42
  8. package/dist/cjs/TagsComponent.js.map +1 -1
  9. package/dist/cjs/index.js +9 -8
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/cjs/utils.js +3 -4
  12. package/dist/cjs/utils.js.map +1 -1
  13. package/dist/index.js +9 -6
  14. package/dist/index.js.map +1 -1
  15. package/dist/inject-css-DmrvuTKK.js +4 -0
  16. package/dist/inject-css-DmrvuTKK.js.map +1 -0
  17. package/dist/inject-css-vQvjPR2x.js +6 -0
  18. package/dist/inject-css-vQvjPR2x.js.map +1 -0
  19. package/dist/{useTagsApi-d2bdaf74.js → useTagsApi-CeXBXe3i.js} +10 -43
  20. package/dist/useTagsApi-CeXBXe3i.js.map +1 -0
  21. package/dist/{useTagsApi-6d449233.js → useTagsApi-V3f4Zddm.js} +3 -31
  22. package/dist/useTagsApi-V3f4Zddm.js.map +1 -0
  23. package/dist/utils.js +3 -2
  24. package/dist/utils.js.map +1 -1
  25. package/package.json +107 -89
  26. package/dist/defineProperty-e90a259c.js +0 -43
  27. package/dist/defineProperty-e90a259c.js.map +0 -1
  28. package/dist/defineProperty-f3094d6c.js +0 -45
  29. package/dist/defineProperty-f3094d6c.js.map +0 -1
  30. package/dist/inject-css-1ae98bac.js +0 -64
  31. package/dist/inject-css-1ae98bac.js.map +0 -1
  32. package/dist/inject-css-b9fd625c.js +0 -59
  33. package/dist/inject-css-b9fd625c.js.map +0 -1
  34. package/dist/useTagsApi-6d449233.js.map +0 -1
  35. package/dist/useTagsApi-d2bdaf74.js.map +0 -1
package/dist/NeetoTags.js CHANGED
@@ -1,19 +1,21 @@
1
- import { _ as _defineProperty } from './defineProperty-e90a259c.js';
2
- import { _ as _arrayLikeToArray, a as _unsupportedIterableToArray, b as _slicedToArray, n } from './inject-css-b9fd625c.js';
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
3
  import { useRef, useState, useMemo, createElement } from 'react';
4
4
  import { useHistory, Switch, Route } from 'react-router-dom';
5
5
  import { showThumbsUpToastr, buildUrl, getQueryParams } from '@bigbinary/neeto-commons-frontend/utils';
6
+ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
6
7
  import { noop, isPresent, existsById, removeById } from '@bigbinary/neeto-cist';
7
8
  import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE, PLURAL, SINGULAR } from '@bigbinary/neeto-commons-frontend/constants';
8
9
  import { useFuncDebounce, handleMetaClick, useQueryParams, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
9
- import { buildFiltersFromURL, Bar } from '@bigbinary/neeto-filters-frontend';
10
+ import FiltersBar from '@bigbinary/neeto-filters-frontend/Bar';
11
+ import { buildFiltersFromURL } from '@bigbinary/neeto-filters-frontend/utils';
10
12
  import Container from '@bigbinary/neeto-molecules/Container';
11
13
  import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
12
14
  import Alert from '@bigbinary/neetoui/Alert';
13
15
  import Typography from '@bigbinary/neetoui/Typography';
14
16
  import { mergeLeft, pluck, isEmpty } from 'ramda';
15
17
  import { useTranslation, Trans } from 'react-i18next';
16
- import { P as PANE_TYPES, u as useUpdateTag, a as useCreateTag, I as INITIAL_TAG_VALUES, b as useFetchTags, c as useDeleteTag, d as useMergeTags } from './useTagsApi-6d449233.js';
18
+ import { P as PANE_TYPES, u as useUpdateTag, a as useCreateTag, I as INITIAL_TAG_VALUES, b as useFetchTags, c as useDeleteTag, d as useMergeTags } from './useTagsApi-V3f4Zddm.js';
17
19
  import Tab from '@bigbinary/neetoui/Tab';
18
20
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
21
  import { t } from 'i18next';
@@ -32,31 +34,17 @@ import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
32
34
  import Dropdown from '@bigbinary/neetoui/Dropdown';
33
35
  import Tag from '@bigbinary/neetoui/Tag';
34
36
  import NeetoUITagMergeIcon from '@bigbinary/neeto-icons/Merge';
35
- import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
37
+ import Spinner from '@bigbinary/neetoui/Spinner';
36
38
  import classNames from 'classnames';
37
39
  import Check from '@bigbinary/neeto-icons/Check';
38
40
  import Input$1 from '@bigbinary/neetoui/Input';
39
41
  import Modal from '@bigbinary/neetoui/Modal';
42
+ import { n } from './inject-css-DmrvuTKK.js';
40
43
  import '@tanstack/react-query';
41
44
  import '@bigbinary/neetoui/Toastr';
45
+ import '@babel/runtime/helpers/objectWithoutProperties';
42
46
  import 'axios';
43
47
 
44
- function _arrayWithoutHoles(arr) {
45
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
46
- }
47
-
48
- function _iterableToArray(iter) {
49
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
50
- }
51
-
52
- function _nonIterableSpread() {
53
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
54
- }
55
-
56
- function _toConsumableArray(arr) {
57
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
58
- }
59
-
60
48
  var Menu$1 = function Menu(_ref) {
61
49
  var tagTypes = _ref.tagTypes,
62
50
  tagType = _ref.tagType,
@@ -169,7 +157,7 @@ var useTagsForm = function useTagsForm(_ref) {
169
157
  var handleSubmit = function handleSubmit(values, _ref2) {
170
158
  var _values$description;
171
159
  var resetForm = _ref2.resetForm;
172
- values.description = values === null || values === void 0 || (_values$description = values.description) === null || _values$description === void 0 ? void 0 : _values$description.trim();
160
+ values.description = values === null || values === void 0 ? void 0 : (_values$description = values.description) === null || _values$description === void 0 ? void 0 : _values$description.trim();
173
161
  var tagData = {
174
162
  payload: {
175
163
  tag: values
@@ -183,7 +171,7 @@ var useTagsForm = function useTagsForm(_ref) {
183
171
  onSuccess: function onSuccess() {
184
172
  var _tagOperation$onSucce;
185
173
  !isEdit && goToFirstPage();
186
- tagOperation === null || tagOperation === void 0 || (_tagOperation$onSucce = tagOperation.onSuccess) === null || _tagOperation$onSucce === void 0 || _tagOperation$onSucce.callback();
174
+ tagOperation === null || tagOperation === void 0 ? void 0 : (_tagOperation$onSucce = tagOperation.onSuccess) === null || _tagOperation$onSucce === void 0 ? void 0 : _tagOperation$onSucce.callback();
187
175
  onClose();
188
176
  },
189
177
  onError: function onError() {
@@ -504,12 +492,12 @@ var Dashboard = function Dashboard(_ref) {
504
492
  onSuccess: function onSuccess() {
505
493
  var _data$tags, _deleteTags$onSuccess;
506
494
  setIsDeleteAlertOpen(false);
507
- if ((data === null || data === void 0 || (_data$tags = data.tags) === null || _data$tags === void 0 ? void 0 : _data$tags.length) === 1) {
495
+ if ((data === null || data === void 0 ? void 0 : (_data$tags = data.tags) === null || _data$tags === void 0 ? void 0 : _data$tags.length) === 1) {
508
496
  setFilters(mergeLeft({
509
497
  page: filters.page - 1
510
498
  }));
511
499
  }
512
- deleteTags === null || deleteTags === void 0 || (_deleteTags$onSuccess = deleteTags.onSuccess) === null || _deleteTags$onSuccess === void 0 || _deleteTags$onSuccess.callback();
500
+ deleteTags === null || deleteTags === void 0 ? void 0 : (_deleteTags$onSuccess = deleteTags.onSuccess) === null || _deleteTags$onSuccess === void 0 ? void 0 : _deleteTags$onSuccess.callback();
513
501
  // @ts-ignore
514
502
  showThumbsUpToastr();
515
503
  }
@@ -561,7 +549,7 @@ var Dashboard = function Dashboard(_ref) {
561
549
  keyword: searchKeywordProps
562
550
  }
563
551
  })
564
- }), /*#__PURE__*/jsx(Bar, {
552
+ }), /*#__PURE__*/jsx(FiltersBar, {
565
553
  columns: NEETO_FILTERS,
566
554
  isOpen: isFiltersPaneOpen,
567
555
  keyword: searchKeywordProps,
@@ -668,10 +656,9 @@ var List = function List(_ref) {
668
656
  });
669
657
  }, [isSource, sourceTags, destinationTags] // eslint-disable-line react-hooks/exhaustive-deps
670
658
  );
671
-
672
659
  var filteredTags = orderBySourceTags(tagList, sourceTags).filter(function (tag) {
673
- var _tag$name;
674
- return tag === null || tag === void 0 || (_tag$name = tag.name) === null || _tag$name === void 0 || (_tag$name = _tag$name.toLowerCase()) === null || _tag$name === void 0 ? void 0 : _tag$name.includes(searchTerm.toLowerCase().trim());
660
+ var _tag$name, _tag$name$toLowerCase;
661
+ return tag === null || tag === void 0 ? void 0 : (_tag$name = tag.name) === null || _tag$name === void 0 ? void 0 : (_tag$name$toLowerCase = _tag$name.toLowerCase()) === null || _tag$name$toLowerCase === void 0 ? void 0 : _tag$name$toLowerCase.includes(searchTerm.toLowerCase().trim());
675
662
  });
676
663
  return /*#__PURE__*/jsxs("div", {
677
664
  className: "neeto-tags-merge__list neeto-tags-border neeto-ui-border-gray-300 neeto-ui-shadow-xs neeto-ui-rounded-lg neeto-ui-flex neeto-ui-flex-col p-3 md:p-4 lg:p-6",
@@ -726,7 +713,6 @@ function commonjsRequire(path) {
726
713
  var pluralize$1 = {exports: {}};
727
714
 
728
715
  /* global define */
729
- pluralize$1.exports;
730
716
 
731
717
  (function (module, exports) {
732
718
  (function (root, pluralize) {
@@ -1225,7 +1211,7 @@ pluralize$1.exports;
1225
1211
 
1226
1212
  return pluralize;
1227
1213
  });
1228
- } (pluralize$1, pluralize$1.exports));
1214
+ } (pluralize$1));
1229
1215
 
1230
1216
  var pluralizeExports = pluralize$1.exports;
1231
1217
  var pluralize = /*@__PURE__*/getDefaultExportFromCjs(pluralizeExports);
@@ -1313,7 +1299,8 @@ var Merge = function Merge(_ref) {
1313
1299
  var _useTranslation = useTranslation(),
1314
1300
  t = _useTranslation.t;
1315
1301
  var _useFetchTags = useFetchTags({
1316
- url: tagType.url
1302
+ url: tagType.url,
1303
+ skipPagination: true
1317
1304
  }),
1318
1305
  data = _useFetchTags.data,
1319
1306
  isLoading = _useFetchTags.isLoading;
@@ -1360,15 +1347,15 @@ var Merge = function Merge(_ref) {
1360
1347
  var _mergeTags$onSuccess;
1361
1348
  setDestinationTags([]);
1362
1349
  setSourceTags([]);
1363
- mergeTags === null || mergeTags === void 0 || (_mergeTags$onSuccess = mergeTags.onSuccess) === null || _mergeTags$onSuccess === void 0 || _mergeTags$onSuccess.callback();
1350
+ mergeTags === null || mergeTags === void 0 ? void 0 : (_mergeTags$onSuccess = mergeTags.onSuccess) === null || _mergeTags$onSuccess === void 0 ? void 0 : _mergeTags$onSuccess.callback();
1364
1351
  setIsModalOpen(false);
1365
1352
  }
1366
1353
  });
1367
1354
  };
1368
1355
  if (isLoading) {
1369
1356
  return /*#__PURE__*/jsx("div", {
1370
- className: "neeto-ui-w-full neeto-ui-h-screen",
1371
- children: /*#__PURE__*/jsx(PageLoader, {})
1357
+ className: "flex h-full w-full items-center justify-center",
1358
+ children: /*#__PURE__*/jsx(Spinner, {})
1372
1359
  });
1373
1360
  }
1374
1361
  return /*#__PURE__*/jsxs("div", {
@@ -1433,7 +1420,7 @@ var getCurrentTagType = function getCurrentTagType() {
1433
1420
  tagLabel = _getQueryParams.view;
1434
1421
  var requiredTagType = tagTypes.find(function (tagType) {
1435
1422
  var _tagType$label;
1436
- return (tagType === null || tagType === void 0 || (_tagType$label = tagType.label) === null || _tagType$label === void 0 ? void 0 : _tagType$label.toLowerCase()) === tagLabel;
1423
+ return (tagType === null || tagType === void 0 ? void 0 : (_tagType$label = tagType.label) === null || _tagType$label === void 0 ? void 0 : _tagType$label.toLowerCase()) === tagLabel;
1437
1424
  });
1438
1425
  return requiredTagType || tagTypes[0];
1439
1426
  };