@leav/ui 1.10.0 → 1.11.0-3d16ca94
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 +14 -1
- package/dist/_gqlTypes/index.js +39 -15
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_utils/index.d.ts +0 -1
- package/dist/_utils/index.js +0 -3
- package/dist/_utils/index.js.map +1 -1
- package/dist/components/Explorer/DataView.js +22 -11
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.js +3 -2
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/TableNameCell.js +1 -4
- package/dist/components/Explorer/TableNameCell.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerCountData.js +3 -4
- package/dist/components/Explorer/_queries/useExplorerCountData.js.map +1 -1
- package/dist/components/Filters/filter-items/CommonFilterItem.js +8 -6
- package/dist/components/Filters/filter-items/CommonFilterItem.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js +6 -1
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js +11 -19
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/TextAttributeDropDown.js +27 -18
- package/dist/components/Filters/filter-items/filter-type/TextAttributeDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/tree/TreeAttributeDropDown.js +11 -0
- package/dist/components/Filters/filter-items/filter-type/tree/TreeAttributeDropDown.js.map +1 -1
- package/dist/components/Filters/filter-items/filter-type/tree/utils/countSelectedTreeChildren.d.ts +2 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/countSelectedTreeChildren.js +10 -0
- package/dist/components/Filters/filter-items/filter-type/tree/utils/countSelectedTreeChildren.js.map +1 -0
- package/dist/components/Notifications/InitNotificationsSubscription.d.ts +4 -2
- package/dist/components/Notifications/InitNotificationsSubscription.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +2 -26
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js +2 -2
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +1 -19
- package/dist/components/RecordEdition/EditRecordContent/_types.js +0 -5
- package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.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/EditRecordSidebar/EditRecordSidebar.d.ts +1 -2
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +7 -9
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +2 -33
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js +11 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +4 -20
- package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
- package/dist/components/RecordHistory/RecordHistory.d.ts +1 -0
- package/dist/components/RecordHistory/RecordHistory.js +3 -3
- package/dist/components/RecordHistory/RecordHistory.js.map +1 -1
- package/dist/components/RecordHistory/RecordHistoryGoUpButton.d.ts +1 -0
- package/dist/components/RecordHistory/RecordHistoryGoUpButton.js +3 -3
- package/dist/components/RecordHistory/RecordHistoryGoUpButton.js.map +1 -1
- package/dist/components/RecordHistory/RecordHistoryLogEntry.js +7 -5
- package/dist/components/RecordHistory/RecordHistoryLogEntry.js.map +1 -1
- package/dist/components/RecordHistory/_queries/recordHistoryQuery.js +38 -14
- package/dist/components/RecordHistory/_queries/recordHistoryQuery.js.map +1 -1
- package/dist/components/RecordHistory/_types.d.ts +2 -2
- package/dist/components/RecordHistory/_types.js.map +1 -1
- package/dist/hooks/useRedirectToLogin/useRedirectToLogin.d.ts +2 -1
- package/dist/hooks/useRedirectToLogin/useRedirectToLogin.js +32 -4
- package/dist/hooks/useRedirectToLogin/useRedirectToLogin.js.map +1 -1
- package/dist/locales/en/shared.json +3 -31
- package/dist/locales/fr/shared.json +3 -31
- package/package.json +6 -6
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.js +0 -2
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js +0 -5
- package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js +0 -5
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js +0 -20
- package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.d.ts +0 -11
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js +0 -35
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.d.ts +0 -52
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.js +0 -144
- package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js +0 -19
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.d.ts +0 -5
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.js +0 -21
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.d.ts +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js +0 -14
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js +0 -28
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.d.ts +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.js +0 -25
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.d.ts +0 -7
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.js +0 -33
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.js +0 -13
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.d.ts +0 -10
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js +0 -24
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.d.ts +0 -13
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js +0 -41
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.d.ts +0 -8
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.js +0 -34
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.js.map +0 -1
package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js
DELETED
|
@@ -1,5 +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
|
-
export { default } from './getActiveFieldValues';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,wBAAwB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nexport {default} from './getActiveFieldValues';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './isCurrentVersion';
|
|
@@ -1,5 +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
|
-
export { default } from './isCurrentVersion';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nexport {default} from './isCurrentVersion';\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type IValueVersion } from '../../../../../types/values';
|
|
2
|
-
/**
|
|
3
|
-
* Check if given version matches the reference version. As reference version might contains
|
|
4
|
-
* trees that are not in the given version, we only check the nodes of given version against reference version.
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: (referenceVersion: IValueVersion, valueVersion: IValueVersion) => boolean;
|
|
7
|
-
export default _default;
|
package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if given version matches the reference version. As reference version might contains
|
|
3
|
-
* trees that are not in the given version, we only check the nodes of given version against reference version.
|
|
4
|
-
*/
|
|
5
|
-
export default (referenceVersion, valueVersion) => {
|
|
6
|
-
if (referenceVersion === valueVersion) {
|
|
7
|
-
// Mostly for the case that both are null or undefined
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
if (!referenceVersion || !valueVersion) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
for (const versionTreeId of Object.keys(valueVersion)) {
|
|
14
|
-
if (referenceVersion?.[versionTreeId]?.id !== valueVersion[versionTreeId].id) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return true;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=isCurrentVersion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCurrentVersion.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAe,CAAC,gBAA+B,EAAE,YAA2B,EAAE,EAAE;IAC5E,IAAI,gBAAgB,KAAK,YAAY,EAAE,CAAC;QACpC,sDAAsD;QACtD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,gBAAgB,IAAI,CAAC,YAAY,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,KAAK,MAAM,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACpD,IAAI,gBAAgB,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,YAAY,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC;YAC3E,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type IValueVersion} from '_ui/types/values';\n\n/**\n * Check if given version matches the reference version. As reference version might contains\n * trees that are not in the given version, we only check the nodes of given version against reference version.\n */\nexport default (referenceVersion: IValueVersion, valueVersion: IValueVersion) => {\n if (referenceVersion === valueVersion) {\n // Mostly for the case that both are null or undefined\n return true;\n }\n\n if (!referenceVersion || !valueVersion) {\n return false;\n }\n\n for (const versionTreeId of Object.keys(valueVersion)) {\n if (referenceVersion?.[versionTreeId]?.id !== valueVersion[versionTreeId].id) {\n return false;\n }\n }\n\n return true;\n};\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type RecordFormElement } from '../../../../hooks/useGetRecordForm';
|
|
2
|
-
/**
|
|
3
|
-
* Hook to manage tab visibility and tab click events in the EditRecordContent component
|
|
4
|
-
* @returns Object containing the visible tab ID and a handler for tab click events
|
|
5
|
-
* @param elements
|
|
6
|
-
*/
|
|
7
|
-
export declare const useTabManagement: (elements: RecordFormElement[]) => {
|
|
8
|
-
tabIdVisible: string;
|
|
9
|
-
handleTabClick: (tabIdClicked: string) => void;
|
|
10
|
-
};
|
|
11
|
-
export default useTabManagement;
|
|
@@ -1,35 +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 { useState, useEffect } from 'react';
|
|
5
|
-
/**
|
|
6
|
-
* Hook to manage tab visibility and tab click events in the EditRecordContent component
|
|
7
|
-
* @returns Object containing the visible tab ID and a handler for tab click events
|
|
8
|
-
* @param elements
|
|
9
|
-
*/
|
|
10
|
-
export const useTabManagement = (elements) => {
|
|
11
|
-
// State to track the currently visible tab ID
|
|
12
|
-
const [tabIdVisible, setTabIdVisible] = useState(undefined);
|
|
13
|
-
// Initialize the visible tab ID when the record form is loaded
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
// When we load the record form, get the ID of the first tab
|
|
16
|
-
const firstTabId = elements?.find(e => e.uiElementType === 'tabs')?.settings?.find(s => s.key === 'tabs')
|
|
17
|
-
?.value[0]?.id;
|
|
18
|
-
if (firstTabId) {
|
|
19
|
-
setTabIdVisible(firstTabId);
|
|
20
|
-
}
|
|
21
|
-
}, [elements]);
|
|
22
|
-
/**
|
|
23
|
-
* Handler for tab click events
|
|
24
|
-
* @param tabIdClicked The ID of the tab that was clicked
|
|
25
|
-
*/
|
|
26
|
-
const handleTabClick = (tabIdClicked) => {
|
|
27
|
-
setTabIdVisible(tabIdClicked);
|
|
28
|
-
};
|
|
29
|
-
return {
|
|
30
|
-
tabIdVisible,
|
|
31
|
-
handleTabClick,
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export default useTabManagement;
|
|
35
|
-
//# sourceMappingURL=useTabManagement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTabManagement.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordContent/hooks/useTabManagement.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAG1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA6B,EAAE,EAAE;IAC9D,8CAA8C;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAEhF,+DAA+D;IAC/D,SAAS,CAAC,GAAG,EAAE;QACX,4DAA4D;QAC5D,MAAM,UAAU,GAAG,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC;YACrG,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAEnB,IAAI,UAAU,EAAE,CAAC;YACb,eAAe,CAAC,UAAU,CAAC,CAAC;QAChC,CAAC;IACL,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf;;;OAGG;IACH,MAAM,cAAc,GAAG,CAAC,YAAoB,EAAE,EAAE;QAC5C,eAAe,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC;IAEF,OAAO;QACH,YAAY;QACZ,cAAc;KACjB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {useState, useEffect} from 'react';\nimport {IRecordForm, type RecordFormElement} from '_ui/hooks/useGetRecordForm';\n\n/**\n * Hook to manage tab visibility and tab click events in the EditRecordContent component\n * @returns Object containing the visible tab ID and a handler for tab click events\n * @param elements\n */\nexport const useTabManagement = (elements: RecordFormElement[]) => {\n // State to track the currently visible tab ID\n const [tabIdVisible, setTabIdVisible] = useState<string | undefined>(undefined);\n\n // Initialize the visible tab ID when the record form is loaded\n useEffect(() => {\n // When we load the record form, get the ID of the first tab\n const firstTabId = elements?.find(e => e.uiElementType === 'tabs')?.settings?.find(s => s.key === 'tabs')\n ?.value[0]?.id;\n\n if (firstTabId) {\n setTabIdVisible(firstTabId);\n }\n }, [elements]);\n\n /**\n * Handler for tab click events\n * @param tabIdClicked The ID of the tab that was clicked\n */\n const handleTabClick = (tabIdClicked: string) => {\n setTabIdVisible(tabIdClicked);\n };\n\n return {\n tabIdVisible,\n handleTabClick,\n };\n};\n\nexport default useTabManagement;\n"]}
|
|
@@ -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 linkFieldReducer from './linkFieldReducer';
|
|
5
|
-
export default linkFieldReducer;
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport linkFieldReducer from './linkFieldReducer';\n\nexport default linkFieldReducer;\n"]}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { VersionFieldScope, type FormElement, type ICommonFieldsReducerState } from '../../../../../components/RecordEdition/EditRecordContent/_types';
|
|
2
|
-
import { type RecordFormElementsValueLinkValue, type RecordFormElementsValueTreeValue } from '../../../../../hooks/useGetRecordForm/useGetRecordForm';
|
|
3
|
-
import { type IRecordIdentityWhoAmI } from '../../../../../types/records';
|
|
4
|
-
import { type IValueVersion } from '../../../../../types/values';
|
|
5
|
-
type AllowedValuesType = RecordFormElementsValueLinkValue | RecordFormElementsValueTreeValue;
|
|
6
|
-
export interface ILinkFieldState<ValuesType> extends ICommonFieldsReducerState<ValuesType[]> {
|
|
7
|
-
errorMessage: string | string[];
|
|
8
|
-
isValuesAddVisible: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare enum LinkFieldReducerActionsType {
|
|
11
|
-
ADD_VALUES = "ADD_VALUES",
|
|
12
|
-
DELETE_VALUE = "DELETE_VALUE",
|
|
13
|
-
DELETE_ALL_VALUES = "DELETE_ALL_VALUES",
|
|
14
|
-
SET_ERROR_MESSAGE = "SET_ERROR_MESSAGE",
|
|
15
|
-
CLEAR_ERROR_MESSAGE = "CLEAR_ERROR_MESSAGE",
|
|
16
|
-
SET_IS_VALUES_ADD_VISIBLE = "SET_IS_VALUES_ADD_VISIBLE",
|
|
17
|
-
CHANGE_ACTIVE_SCOPE = "CHANGE_ACTIVE_SCOPE",
|
|
18
|
-
REFRESH_VALUES = "REFRESH_VALUES"
|
|
19
|
-
}
|
|
20
|
-
export type LinkFieldReducerActions<ValuesType extends AllowedValuesType> = {
|
|
21
|
-
type: LinkFieldReducerActionsType.ADD_VALUES;
|
|
22
|
-
values: ValuesType[];
|
|
23
|
-
} | {
|
|
24
|
-
type: LinkFieldReducerActionsType.DELETE_VALUE;
|
|
25
|
-
idValue: string;
|
|
26
|
-
} | {
|
|
27
|
-
type: LinkFieldReducerActionsType.DELETE_ALL_VALUES;
|
|
28
|
-
} | {
|
|
29
|
-
type: LinkFieldReducerActionsType.SET_ERROR_MESSAGE;
|
|
30
|
-
errorMessage: string | string[];
|
|
31
|
-
} | {
|
|
32
|
-
type: LinkFieldReducerActionsType.CLEAR_ERROR_MESSAGE;
|
|
33
|
-
} | {
|
|
34
|
-
type: LinkFieldReducerActionsType.SET_IS_VALUES_ADD_VISIBLE;
|
|
35
|
-
isValuesAddVisible: boolean;
|
|
36
|
-
} | {
|
|
37
|
-
type: LinkFieldReducerActionsType.CHANGE_ACTIVE_SCOPE;
|
|
38
|
-
scope: VersionFieldScope;
|
|
39
|
-
} | {
|
|
40
|
-
type: LinkFieldReducerActionsType.REFRESH_VALUES;
|
|
41
|
-
values: ValuesType[];
|
|
42
|
-
formVersion: IValueVersion;
|
|
43
|
-
};
|
|
44
|
-
export declare const virginState: ILinkFieldState<AllowedValuesType>;
|
|
45
|
-
export declare const computeInitialState: <ValuesType extends AllowedValuesType>(params: {
|
|
46
|
-
element: FormElement<unknown>;
|
|
47
|
-
record: IRecordIdentityWhoAmI;
|
|
48
|
-
isRecordReadOnly: boolean;
|
|
49
|
-
formVersion: IValueVersion;
|
|
50
|
-
}) => ILinkFieldState<ValuesType>;
|
|
51
|
-
declare const linkFieldReducer: <ValuesType extends AllowedValuesType>(state: ILinkFieldState<ValuesType>, action: LinkFieldReducerActions<ValuesType>) => ILinkFieldState<ValuesType>;
|
|
52
|
-
export default linkFieldReducer;
|
|
@@ -1,144 +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 getActiveFieldValues from '../../../../../components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues';
|
|
5
|
-
import isCurrentVersion from '../../../../../components/RecordEdition/EditRecordContent/helpers/isCurrentVersion';
|
|
6
|
-
import { VersionFieldScope, } from '../../../../../components/RecordEdition/EditRecordContent/_types';
|
|
7
|
-
export var LinkFieldReducerActionsType;
|
|
8
|
-
(function (LinkFieldReducerActionsType) {
|
|
9
|
-
LinkFieldReducerActionsType["ADD_VALUES"] = "ADD_VALUES";
|
|
10
|
-
LinkFieldReducerActionsType["DELETE_VALUE"] = "DELETE_VALUE";
|
|
11
|
-
LinkFieldReducerActionsType["DELETE_ALL_VALUES"] = "DELETE_ALL_VALUES";
|
|
12
|
-
LinkFieldReducerActionsType["SET_ERROR_MESSAGE"] = "SET_ERROR_MESSAGE";
|
|
13
|
-
LinkFieldReducerActionsType["CLEAR_ERROR_MESSAGE"] = "CLEAR_ERROR_MESSAGE";
|
|
14
|
-
LinkFieldReducerActionsType["SET_IS_VALUES_ADD_VISIBLE"] = "SET_IS_VALUES_ADD_VISIBLE";
|
|
15
|
-
LinkFieldReducerActionsType["CHANGE_ACTIVE_SCOPE"] = "CHANGE_ACTIVE_SCOPE";
|
|
16
|
-
LinkFieldReducerActionsType["REFRESH_VALUES"] = "REFRESH_VALUES";
|
|
17
|
-
})(LinkFieldReducerActionsType || (LinkFieldReducerActionsType = {}));
|
|
18
|
-
export const virginState = {
|
|
19
|
-
record: null,
|
|
20
|
-
formElement: null,
|
|
21
|
-
attribute: null,
|
|
22
|
-
isReadOnly: false,
|
|
23
|
-
activeScope: VersionFieldScope.CURRENT,
|
|
24
|
-
values: {
|
|
25
|
-
[VersionFieldScope.CURRENT]: {
|
|
26
|
-
version: null,
|
|
27
|
-
values: [],
|
|
28
|
-
},
|
|
29
|
-
[VersionFieldScope.INHERITED]: null,
|
|
30
|
-
},
|
|
31
|
-
errorMessage: '',
|
|
32
|
-
isValuesAddVisible: false,
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* For given list of values, determine if there is inherited values, inherited/current version and default active scope
|
|
36
|
-
*/
|
|
37
|
-
const _computeScopeAndValues = (params) => {
|
|
38
|
-
const { attribute, values, formVersion } = params;
|
|
39
|
-
const currentVersion = attribute?.versions_conf?.versionable && attribute?.versions_conf?.profile
|
|
40
|
-
? attribute.versions_conf.profile.trees.reduce((relevantVersion, tree) => {
|
|
41
|
-
if (formVersion?.[tree.id]) {
|
|
42
|
-
relevantVersion[tree.id] = formVersion[tree.id];
|
|
43
|
-
}
|
|
44
|
-
return relevantVersion;
|
|
45
|
-
}, {})
|
|
46
|
-
: null;
|
|
47
|
-
const hasInheritedValues = attribute?.versions_conf?.versionable
|
|
48
|
-
? !isCurrentVersion(currentVersion, values?.[0]?.version ?? currentVersion)
|
|
49
|
-
: false; // We assume that all values have the same version
|
|
50
|
-
const inheritedVersion = hasInheritedValues ? values?.[0]?.version : null;
|
|
51
|
-
return {
|
|
52
|
-
activeScope: hasInheritedValues ? VersionFieldScope.INHERITED : VersionFieldScope.CURRENT,
|
|
53
|
-
values: {
|
|
54
|
-
[VersionFieldScope.CURRENT]: {
|
|
55
|
-
version: currentVersion ?? null,
|
|
56
|
-
values: hasInheritedValues ? [] : values,
|
|
57
|
-
},
|
|
58
|
-
[VersionFieldScope.INHERITED]: hasInheritedValues ? { version: inheritedVersion ?? null, values } : null,
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export const computeInitialState = (params) => {
|
|
63
|
-
const { element, record, isRecordReadOnly, formVersion } = params;
|
|
64
|
-
const attribute = element.attribute;
|
|
65
|
-
const fieldValues = element.values ?? [];
|
|
66
|
-
const initialState = {
|
|
67
|
-
...virginState,
|
|
68
|
-
attribute,
|
|
69
|
-
record,
|
|
70
|
-
formElement: element,
|
|
71
|
-
isReadOnly: attribute?.readonly || isRecordReadOnly || !attribute?.permissions?.edit_value,
|
|
72
|
-
..._computeScopeAndValues({ attribute, values: fieldValues, formVersion }),
|
|
73
|
-
};
|
|
74
|
-
return initialState;
|
|
75
|
-
};
|
|
76
|
-
const linkFieldReducer = (state, action) => {
|
|
77
|
-
switch (action.type) {
|
|
78
|
-
case LinkFieldReducerActionsType.ADD_VALUES: {
|
|
79
|
-
const newValues = [...state.values[state.activeScope].values, ...action.values];
|
|
80
|
-
return {
|
|
81
|
-
...state,
|
|
82
|
-
values: {
|
|
83
|
-
...state.values,
|
|
84
|
-
[state.activeScope]: {
|
|
85
|
-
...state.values[state.activeScope],
|
|
86
|
-
values: newValues,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
case LinkFieldReducerActionsType.DELETE_VALUE: {
|
|
92
|
-
const activeValues = getActiveFieldValues(state);
|
|
93
|
-
const newValues = activeValues.filter(value => value.id_value !== action.idValue);
|
|
94
|
-
return {
|
|
95
|
-
...state,
|
|
96
|
-
values: {
|
|
97
|
-
...state.values,
|
|
98
|
-
[state.activeScope]: {
|
|
99
|
-
...state.values[state.activeScope],
|
|
100
|
-
values: newValues,
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
case LinkFieldReducerActionsType.DELETE_ALL_VALUES: {
|
|
106
|
-
return {
|
|
107
|
-
...state,
|
|
108
|
-
values: {
|
|
109
|
-
...state.values,
|
|
110
|
-
[state.activeScope]: {
|
|
111
|
-
...state.values[state.activeScope],
|
|
112
|
-
values: [],
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
case LinkFieldReducerActionsType.SET_ERROR_MESSAGE: {
|
|
118
|
-
return { ...state, errorMessage: action.errorMessage };
|
|
119
|
-
}
|
|
120
|
-
case LinkFieldReducerActionsType.CLEAR_ERROR_MESSAGE: {
|
|
121
|
-
return { ...state, errorMessage: '' };
|
|
122
|
-
}
|
|
123
|
-
case LinkFieldReducerActionsType.SET_IS_VALUES_ADD_VISIBLE: {
|
|
124
|
-
return { ...state, isValuesAddVisible: action.isValuesAddVisible };
|
|
125
|
-
}
|
|
126
|
-
case LinkFieldReducerActionsType.CHANGE_ACTIVE_SCOPE: {
|
|
127
|
-
return { ...state, activeScope: action.scope };
|
|
128
|
-
}
|
|
129
|
-
case LinkFieldReducerActionsType.REFRESH_VALUES: {
|
|
130
|
-
return {
|
|
131
|
-
...state,
|
|
132
|
-
..._computeScopeAndValues({
|
|
133
|
-
attribute: state.formElement.attribute,
|
|
134
|
-
values: action.values,
|
|
135
|
-
formVersion: state.values[VersionFieldScope.CURRENT].version,
|
|
136
|
-
}),
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
default:
|
|
140
|
-
return state;
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
export default linkFieldReducer;
|
|
144
|
-
//# sourceMappingURL=linkFieldReducer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkFieldReducer.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,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,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,OAAO;iBAC/D,CAAC;aACL,CAAC;QACN,CAAC;QACD;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport getActiveFieldValues from '_ui/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues';\nimport isCurrentVersion from '_ui/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion';\nimport {\n VersionFieldScope,\n type FormElement,\n type ICommonFieldsReducerState,\n} from '_ui/components/RecordEdition/EditRecordContent/_types';\nimport {\n type RecordFormElementsValueLinkValue,\n type RecordFormElementsValueTreeValue,\n} from '_ui/hooks/useGetRecordForm/useGetRecordForm';\nimport {type IRecordIdentityWhoAmI} from '_ui/types/records';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type RecordFormAttributeFragment} from '_ui/_gqlTypes';\n\ntype AllowedValuesType = RecordFormElementsValueLinkValue | RecordFormElementsValueTreeValue;\n\nexport interface ILinkFieldState<ValuesType> extends ICommonFieldsReducerState<ValuesType[]> {\n errorMessage: string | string[];\n isValuesAddVisible: boolean;\n}\n\nexport enum LinkFieldReducerActionsType {\n ADD_VALUES = 'ADD_VALUES',\n DELETE_VALUE = 'DELETE_VALUE',\n DELETE_ALL_VALUES = 'DELETE_ALL_VALUES',\n SET_ERROR_MESSAGE = 'SET_ERROR_MESSAGE',\n CLEAR_ERROR_MESSAGE = 'CLEAR_ERROR_MESSAGE',\n SET_IS_VALUES_ADD_VISIBLE = 'SET_IS_VALUES_ADD_VISIBLE',\n CHANGE_ACTIVE_SCOPE = 'CHANGE_ACTIVE_SCOPE',\n REFRESH_VALUES = 'REFRESH_VALUES',\n}\n\nexport type LinkFieldReducerActions<ValuesType extends AllowedValuesType> =\n | {\n type: LinkFieldReducerActionsType.ADD_VALUES;\n values: ValuesType[];\n }\n | {\n type: LinkFieldReducerActionsType.DELETE_VALUE;\n idValue: string;\n }\n | {\n type: LinkFieldReducerActionsType.DELETE_ALL_VALUES;\n }\n | {type: LinkFieldReducerActionsType.SET_ERROR_MESSAGE; errorMessage: string | string[]}\n | {type: LinkFieldReducerActionsType.CLEAR_ERROR_MESSAGE}\n | {type: LinkFieldReducerActionsType.SET_IS_VALUES_ADD_VISIBLE; isValuesAddVisible: boolean}\n | {type: LinkFieldReducerActionsType.CHANGE_ACTIVE_SCOPE; scope: VersionFieldScope}\n | {\n type: LinkFieldReducerActionsType.REFRESH_VALUES;\n values: ValuesType[];\n formVersion: IValueVersion;\n };\n\nexport const virginState: ILinkFieldState<AllowedValuesType> = {\n record: null,\n formElement: null,\n attribute: null,\n isReadOnly: false,\n activeScope: VersionFieldScope.CURRENT,\n values: {\n [VersionFieldScope.CURRENT]: {\n version: null,\n values: [],\n },\n [VersionFieldScope.INHERITED]: null,\n },\n errorMessage: '',\n isValuesAddVisible: false,\n};\n\n/**\n * For given list of values, determine if there is inherited values, inherited/current version and default active scope\n */\nconst _computeScopeAndValues = <ValuesType extends AllowedValuesType>(params: {\n attribute: RecordFormAttributeFragment;\n values: ValuesType[];\n formVersion: IValueVersion;\n}): Pick<ILinkFieldState<ValuesType>, 'values' | 'activeScope'> => {\n const {attribute, values, formVersion} = params;\n\n const currentVersion: IValueVersion =\n attribute?.versions_conf?.versionable && attribute?.versions_conf?.profile\n ? attribute.versions_conf.profile.trees.reduce((relevantVersion, tree) => {\n if (formVersion?.[tree.id]) {\n relevantVersion[tree.id] = formVersion[tree.id];\n }\n\n return relevantVersion;\n }, {})\n : null;\n\n const hasInheritedValues = attribute?.versions_conf?.versionable\n ? !isCurrentVersion(currentVersion, values?.[0]?.version ?? currentVersion)\n : false; // We assume that all values have the same version\n const inheritedVersion = hasInheritedValues ? values?.[0]?.version : null;\n\n return {\n activeScope: hasInheritedValues ? VersionFieldScope.INHERITED : VersionFieldScope.CURRENT,\n values: {\n [VersionFieldScope.CURRENT]: {\n version: currentVersion ?? null,\n values: hasInheritedValues ? [] : values,\n },\n [VersionFieldScope.INHERITED]: hasInheritedValues ? {version: inheritedVersion ?? null, values} : null,\n },\n };\n};\n\nexport const computeInitialState = <ValuesType extends AllowedValuesType>(params: {\n element: FormElement<unknown>;\n record: IRecordIdentityWhoAmI;\n isRecordReadOnly: boolean;\n formVersion: IValueVersion;\n}): ILinkFieldState<ValuesType> => {\n const {element, record, isRecordReadOnly, formVersion} = params;\n\n const attribute = element.attribute;\n\n const fieldValues = (element.values as ValuesType[]) ?? [];\n\n const initialState: ILinkFieldState<ValuesType> = {\n ...virginState,\n attribute,\n record,\n formElement: element,\n isReadOnly: attribute?.readonly || isRecordReadOnly || !attribute?.permissions?.edit_value,\n ..._computeScopeAndValues<ValuesType>({attribute, values: fieldValues, formVersion}),\n };\n\n return initialState;\n};\n\nconst linkFieldReducer = <ValuesType extends AllowedValuesType>(\n state: ILinkFieldState<ValuesType>,\n action: LinkFieldReducerActions<ValuesType>,\n): ILinkFieldState<ValuesType> => {\n switch (action.type) {\n case LinkFieldReducerActionsType.ADD_VALUES: {\n const newValues = [...state.values[state.activeScope].values, ...action.values];\n return {\n ...state,\n values: {\n ...state.values,\n [state.activeScope]: {\n ...state.values[state.activeScope],\n values: newValues,\n },\n },\n };\n }\n case LinkFieldReducerActionsType.DELETE_VALUE: {\n const activeValues = getActiveFieldValues(state);\n const newValues = activeValues.filter(value => value.id_value !== action.idValue);\n\n return {\n ...state,\n values: {\n ...state.values,\n [state.activeScope]: {\n ...state.values[state.activeScope],\n values: newValues,\n },\n },\n };\n }\n case LinkFieldReducerActionsType.DELETE_ALL_VALUES: {\n return {\n ...state,\n values: {\n ...state.values,\n [state.activeScope]: {\n ...state.values[state.activeScope],\n values: [],\n },\n },\n };\n }\n case LinkFieldReducerActionsType.SET_ERROR_MESSAGE: {\n return {...state, errorMessage: action.errorMessage};\n }\n case LinkFieldReducerActionsType.CLEAR_ERROR_MESSAGE: {\n return {...state, errorMessage: ''};\n }\n case LinkFieldReducerActionsType.SET_IS_VALUES_ADD_VISIBLE: {\n return {...state, isValuesAddVisible: action.isValuesAddVisible};\n }\n case LinkFieldReducerActionsType.CHANGE_ACTIVE_SCOPE: {\n return {...state, activeScope: action.scope};\n }\n case LinkFieldReducerActionsType.REFRESH_VALUES: {\n return {\n ...state,\n ..._computeScopeAndValues({\n attribute: state.formElement.attribute,\n values: action.values,\n formVersion: state.values[VersionFieldScope.CURRENT].version,\n }),\n };\n }\n default:\n return state;\n }\n};\n\nexport default linkFieldReducer;\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type ButtonProps } from 'antd';
|
|
2
|
-
import { VersionFieldScope } from '../../_types';
|
|
3
|
-
interface IAddValueBtnProps extends ButtonProps {
|
|
4
|
-
bordered?: boolean;
|
|
5
|
-
linkField?: boolean;
|
|
6
|
-
activeScope: VersionFieldScope;
|
|
7
|
-
}
|
|
8
|
-
declare function AddValueBtn({ bordered, linkField, activeScope, ...props }: IAddValueBtnProps): JSX.Element;
|
|
9
|
-
export default AddValueBtn;
|
|
@@ -1,19 +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 { PlusOutlined } from '@ant-design/icons';
|
|
6
|
-
import { themeVars } from '../../../../../antdTheme';
|
|
7
|
-
import { BasicButton } from '../../../../../components';
|
|
8
|
-
import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
|
|
9
|
-
import { VersionFieldScope } from '../../_types';
|
|
10
|
-
function AddValueBtn({ bordered = false, linkField = false, activeScope, ...props }) {
|
|
11
|
-
const { t } = useSharedTranslation();
|
|
12
|
-
return (_jsxs(BasicButton, { bordered: bordered, ...props, style: {
|
|
13
|
-
color: activeScope === VersionFieldScope.INHERITED
|
|
14
|
-
? themeVars.inheritedValuesVersionColor
|
|
15
|
-
: themeVars.defaultTextColor,
|
|
16
|
-
}, children: [_jsx(PlusOutlined, {}), linkField ? t('record_edition.add_value_link') : t('record_edition.add_value')] }));
|
|
17
|
-
}
|
|
18
|
-
export default AddValueBtn;
|
|
19
|
-
//# sourceMappingURL=AddValueBtn.js.map
|
package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AddValueBtn.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAQ/C,SAAS,WAAW,CAAC,EAAC,QAAQ,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAoB;IAChG,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,OAAO,CACH,MAAC,WAAW,IACR,QAAQ,EAAE,QAAQ,KACd,KAAK,EACT,KAAK,EAAE;YACH,KAAK,EACD,WAAW,KAAK,iBAAiB,CAAC,SAAS;gBACvC,CAAC,CAAC,SAAS,CAAC,2BAA2B;gBACvC,CAAC,CAAC,SAAS,CAAC,gBAAgB;SACvC,aAED,KAAC,YAAY,KAAG,EACf,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,IACrE,CACjB,CAAC;AACN,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {PlusOutlined} from '@ant-design/icons';\nimport {type ButtonProps} from 'antd';\nimport {themeVars} from '_ui/antdTheme';\nimport {BasicButton} from '_ui/components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {VersionFieldScope} from '../../_types';\n\ninterface IAddValueBtnProps extends ButtonProps {\n bordered?: boolean;\n linkField?: boolean;\n activeScope: VersionFieldScope;\n}\n\nfunction AddValueBtn({bordered = false, linkField = false, activeScope, ...props}: IAddValueBtnProps): JSX.Element {\n const {t} = useSharedTranslation();\n return (\n <BasicButton\n bordered={bordered}\n {...props}\n style={{\n color:\n activeScope === VersionFieldScope.INHERITED\n ? themeVars.inheritedValuesVersionColor\n : themeVars.defaultTextColor,\n }}\n >\n <PlusOutlined />\n {linkField ? t('record_edition.add_value_link') : t('record_edition.add_value')}\n </BasicButton>\n );\n}\n\nexport default AddValueBtn;\n"]}
|
|
@@ -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 AddValueBtn from './AddValueBtn';
|
|
5
|
-
export default AddValueBtn;
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,eAAe,WAAW,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport AddValueBtn from './AddValueBtn';\n\nexport default AddValueBtn;\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } 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 { DeleteOutlined } from '@ant-design/icons';
|
|
6
|
-
import { Popconfirm, Tooltip } from 'antd';
|
|
7
|
-
import { useState } from 'react';
|
|
8
|
-
import { BasicButton } from '../../../../../components';
|
|
9
|
-
import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
|
|
10
|
-
function DeleteAllValuesBtn({ onDelete }) {
|
|
11
|
-
const { t } = useSharedTranslation();
|
|
12
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
13
|
-
const _handleDelete = async () => {
|
|
14
|
-
setIsLoading(true);
|
|
15
|
-
await onDelete();
|
|
16
|
-
setIsLoading(false);
|
|
17
|
-
};
|
|
18
|
-
return (_jsx(Popconfirm, { placement: "leftTop", title: t('record_edition.delete_all_values_confirm'), onConfirm: _handleDelete, okText: t('global.submit'), okButtonProps: { 'aria-label': 'delete-confirm-button' }, cancelText: t('global.cancel'), children: _jsx(_Fragment, { children: _jsx(Tooltip, { title: t('record_edition.delete_all_values'), children: _jsx(BasicButton, { "aria-label": "delete-all-values", icon: _jsx(DeleteOutlined, {}), shape: "circle", loading: isLoading }) }) }) }));
|
|
19
|
-
}
|
|
20
|
-
export default DeleteAllValuesBtn;
|
|
21
|
-
//# sourceMappingURL=DeleteAllValuesBtn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteAllValuesBtn.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,UAAU,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAMpE,SAAS,kBAAkB,CAAC,EAAC,QAAQ,EAA2B;IAC5D,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;QAC7B,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,QAAQ,EAAE,CAAC;QACjB,YAAY,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,IACP,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE,CAAC,CAAC,0CAA0C,CAAC,EACpD,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,CAAC,CAAC,eAAe,CAAC,EAC1B,aAAa,EAAE,EAAC,YAAY,EAAE,uBAAuB,EAAC,EACtD,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC,YAG9B,4BACI,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,CAAC,kCAAkC,CAAC,YACjD,KAAC,WAAW,kBACG,mBAAmB,EAC9B,IAAI,EAAE,KAAC,cAAc,KAAG,EACxB,KAAK,EAAC,QAAQ,EACd,OAAO,EAAE,SAAS,GACpB,GACI,GACX,GACM,CAChB,CAAC;AACN,CAAC;AAED,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {DeleteOutlined} from '@ant-design/icons';\nimport {Popconfirm, Tooltip} from 'antd';\nimport {useState} from 'react';\nimport {BasicButton} from '_ui/components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\n\ninterface IDeleteAllValuesBtnProps {\n onDelete: () => Promise<void>;\n}\n\nfunction DeleteAllValuesBtn({onDelete}: IDeleteAllValuesBtnProps): JSX.Element {\n const {t} = useSharedTranslation();\n const [isLoading, setIsLoading] = useState(false);\n\n const _handleDelete = async () => {\n setIsLoading(true);\n await onDelete();\n setIsLoading(false);\n };\n\n return (\n <Popconfirm\n placement=\"leftTop\"\n title={t('record_edition.delete_all_values_confirm')}\n onConfirm={_handleDelete}\n okText={t('global.submit')}\n okButtonProps={{'aria-label': 'delete-confirm-button'}}\n cancelText={t('global.cancel')}\n >\n {/* Do not remove the <></>. Workaround for issue https://github.com/ant-design/ant-design/issues/41206 */}\n <>\n <Tooltip title={t('record_edition.delete_all_values')}>\n <BasicButton\n aria-label=\"delete-all-values\"\n icon={<DeleteOutlined />}\n shape=\"circle\"\n loading={isLoading}\n />\n </Tooltip>\n </>\n </Popconfirm>\n );\n}\n\nexport default DeleteAllValuesBtn;\n"]}
|
|
@@ -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 DeleteAllValuesBtn from './DeleteAllValuesBtn';
|
|
5
|
-
export default DeleteAllValuesBtn;
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport DeleteAllValuesBtn from './DeleteAllValuesBtn';\n\nexport default DeleteAllValuesBtn;\n"]}
|
package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js
DELETED
|
@@ -1,14 +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 { DeleteOutlined } from '@ant-design/icons';
|
|
6
|
-
import { Button, Popconfirm } from 'antd';
|
|
7
|
-
import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
|
|
8
|
-
function DeleteValueBtn({ onDelete, ...buttonProps }) {
|
|
9
|
-
const { t } = useSharedTranslation();
|
|
10
|
-
const _handleDelete = () => onDelete();
|
|
11
|
-
return (_jsx(Popconfirm, { placement: "leftTop", title: t('record_edition.delete_value_confirm'), onConfirm: _handleDelete, okText: t('global.submit'), okButtonProps: { 'aria-label': 'delete-confirm-button' }, cancelText: t('global.cancel'), children: _jsx(Button, { shape: "circle", ...buttonProps, icon: _jsx(DeleteOutlined, {}), style: { background: '#FFF' }, danger: true, "aria-label": "delete-value", onClick: e => e.stopPropagation(), className: "delete-value-button" }) }));
|
|
12
|
-
}
|
|
13
|
-
export default DeleteValueBtn;
|
|
14
|
-
//# sourceMappingURL=DeleteValueBtn.js.map
|
package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteValueBtn.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,MAAM,EAAoB,UAAU,EAAC,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAMpE,SAAS,cAAc,CAAC,EAAC,QAAQ,EAAE,GAAG,WAAW,EAAuB;IACpE,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAEvC,OAAO,CACH,KAAC,UAAU,IACP,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE,CAAC,CAAC,qCAAqC,CAAC,EAC/C,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,CAAC,CAAC,eAAe,CAAC,EAC1B,aAAa,EAAE,EAAC,YAAY,EAAE,uBAAuB,EAAC,EACtD,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC,YAE9B,KAAC,MAAM,IACH,KAAK,EAAC,QAAQ,KACV,WAAW,EACf,IAAI,EAAE,KAAC,cAAc,KAAG,EACxB,KAAK,EAAE,EAAC,UAAU,EAAE,MAAM,EAAC,EAC3B,MAAM,sBACK,cAAc,EACzB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACjC,SAAS,EAAC,qBAAqB,GACjC,GACO,CAChB,CAAC;AACN,CAAC;AAED,eAAe,cAAc,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {DeleteOutlined} from '@ant-design/icons';\nimport {Button, type ButtonProps, Popconfirm} from 'antd';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\n\ninterface IDeleteValueBtnProps extends ButtonProps {\n onDelete: () => void;\n}\n\nfunction DeleteValueBtn({onDelete, ...buttonProps}: IDeleteValueBtnProps): JSX.Element {\n const {t} = useSharedTranslation();\n\n const _handleDelete = () => onDelete();\n\n return (\n <Popconfirm\n placement=\"leftTop\"\n title={t('record_edition.delete_value_confirm')}\n onConfirm={_handleDelete}\n okText={t('global.submit')}\n okButtonProps={{'aria-label': 'delete-confirm-button'}}\n cancelText={t('global.cancel')}\n >\n <Button\n shape=\"circle\"\n {...buttonProps}\n icon={<DeleteOutlined />}\n style={{background: '#FFF'}}\n danger\n aria-label=\"delete-value\"\n onClick={e => e.stopPropagation()}\n className=\"delete-value-button\"\n />\n </Popconfirm>\n );\n}\n\nexport default DeleteValueBtn;\n"]}
|
|
@@ -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 DeleteValueBtn from './DeleteValueBtn';
|
|
5
|
-
export default DeleteValueBtn;
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,eAAe,cAAc,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport DeleteValueBtn from './DeleteValueBtn';\n\nexport default DeleteValueBtn;\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type CSSObject } from 'styled-components';
|
|
3
|
-
interface IFieldFooterProps {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
bordered?: boolean;
|
|
6
|
-
style?: CSSObject;
|
|
7
|
-
}
|
|
8
|
-
declare function FieldFooter({ children, bordered, style }: IFieldFooterProps): JSX.Element;
|
|
9
|
-
export default FieldFooter;
|
|
@@ -1,28 +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 { theme } from 'antd';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { themeVars } from '../../../../../antdTheme';
|
|
8
|
-
const FooterWrapper = styled.div `
|
|
9
|
-
display: flex;
|
|
10
|
-
justify-content: space-between;
|
|
11
|
-
align-items: center;
|
|
12
|
-
flex-direction: row-reverse;
|
|
13
|
-
padding: 0.25rem;
|
|
14
|
-
background: ${themeVars.lightBg};
|
|
15
|
-
border-radius: ${p => p.$themeToken.borderRadius}px;
|
|
16
|
-
border-top-left-radius: 0;
|
|
17
|
-
border-top-right-radius: 0;
|
|
18
|
-
|
|
19
|
-
${props => (props.$bordered ? `border: 1px solid ${themeVars.borderColor};` : '')}
|
|
20
|
-
|
|
21
|
-
${props => props.style}
|
|
22
|
-
`;
|
|
23
|
-
function FieldFooter({ children, bordered, style }) {
|
|
24
|
-
const { token } = theme.useToken();
|
|
25
|
-
return (_jsx(FooterWrapper, { style: style, "$bordered": bordered, "$themeToken": token, children: children }));
|
|
26
|
-
}
|
|
27
|
-
export default FieldFooter;
|
|
28
|
-
//# sourceMappingURL=FieldFooter.js.map
|
package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldFooter.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,MAAM,CAAC;AAG3B,OAAO,MAAwB,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAQxC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAmE;;;;;;kBAMjF,SAAS,CAAC,OAAO;qBACd,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY;;;;MAI9C,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB,SAAS,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;;MAE/E,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK;CACzB,CAAC;AAEF,SAAS,WAAW,CAAC,EAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAoB;IAC/D,MAAM,EAAC,KAAK,EAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IAEjC,OAAO,CACH,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,eAAa,QAAQ,iBAAe,KAAK,YAC/D,QAAQ,GACG,CACnB,CAAC;AACN,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {theme} from 'antd';\nimport {type GlobalToken} from 'antd/lib/theme/interface';\nimport React from 'react';\nimport styled, {type CSSObject} from 'styled-components';\nimport {themeVars} from '_ui/antdTheme';\n\ninterface IFieldFooterProps {\n children?: React.ReactNode;\n bordered?: boolean;\n style?: CSSObject;\n}\n\nconst FooterWrapper = styled.div<{style: CSSObject; $bordered?: boolean; $themeToken: GlobalToken}>`\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: row-reverse;\n padding: 0.25rem;\n background: ${themeVars.lightBg};\n border-radius: ${p => p.$themeToken.borderRadius}px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n\n ${props => (props.$bordered ? `border: 1px solid ${themeVars.borderColor};` : '')}\n\n ${props => props.style}\n`;\n\nfunction FieldFooter({children, bordered, style}: IFieldFooterProps): JSX.Element {\n const {token} = theme.useToken();\n\n return (\n <FooterWrapper style={style} $bordered={bordered} $themeToken={token}>\n {children}\n </FooterWrapper>\n );\n}\n\nexport default FieldFooter;\n"]}
|
|
@@ -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 FieldFooter from './FieldFooter';
|
|
5
|
-
export default FieldFooter;
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,eAAe,WAAW,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport FieldFooter from './FieldFooter';\n\nexport default FieldFooter;\n"]}
|