@leav/ui 1.3.0 → 1.4.0-c456a7bc
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.
- package/dist/_gqlTypes/index.d.ts +29 -6
- package/dist/_gqlTypes/index.js +16 -6
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/records/getRecordsFromLibraryQuery.d.ts +1 -1
- package/dist/components/Explorer/DataView.d.ts +0 -1
- package/dist/components/Explorer/DataView.js +30 -63
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +2 -3
- package/dist/components/Explorer/Explorer.js +32 -41
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerFiltersAndSorts.d.ts +7 -0
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js +48 -0
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js.map +1 -0
- package/dist/components/Explorer/ExplorerToolbar.d.ts +3 -1
- package/dist/components/Explorer/ExplorerToolbar.js +12 -46
- package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
- package/dist/components/Explorer/IdCard.js +1 -1
- package/dist/components/Explorer/IdCard.js.map +1 -1
- package/dist/components/Explorer/TableNameCell.d.ts +7 -0
- package/dist/components/Explorer/TableNameCell.js +65 -0
- package/dist/components/Explorer/TableNameCell.js.map +1 -0
- package/dist/components/Explorer/_constants.d.ts +2 -0
- package/dist/components/Explorer/_constants.js +2 -0
- package/dist/components/Explorer/_constants.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +1 -0
- package/dist/components/Explorer/_types.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useMassActions.d.ts +3 -2
- package/dist/components/Explorer/actions-mass/useMassActions.js +9 -14
- package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +2 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
- package/dist/components/Explorer/actions-primary/usePrimaryActions.d.ts +3 -1
- package/dist/components/Explorer/actions-primary/usePrimaryActions.js +14 -10
- package/dist/components/Explorer/actions-primary/usePrimaryActions.js.map +1 -1
- package/dist/components/Explorer/link-item/LinkModal.js +1 -1
- package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
- package/dist/components/Explorer/list-saved-views/SavedViews.js +26 -2
- package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +2 -2
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js.map +1 -1
- package/dist/components/Explorer/useSearchInput.js +1 -1
- package/dist/components/Explorer/useSearchInput.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js +4 -12
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +2 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +28 -7
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/useEditRecordModal.d.ts +14 -0
- package/dist/components/RecordEdition/EditRecordModal/useEditRecordModal.js +22 -0
- package/dist/components/RecordEdition/EditRecordModal/useEditRecordModal.js.map +1 -0
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +43 -22
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +1 -6
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
- package/dist/components/SelectTreeNode/TreeNodeTitle.d.ts +7 -5
- package/dist/components/SelectTreeNode/TreeNodeTitle.js +22 -6
- package/dist/components/SelectTreeNode/TreeNodeTitle.js.map +1 -1
- package/dist/constants.d.ts +10 -2
- package/dist/constants.js +1 -2
- package/dist/constants.js.map +1 -1
- package/dist/hooks/useAppLang/useAppLang.js +2 -1
- package/dist/hooks/useAppLang/useAppLang.js.map +1 -1
- package/dist/hooks/useAuth/useAuth.js +2 -1
- package/dist/hooks/useAuth/useAuth.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/schema.d.ts +2 -2
- package/dist/hooks/useIFrameMessenger/schema.js +3 -3
- package/dist/hooks/useIFrameMessenger/schema.js.map +1 -1
- package/dist/hooks/useLoginChecker/useLoginChecker.js +2 -1
- package/dist/hooks/useLoginChecker/useLoginChecker.js.map +1 -1
- package/dist/locales/en/shared.json +3 -1
- package/dist/locales/fr/shared.json +3 -1
- package/package.json +4 -4
- package/dist/components/Explorer/actions-item/useEditItemAction.d.ts +0 -19
- package/dist/components/Explorer/actions-item/useEditItemAction.js +0 -57
- package/dist/components/Explorer/actions-item/useEditItemAction.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoginChecker.js","sourceRoot":"","sources":["../../../src/hooks/useLoginChecker/useLoginChecker.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,MAAM,CAAC,OAAO,UAAU,eAAe;IACnC,OAAO;QACH,YAAY,EAAE,KAAK,IAAI,EAAE;YACrB,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,qBAAqB,EAAE;
|
|
1
|
+
{"version":3,"file":"useLoginChecker.js","sourceRoot":"","sources":["../../../src/hooks/useLoginChecker/useLoginChecker.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9C,MAAM,CAAC,OAAO,UAAU,eAAe;IACnC,OAAO;QACH,YAAY,EAAE,KAAK,IAAI,EAAE;YACrB,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,eAAe,qBAAqB,EAAE;gBAC7D,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;aAChD,CAAC,CAAC;YAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,EAAC,KAAK,EAAE,GAAG,EAAC,CAAC,CAAC;YAClD,CAAC;QACL,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -731,7 +731,9 @@
|
|
|
731
731
|
"save-view-as": "Save as...",
|
|
732
732
|
"share-view": "Share",
|
|
733
733
|
"unshare-view": "Unshare",
|
|
734
|
-
"reinit-view": "Reset"
|
|
734
|
+
"reinit-view": "Reset",
|
|
735
|
+
"copy-id": "Copy view Id",
|
|
736
|
+
"copied": "Copied"
|
|
735
737
|
},
|
|
736
738
|
"massAction": {
|
|
737
739
|
"itemsTotal_one": "{{count, number}} item",
|
|
@@ -731,7 +731,9 @@
|
|
|
731
731
|
"save-view-as": "Enregistrer sous...",
|
|
732
732
|
"share-view": "Partager",
|
|
733
733
|
"unshare-view": "Retirer le partage",
|
|
734
|
-
"reinit-view": "Réinitialiser"
|
|
734
|
+
"reinit-view": "Réinitialiser",
|
|
735
|
+
"copy-id": "Copier l'Id de la vue",
|
|
736
|
+
"copied": "Copié"
|
|
735
737
|
},
|
|
736
738
|
"massAction": {
|
|
737
739
|
"itemsTotal_one": "{{count, number}} élément",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leav/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-c456a7bc",
|
|
4
4
|
"description": "Shared React components and hooks",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepublishOnly": "yarn build",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react-table": "7.7.12",
|
|
46
46
|
"@types/uuid": "^9",
|
|
47
47
|
"antd": "5.22.2",
|
|
48
|
-
"aristid-ds": "14.0.0-
|
|
48
|
+
"aristid-ds": "14.0.0-73ccc64",
|
|
49
49
|
"babel-jest": "29.3.1",
|
|
50
50
|
"commander": "9.5.0",
|
|
51
51
|
"graphql": "16.6.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@ant-design/icons": ">=5.2",
|
|
68
68
|
"@apollo/client": ">=3.8.1",
|
|
69
69
|
"antd": "5.22.2",
|
|
70
|
-
"aristid-ds": "14.0.0-
|
|
70
|
+
"aristid-ds": "14.0.0-73ccc64",
|
|
71
71
|
"dayjs": "^1.11.13",
|
|
72
72
|
"i18next": "22.5",
|
|
73
73
|
"react": "18.2.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@ckeditor/ckeditor5-react": "6.1.0",
|
|
83
83
|
"@dnd-kit/core": "6.1.0",
|
|
84
84
|
"@dnd-kit/sortable": "8.0.0",
|
|
85
|
-
"@leav/utils": "1.
|
|
85
|
+
"@leav/utils": "1.4.0",
|
|
86
86
|
"@uidotdev/usehooks": "2.4.1",
|
|
87
87
|
"dompurify": "3.2.4",
|
|
88
88
|
"html-react-parser": "4.2.2",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type FeatureHook, type IItemAction } from '../_types';
|
|
2
|
-
/**
|
|
3
|
-
* Hook used to get the action for `<DataView />` component.
|
|
4
|
-
*
|
|
5
|
-
* When the mutation for editing is done, the Apollo cache will be refreshed (`Record` and `RecordIdentity`)
|
|
6
|
-
* from only edited record.
|
|
7
|
-
*
|
|
8
|
-
* It returns also two parts : one for the action button call - one for displaying the modal required by the action.
|
|
9
|
-
*
|
|
10
|
-
* @param isEnabled - whether the action is present
|
|
11
|
-
*/
|
|
12
|
-
export declare const useEditItemAction: ({ isEnabled, formId, onEdit, refetch }: FeatureHook<{
|
|
13
|
-
onEdit?: IItemAction["callback"];
|
|
14
|
-
formId?: string;
|
|
15
|
-
refetch: () => void;
|
|
16
|
-
}>) => {
|
|
17
|
-
editItemAction: IItemAction;
|
|
18
|
-
editItemModal: JSX.Element;
|
|
19
|
-
};
|
|
@@ -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,IAA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