@leav/ui 1.3.0 → 1.4.0-83f529d8

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 (84) hide show
  1. package/dist/_gqlTypes/index.d.ts +29 -6
  2. package/dist/_gqlTypes/index.js +16 -6
  3. package/dist/_gqlTypes/index.js.map +1 -1
  4. package/dist/components/Explorer/DataView.d.ts +0 -1
  5. package/dist/components/Explorer/DataView.js +30 -63
  6. package/dist/components/Explorer/DataView.js.map +1 -1
  7. package/dist/components/Explorer/Explorer.d.ts +2 -3
  8. package/dist/components/Explorer/Explorer.js +32 -41
  9. package/dist/components/Explorer/Explorer.js.map +1 -1
  10. package/dist/components/Explorer/ExplorerFiltersAndSorts.d.ts +7 -0
  11. package/dist/components/Explorer/ExplorerFiltersAndSorts.js +48 -0
  12. package/dist/components/Explorer/ExplorerFiltersAndSorts.js.map +1 -0
  13. package/dist/components/Explorer/ExplorerToolbar.d.ts +3 -1
  14. package/dist/components/Explorer/ExplorerToolbar.js +12 -46
  15. package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
  16. package/dist/components/Explorer/IdCard.js +1 -1
  17. package/dist/components/Explorer/IdCard.js.map +1 -1
  18. package/dist/components/Explorer/TableNameCell.d.ts +7 -0
  19. package/dist/components/Explorer/TableNameCell.js +65 -0
  20. package/dist/components/Explorer/TableNameCell.js.map +1 -0
  21. package/dist/components/Explorer/_constants.d.ts +2 -0
  22. package/dist/components/Explorer/_constants.js +2 -0
  23. package/dist/components/Explorer/_constants.js.map +1 -1
  24. package/dist/components/Explorer/_types.d.ts +1 -0
  25. package/dist/components/Explorer/_types.js.map +1 -1
  26. package/dist/components/Explorer/actions-mass/useMassActions.d.ts +3 -2
  27. package/dist/components/Explorer/actions-mass/useMassActions.js +9 -14
  28. package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
  29. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +2 -1
  30. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
  31. package/dist/components/Explorer/actions-primary/usePrimaryActions.d.ts +3 -1
  32. package/dist/components/Explorer/actions-primary/usePrimaryActions.js +14 -10
  33. package/dist/components/Explorer/actions-primary/usePrimaryActions.js.map +1 -1
  34. package/dist/components/Explorer/link-item/LinkModal.js +1 -1
  35. package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
  36. package/dist/components/Explorer/list-saved-views/SavedViews.js +26 -2
  37. package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -1
  38. package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.js.map +1 -1
  39. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +2 -2
  40. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
  41. package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js +1 -1
  42. package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js.map +1 -1
  43. package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js +1 -1
  44. package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js.map +1 -1
  45. package/dist/components/Explorer/useSearchInput.js +1 -1
  46. package/dist/components/Explorer/useSearchInput.js.map +1 -1
  47. package/dist/components/RecordEdition/EditRecord/EditRecord.js +1 -1
  48. package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
  49. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js +4 -12
  50. package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js.map +1 -1
  51. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +2 -0
  52. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
  53. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.d.ts +2 -1
  54. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +28 -7
  55. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +1 -1
  56. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +1 -1
  57. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
  58. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +1 -1
  59. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
  60. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +1 -1
  61. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
  62. package/dist/components/RecordEdition/EditRecordModal/useEditRecordModal.d.ts +14 -0
  63. package/dist/components/RecordEdition/EditRecordModal/useEditRecordModal.js +22 -0
  64. package/dist/components/RecordEdition/EditRecordModal/useEditRecordModal.js.map +1 -0
  65. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +43 -22
  66. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
  67. package/dist/constants.d.ts +10 -2
  68. package/dist/constants.js +1 -2
  69. package/dist/constants.js.map +1 -1
  70. package/dist/hooks/useAppLang/useAppLang.js +2 -1
  71. package/dist/hooks/useAppLang/useAppLang.js.map +1 -1
  72. package/dist/hooks/useAuth/useAuth.js +2 -1
  73. package/dist/hooks/useAuth/useAuth.js.map +1 -1
  74. package/dist/hooks/useIFrameMessenger/schema.d.ts +2 -2
  75. package/dist/hooks/useIFrameMessenger/schema.js +3 -3
  76. package/dist/hooks/useIFrameMessenger/schema.js.map +1 -1
  77. package/dist/hooks/useLoginChecker/useLoginChecker.js +2 -1
  78. package/dist/hooks/useLoginChecker/useLoginChecker.js.map +1 -1
  79. package/dist/locales/en/shared.json +3 -1
  80. package/dist/locales/fr/shared.json +3 -1
  81. package/package.json +4 -4
  82. package/dist/components/Explorer/actions-item/useEditItemAction.d.ts +0 -19
  83. package/dist/components/Explorer/actions-item/useEditItemAction.js +0 -57
  84. package/dist/components/Explorer/actions-item/useEditItemAction.js.map +0 -1
@@ -1,57 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
- // This file is released under LGPL V3
4
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
- import { useMemo, useState } from 'react';
6
- import { FaEye } from 'react-icons/fa';
7
- import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
8
- import { EditRecordModal } from '../../../components/RecordEdition/EditRecordModal';
9
- import { RecordFilterCondition, useExplorerLibraryDataLazyQuery } from '../../../_gqlTypes';
10
- import { EDIT_RECORD_MODAL_CLASSNAME } from '../_constants';
11
- /**
12
- * Hook used to get the action for `<DataView />` component.
13
- *
14
- * When the mutation for editing is done, the Apollo cache will be refreshed (`Record` and `RecordIdentity`)
15
- * from only edited record.
16
- *
17
- * It returns also two parts : one for the action button call - one for displaying the modal required by the action.
18
- *
19
- * @param isEnabled - whether the action is present
20
- */
21
- export const useEditItemAction = ({ isEnabled, formId, onEdit, refetch }) => {
22
- const { t } = useSharedTranslation();
23
- const [refreshItem] = useExplorerLibraryDataLazyQuery({ fetchPolicy: 'network-only' });
24
- const [editingItem, setEditingItem] = useState(null);
25
- const _editItemAction = {
26
- label: t('explorer.edit-item'),
27
- icon: _jsx(FaEye, {}),
28
- callback: item => {
29
- setEditingItem(item);
30
- }
31
- };
32
- const _handleEditModalClose = (item) => {
33
- refetch();
34
- refreshItem({
35
- variables: {
36
- libraryId: item.libraryId,
37
- attributeIds: ['id'], // TODO: get list of displayed attributes stored in the view
38
- pagination: { limit: 1 },
39
- filters: [
40
- {
41
- condition: RecordFilterCondition.EQUAL,
42
- field: 'id',
43
- value: item.itemId
44
- }
45
- ]
46
- }
47
- });
48
- onEdit?.(item);
49
- setEditingItem(null);
50
- };
51
- const editAction = useMemo(() => ({
52
- editItemAction: isEnabled ? _editItemAction : null,
53
- editItemModal: isEnabled && editingItem !== null ? (_jsx(EditRecordModal, { className: EDIT_RECORD_MODAL_CLASSNAME, open: true, editionFormId: formId, record: editingItem.whoAmI, library: editingItem.libraryId, onClose: () => _handleEditModalClose(editingItem) })) : null
54
- }), [isEnabled, editingItem]);
55
- return editAction;
56
- };
57
- //# sourceMappingURL=useEditItemAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditItemAction.js","sourceRoot":"","sources":["../../../../src/components/Explorer/actions-item/useEditItemAction.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,KAAK,EAAQ,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,qBAAqB,EAAE,+BAA+B,EAAC,MAAM,eAAe,CAAC;AAErF,OAAO,EAAC,2BAA2B,EAAC,MAAM,eAAe,CAAC;AAE1D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAC9B,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,EAKT,EAAE,EAAE;IACF,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,CAAC,WAAW,CAAC,GAAG,+BAA+B,CAAC,EAAC,WAAW,EAAE,cAAc,EAAC,CAAC,CAAC;IAErF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAmB,IAAI,CAAC,CAAC;IAEvE,MAAM,eAAe,GAAgB;QACjC,KAAK,EAAE,CAAC,CAAC,oBAAoB,CAAC;QAC9B,IAAI,EAAE,KAAC,KAAK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