@leav/ui 1.10.0-7414117e → 1.10.0-dec3db65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/_utils/index.d.ts +0 -1
  2. package/dist/_utils/index.js +0 -3
  3. package/dist/_utils/index.js.map +1 -1
  4. package/dist/components/RecordEdition/EditRecord/EditRecord.js +1 -25
  5. package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
  6. package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js +2 -2
  7. package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js.map +1 -1
  8. package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +1 -19
  9. package/dist/components/RecordEdition/EditRecordContent/_types.js +0 -5
  10. package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
  11. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.d.ts +0 -3
  12. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.js.map +1 -1
  13. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +0 -2
  14. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +6 -8
  15. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
  16. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +2 -33
  17. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -1
  18. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js +11 -0
  19. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js.map +1 -1
  20. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +2 -19
  21. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
  22. package/dist/hooks/useRedirectToLogin/useRedirectToLogin.d.ts +2 -1
  23. package/dist/hooks/useRedirectToLogin/useRedirectToLogin.js +32 -4
  24. package/dist/hooks/useRedirectToLogin/useRedirectToLogin.js.map +1 -1
  25. package/dist/locales/en/shared.json +3 -31
  26. package/dist/locales/fr/shared.json +3 -31
  27. package/package.json +4 -4
  28. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.d.ts +0 -3
  29. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.js +0 -2
  30. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.js.map +0 -1
  31. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.d.ts +0 -1
  32. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js +0 -5
  33. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js.map +0 -1
  34. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.d.ts +0 -1
  35. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js +0 -5
  36. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js.map +0 -1
  37. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.d.ts +0 -7
  38. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js +0 -20
  39. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js.map +0 -1
  40. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.d.ts +0 -11
  41. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js +0 -35
  42. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js.map +0 -1
  43. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.d.ts +0 -2
  44. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js +0 -6
  45. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js.map +0 -1
  46. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.d.ts +0 -52
  47. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.js +0 -144
  48. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.js.map +0 -1
  49. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.d.ts +0 -9
  50. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js +0 -19
  51. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js.map +0 -1
  52. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.d.ts +0 -2
  53. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.js +0 -6
  54. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.js.map +0 -1
  55. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.d.ts +0 -5
  56. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.js +0 -21
  57. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.js.map +0 -1
  58. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.d.ts +0 -2
  59. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js +0 -6
  60. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js.map +0 -1
  61. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.d.ts +0 -6
  62. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js +0 -14
  63. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js.map +0 -1
  64. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.d.ts +0 -2
  65. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.js +0 -6
  66. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.js.map +0 -1
  67. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.d.ts +0 -9
  68. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js +0 -28
  69. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js.map +0 -1
  70. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.d.ts +0 -2
  71. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.js +0 -6
  72. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.js.map +0 -1
  73. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.d.ts +0 -6
  74. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.js +0 -25
  75. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.js.map +0 -1
  76. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.d.ts +0 -2
  77. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.js +0 -6
  78. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.js.map +0 -1
  79. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.d.ts +0 -7
  80. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.js +0 -33
  81. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.js.map +0 -1
  82. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.d.ts +0 -2
  83. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.js +0 -6
  84. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.js.map +0 -1
  85. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.d.ts +0 -2
  86. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.js +0 -13
  87. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.js.map +0 -1
  88. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.d.ts +0 -2
  89. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.js +0 -6
  90. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.js.map +0 -1
  91. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.d.ts +0 -10
  92. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js +0 -24
  93. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js.map +0 -1
  94. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.d.ts +0 -2
  95. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.js +0 -6
  96. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.js.map +0 -1
  97. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.d.ts +0 -13
  98. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js +0 -41
  99. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js.map +0 -1
  100. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.d.ts +0 -2
  101. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.js +0 -6
  102. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.js.map +0 -1
  103. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.d.ts +0 -8
  104. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.js +0 -34
  105. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.js.map +0 -1
  106. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.d.ts +0 -2
  107. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.js +0 -6
  108. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.js.map +0 -1
@@ -1,24 +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 { InfoCircleOutlined, InfoOutlined } from '@ant-design/icons';
6
- import { Button, Tooltip } from 'antd';
7
- import { BasicButton } from '../../../../../components';
8
- import { EditRecordReducerActionsTypes } from '../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
9
- import { useEditRecordReducer } from '../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
10
- import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
11
- function ValueDetailsBtn({ value, attribute, basic = false, ...buttonProps }) {
12
- const { dispatch } = useEditRecordReducer();
13
- const { t } = useSharedTranslation();
14
- const _handleClick = () => {
15
- dispatch({
16
- type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
17
- attribute,
18
- });
19
- };
20
- const detailsButton = basic ? (_jsx(BasicButton, { shape: "circle", ...buttonProps, icon: _jsx(InfoCircleOutlined, {}), onClick: _handleClick })) : (_jsx(Button, { shape: "circle", ...buttonProps, icon: _jsx(InfoOutlined, {}), onClick: _handleClick }));
21
- return _jsx(Tooltip, { title: t('record_edition.value_details_tooltip'), children: detailsButton });
22
- }
23
- export default ValueDetailsBtn;
24
- //# sourceMappingURL=ValueDetailsBtn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValueDetailsBtn.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,kBAAkB,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAC,MAAM,EAAoB,OAAO,EAAC,MAAM,MAAM,CAAC;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,6BAA6B,EAAC,MAAM,kEAAkE,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,qEAAqE,CAAC;AACzG,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAUpE,SAAS,eAAe,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,GAAG,KAAK,EAAE,GAAG,WAAW,EAAwB;IAC7F,MAAM,EAAC,QAAQ,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAC1C,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,YAAY,GAAG,GAAG,EAAE;QACtB,QAAQ,CAAC;YACL,IAAI,EAAE,6BAA6B,CAAC,gBAAgB;YACpD,SAAS;SACZ,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,CAC1B,KAAC,WAAW,IAAC,KAAK,EAAC,QAAQ,KAAK,WAAW,EAAE,IAAI,EAAE,KAAC,kBAAkB,KAAG,EAAE,OAAO,EAAE,YAAY,GAAI,CACvG,CAAC,CAAC,CAAC,CACA,KAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,KAAK,WAAW,EAAE,IAAI,EAAE,KAAC,YAAY,KAAG,EAAE,OAAO,EAAE,YAAY,GAAI,CAC5F,CAAC;IAEF,OAAO,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,CAAC,sCAAsC,CAAC,YAAG,aAAa,GAAW,CAAC;AAChG,CAAC;AAED,eAAe,eAAe,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 {InfoCircleOutlined, InfoOutlined} from '@ant-design/icons';\nimport {Button, type ButtonProps, Tooltip} from 'antd';\nimport {BasicButton} from '_ui/components';\nimport {EditRecordReducerActionsTypes} from '_ui/components/RecordEdition/editRecordReducer/editRecordReducer';\nimport {useEditRecordReducer} from '_ui/components/RecordEdition/editRecordReducer/useEditRecordReducer';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {type RecordFormAttributeFragment} from '_ui/_gqlTypes';\nimport {type RecordProperty} from '_ui/_queries/records/getRecordPropertiesQuery';\n\ninterface IValueDetailsBtnProps extends Omit<ButtonProps, 'value'> {\n attribute: RecordFormAttributeFragment;\n value: RecordProperty;\n basic?: boolean;\n}\n\nfunction ValueDetailsBtn({value, attribute, basic = false, ...buttonProps}: IValueDetailsBtnProps): JSX.Element {\n const {dispatch} = useEditRecordReducer();\n const {t} = useSharedTranslation();\n\n const _handleClick = () => {\n dispatch({\n type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,\n attribute,\n });\n };\n\n const detailsButton = basic ? (\n <BasicButton shape=\"circle\" {...buttonProps} icon={<InfoCircleOutlined />} onClick={_handleClick} />\n ) : (\n <Button shape=\"circle\" {...buttonProps} icon={<InfoOutlined />} onClick={_handleClick} />\n );\n\n return <Tooltip title={t('record_edition.value_details_tooltip')}>{detailsButton}</Tooltip>;\n}\n\nexport default ValueDetailsBtn;\n"]}
@@ -1,2 +0,0 @@
1
- import ValueDetailsBtn from './ValueDetailsBtn';
2
- export default ValueDetailsBtn;
@@ -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 ValueDetailsBtn from './ValueDetailsBtn';
5
- export default ValueDetailsBtn;
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,eAAe,eAAe,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 ValueDetailsBtn from './ValueDetailsBtn';\n\nexport default ValueDetailsBtn;\n"]}
@@ -1,13 +0,0 @@
1
- import { type ButtonProps } from 'antd';
2
- import { type IValueVersion } from '../../../../../types/values';
3
- import { VersionFieldScope } from '../../_types';
4
- interface IValuesVersionBtnProps extends Omit<ButtonProps, 'value'> {
5
- versions: {
6
- [scope in VersionFieldScope]: IValueVersion;
7
- };
8
- activeScope: VersionFieldScope;
9
- onScopeChange: (scope: VersionFieldScope) => void;
10
- basic?: boolean;
11
- }
12
- declare function ValuesVersionBtn({ versions, activeScope, onScopeChange, basic, ...buttonProps }: IValuesVersionBtnProps): JSX.Element;
13
- export default ValuesVersionBtn;
@@ -1,41 +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 { Button, Dropdown, Space } from 'antd';
6
- import { BasicButton } from '../../../../../components';
7
- import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
8
- import { getValueVersionLabel } from '../../../../../_utils';
9
- import { VersionFieldScope } from '../../_types';
10
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
11
- import { faLayerGroup } from '@fortawesome/free-solid-svg-icons';
12
- function ValuesVersionBtn({ versions, activeScope, onScopeChange, basic, ...buttonProps }) {
13
- const { t } = useSharedTranslation();
14
- const hasInheritedVersion = !!versions[VersionFieldScope.INHERITED];
15
- const _handleVersionSelect = item => {
16
- item.domEvent.preventDefault();
17
- item.domEvent.stopPropagation();
18
- onScopeChange(item.key);
19
- };
20
- const currentVersionLabel = getValueVersionLabel(versions[VersionFieldScope.CURRENT]);
21
- const menuItems = [
22
- {
23
- key: VersionFieldScope.CURRENT,
24
- label: (_jsxs(Space, { style: { paddingLeft: hasInheritedVersion ? '1rem' : 0 }, children: [_jsx(FontAwesomeIcon, { icon: faLayerGroup }), currentVersionLabel] })),
25
- onClick: _handleVersionSelect,
26
- },
27
- ];
28
- if (hasInheritedVersion) {
29
- const inheritedVersionLabel = getValueVersionLabel(versions[VersionFieldScope.INHERITED]) + ` (${t('values_version.inherited_value')})`;
30
- menuItems.unshift({
31
- key: VersionFieldScope.INHERITED,
32
- label: (_jsxs(Space, { children: [_jsx(FontAwesomeIcon, { icon: faLayerGroup }), inheritedVersionLabel] })),
33
- onClick: _handleVersionSelect,
34
- });
35
- }
36
- const buttonIcon = _jsx(FontAwesomeIcon, { icon: faLayerGroup });
37
- const button = basic ? (_jsx(BasicButton, { "aria-label": "values-version", shape: "circle", ...buttonProps, icon: buttonIcon, centered: true })) : (_jsx(Button, { "aria-label": "values-version", shape: "circle", ...buttonProps, icon: buttonIcon }));
38
- return (_jsx(Dropdown, { trigger: ['click'], menu: { items: menuItems, activeKey: activeScope }, children: button }));
39
- }
40
- export default ValuesVersionBtn;
41
- //# sourceMappingURL=ValuesVersionBtn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValuesVersionBtn.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,MAAM,EAAoB,QAAQ,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AAI/D,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,oBAAoB,EAAC,MAAM,YAAY,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAS/D,SAAS,gBAAgB,CAAC,EACtB,QAAQ,EACR,WAAW,EACX,aAAa,EACb,KAAK,EACL,GAAG,WAAW,EACO;IACrB,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,mBAAmB,GAAG,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAEpE,MAAM,oBAAoB,GAA4B,IAAI,CAAC,EAAE;QACzD,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;QAEhC,aAAa,CAAC,IAAI,CAAC,GAAwB,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEtF,MAAM,SAAS,GAAe;QAC1B;YACI,GAAG,EAAE,iBAAiB,CAAC,OAAO;YAC9B,KAAK,EAAE,CACH,MAAC,KAAK,IAAC,KAAK,EAAE,EAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAC,aACzD,KAAC,eAAe,IAAC,IAAI,EAAE,YAAY,GAAI,EACtC,mBAAmB,IAChB,CACX;YACD,OAAO,EAAE,oBAAoB;SAChC;KACJ,CAAC;IAEF,IAAI,mBAAmB,EAAE,CAAC;QACtB,MAAM,qBAAqB,GACvB,oBAAoB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,gCAAgC,CAAC,GAAG,CAAC;QAE9G,SAAS,CAAC,OAAO,CAAC;YACd,GAAG,EAAE,iBAAiB,CAAC,SAAS;YAChC,KAAK,EAAE,CACH,MAAC,KAAK,eACF,KAAC,eAAe,IAAC,IAAI,EAAE,YAAY,GAAI,EACtC,qBAAqB,IAClB,CACX;YACD,OAAO,EAAE,oBAAoB;SAChC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,UAAU,GAAG,KAAC,eAAe,IAAC,IAAI,EAAE,YAAY,GAAI,CAAC;IAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CACnB,KAAC,WAAW,kBAAY,gBAAgB,EAAC,KAAK,EAAC,QAAQ,KAAK,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,SAAG,CACzG,CAAC,CAAC,CAAC,CACA,KAAC,MAAM,kBAAY,gBAAgB,EAAC,KAAK,EAAC,QAAQ,KAAK,WAAW,EAAE,IAAI,EAAE,UAAU,GAAI,CAC3F,CAAC;IAEF,OAAO,CACH,KAAC,QAAQ,IAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAC,YACzE,MAAM,GACA,CACd,CAAC;AACN,CAAC;AAED,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 {Button, type ButtonProps, Dropdown, Space} from 'antd';\nimport {type ItemType} from 'antd/es/menu/interface';\nimport {type MenuItemType} from 'rc-menu/lib/interface';\nimport {themeVars} from '_ui/antdTheme';\nimport {BasicButton} from '_ui/components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {type IValueVersion} from '_ui/types/values';\nimport {getValueVersionLabel} from '_ui/_utils';\nimport {VersionFieldScope} from '../../_types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faLayerGroup} from '@fortawesome/free-solid-svg-icons';\n\ninterface IValuesVersionBtnProps extends Omit<ButtonProps, 'value'> {\n versions: {[scope in VersionFieldScope]: IValueVersion};\n activeScope: VersionFieldScope;\n onScopeChange: (scope: VersionFieldScope) => void;\n basic?: boolean;\n}\n\nfunction ValuesVersionBtn({\n versions,\n activeScope,\n onScopeChange,\n basic,\n ...buttonProps\n}: IValuesVersionBtnProps): JSX.Element {\n const {t} = useSharedTranslation();\n const hasInheritedVersion = !!versions[VersionFieldScope.INHERITED];\n\n const _handleVersionSelect: MenuItemType['onClick'] = item => {\n item.domEvent.preventDefault();\n item.domEvent.stopPropagation();\n\n onScopeChange(item.key as VersionFieldScope);\n };\n\n const currentVersionLabel = getValueVersionLabel(versions[VersionFieldScope.CURRENT]);\n\n const menuItems: ItemType[] = [\n {\n key: VersionFieldScope.CURRENT,\n label: (\n <Space style={{paddingLeft: hasInheritedVersion ? '1rem' : 0}}>\n <FontAwesomeIcon icon={faLayerGroup} />\n {currentVersionLabel}\n </Space>\n ),\n onClick: _handleVersionSelect,\n },\n ];\n\n if (hasInheritedVersion) {\n const inheritedVersionLabel =\n getValueVersionLabel(versions[VersionFieldScope.INHERITED]) + ` (${t('values_version.inherited_value')})`;\n\n menuItems.unshift({\n key: VersionFieldScope.INHERITED,\n label: (\n <Space>\n <FontAwesomeIcon icon={faLayerGroup} />\n {inheritedVersionLabel}\n </Space>\n ),\n onClick: _handleVersionSelect,\n });\n }\n\n const buttonIcon = <FontAwesomeIcon icon={faLayerGroup} />;\n const button = basic ? (\n <BasicButton aria-label=\"values-version\" shape=\"circle\" {...buttonProps} icon={buttonIcon} centered />\n ) : (\n <Button aria-label=\"values-version\" shape=\"circle\" {...buttonProps} icon={buttonIcon} />\n );\n\n return (\n <Dropdown trigger={['click']} menu={{items: menuItems, activeKey: activeScope}}>\n {button}\n </Dropdown>\n );\n}\n\nexport default ValuesVersionBtn;\n"]}
@@ -1,2 +0,0 @@
1
- import ValuesVersionBtn from './ValuesVersionBtn';
2
- export default ValuesVersionBtn;
@@ -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 ValuesVersionBtn from './ValuesVersionBtn';
5
- export default ValuesVersionBtn;
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/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 ValuesVersionBtn from './ValuesVersionBtn';\n\nexport default ValuesVersionBtn;\n"]}
@@ -1,8 +0,0 @@
1
- import { type CSSObject } from 'styled-components';
2
- import { VersionFieldScope } from '../../_types';
3
- interface IValuesVersionIndicatorProps {
4
- activeScope: VersionFieldScope;
5
- style?: CSSObject;
6
- }
7
- declare function ValuesVersionIndicator({ activeScope, style }: IValuesVersionIndicatorProps): JSX.Element;
8
- export default ValuesVersionIndicator;
@@ -1,34 +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
- import { VersionFieldScope } from '../../_types';
9
- const Indicator = styled.div `
10
- position: absolute;
11
- left: 0;
12
- top: 0;
13
- bottom: 0;
14
- background: ${p => (p.$isCurrentVersion ? 'none' : themeVars.inheritedValuesVersionColor)};
15
- width: 6px;
16
- z-index: 100;
17
- border-radius: ${p => p.$themeToken.borderRadius}px;;
18
-
19
- .first-value & {
20
- border-top-left-radius: ${p => p.$themeToken.borderRadius}}
21
- }
22
-
23
- ${p => p.$style}
24
-
25
- border-top-right-radius: 0;
26
- border-bottom-right-radius: 0;
27
- `;
28
- function ValuesVersionIndicator({ activeScope, style }) {
29
- const isCurrentVersion = activeScope === VersionFieldScope.CURRENT;
30
- const { token } = theme.useToken();
31
- return _jsx(Indicator, { "$isCurrentVersion": isCurrentVersion, "$style": style, "$themeToken": token });
32
- }
33
- export default ValuesVersionIndicator;
34
- //# sourceMappingURL=ValuesVersionIndicator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValuesVersionIndicator.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,MAAM,CAAC;AAE3B,OAAO,MAAwB,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAE/C,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAA2E;;;;;kBAKrF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,2BAA2B,CAAC;;;qBAGxE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY;;;kCAGlB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY;;;MAG3D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;;;;CAIlB,CAAC;AAOF,SAAS,sBAAsB,CAAC,EAAC,WAAW,EAAE,KAAK,EAA+B;IAC9E,MAAM,gBAAgB,GAAG,WAAW,KAAK,iBAAiB,CAAC,OAAO,CAAC;IACnE,MAAM,EAAC,KAAK,EAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IAEjC,OAAO,KAAC,SAAS,yBAAoB,gBAAgB,YAAU,KAAK,iBAAe,KAAK,GAAI,CAAC;AACjG,CAAC;AAED,eAAe,sBAAsB,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 styled, {type CSSObject} from 'styled-components';\nimport {themeVars} from '_ui/antdTheme';\nimport {VersionFieldScope} from '../../_types';\n\nconst Indicator = styled.div<{$isCurrentVersion: boolean; $style: CSSObject; $themeToken: GlobalToken}>`\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n background: ${p => (p.$isCurrentVersion ? 'none' : themeVars.inheritedValuesVersionColor)};\n width: 6px;\n z-index: 100;\n border-radius: ${p => p.$themeToken.borderRadius}px;;\n\n .first-value & {\n border-top-left-radius: ${p => p.$themeToken.borderRadius}}\n }\n\n ${p => p.$style}\n\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n`;\n\ninterface IValuesVersionIndicatorProps {\n activeScope: VersionFieldScope;\n style?: CSSObject;\n}\n\nfunction ValuesVersionIndicator({activeScope, style}: IValuesVersionIndicatorProps): JSX.Element {\n const isCurrentVersion = activeScope === VersionFieldScope.CURRENT;\n const {token} = theme.useToken();\n\n return <Indicator $isCurrentVersion={isCurrentVersion} $style={style} $themeToken={token} />;\n}\n\nexport default ValuesVersionIndicator;\n"]}
@@ -1,2 +0,0 @@
1
- import ValuesVersionIndicator from './ValuesVersionIndicator';
2
- export default ValuesVersionIndicator;
@@ -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 ValuesVersionIndicator from './ValuesVersionIndicator';
5
- export default ValuesVersionIndicator;
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAE9D,eAAe,sBAAsB,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 ValuesVersionIndicator from './ValuesVersionIndicator';\n\nexport default ValuesVersionIndicator;\n"]}