@leav/ui 0.3.6-47ac9d2 → 0.3.6-50b62a3
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/__mocks__/common/form.d.ts +0 -1
- package/dist/__mocks__/common/form.js +0 -15
- package/dist/__mocks__/common/form.js.map +1 -1
- package/dist/components/Explorer/DataView.d.ts +1 -6
- package/dist/components/Explorer/DataView.js +18 -66
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +2 -5
- package/dist/components/Explorer/Explorer.js +11 -48
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/TableCell.js +1 -9
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/_constants.d.ts +0 -1
- package/dist/components/Explorer/_constants.js +0 -1
- package/dist/components/Explorer/_constants.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.d.ts +2 -2
- package/dist/components/Explorer/_queries/useExplorerData.js +93 -5
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +1 -7
- package/dist/components/Explorer/display-view-filters/ExplorerToolBar.d.ts +4 -0
- package/dist/components/Explorer/display-view-filters/ExplorerToolBar.js +47 -0
- package/dist/components/Explorer/display-view-filters/ExplorerToolBar.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.d.ts +0 -1
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.d.ts +1 -3
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js +3 -9
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.d.ts +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +0 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +2 -16
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +0 -11
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
- package/dist/components/Explorer/useRemoveAction.d.ts +2 -13
- package/dist/components/Explorer/useRemoveAction.js +9 -28
- package/dist/components/Explorer/useRemoveAction.js.map +1 -1
- package/dist/components/Explorer/useSearchInput.d.ts +4 -10
- package/dist/components/Explorer/useSearchInput.js +0 -8
- package/dist/components/Explorer/useSearchInput.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +57 -53
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/{EditRecordSkeleton → EditRecordContent}/EditRecordSkeleton.d.ts +1 -1
- package/dist/components/RecordEdition/{EditRecordSkeleton → EditRecordContent}/EditRecordSkeleton.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/EditRecordSkeleton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useExecuteSaveValueBatchMutation.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js +3 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +25 -43
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +1 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +2 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +7 -12
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +13 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +2 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +4 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +14 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js +2 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +4 -5
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
- package/dist/components/RecordEdition/index.d.ts +0 -1
- package/dist/components/RecordEdition/index.js +0 -1
- package/dist/components/RecordEdition/index.js.map +1 -1
- package/dist/locales/en/shared.json +7 -22
- package/dist/locales/fr/shared.json +9 -24
- package/package.json +1 -1
- package/dist/components/Explorer/ExplorerToolbar.d.ts +0 -5
- package/dist/components/Explorer/ExplorerToolbar.js +0 -45
- package/dist/components/Explorer/ExplorerToolbar.js.map +0 -1
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.d.ts +0 -4
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.js +0 -81
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.js.map +0 -1
- package/dist/components/Explorer/useColumnWidth.d.ts +0 -6
- package/dist/components/Explorer/useColumnWidth.js +0 -48
- package/dist/components/Explorer/useColumnWidth.js.map +0 -1
- package/dist/components/Explorer/useDeactivateMassAction.d.ts +0 -27
- package/dist/components/Explorer/useDeactivateMassAction.js +0 -71
- package/dist/components/Explorer/useDeactivateMassAction.js.map +0 -1
- package/dist/components/Explorer/useMassActions.d.ts +0 -27
- package/dist/components/Explorer/useMassActions.js +0 -109
- package/dist/components/Explorer/useMassActions.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/AttributeSummary.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/AttributeSummary.js +0 -9
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/AttributeSummary.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.js +0 -25
- package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.js +0 -53
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSkeleton/EditRecordSkeleton.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordSkeleton/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordSkeleton/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordSkeleton/index.js.map +0 -1
|
@@ -498,11 +498,7 @@
|
|
|
498
498
|
"open_preview_modal": "Ouvrir la modale d'aperçu",
|
|
499
499
|
"informations": "Informations",
|
|
500
500
|
"chat": "Chat",
|
|
501
|
-
"history": "Historique"
|
|
502
|
-
"entity_overview": "Fiche {{entity}}",
|
|
503
|
-
"attribute": "Attribut",
|
|
504
|
-
"attribute_format": "Format de l'attribut",
|
|
505
|
-
"descriptive": "Descriptif"
|
|
501
|
+
"history": "Historique"
|
|
506
502
|
},
|
|
507
503
|
"view": {
|
|
508
504
|
"views": "Vues",
|
|
@@ -566,8 +562,8 @@
|
|
|
566
562
|
"records_deactivation": {
|
|
567
563
|
"title": "Désactiver les éléments",
|
|
568
564
|
"title_one": "Désactiver",
|
|
569
|
-
"confirm": "Êtes-vous sûr de vouloir désactiver les éléments sélectionnés
|
|
570
|
-
"confirm_one": "Êtes-vous sûr de vouloir désactiver cet élément
|
|
565
|
+
"confirm": "Êtes-vous sûr de vouloir désactiver les éléments sélectionnés?",
|
|
566
|
+
"confirm_one": "Êtes-vous sûr de vouloir désactiver cet élément?"
|
|
571
567
|
},
|
|
572
568
|
"table-columns-selection": {
|
|
573
569
|
"header": "Colonnes disponibles",
|
|
@@ -649,7 +645,10 @@
|
|
|
649
645
|
"active": "Tris actifs",
|
|
650
646
|
"inactive": "Tris inactifs"
|
|
651
647
|
},
|
|
652
|
-
"toolbar":
|
|
648
|
+
"toolbar": {
|
|
649
|
+
"active": "Filtres actifs",
|
|
650
|
+
"inactive": "Filtres inactifs"
|
|
651
|
+
},
|
|
653
652
|
"reset-filter": "Réinitialiser le filtre",
|
|
654
653
|
"reset-view": "Réinitialiser la vue",
|
|
655
654
|
"empty-data": "Aucun élément trouvé.",
|
|
@@ -659,8 +658,7 @@
|
|
|
659
658
|
"coming-soon": "À venir",
|
|
660
659
|
"show": "Afficher",
|
|
661
660
|
"hide": "Masquer",
|
|
662
|
-
"pagination-total-
|
|
663
|
-
"pagination-total-number_other": "{{from, number}} - {{to, number}} de {{count, number}} éléments",
|
|
661
|
+
"pagination-total-number": "{{from, number}} - {{to, number}} de {{total, number}} éléments",
|
|
664
662
|
"columns": "Colonnes",
|
|
665
663
|
"visible-columns": "Colonnes visibles",
|
|
666
664
|
"invisible-columns": "Colonnes invisibles",
|
|
@@ -672,19 +670,6 @@
|
|
|
672
670
|
"reinit-view": "Réinitialiser",
|
|
673
671
|
"select-condition": "Sélectionner une condition",
|
|
674
672
|
"true": "Vrai",
|
|
675
|
-
"false": "Faux"
|
|
676
|
-
"massAction": {
|
|
677
|
-
"itemsTotal_one": "{{count, number}} élément",
|
|
678
|
-
"itemsTotal_other": "{{count, number}} éléments",
|
|
679
|
-
"selectedItems_one": "{{count, number}} sélectionné",
|
|
680
|
-
"selectedItems_other": "{{count, number}} sélectionnés",
|
|
681
|
-
"deactivate": "Supprimer",
|
|
682
|
-
"toggle_selection": {
|
|
683
|
-
"select_page_one": "Sélectionner l’éléments visible ({{count, number}})",
|
|
684
|
-
"select_page_other": "Sélectionner les éléments visibles ({{count, number}})",
|
|
685
|
-
"select_all": "Tout sélectionner ({{count, number}})",
|
|
686
|
-
"deselect_all": "Tout désélectionner"
|
|
687
|
-
}
|
|
688
|
-
}
|
|
673
|
+
"false": "Faux"
|
|
689
674
|
}
|
|
690
675
|
}
|
package/package.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { KitButton, KitDivider, KitFilter, KitSpace } from 'aristid-ds';
|
|
3
|
-
import { FaTrash } from 'react-icons/fa';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
6
|
-
import { SortOrder } from '../../_gqlTypes';
|
|
7
|
-
import { useViewSettingsContext } from './manage-view-settings/store-view-settings/useViewSettingsContext';
|
|
8
|
-
import { CommonFilterItem } from './manage-view-settings/_shared/CommonFilterItem';
|
|
9
|
-
import { useAttributeDetailsData } from './manage-view-settings/_shared/useAttributeDetailsData';
|
|
10
|
-
import { useOpenViewSettings } from './manage-view-settings';
|
|
11
|
-
const FilterStyled = styled(KitFilter) `
|
|
12
|
-
flex: 0 0 auto;
|
|
13
|
-
`;
|
|
14
|
-
const ExplorerToolbarListStyled = styled.ul `
|
|
15
|
-
padding: calc(var(--general-spacing-xs) * 1px) calc(var(--general-spacing-xxs) * 1px)
|
|
16
|
-
calc(var(--general-spacing-m) * 1px) calc(var(--general-spacing-xxs) * 1px);
|
|
17
|
-
margin: 0;
|
|
18
|
-
list-style: none;
|
|
19
|
-
display: flex;
|
|
20
|
-
overflow: auto;
|
|
21
|
-
flex-wrap: nowrap;
|
|
22
|
-
align-items: center;
|
|
23
|
-
gap: 0;
|
|
24
|
-
white-space: nowrap;
|
|
25
|
-
`;
|
|
26
|
-
const DividerStyled = styled(KitDivider) `
|
|
27
|
-
height: 2em;
|
|
28
|
-
`;
|
|
29
|
-
export const ExplorerToolbar = ({ libraryId, isMassSelectionAll, children }) => {
|
|
30
|
-
const { t } = useSharedTranslation();
|
|
31
|
-
const { view: { filters, sort } } = useViewSettingsContext();
|
|
32
|
-
const { openSettingsPanel } = useOpenViewSettings(libraryId);
|
|
33
|
-
const { attributeDetailsById } = useAttributeDetailsData(libraryId);
|
|
34
|
-
if (filters.length === 0 && sort.length === 0 && children === null) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
const sortValues = sort.length === 0
|
|
38
|
-
? undefined
|
|
39
|
-
: sort.map(({ field, order }) => (attributeDetailsById?.[field]?.label ?? field) +
|
|
40
|
-
' ' +
|
|
41
|
-
(order === SortOrder.asc ? t('explorer.sort-ascending') : t('explorer.sort-descending')));
|
|
42
|
-
const _handleClickOnSort = () => isMassSelectionAll ? undefined : () => openSettingsPanel('sort-items');
|
|
43
|
-
return (_jsxs(ExplorerToolbarListStyled, { "aria-label": t('explorer.toolbar'), children: [children !== null && (_jsxs(_Fragment, { children: [_jsx("li", { children: children }), filters.length !== 0 && _jsx(DividerStyled, { type: "vertical" })] })), filters.length > 0 && (_jsxs(_Fragment, { children: [_jsx(KitSpace, { size: "s", children: filters.map(filter => (_jsx("li", { children: _jsx(CommonFilterItem, { filter: filter, disabled: isMassSelectionAll }, filter.id) }, filter.id))) }), sort.length > 0 && _jsx(DividerStyled, { type: "vertical" })] })), sort.length > 0 && (_jsxs(_Fragment, { children: [_jsx("li", { children: _jsx(FilterStyled, { label: t('explorer.sort-items'), values: sortValues, disabled: isMassSelectionAll, onClick: _handleClickOnSort }) }), _jsx(DividerStyled, { type: "vertical" })] })), _jsx("li", { children: _jsx(FilterStyled, { as: KitButton, type: "secondary", size: "s", danger: true, icon: _jsx(FaTrash, {}), disabled: true /* TODO: why? */, children: t('explorer.reset-view') }) })] }));
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=ExplorerToolbar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExplorerToolbar.js","sourceRoot":"","sources":["../../../src/components/Explorer/ExplorerToolbar.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,sBAAsB,EAAC,MAAM,mEAAmE,CAAC;AACzG,OAAO,EAAC,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAC,uBAAuB,EAAC,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAE3D,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;;CAErC,CAAC;AAEF,MAAM,yBAAyB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;CAW1C,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;CAEvC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAGvB,CAAC,E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AAa,IAAC,IAAI,EAAC,UAAU,GAAG,IAC3D,CACN,EACA,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,8BACI,KAAC,QAAQ,IAAC,IAAI,EAAC,GAAG,YACb,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACnB,uBACI,KAAC,gBAAgB,IAAiB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,IAAvD,MAAM,CAAC,EAAE,CAAkD,IAD7E,MAAM,CAAC,EAAE,CAEb,CACR,CAAC,GACK,EACV,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,aAAa,IAAC,IAAI,EAAC,UAAU,GAAG,IACtD,CACN,EACA,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAChB,8BACI,uBACI,KAAC,YAAY,IACT,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,kBAAkB,GAC7B,GACD,EACL,KAAC,aAAa,IAAC,IAAI,EAAC,UAAU,GAAG,IAClC,CACN,EACD,uBACI,KAAC,YAAY,IACT,EAAE,EAAE,SAAS,EACb,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,GAAG,EACR,MAAM,QACN,IAAI,EAAE,KAAC,OAAO,KAAG,EACjB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,YAE9B,CAAC,CAAC,qBAAqB,CAAC,GACd,GACd,IACmB,CAC/B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
-
// This file is released under LGPL V3
|
|
3
|
-
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
-
import dayjs from 'dayjs';
|
|
5
|
-
import { AttributeFormat, RecordFilterCondition, RecordFilterOperator } from '../../../_gqlTypes';
|
|
6
|
-
import { interleaveElement } from '../../../_utils/interleaveElement';
|
|
7
|
-
import { AttributeConditionFilter } from '../../../types';
|
|
8
|
-
import { nullValueConditions } from '../conditionsHelper';
|
|
9
|
-
export const dateValuesSeparator = '\n';
|
|
10
|
-
const _getDateAtNoon = (date) => dayjs.unix(Number(date)).add(12, 'hour').unix().toString();
|
|
11
|
-
const _getDateRequestFilters = ({ field, condition, value }) => {
|
|
12
|
-
switch (condition) {
|
|
13
|
-
case RecordFilterCondition.BETWEEN:
|
|
14
|
-
const [from, to] = value.split(dateValuesSeparator);
|
|
15
|
-
return [
|
|
16
|
-
{
|
|
17
|
-
field,
|
|
18
|
-
condition,
|
|
19
|
-
value: JSON.stringify({
|
|
20
|
-
from,
|
|
21
|
-
to
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
|
-
case RecordFilterCondition.NOT_EQUAL:
|
|
26
|
-
return [
|
|
27
|
-
{
|
|
28
|
-
field,
|
|
29
|
-
condition: RecordFilterCondition.NOT_EQUAL,
|
|
30
|
-
value: _getDateAtNoon(Number(value))
|
|
31
|
-
}
|
|
32
|
-
];
|
|
33
|
-
case RecordFilterCondition.EQUAL:
|
|
34
|
-
return [
|
|
35
|
-
{
|
|
36
|
-
field,
|
|
37
|
-
condition,
|
|
38
|
-
value: _getDateAtNoon(Number(value))
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
default:
|
|
42
|
-
return [
|
|
43
|
-
{
|
|
44
|
-
field,
|
|
45
|
-
condition,
|
|
46
|
-
value
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const _getBooleanRequestFilters = ({ field, condition, value }) => {
|
|
52
|
-
if (value === 'false') {
|
|
53
|
-
return [
|
|
54
|
-
{
|
|
55
|
-
field,
|
|
56
|
-
condition: AttributeConditionFilter.NOT_EQUAL,
|
|
57
|
-
value: 'true'
|
|
58
|
-
}
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
return [{ field, condition, value }];
|
|
62
|
-
};
|
|
63
|
-
export const prepareFiltersForRequest = (filters) => interleaveElement({ operator: RecordFilterOperator.AND }, filters
|
|
64
|
-
.filter(({ value, condition }) => value !== null || nullValueConditions.includes(condition ?? ''))
|
|
65
|
-
.map(({ attribute, field, condition, value }) => {
|
|
66
|
-
switch (attribute.format) {
|
|
67
|
-
case AttributeFormat.date:
|
|
68
|
-
return _getDateRequestFilters({ field, condition, value });
|
|
69
|
-
case AttributeFormat.boolean:
|
|
70
|
-
return _getBooleanRequestFilters({ field, condition, value });
|
|
71
|
-
default:
|
|
72
|
-
return [
|
|
73
|
-
{
|
|
74
|
-
field,
|
|
75
|
-
condition,
|
|
76
|
-
value
|
|
77
|
-
}
|
|
78
|
-
];
|
|
79
|
-
}
|
|
80
|
-
}));
|
|
81
|
-
//# sourceMappingURL=prepareFiltersForRequest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prepareFiltersForRequest.js","sourceRoot":"","sources":["../../../../src/components/Explorer/_queries/prepareFiltersForRequest.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAqB,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAC9G,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,wBAAwB,EAAC,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CA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AC,OAA0B,EAAuB,EAAE,CACxF,iBAAiB,CACb,EAAC,QAAQ,EAAE,oBAAoB,CAAC,GAAG,EAAC,EACpC,OAAO;KACF,MAAM,CAAC,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,mBAAmB,CAAC,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;KAC/F,GAAG,CAAC,CAAC,EAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAC,EAAE,EAAE;IAC1C,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC;QACvB,KAAK,eAAe,CAAC,IAAI;YACrB,OAAO,sBAAsB,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC;QAC7D,KAAK,eAAe,CAAC,OAAO;YACxB,OAAO,yBAAyB,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC;QAChE;YACI,OAAO;gBACH;oBACI,KAAK;oBACL,SAAS;oBACT,KAAK;iBACR;aACJ,CAAC;IACV,CAAC;AACL,CAAC,CAAC,CACT,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
-
// This file is released under LGPL V3
|
|
3
|
-
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
-
import { isTypeStandard } from '@leav/utils';
|
|
5
|
-
import { useEffect, useRef, useState } from 'react';
|
|
6
|
-
import { AttributeFormat } from '../../_gqlTypes';
|
|
7
|
-
const FieldColumnWidth = {
|
|
8
|
-
TINY: 125,
|
|
9
|
-
SMALL: 150,
|
|
10
|
-
MEDIUM: 250,
|
|
11
|
-
LARGE: 300
|
|
12
|
-
};
|
|
13
|
-
const _getFieldColumWidth = (field) => {
|
|
14
|
-
if (!field || !isTypeStandard(field.type) || field.multiple_values) {
|
|
15
|
-
return FieldColumnWidth.LARGE;
|
|
16
|
-
}
|
|
17
|
-
switch (field.format) {
|
|
18
|
-
case AttributeFormat.boolean:
|
|
19
|
-
return FieldColumnWidth.TINY;
|
|
20
|
-
case AttributeFormat.numeric:
|
|
21
|
-
case AttributeFormat.date:
|
|
22
|
-
return FieldColumnWidth.SMALL;
|
|
23
|
-
case AttributeFormat.date_range:
|
|
24
|
-
return FieldColumnWidth.LARGE;
|
|
25
|
-
default:
|
|
26
|
-
return FieldColumnWidth.MEDIUM;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export const useColumnWidth = () => {
|
|
30
|
-
const ref = useRef(null);
|
|
31
|
-
const [columnWidth, setColumnWidth] = useState(FieldColumnWidth.TINY);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (ref.current) {
|
|
34
|
-
const columnElement = ref.current;
|
|
35
|
-
const columnElementtWidth = columnElement.getBoundingClientRect().width;
|
|
36
|
-
const lastColumnsInlinePadding = 36;
|
|
37
|
-
if (columnElementtWidth !== columnWidth - lastColumnsInlinePadding) {
|
|
38
|
-
setColumnWidth(columnElementtWidth + lastColumnsInlinePadding);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}, [ref.current]);
|
|
42
|
-
return {
|
|
43
|
-
ref,
|
|
44
|
-
getFieldColumnWidth: _getFieldColumWidth,
|
|
45
|
-
columnWidth
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=useColumnWidth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useColumnWidth.js","sourceRoot":"","sources":["../../../src/components/Explorer/useColumnWidth.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,eAAe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,mBAAmB,GAAG,wBAAwB,CAAC,CAAC;YACnE,CAAC;QACL,CAAC;IACL,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAElB,OAAO;QACH,GAAG;QACH,mBAAmB,EAAE,mBAAmB;QACxC,WAAW;KACd,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from 'react';
|
|
2
|
-
import { ActionHook, IMassActions } from './_types';
|
|
3
|
-
import { IViewSettingsAction, IViewSettingsState } from './manage-view-settings';
|
|
4
|
-
import type { useExplorerData } from './_queries/useExplorerData';
|
|
5
|
-
/**
|
|
6
|
-
* Hook used to get the action for mass actions only available on selection.
|
|
7
|
-
*
|
|
8
|
-
* When the mutation for deactivation is done, the Apollo cache will be clean (`Record` and `RecordIdentity`)
|
|
9
|
-
* from deactivated record.
|
|
10
|
-
*
|
|
11
|
-
* @param isEnabled - whether the action is present
|
|
12
|
-
* @param view - represent the current view
|
|
13
|
-
* @param dispatch - method to change the current view
|
|
14
|
-
* @param libraryId - concerned library
|
|
15
|
-
* @param allVisibleKeys - list of all visible keys used to know if we need to change page
|
|
16
|
-
* @param refetch - method to get fresh data when we delete last page
|
|
17
|
-
*/
|
|
18
|
-
export declare const useDeactivateMassAction: ({ isEnabled, store: { view, dispatch }, allVisibleKeys, refetch }: ActionHook<{
|
|
19
|
-
store: {
|
|
20
|
-
view: IViewSettingsState;
|
|
21
|
-
dispatch: Dispatch<IViewSettingsAction>;
|
|
22
|
-
};
|
|
23
|
-
allVisibleKeys: string[];
|
|
24
|
-
refetch: ReturnType<typeof useExplorerData>["refetch"];
|
|
25
|
-
}>) => {
|
|
26
|
-
deactivateMassAction: IMassActions;
|
|
27
|
-
};
|
|
@@ -1,71 +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 } from 'react';
|
|
6
|
-
import { FaTrash } from 'react-icons/fa';
|
|
7
|
-
import { KitModal } from 'aristid-ds';
|
|
8
|
-
import { useDeactivateRecordsMutation } from '../../_gqlTypes';
|
|
9
|
-
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
10
|
-
import { ViewSettingsActionTypes } from './manage-view-settings';
|
|
11
|
-
import { MASS_SELECTION_ALL } from './_constants';
|
|
12
|
-
/**
|
|
13
|
-
* Hook used to get the action for mass actions only available on selection.
|
|
14
|
-
*
|
|
15
|
-
* When the mutation for deactivation is done, the Apollo cache will be clean (`Record` and `RecordIdentity`)
|
|
16
|
-
* from deactivated record.
|
|
17
|
-
*
|
|
18
|
-
* @param isEnabled - whether the action is present
|
|
19
|
-
* @param view - represent the current view
|
|
20
|
-
* @param dispatch - method to change the current view
|
|
21
|
-
* @param libraryId - concerned library
|
|
22
|
-
* @param allVisibleKeys - list of all visible keys used to know if we need to change page
|
|
23
|
-
* @param refetch - method to get fresh data when we delete last page
|
|
24
|
-
*/
|
|
25
|
-
export const useDeactivateMassAction = ({ isEnabled, store: { view, dispatch }, allVisibleKeys, refetch }) => {
|
|
26
|
-
const { t } = useSharedTranslation();
|
|
27
|
-
const [deactivateRecordsMutation] = useDeactivateRecordsMutation();
|
|
28
|
-
const _deactivateMassAction = useMemo(() => ({
|
|
29
|
-
label: t('explorer.massAction.deactivate'),
|
|
30
|
-
icon: _jsx(FaTrash, {}),
|
|
31
|
-
callback: massSelectionFilter => {
|
|
32
|
-
KitModal.confirm({
|
|
33
|
-
type: 'confirm',
|
|
34
|
-
dangerConfirm: true,
|
|
35
|
-
content: t('records_deactivation.confirm', {
|
|
36
|
-
count: view.massSelection === MASS_SELECTION_ALL ? Infinity : view.massSelection.length
|
|
37
|
-
}),
|
|
38
|
-
okText: t('global.submit') ?? undefined,
|
|
39
|
-
cancelText: t('global.cancel') ?? undefined,
|
|
40
|
-
onOk: async () => {
|
|
41
|
-
await deactivateRecordsMutation({
|
|
42
|
-
variables: {
|
|
43
|
-
libraryId: view.libraryId,
|
|
44
|
-
filters: massSelectionFilter
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
if (view.massSelection === MASS_SELECTION_ALL ||
|
|
48
|
-
allVisibleKeys.every(key => view.massSelection.includes(key))) {
|
|
49
|
-
await refetch({
|
|
50
|
-
pagination: {
|
|
51
|
-
limit: view.pageSize,
|
|
52
|
-
offset: 0
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
await refetch();
|
|
58
|
-
}
|
|
59
|
-
dispatch({
|
|
60
|
-
type: ViewSettingsActionTypes.SET_SELECTED_KEYS,
|
|
61
|
-
payload: []
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}), [t, deactivateRecordsMutation, view.massSelection, dispatch, view.libraryId, allVisibleKeys, refetch]);
|
|
67
|
-
return {
|
|
68
|
-
deactivateMassAction: isEnabled ? _deactivateMassAction : null
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=useDeactivateMassAction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeactivateMassAction.js","sourceRoot":"","sources":["../../../src/components/Explorer/useDeactivateMassAction.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAW,OAAO,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,4BAA4B,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAA0C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C,QAAQ,CAAC,GAAG,CAAC,CAAC,EAC/D,CAAC;wBACC,MAAM,OAAO,CAAC;4BACV,UAAU,EAAE;gCACR,KAAK,EAAE,IAAI,CAAC,QAAQ;gCACpB,MAAM,EAAE,CAAC;6BACZ;yBACJ,CAAC,CAAC;oBACP,CAAC;yBAAM,CAAC;wBACJ,MAAM,OAAO,EAAE,CAAC;oBACpB,CAAC;oBACD,QAAQ,CAAC;wBACL,IAAI,EAAE,uBAAuB,CAAC,iBAAiB;wBAC/C,OAAO,EAAE,EAAE;qBACd,CAAC,CAAC;gBACP,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC,EACF,CAAC,CAAC,EAAE,yBAAyB,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CACxG,CAAC;IAEF,OAAO;QACH,oBAAoB,EAAE,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI;KACjE,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from 'react';
|
|
2
|
-
import { IMassActions } from './_types';
|
|
3
|
-
import { IViewSettingsAction, IViewSettingsState } from './manage-view-settings';
|
|
4
|
-
import { MassSelection } from './manage-view-settings/store-view-settings/viewSettingsReducer';
|
|
5
|
-
/**
|
|
6
|
-
* Hook used to manage mass selection as the snackbar and all kind of selection (manual, all in page, all in filters)
|
|
7
|
-
*
|
|
8
|
-
* @param isEnabled - whether the selection is present
|
|
9
|
-
* @param view - represent the current view
|
|
10
|
-
* @param dispatch - method to change the current view
|
|
11
|
-
* @param totalCount - used for display purpose only
|
|
12
|
-
* @param allVisibleKeys - list of all ids currently selected
|
|
13
|
-
* @param massActions - array of all actions available on mass selection
|
|
14
|
-
*/
|
|
15
|
-
export declare const useMassActions: ({ isEnabled, store: { dispatch, view }, totalCount, allVisibleKeys, massActions }: {
|
|
16
|
-
isEnabled: boolean;
|
|
17
|
-
store: {
|
|
18
|
-
view: IViewSettingsState;
|
|
19
|
-
dispatch: Dispatch<IViewSettingsAction>;
|
|
20
|
-
};
|
|
21
|
-
totalCount: number;
|
|
22
|
-
allVisibleKeys: string[];
|
|
23
|
-
massActions: IMassActions[];
|
|
24
|
-
}) => {
|
|
25
|
-
selectAllButton: JSX.Element;
|
|
26
|
-
setSelectedKeys: (keys: MassSelection) => void;
|
|
27
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } 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 { closeKitSnackBar, KitCheckbox, KitDropDown, KitSpace, openKitSnackBar } from 'aristid-ds';
|
|
6
|
-
import { useCallback, useEffect } from 'react';
|
|
7
|
-
import { FaChevronDown } from 'react-icons/fa';
|
|
8
|
-
import { RecordFilterCondition, RecordFilterOperator } from '../../_gqlTypes';
|
|
9
|
-
import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
10
|
-
import { interleaveElement } from '../../_utils/interleaveElement';
|
|
11
|
-
import { MASS_SELECTION_ALL } from './_constants';
|
|
12
|
-
import { ViewSettingsActionTypes } from './manage-view-settings';
|
|
13
|
-
import { prepareFiltersForRequest } from './_queries/prepareFiltersForRequest';
|
|
14
|
-
/**
|
|
15
|
-
* Hook used to manage mass selection as the snackbar and all kind of selection (manual, all in page, all in filters)
|
|
16
|
-
*
|
|
17
|
-
* @param isEnabled - whether the selection is present
|
|
18
|
-
* @param view - represent the current view
|
|
19
|
-
* @param dispatch - method to change the current view
|
|
20
|
-
* @param totalCount - used for display purpose only
|
|
21
|
-
* @param allVisibleKeys - list of all ids currently selected
|
|
22
|
-
* @param massActions - array of all actions available on mass selection
|
|
23
|
-
*/
|
|
24
|
-
export const useMassActions = ({ isEnabled, store: { dispatch, view }, totalCount, allVisibleKeys, massActions }) => {
|
|
25
|
-
const { t } = useSharedTranslation();
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (view.massSelection === MASS_SELECTION_ALL || view.massSelection.length !== 0) {
|
|
28
|
-
openKitSnackBar({
|
|
29
|
-
duration: 0,
|
|
30
|
-
closable: true,
|
|
31
|
-
onClose: () => _setSelectedKeys([]),
|
|
32
|
-
message: t('explorer.massAction.selectedItems', {
|
|
33
|
-
count: view.massSelection === MASS_SELECTION_ALL ? totalCount : view.massSelection.length
|
|
34
|
-
}),
|
|
35
|
-
actions: massActions.map(({ label, icon, callback }, index) => ({
|
|
36
|
-
key: index,
|
|
37
|
-
label,
|
|
38
|
-
icon,
|
|
39
|
-
onClick: async () => {
|
|
40
|
-
await callback(view.massSelection === MASS_SELECTION_ALL
|
|
41
|
-
? prepareFiltersForRequest(view.filters)
|
|
42
|
-
: interleaveElement({ operator: RecordFilterOperator.OR }, view.massSelection.map(key => [
|
|
43
|
-
{
|
|
44
|
-
field: 'id',
|
|
45
|
-
condition: RecordFilterCondition.EQUAL,
|
|
46
|
-
value: key
|
|
47
|
-
}
|
|
48
|
-
])));
|
|
49
|
-
dispatch({
|
|
50
|
-
type: ViewSettingsActionTypes.SET_SELECTED_KEYS,
|
|
51
|
-
payload: []
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}))
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
closeKitSnackBar();
|
|
59
|
-
}
|
|
60
|
-
}, [view.massSelection, view.filters, totalCount]);
|
|
61
|
-
const isOnePage = view.pageSize > totalCount;
|
|
62
|
-
const hasSelectedAllAvailableItems = view.massSelection === MASS_SELECTION_ALL || view.massSelection.length === totalCount;
|
|
63
|
-
const hasSelectedSomeItems = view.massSelection !== MASS_SELECTION_ALL &&
|
|
64
|
-
view.massSelection.length > 0 &&
|
|
65
|
-
view.massSelection.length < totalCount;
|
|
66
|
-
const _selectAllButton = isOnePage ? (_jsx(KitCheckbox, { indeterminate: hasSelectedSomeItems, checked: hasSelectedAllAvailableItems, onChange: _ => {
|
|
67
|
-
if (hasSelectedAllAvailableItems) {
|
|
68
|
-
_setSelectedKeys([]);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
_setSelectedKeys(allVisibleKeys);
|
|
72
|
-
}
|
|
73
|
-
}, children: t('explorer.massAction.itemsTotal', { count: totalCount }) })) : (_jsx(KitDropDown, { trigger: ['click'], menu: {
|
|
74
|
-
items: [
|
|
75
|
-
hasSelectedAllAvailableItems
|
|
76
|
-
? null
|
|
77
|
-
: {
|
|
78
|
-
key: 'toggle_page_selection',
|
|
79
|
-
label: t('explorer.massAction.toggle_selection.select_page', { count: view.pageSize }),
|
|
80
|
-
onClick: () => {
|
|
81
|
-
_setSelectedKeys([...new Set([...view.massSelection, ...allVisibleKeys])]);
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
key: 'toggle_all_selection',
|
|
86
|
-
label: hasSelectedAllAvailableItems
|
|
87
|
-
? t('explorer.massAction.toggle_selection.deselect_all', { count: totalCount })
|
|
88
|
-
: t('explorer.massAction.toggle_selection.select_all', { count: totalCount }),
|
|
89
|
-
onClick: async () => {
|
|
90
|
-
if (hasSelectedAllAvailableItems) {
|
|
91
|
-
_setSelectedKeys([]);
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
_setSelectedKeys(MASS_SELECTION_ALL);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
}, children: _jsx(KitCheckbox, { indeterminate: hasSelectedSomeItems, checked: hasSelectedAllAvailableItems, children: _jsxs(KitSpace, { size: "s", children: [t('explorer.massAction.itemsTotal', { count: totalCount }), _jsx(FaChevronDown, {})] }) }) }));
|
|
100
|
-
const _setSelectedKeys = useCallback((keys) => dispatch({
|
|
101
|
-
type: ViewSettingsActionTypes.SET_SELECTED_KEYS,
|
|
102
|
-
payload: keys
|
|
103
|
-
}), [dispatch]);
|
|
104
|
-
return {
|
|
105
|
-
selectAllButton: isEnabled ? _selectAllButton : null,
|
|
106
|
-
setSelectedKeys: isEnabled ? _setSelectedKeys : null
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
//# sourceMappingURL=useMassActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMassActions.js","sourceRoot":"","sources":["../../../src/components/Explorer/useMassActions.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAC,MAAM,YAAY,CAAC;AACjG,OAAO,EAAW,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAA0C,uBAAuB,EAAC,MAAM,wBAAwB,CAAC;AACxG,OAAO,EAAC,wBAAwB,EAAC,MAAM,qCAAqC,CAAC;AAG7E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC3B,SAAS,EACT,KAAK,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,EACvB,UAAU,EACV,cAAc,EACd,WAAW,EAUd,EAAE,EAAE;IACD,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,IAAI,CAAC,aAAa,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Component } from 'react';
|
|
2
|
-
import { RecordFormAttributeFragment } from '../../../../_gqlTypes';
|
|
3
|
-
interface IAttributeSummaryProps {
|
|
4
|
-
attribute: RecordFormAttributeFragment;
|
|
5
|
-
}
|
|
6
|
-
export declare const AttributeSummary: FunctionComponent<IAttributeSummaryProps>;
|
|
7
|
-
export default AttributeSummary;
|
package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/AttributeSummary.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import PropertiesList from '../PropertiesList';
|
|
3
|
-
import { useAttributeInformations } from './useAttributeInformations';
|
|
4
|
-
export const AttributeSummary = ({ attribute }) => {
|
|
5
|
-
const attributeInformations = useAttributeInformations(attribute);
|
|
6
|
-
return _jsx(PropertiesList, { items: attributeInformations });
|
|
7
|
-
};
|
|
8
|
-
export default AttributeSummary;
|
|
9
|
-
//# sourceMappingURL=AttributeSummary.js.map
|
package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/AttributeSummary.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeSummary.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/AttributeSummary/AttributeSummary.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAMpE,MAAM,CAAC,MAAM,gBAAgB,GAA8C,CAAC,EAAC,SAAS,EAAC,EAAE,EAAE;IACvF,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAElE,OAAO,KAAC,cAAc,IAAC,KAAK,EAAE,qBAAqB,GAAI,CAAC;AAC5D,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
-
// This file is released under LGPL V3
|
|
3
|
-
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
-
import AttributeSummary from './AttributeSummary';
|
|
5
|
-
export default AttributeSummary;
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/AttributeSummary/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,eAAe,gBAAgB,CAAC"}
|
package/dist/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
-
// This file is released under LGPL V3
|
|
3
|
-
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
-
import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
|
|
5
|
-
import { useLang } from '../../../../hooks';
|
|
6
|
-
import { localizedTranslation } from '@leav/utils';
|
|
7
|
-
export const useAttributeInformations = (attribute) => {
|
|
8
|
-
const { t } = useSharedTranslation();
|
|
9
|
-
const { lang } = useLang();
|
|
10
|
-
const attributeInformations = [];
|
|
11
|
-
if (attribute.format) {
|
|
12
|
-
attributeInformations.push({
|
|
13
|
-
title: t('record_summary.attribute_format'),
|
|
14
|
-
value: attribute.format
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
if (attribute.description) {
|
|
18
|
-
attributeInformations.push({
|
|
19
|
-
title: t('record_summary.descriptive'),
|
|
20
|
-
value: localizedTranslation(attribute.description, lang)
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return attributeInformations;
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=useAttributeInformations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAttributeInformations.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/AttributeSummary/useAttributeInformations.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAsC,EAAE,EAAE;IAC/E,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,IAAI,EAAC,GAAG,OAAO,EAAE,CAAC;IAEzB,MAAM,qBAAqB,GAAG,EAAE,CAAC;IACjC,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;QACnB,qBAAqB,CAAC,IAAI,CAAC;YACvB,KAAK,EAAE,CAAC,CAAC,iCAAiC,CAAC;YAC3C,KAAK,EAAE,SAAS,CAAC,MAAM;SAC1B,CAAC,CAAC;IACP,CAAC;IAED,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;QACxB,qBAAqB,CAAC,IAAI,CAAC;YACvB,KAAK,EAAE,CAAC,CAAC,4BAA4B,CAAC;YACtC,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC;SAC3D,CAAC,CAAC;IACP,CAAC;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC,CAAC"}
|