@leav/ui 1.6.0-4fe8c6ba → 1.6.0-638134f7

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 (91) hide show
  1. package/dist/components/Explorer/TableCell.js +5 -7
  2. package/dist/components/Explorer/TableCell.js.map +1 -1
  3. package/dist/components/Explorer/TableNameCell.js +3 -2
  4. package/dist/components/Explorer/TableNameCell.js.map +1 -1
  5. package/dist/components/Explorer/actions-item/useEditStatusItemAction.js +3 -2
  6. package/dist/components/Explorer/actions-item/useEditStatusItemAction.js.map +1 -1
  7. package/dist/components/Explorer/actions-item/useReplaceItemAction.js +3 -2
  8. package/dist/components/Explorer/actions-item/useReplaceItemAction.js.map +1 -1
  9. package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +3 -2
  10. package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -1
  11. package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +3 -2
  12. package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
  13. package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js +3 -2
  14. package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js.map +1 -1
  15. package/dist/components/Explorer/actions-mass/useExportMassAction.js +3 -2
  16. package/dist/components/Explorer/actions-mass/useExportMassAction.js.map +1 -1
  17. package/dist/components/Explorer/actions-mass/useMassActions.js +3 -2
  18. package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
  19. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +3 -2
  20. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
  21. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +3 -2
  22. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
  23. package/dist/components/Explorer/list-saved-views/SavedViews.js +4 -3
  24. package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -1
  25. package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js +5 -8
  26. package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js.map +1 -1
  27. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js +3 -2
  28. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -1
  29. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +7 -6
  30. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
  31. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +3 -2
  32. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -1
  33. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +4 -3
  34. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
  35. package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js +3 -2
  36. package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js.map +1 -1
  37. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +3 -2
  38. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
  39. package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js +3 -2
  40. package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js.map +1 -1
  41. package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js +3 -2
  42. package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js.map +1 -1
  43. package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js +4 -3
  44. package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js.map +1 -1
  45. package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js +3 -2
  46. package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js.map +1 -1
  47. package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js +3 -2
  48. package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js.map +1 -1
  49. package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js +3 -2
  50. package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js.map +1 -1
  51. package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js +3 -2
  52. package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js.map +1 -1
  53. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +7 -6
  54. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -1
  55. package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js +3 -2
  56. package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js.map +1 -1
  57. package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js +3 -2
  58. package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js.map +1 -1
  59. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js +4 -3
  60. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -1
  61. package/dist/components/LibraryItemsList/MenuView/MenuView.js +4 -4
  62. package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +1 -1
  63. package/dist/components/LibraryItemsList/ViewPanel/View/View.js +3 -2
  64. package/dist/components/LibraryItemsList/ViewPanel/View/View.js.map +1 -1
  65. package/dist/components/Notifications/hooks/useNotificationSubscription.js +3 -2
  66. package/dist/components/Notifications/hooks/useNotificationSubscription.js.map +1 -1
  67. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js +5 -20
  68. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js.map +1 -1
  69. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +4 -3
  70. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +1 -1
  71. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +4 -3
  72. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
  73. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +3 -2
  74. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
  75. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js +3 -2
  76. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js.map +1 -1
  77. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +2 -5
  78. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
  79. package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js +3 -2
  80. package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js.map +1 -1
  81. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +3 -2
  82. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -1
  83. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js +4 -3
  84. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js.map +1 -1
  85. package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js +3 -2
  86. package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js.map +1 -1
  87. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +3 -5
  88. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
  89. package/dist/components/SelectTreeNode/TreeNodeTitle.js +3 -2
  90. package/dist/components/SelectTreeNode/TreeNodeTitle.js.map +1 -1
  91. package/package.json +5 -3
@@ -1,5 +1,4 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FaEye, FaEyeSlash, FaSearch } from 'react-icons/fa';
3
2
  import { KitFilter, KitInput, KitTypography } from 'aristid-ds';
4
3
  import styled from 'styled-components';
5
4
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
@@ -11,6 +10,8 @@ import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsRedu
11
10
  import { FilterListItem } from './FilterListItem';
12
11
  import { CommonFilterItem } from '../../../../components/Filters/filter-items/CommonFilterItem';
13
12
  import { useFiltersContext } from '../../../../components/Filters/useFiltersContext';
13
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
14
+ import { faEye, faEyeSlash, faSearch } from '@fortawesome/free-solid-svg-icons';
14
15
  const StyledListContainer = styled.div `
15
16
  display: flex;
16
17
  flex-direction: column;
@@ -22,10 +23,10 @@ const StyledList = styled.ul `
22
23
  list-style: none;
23
24
  color: var(--general-utilities-text-primary);
24
25
  `;
25
- const StyledEyeSlash = styled(FaEyeSlash) `
26
+ const StyledEyeSlash = styled(FontAwesomeIcon) `
26
27
  color: var(--general-utilities-neutral-dark);
27
28
  `;
28
- const StyledFaEye = styled(FaEye) `
29
+ const StyledFaEye = styled(FontAwesomeIcon) `
29
30
  color: var(--general-utilities-neutral-deepDark);
30
31
  `;
31
32
  const _isLibraryLinkAttribute = (attribute) => [AttributeType.simple_link, AttributeType.advanced_link].includes(attribute.type) && 'linked_library' in attribute;
@@ -81,7 +82,7 @@ export const FilterItems = ({ libraryId }) => {
81
82
  return _jsx(_Fragment, {});
82
83
  }
83
84
  return (_jsxs(StyledListContainer, { children: [activeFilters.length > 0 && (_jsx(StyledList, { "aria-label": t('explorer.filter-list.active'), children: _jsx(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragEnd: _handleDragEnd, children: _jsx(SortableContext, { items: activeFilters.map(({ attribute }) => attribute.id), strategy: verticalListSortingStrategy, children: activeFilters.map(activeFilter => (_jsx(FilterListItem, { attributeId: activeFilter.attribute.id, isDraggable: true, visibilityButtonProps: {
84
- icon: _jsx(StyledFaEye, {}),
85
+ icon: _jsx(StyledFaEye, { icon: faEye }),
85
86
  title: String(t('explorer.hide')),
86
87
  onClick: removeFilter(activeFilter.id),
87
88
  }, children: _jsx(CommonFilterItem, { filter: {
@@ -90,8 +91,8 @@ export const FilterItems = ({ libraryId }) => {
90
91
  ...activeFilter.attribute,
91
92
  ...attributeDetailsById[activeFilter?.attribute?.id],
92
93
  },
93
- } }) }, activeFilter.attribute.id))) }) }) })), _jsx(KitTypography.Title, { level: "h4", children: t('explorer.available-attributes') }), _jsx(KitInput, { placeholder: String(t('global.search')), onChange: onSearchChanged, allowClear: true, prefix: _jsx(FaSearch, {}) }), _jsx(StyledList, { "aria-label": t('explorer.filter-list.inactive'), children: inactiveFilters.map(attributeId => (_jsx(FilterListItem, { attributeId: attributeId, visibilityButtonProps: {
94
- icon: _jsx(StyledEyeSlash, {}),
94
+ } }) }, activeFilter.attribute.id))) }) }) })), _jsx(KitTypography.Title, { level: "h4", children: t('explorer.available-attributes') }), _jsx(KitInput, { placeholder: String(t('global.search')), onChange: onSearchChanged, allowClear: true, prefix: _jsx(FontAwesomeIcon, { icon: faSearch }) }), _jsx(StyledList, { "aria-label": t('explorer.filter-list.inactive'), children: inactiveFilters.map(attributeId => (_jsx(FilterListItem, { attributeId: attributeId, visibilityButtonProps: {
95
+ icon: _jsx(StyledEyeSlash, { icon: faEyeSlash }),
95
96
  title: String(t('explorer.show')),
96
97
  onClick: addFilter(attributeId),
97
98
  }, children: _jsx(KitFilter, { label: attributeDetailsById[attributeId].label }) }, attributeId))) })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"FilterItems.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/filter-items/FilterItems.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,E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,EACD,KAAC,aAAa,CAAC,KAAK,IAAC,KAAK,EAAC,IAAI,YAAE,CAAC,CAAC,+BAA+B,CAAC,GAAuB,EAC1F,KAAC,QAAQ,IACL,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,EACvC,QAAQ,EAAE,eAAe,EACzB,UAAU,QACV,MAAM,EAAE,KAAC,QAAQ,KAAG,GACtB,EACF,KAAC,UAAU,kBAAa,CAAC,CAAC,+BAA+B,CAAC,YACrD,eAAe,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAChC,KAAC,cAAc,IAEX,WAAW,EAAE,WAAW,EACxB,qBAAqB,EAAE;wBACnB,IAAI,EAAE,KAAC,cAAc,KAAG;wBACxB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;wBACjC,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC;qBAClC,YAED,KAAC,SAAS,IAAC,KAAK,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC,KAAK,GAAI,IARxD,WAAW,CASH,CACpB,CAAC,GACO,IACK,CACzB,CAAC;AACN,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 FunctionComponent} from 'react';\nimport {FaEye, FaEyeSlash, FaSearch} from 'react-icons/fa';\nimport {KitFilter, KitInput, KitTypography} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {\n AttributeFormat,\n type AttributesByLibAttributeFragment,\n type AttributesByLibAttributeLinkAttributeFragment,\n type AttributesByLibAttributeTreeAttributeFragment,\n AttributeType,\n} from '_ui/_gqlTypes';\nimport {\n closestCenter,\n DndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy} from '@dnd-kit/sortable';\nimport {useAttributeDetailsData} from '../_shared/useAttributeDetailsData';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {FilterListItem} from './FilterListItem';\nimport {CommonFilterItem} from '_ui/components/Filters/filter-items/CommonFilterItem';\nimport {useFiltersContext} from '_ui/components/Filters/useFiltersContext';\nimport {type IUIFilterBaseAttribute, type UIFilter} from '_ui/components/Filters/_types';\n\nconst StyledListContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: calc(var(--general-spacing-l) * 1px);\n`;\n\nconst StyledList = styled.ul`\n padding: calc(var(--general-spacing-s) * 1px) 0;\n margin: 0;\n list-style: none;\n color: var(--general-utilities-text-primary);\n`;\n\nconst StyledEyeSlash = styled(FaEyeSlash)`\n color: var(--general-utilities-neutral-dark);\n`;\n\nconst StyledFaEye = styled(FaEye)`\n color: var(--general-utilities-neutral-deepDark);\n`;\n\nconst _isLibraryLinkAttribute = (\n attribute: AttributesByLibAttributeFragment,\n): attribute is AttributesByLibAttributeLinkAttributeFragment =>\n [AttributeType.simple_link, AttributeType.advanced_link].includes(attribute.type) && 'linked_library' in attribute;\n\nconst _isLibraryTreeAttribute = (\n attribute: AttributesByLibAttributeFragment,\n): attribute is AttributesByLibAttributeTreeAttributeFragment =>\n attribute.type === AttributeType.tree && 'linked_tree' in attribute;\n\nexport const FilterItems: FunctionComponent<{libraryId: string}> = ({libraryId}) => {\n const {t} = useSharedTranslation();\n const {\n filtersData: {filters},\n dispatch,\n } = useFiltersContext();\n\n const {onSearchChanged, searchFilteredColumnsIds, attributeDetailsById} = useAttributeDetailsData(libraryId);\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const addFilter = (attributeId: string) => () => {\n dispatch({\n type: ViewSettingsActionTypes.ADD_FILTER,\n payload: {\n field: attributeId,\n attribute: {\n id: attributeId,\n label: attributeDetailsById[attributeId].label,\n format: attributeDetailsById[attributeId].format ?? AttributeFormat.text,\n type: attributeDetailsById[attributeId].type,\n valuesList: (attributeDetailsById[attributeId] as IUIFilterBaseAttribute).valuesList,\n linkedLibrary: _isLibraryLinkAttribute(attributeDetailsById[attributeId])\n ? (attributeDetailsById[attributeId].linked_library ?? undefined)\n : undefined, // TODO : https://aristid.atlassian.net/browse/XSTREAM-1155\n linkedTree: _isLibraryTreeAttribute(attributeDetailsById[attributeId])\n ? (attributeDetailsById[attributeId].linked_tree ?? undefined)\n : undefined,\n },\n },\n });\n };\n\n const removeFilter = (filterId: string) => () => {\n dispatch({\n type: ViewSettingsActionTypes.REMOVE_FILTER,\n payload: {\n id: filterId,\n },\n });\n };\n\n const _handleDragEnd = ({active: draggedElement, over: dropTarget}: DragEndEvent) => {\n const indexFrom = activeFilters.findIndex(({field}) => field === String(draggedElement.id));\n const indexTo = activeFilters.findIndex(({field}) => field === String(dropTarget?.id));\n\n if (!dropTarget || indexFrom === indexTo || indexTo === -1) {\n return;\n }\n\n dispatch({type: ViewSettingsActionTypes.MOVE_FILTER, payload: {indexFrom, indexTo}});\n };\n\n const activeFilters = filters.filter(({attribute}) => searchFilteredColumnsIds.includes(attribute.id));\n const inactiveFilters = searchFilteredColumnsIds.filter(\n attributeId =>\n filters.every(filterItem => filterItem.attribute.id !== attributeId) &&\n !('compute' in attributeDetailsById[attributeId] && attributeDetailsById[attributeId]?.compute),\n );\n\n if (!Object.keys(attributeDetailsById).length) {\n return <></>;\n }\n\n return (\n <StyledListContainer>\n {activeFilters.length > 0 && (\n <StyledList aria-label={t('explorer.filter-list.active')}>\n <DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={_handleDragEnd}>\n <SortableContext\n items={activeFilters.map(({attribute}) => attribute.id)}\n strategy={verticalListSortingStrategy}\n >\n {activeFilters.map(activeFilter => (\n <FilterListItem\n key={activeFilter.attribute.id}\n attributeId={activeFilter.attribute.id}\n isDraggable\n visibilityButtonProps={{\n icon: <StyledFaEye />,\n title: String(t('explorer.hide')),\n onClick: removeFilter(activeFilter.id),\n }}\n >\n <CommonFilterItem\n filter={\n {\n ...activeFilter,\n attribute: {\n ...activeFilter.attribute,\n ...attributeDetailsById[activeFilter?.attribute?.id],\n },\n } as UIFilter\n }\n />\n </FilterListItem>\n ))}\n </SortableContext>\n </DndContext>\n </StyledList>\n )}\n <KitTypography.Title level=\"h4\">{t('explorer.available-attributes')}</KitTypography.Title>\n <KitInput\n placeholder={String(t('global.search'))}\n onChange={onSearchChanged}\n allowClear\n prefix={<FaSearch />}\n />\n <StyledList aria-label={t('explorer.filter-list.inactive')}>\n {inactiveFilters.map(attributeId => (\n <FilterListItem\n key={attributeId}\n attributeId={attributeId}\n visibilityButtonProps={{\n icon: <StyledEyeSlash />,\n title: String(t('explorer.show')),\n onClick: addFilter(attributeId),\n }}\n >\n <KitFilter label={attributeDetailsById[attributeId].label} />\n </FilterListItem>\n ))}\n </StyledList>\n </StyledListContainer>\n );\n};\n"]}
1
+ {"version":3,"file":"FilterItems.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/filter-items/FilterItems.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACH,eAAe,EAIf,aAAa,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,aAAa,EACb,UAAU,EAEV,cAAc,EACd,aAAa,EACb,SAAS,EACT,UAAU,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,eAAe,EAAE,2BAA2B,EAAE,2BAA2B,EAAC,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,uBAAuB,EAAC,MAAM,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kBAAa,CAAC,CAAC,+BAA+B,CAAC,YACrD,eAAe,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAChC,KAAC,cAAc,IAEX,WAAW,EAAE,WAAW,EACxB,qBAAqB,EAAE;wBACnB,IAAI,EAAE,KAAC,cAAc,IAAC,IAAI,EAAE,UAAU,GAAI;wBAC1C,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;wBACjC,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC;qBAClC,YAED,KAAC,SAAS,IAAC,KAAK,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC,KAAK,GAAI,IARxD,WAAW,CASH,CACpB,CAAC,GACO,IACK,CACzB,CAAC;AACN,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 FunctionComponent} from 'react';\nimport {KitFilter, KitInput, KitTypography} from 'aristid-ds';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {\n AttributeFormat,\n type AttributesByLibAttributeFragment,\n type AttributesByLibAttributeLinkAttributeFragment,\n type AttributesByLibAttributeTreeAttributeFragment,\n AttributeType,\n} from '_ui/_gqlTypes';\nimport {\n closestCenter,\n DndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy} from '@dnd-kit/sortable';\nimport {useAttributeDetailsData} from '../_shared/useAttributeDetailsData';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {FilterListItem} from './FilterListItem';\nimport {CommonFilterItem} from '_ui/components/Filters/filter-items/CommonFilterItem';\nimport {useFiltersContext} from '_ui/components/Filters/useFiltersContext';\nimport {type IUIFilterBaseAttribute, type UIFilter} from '_ui/components/Filters/_types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faEye, faEyeSlash, faSearch} from '@fortawesome/free-solid-svg-icons';\n\nconst StyledListContainer = styled.div`\n display: flex;\n flex-direction: column;\n gap: calc(var(--general-spacing-l) * 1px);\n`;\n\nconst StyledList = styled.ul`\n padding: calc(var(--general-spacing-s) * 1px) 0;\n margin: 0;\n list-style: none;\n color: var(--general-utilities-text-primary);\n`;\n\nconst StyledEyeSlash = styled(FontAwesomeIcon)`\n color: var(--general-utilities-neutral-dark);\n`;\n\nconst StyledFaEye = styled(FontAwesomeIcon)`\n color: var(--general-utilities-neutral-deepDark);\n`;\n\nconst _isLibraryLinkAttribute = (\n attribute: AttributesByLibAttributeFragment,\n): attribute is AttributesByLibAttributeLinkAttributeFragment =>\n [AttributeType.simple_link, AttributeType.advanced_link].includes(attribute.type) && 'linked_library' in attribute;\n\nconst _isLibraryTreeAttribute = (\n attribute: AttributesByLibAttributeFragment,\n): attribute is AttributesByLibAttributeTreeAttributeFragment =>\n attribute.type === AttributeType.tree && 'linked_tree' in attribute;\n\nexport const FilterItems: FunctionComponent<{libraryId: string}> = ({libraryId}) => {\n const {t} = useSharedTranslation();\n const {\n filtersData: {filters},\n dispatch,\n } = useFiltersContext();\n\n const {onSearchChanged, searchFilteredColumnsIds, attributeDetailsById} = useAttributeDetailsData(libraryId);\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const addFilter = (attributeId: string) => () => {\n dispatch({\n type: ViewSettingsActionTypes.ADD_FILTER,\n payload: {\n field: attributeId,\n attribute: {\n id: attributeId,\n label: attributeDetailsById[attributeId].label,\n format: attributeDetailsById[attributeId].format ?? AttributeFormat.text,\n type: attributeDetailsById[attributeId].type,\n valuesList: (attributeDetailsById[attributeId] as IUIFilterBaseAttribute).valuesList,\n linkedLibrary: _isLibraryLinkAttribute(attributeDetailsById[attributeId])\n ? (attributeDetailsById[attributeId].linked_library ?? undefined)\n : undefined, // TODO : https://aristid.atlassian.net/browse/XSTREAM-1155\n linkedTree: _isLibraryTreeAttribute(attributeDetailsById[attributeId])\n ? (attributeDetailsById[attributeId].linked_tree ?? undefined)\n : undefined,\n },\n },\n });\n };\n\n const removeFilter = (filterId: string) => () => {\n dispatch({\n type: ViewSettingsActionTypes.REMOVE_FILTER,\n payload: {\n id: filterId,\n },\n });\n };\n\n const _handleDragEnd = ({active: draggedElement, over: dropTarget}: DragEndEvent) => {\n const indexFrom = activeFilters.findIndex(({field}) => field === String(draggedElement.id));\n const indexTo = activeFilters.findIndex(({field}) => field === String(dropTarget?.id));\n\n if (!dropTarget || indexFrom === indexTo || indexTo === -1) {\n return;\n }\n\n dispatch({type: ViewSettingsActionTypes.MOVE_FILTER, payload: {indexFrom, indexTo}});\n };\n\n const activeFilters = filters.filter(({attribute}) => searchFilteredColumnsIds.includes(attribute.id));\n const inactiveFilters = searchFilteredColumnsIds.filter(\n attributeId =>\n filters.every(filterItem => filterItem.attribute.id !== attributeId) &&\n !('compute' in attributeDetailsById[attributeId] && attributeDetailsById[attributeId]?.compute),\n );\n\n if (!Object.keys(attributeDetailsById).length) {\n return <></>;\n }\n\n return (\n <StyledListContainer>\n {activeFilters.length > 0 && (\n <StyledList aria-label={t('explorer.filter-list.active')}>\n <DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={_handleDragEnd}>\n <SortableContext\n items={activeFilters.map(({attribute}) => attribute.id)}\n strategy={verticalListSortingStrategy}\n >\n {activeFilters.map(activeFilter => (\n <FilterListItem\n key={activeFilter.attribute.id}\n attributeId={activeFilter.attribute.id}\n isDraggable\n visibilityButtonProps={{\n icon: <StyledFaEye icon={faEye} />,\n title: String(t('explorer.hide')),\n onClick: removeFilter(activeFilter.id),\n }}\n >\n <CommonFilterItem\n filter={\n {\n ...activeFilter,\n attribute: {\n ...activeFilter.attribute,\n ...attributeDetailsById[activeFilter?.attribute?.id],\n },\n } as UIFilter\n }\n />\n </FilterListItem>\n ))}\n </SortableContext>\n </DndContext>\n </StyledList>\n )}\n <KitTypography.Title level=\"h4\">{t('explorer.available-attributes')}</KitTypography.Title>\n <KitInput\n placeholder={String(t('global.search'))}\n onChange={onSearchChanged}\n allowClear\n prefix={<FontAwesomeIcon icon={faSearch} />}\n />\n <StyledList aria-label={t('explorer.filter-list.inactive')}>\n {inactiveFilters.map(attributeId => (\n <FilterListItem\n key={attributeId}\n attributeId={attributeId}\n visibilityButtonProps={{\n icon: <StyledEyeSlash icon={faEyeSlash} />,\n title: String(t('explorer.show')),\n onClick: addFilter(attributeId),\n }}\n >\n <KitFilter label={attributeDetailsById[attributeId].label} />\n </FilterListItem>\n ))}\n </StyledList>\n </StyledListContainer>\n );\n};\n"]}
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from 'styled-components';
3
- import { FaGripLines } from 'react-icons/fa';
4
3
  import { KitButton } from 'aristid-ds';
5
4
  import { useSortable } from '@dnd-kit/sortable';
6
5
  import { CSS } from '@dnd-kit/utilities';
6
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
7
+ import { faGripLines } from '@fortawesome/free-solid-svg-icons';
7
8
  const StyledFilterListItem = styled.li `
8
9
  display: flex;
9
10
  justify-content: space-between;
@@ -28,6 +29,6 @@ export const FilterListItem = ({ attributeId, isDraggable, visibilityButtonProps
28
29
  transform: CSS.Transform.toString(transform),
29
30
  transition,
30
31
  };
31
- return (_jsxs(StyledFilterListItem, { ref: setNodeRef, style: style, children: [_jsxs("div", { children: [isDraggable && (_jsx(StyledDragHandle, { ...attributes, ...listeners, "$isDragging": isDragging, children: _jsx(FaGripLines, {}) })), children] }), visibilityButtonProps && _jsx(KitButton, { size: "m", type: "tertiary", ...visibilityButtonProps })] }));
32
+ return (_jsxs(StyledFilterListItem, { ref: setNodeRef, style: style, children: [_jsxs("div", { children: [isDraggable && (_jsx(StyledDragHandle, { ...attributes, ...listeners, "$isDragging": isDragging, children: _jsx(FontAwesomeIcon, { icon: faGripLines }) })), children] }), visibilityButtonProps && _jsx(KitButton, { size: "m", type: "tertiary", ...visibilityButtonProps })] }));
32
33
  };
33
34
  //# sourceMappingURL=FilterListItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterListItem.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/filter-items/FilterListItem.tsx"],"names":[],"mappings":";AAIA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,GAAG,EAAC,MAAM,oBAAoB,CAAC;AAEvC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;CAYrC,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAwB;;;cAG9C,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;CAC/D,CAAC;AAQF,MAAM,CAAC,MAAM,cAAc,GAAkD,CAAC,EAC1E,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,QAAQ,GACX,EAAE,EAAE;IACD,MAAM,EAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,GAAG,WAAW,CAAC,EAAC,EAAE,EAAE,WAAW,EAAC,CAAC,CAAC;IAC9G,MAAM,KAAK,GAAG;QACV,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC5C,UAAU;KACb,CAAC;IAEF,OAAO,CACH,MAAC,oBAAoB,IAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,aAC/C,0BACK,WAAW,IAAI,CACZ,KAAC,gBAAgB,OAAK,UAAU,KAAM,SAAS,iBAAe,UAAU,YACpE,KAAC,WAAW,KAAG,GACA,CACtB,EACA,QAAQ,IACP,EACL,qBAAqB,IAAI,KAAC,SAAS,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,UAAU,KAAK,qBAAqB,GAAI,IACxE,CAC1B,CAAC;AACN,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 ComponentProps, type FunctionComponent} from 'react';\nimport styled from 'styled-components';\nimport {FaGripLines} from 'react-icons/fa';\nimport {KitButton} from 'aristid-ds';\nimport {useSortable} from '@dnd-kit/sortable';\nimport {CSS} from '@dnd-kit/utilities';\n\nconst StyledFilterListItem = styled.li`\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 32px;\n\n div {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: calc(var(--general-spacing-xs) * 1px);\n }\n`;\n\nconst StyledDragHandle = styled.span<{$isDragging: boolean}>`\n display: flex;\n align-items: center;\n cursor: ${props => (props.$isDragging ? 'grabbing' : 'grab')};\n`;\n\ninterface IActiveFilterListItemProps {\n attributeId: string;\n isDraggable?: true;\n visibilityButtonProps?: Pick<ComponentProps<typeof KitButton>, 'onClick' | 'icon' | 'title'>;\n}\n\nexport const FilterListItem: FunctionComponent<IActiveFilterListItemProps> = ({\n attributeId,\n isDraggable,\n visibilityButtonProps,\n children,\n}) => {\n const {attributes, listeners, setNodeRef, transform, transition, isDragging} = useSortable({id: attributeId});\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n\n return (\n <StyledFilterListItem ref={setNodeRef} style={style}>\n <div>\n {isDraggable && (\n <StyledDragHandle {...attributes} {...listeners} $isDragging={isDragging}>\n <FaGripLines />\n </StyledDragHandle>\n )}\n {children}\n </div>\n {visibilityButtonProps && <KitButton size=\"m\" type=\"tertiary\" {...visibilityButtonProps} />}\n </StyledFilterListItem>\n );\n};\n"]}
1
+ {"version":3,"file":"FilterListItem.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/filter-items/FilterListItem.tsx"],"names":[],"mappings":";AAIA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,GAAG,EAAC,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,WAAW,EAAC,MAAM,mCAAmC,CAAC;AAE9D,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;CAYrC,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAwB;;;cAG9C,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;CAC/D,CAAC;AAQF,MAAM,CAAC,MAAM,cAAc,GAAkD,CAAC,EAC1E,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,QAAQ,GACX,EAAE,EAAE;IACD,MAAM,EAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,GAAG,WAAW,CAAC,EAAC,EAAE,EAAE,WAAW,EAAC,CAAC,CAAC;IAC9G,MAAM,KAAK,GAAG;QACV,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC5C,UAAU;KACb,CAAC;IAEF,OAAO,CACH,MAAC,oBAAoB,IAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,aAC/C,0BACK,WAAW,IAAI,CACZ,KAAC,gBAAgB,OAAK,UAAU,KAAM,SAAS,iBAAe,UAAU,YACpE,KAAC,eAAe,IAAC,IAAI,EAAE,WAAW,GAAI,GACvB,CACtB,EACA,QAAQ,IACP,EACL,qBAAqB,IAAI,KAAC,SAAS,IAAC,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,UAAU,KAAK,qBAAqB,GAAI,IACxE,CAC1B,CAAC;AACN,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 ComponentProps, type FunctionComponent} from 'react';\nimport styled from 'styled-components';\nimport {KitButton} from 'aristid-ds';\nimport {useSortable} from '@dnd-kit/sortable';\nimport {CSS} from '@dnd-kit/utilities';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faGripLines} from '@fortawesome/free-solid-svg-icons';\n\nconst StyledFilterListItem = styled.li`\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 32px;\n\n div {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: calc(var(--general-spacing-xs) * 1px);\n }\n`;\n\nconst StyledDragHandle = styled.span<{$isDragging: boolean}>`\n display: flex;\n align-items: center;\n cursor: ${props => (props.$isDragging ? 'grabbing' : 'grab')};\n`;\n\ninterface IActiveFilterListItemProps {\n attributeId: string;\n isDraggable?: true;\n visibilityButtonProps?: Pick<ComponentProps<typeof KitButton>, 'onClick' | 'icon' | 'title'>;\n}\n\nexport const FilterListItem: FunctionComponent<IActiveFilterListItemProps> = ({\n attributeId,\n isDraggable,\n visibilityButtonProps,\n children,\n}) => {\n const {attributes, listeners, setNodeRef, transform, transition, isDragging} = useSortable({id: attributeId});\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n\n return (\n <StyledFilterListItem ref={setNodeRef} style={style}>\n <div>\n {isDraggable && (\n <StyledDragHandle {...attributes} {...listeners} $isDragging={isDragging}>\n <FontAwesomeIcon icon={faGripLines} />\n </StyledDragHandle>\n )}\n {children}\n </div>\n {visibilityButtonProps && <KitButton size=\"m\" type=\"tertiary\" {...visibilityButtonProps} />}\n </StyledFilterListItem>\n );\n};\n"]}
@@ -3,7 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  // This file is released under LGPL V3
4
4
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
5
  import { KitButton, KitTag } from 'aristid-ds';
6
- import { FaBars, FaSlidersH } from 'react-icons/fa';
7
6
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
8
7
  import { SettingsPanel } from '../router-menu/SettingsPanel';
9
8
  import { useEditSettings } from './useEditSettings';
@@ -12,6 +11,8 @@ import { useLang } from '../../../../hooks';
12
11
  import { useEffect, useState } from 'react';
13
12
  import styled from 'styled-components';
14
13
  import { MASS_SELECTION_ALL } from '../../_constants';
14
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
15
+ import { faBars, faSlidersH } from '@fortawesome/free-solid-svg-icons';
15
16
  const ModifiedStyledKitTag = styled(KitTag) `
16
17
  margin: 0;
17
18
  `;
@@ -53,8 +54,8 @@ export const useOpenViewSettings = ({ view, isEnabled = true }) => {
53
54
  const viewName = localizedTranslation(view?.viewLabels ?? {}, lang);
54
55
  const isMassSelectionAll = view.massSelection === MASS_SELECTION_ALL;
55
56
  useEffect(() => {
56
- setButton(_jsx(KitButton, { type: "secondary", size: "m", icon: _jsx(FaSlidersH, {}), onClick: () => _openSettingsPanel(), disabled: isMassSelectionAll, title: String(t('explorer.settings')) /* TODO: avoid transform null to 'null' */ }));
57
- setViewListButton(_jsxs(KitButton, { type: "secondary", size: "m", icon: _jsx(FaBars, {}), onClick: () => _openSettingsPanel('viewList.my-views'), disabled: isMassSelectionAll, title: String(t('explorer.viewList.manage-views')) /* TODO: avoid transform null to 'null' */, children: [viewName === '' ? t('explorer.viewList.manage-views') : viewName, view.viewModified && (_jsx(ModifiedStyledKitTag, { type: "error", idCardProps: { description: String(t('explorer.modified')) } }))] }));
57
+ setButton(_jsx(KitButton, { type: "secondary", size: "m", icon: _jsx(FontAwesomeIcon, { icon: faSlidersH }), onClick: () => _openSettingsPanel(), disabled: isMassSelectionAll, title: String(t('explorer.settings')) /* TODO: avoid transform null to 'null' */ }));
58
+ setViewListButton(_jsxs(KitButton, { type: "secondary", size: "m", icon: _jsx(FontAwesomeIcon, { icon: faBars }), onClick: () => _openSettingsPanel('viewList.my-views'), disabled: isMassSelectionAll, title: String(t('explorer.viewList.manage-views')) /* TODO: avoid transform null to 'null' */, children: [viewName === '' ? t('explorer.viewList.manage-views') : viewName, view.viewModified && (_jsx(ModifiedStyledKitTag, { type: "error", idCardProps: { description: String(t('explorer.modified')) } }))] }));
58
59
  }, [view.viewModified, viewName, isMassSelectionAll]);
59
60
  return {
60
61
  openSettingsPanel: _openSettingsPanel,
@@ -1 +1 @@
1
- {"version":3,"file":"useOpenViewSettings.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAE,MAAM,EAAC,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAoB,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,kBAAkB,EA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C,IAAI,EAAC,OAAO,EAAC,WAAW,EAAE,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,EAAC,GAAI,CACpG,IACO,CACf,CAAC;IACN,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEtD,OAAO;QACH,iBAAiB,EAAE,kBAAkB;QACrC,kBAAkB,EAAE,MAAM;QAC1B,cAAc;QACd,QAAQ,EAAE,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,QAAQ;KAC7E,CAAC;AACN,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 {KitButton, KitTag} from 'aristid-ds';\nimport {FaBars, FaSlidersH} from 'react-icons/fa';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {SettingsPanel} from '../router-menu/SettingsPanel';\nimport {useEditSettings} from './useEditSettings';\nimport {type SettingsPanelPages} from './EditSettingsContext';\nimport {localizedTranslation} from '@leav/utils';\nimport {useLang} from '_ui/hooks';\nimport {type ReactElement, useEffect, useState} from 'react';\nimport {type IViewSettingsState} from '../store-view-settings/viewSettingsReducer';\nimport styled from 'styled-components';\nimport {type FeatureHook} from '../../_types';\nimport {MASS_SELECTION_ALL} from '../../_constants';\n\nconst ModifiedStyledKitTag = styled(KitTag)`\n margin: 0;\n`;\n\ninterface IChangePanelPage {\n pageName: SettingsPanelPages;\n title: string;\n onClickLeftButton?: () => void;\n}\n\nexport const useOpenViewSettings = ({view, isEnabled = true}: FeatureHook<{view: IViewSettingsState}>) => {\n const {activeSettings, setActiveSettings, closeSettingsPanel} = useEditSettings();\n const [button, setButton] = useState<ReactElement | null>(null);\n const [viewListButton, setViewListButton] = useState<ReactElement | null>(null);\n\n const {t} = useSharedTranslation();\n const {lang} = useLang();\n\n useEffect(() => {\n if (!isEnabled) {\n closeSettingsPanel();\n }\n return () => {\n closeSettingsPanel();\n };\n }, [isEnabled]);\n\n const rootPanel = {pageName: 'router-menu', title: t('explorer.settings')} as const;\n\n const _changePanelPage = ({pageName, title, onClickLeftButton}: IChangePanelPage) => {\n setActiveSettings({\n ...activeSettings!,\n content: <SettingsPanel library={view.libraryId} page={pageName} />,\n title,\n onClickLeftButton,\n });\n };\n\n const _openSettingsPanel = (pageName: SettingsPanelPages = 'router-menu') => {\n const chanelPageParams: IChangePanelPage = {\n pageName,\n title: t(`explorer.${pageName}`),\n };\n if (pageName !== rootPanel.pageName) {\n chanelPageParams.onClickLeftButton = () => {\n _changePanelPage(rootPanel);\n };\n }\n\n _changePanelPage(chanelPageParams);\n };\n\n const viewName = localizedTranslation(view?.viewLabels ?? {}, lang);\n const isMassSelectionAll = view.massSelection === MASS_SELECTION_ALL;\n\n useEffect(() => {\n setButton(\n <KitButton\n type=\"secondary\"\n size=\"m\"\n icon={<FaSlidersH />}\n onClick={() => _openSettingsPanel()}\n disabled={isMassSelectionAll}\n title={String(t('explorer.settings')) /* TODO: avoid transform null to 'null' */}\n />,\n );\n setViewListButton(\n <KitButton\n type=\"secondary\"\n size=\"m\"\n icon={<FaBars />}\n onClick={() => _openSettingsPanel('viewList.my-views')}\n disabled={isMassSelectionAll}\n title={String(t('explorer.viewList.manage-views')) /* TODO: avoid transform null to 'null' */}\n >\n {viewName === '' ? t('explorer.viewList.manage-views') : viewName}\n {view.viewModified && (\n <ModifiedStyledKitTag type=\"error\" idCardProps={{description: String(t('explorer.modified'))}} />\n )}\n </KitButton>,\n );\n }, [view.viewModified, viewName, isMassSelectionAll]);\n\n return {\n openSettingsPanel: _openSettingsPanel,\n viewSettingsButton: button,\n viewListButton,\n viewName: viewName === '' ? t('explorer.viewList.default-view') : viewName,\n };\n};\n"]}
1
+ {"version":3,"file":"useOpenViewSettings.js","s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06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {KitButton, KitTag} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {SettingsPanel} from '../router-menu/SettingsPanel';\nimport {useEditSettings} from './useEditSettings';\nimport {type SettingsPanelPages} from './EditSettingsContext';\nimport {localizedTranslation} from '@leav/utils';\nimport {useLang} from '_ui/hooks';\nimport {type ReactElement, useEffect, useState} from 'react';\nimport {type IViewSettingsState} from '../store-view-settings/viewSettingsReducer';\nimport styled from 'styled-components';\nimport {type FeatureHook} from '../../_types';\nimport {MASS_SELECTION_ALL} from '../../_constants';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faBars, faSlidersH} from '@fortawesome/free-solid-svg-icons';\n\nconst ModifiedStyledKitTag = styled(KitTag)`\n margin: 0;\n`;\n\ninterface IChangePanelPage {\n pageName: SettingsPanelPages;\n title: string;\n onClickLeftButton?: () => void;\n}\n\nexport const useOpenViewSettings = ({view, isEnabled = true}: FeatureHook<{view: IViewSettingsState}>) => {\n const {activeSettings, setActiveSettings, closeSettingsPanel} = useEditSettings();\n const [button, setButton] = useState<ReactElement | null>(null);\n const [viewListButton, setViewListButton] = useState<ReactElement | null>(null);\n\n const {t} = useSharedTranslation();\n const {lang} = useLang();\n\n useEffect(() => {\n if (!isEnabled) {\n closeSettingsPanel();\n }\n return () => {\n closeSettingsPanel();\n };\n }, [isEnabled]);\n\n const rootPanel = {pageName: 'router-menu', title: t('explorer.settings')} as const;\n\n const _changePanelPage = ({pageName, title, onClickLeftButton}: IChangePanelPage) => {\n setActiveSettings({\n ...activeSettings!,\n content: <SettingsPanel library={view.libraryId} page={pageName} />,\n title,\n onClickLeftButton,\n });\n };\n\n const _openSettingsPanel = (pageName: SettingsPanelPages = 'router-menu') => {\n const chanelPageParams: IChangePanelPage = {\n pageName,\n title: t(`explorer.${pageName}`),\n };\n if (pageName !== rootPanel.pageName) {\n chanelPageParams.onClickLeftButton = () => {\n _changePanelPage(rootPanel);\n };\n }\n\n _changePanelPage(chanelPageParams);\n };\n\n const viewName = localizedTranslation(view?.viewLabels ?? {}, lang);\n const isMassSelectionAll = view.massSelection === MASS_SELECTION_ALL;\n\n useEffect(() => {\n setButton(\n <KitButton\n type=\"secondary\"\n size=\"m\"\n icon={<FontAwesomeIcon icon={faSlidersH} />}\n onClick={() => _openSettingsPanel()}\n disabled={isMassSelectionAll}\n title={String(t('explorer.settings')) /* TODO: avoid transform null to 'null' */}\n />,\n );\n setViewListButton(\n <KitButton\n type=\"secondary\"\n size=\"m\"\n icon={<FontAwesomeIcon icon={faBars} />}\n onClick={() => _openSettingsPanel('viewList.my-views')}\n disabled={isMassSelectionAll}\n title={String(t('explorer.viewList.manage-views')) /* TODO: avoid transform null to 'null' */}\n >\n {viewName === '' ? t('explorer.viewList.manage-views') : viewName}\n {view.viewModified && (\n <ModifiedStyledKitTag type=\"error\" idCardProps={{description: String(t('explorer.modified'))}} />\n )}\n </KitButton>,\n );\n }, [view.viewModified, viewName, isMassSelectionAll]);\n\n return {\n openSettingsPanel: _openSettingsPanel,\n viewSettingsButton: button,\n viewListButton,\n viewName: viewName === '' ? t('explorer.viewList.default-view') : viewName,\n };\n};\n"]}
@@ -3,8 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  // This file is released under LGPL V3
4
4
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
5
  import { KitTypography } from 'aristid-ds';
6
- import { FaChevronRight } from 'react-icons/fa';
7
6
  import styled from 'styled-components';
7
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
8
+ import { faChevronRight } from '@fortawesome/free-solid-svg-icons';
8
9
  const StyledValue = styled(KitTypography.Text) `
9
10
  color: var(--general-utilities-disabled);
10
11
  `;
@@ -51,5 +52,5 @@ const StyledConfigurationItem = styled.li `
51
52
  }
52
53
  }
53
54
  `;
54
- export const SettingItem = ({ icon, title, value = '', onClick }) => (_jsx(StyledConfigurationItem, { children: _jsxs("button", { onClick: onClick, children: [icon, _jsx(KitTypography.Text, { size: "fontSize5", ellipsis: true, className: "title", children: title }), _jsx(StyledValue, { size: "fontSize5", ellipsis: true, className: "value", children: value }), _jsx(FaChevronRight, {})] }) }));
55
+ export const SettingItem = ({ icon, title, value = '', onClick }) => (_jsx(StyledConfigurationItem, { children: _jsxs("button", { onClick: onClick, children: [icon, _jsx(KitTypography.Text, { size: "fontSize5", ellipsis: true, className: "title", children: title }), _jsx(StyledValue, { size: "fontSize5", ellipsis: true, className: "value", children: value }), _jsx(FontAwesomeIcon, { icon: faChevronRight })] }) }));
55
56
  //# sourceMappingURL=SettingItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingItem.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/router-menu/SettingItem.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;;CAE7C,CAAC;AAEF,MAAM,uBAAuB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;cAwB3B,WAAW;;;;;;;;;;;;;;;;;;CAkBxB,CAAC;AASF,MAAM,CAAC,MAAM,WAAW,GAAyC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,EAAC,EAAE,EAAE,CAAC,CACrG,KAAC,uBAAuB,cACpB,kBAAQ,OAAO,EAAE,OAAO,aACnB,IAAI,EACL,KAAC,aAAa,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,EAAC,QAAQ,QAAC,SAAS,EAAC,OAAO,YAC1D,KAAK,GACW,EACrB,KAAC,WAAW,IAAC,IAAI,EAAC,WAAW,EAAC,QAAQ,QAAC,SAAS,EAAC,OAAO,YACnD,KAAK,GACI,EACd,KAAC,cAAc,KAAG,IACb,GACa,CAC7B,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 {KitTypography} from 'aristid-ds';\nimport {type FunctionComponent, type ReactNode} from 'react';\nimport {FaChevronRight} from 'react-icons/fa';\nimport styled from 'styled-components';\n\nconst StyledValue = styled(KitTypography.Text)`\n color: var(--general-utilities-disabled);\n`;\n\nconst StyledConfigurationItem = styled.li`\n list-style: none;\n\n &:first-child {\n margin-top: calc(var(--general-spacing-xs) * 1px);\n }\n\n > button {\n color: var(--general-utilities-text-primary);\n border: none;\n background: transparent;\n display: flex;\n width: 100%;\n height: 40px;\n align-items: center;\n padding: 0 calc(var(--general-spacing-xs) * 1px);\n gap: calc(var(--general-spacing-xs) * 1px);\n border-radius: calc(var(--general-spacing-xs) * 1px);\n text-align: left;\n cursor: pointer;\n\n &:hover {\n background: var(--general-utilities-main-light);\n\n ${StyledValue} {\n color: var(--general-utilities-text-primary);\n }\n }\n\n .title {\n flex: 1 1 auto;\n }\n\n .value {\n flex: 0 1 auto;\n text-align: right;\n }\n\n > svg {\n flex: 0 0 calc(var(--general-spacing-s) * 1px);\n }\n }\n`;\n\ninterface ISettingItemProps {\n icon: ReactNode;\n title: string;\n onClick: () => void;\n value?: string;\n}\n\nexport const SettingItem: FunctionComponent<ISettingItemProps> = ({icon, title, value = '', onClick}) => (\n <StyledConfigurationItem>\n <button onClick={onClick}>\n {icon}\n <KitTypography.Text size=\"fontSize5\" ellipsis className=\"title\">\n {title}\n </KitTypography.Text>\n <StyledValue size=\"fontSize5\" ellipsis className=\"value\">\n {value}\n </StyledValue>\n <FaChevronRight />\n </button>\n </StyledConfigurationItem>\n);\n"]}
1
+ {"version":3,"file":"SettingItem.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/router-menu/SettingItem.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,cAAc,EAAC,MAAM,mCAAmC,CAAC;AAEjE,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;;CAE7C,CAAC;AAEF,MAAM,uBAAuB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;cAwB3B,WAAW;;;;;;;;;;;;;;;;;;CAkBxB,CAAC;AASF,MAAM,CAAC,MAAM,WAAW,GAAyC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,EAAC,EAAE,EAAE,CAAC,CACrG,KAAC,uBAAuB,cACpB,kBAAQ,OAAO,EAAE,OAAO,aACnB,IAAI,EACL,KAAC,aAAa,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,EAAC,QAAQ,QAAC,SAAS,EAAC,OAAO,YAC1D,KAAK,GACW,EACrB,KAAC,WAAW,IAAC,IAAI,EAAC,WAAW,EAAC,QAAQ,QAAC,SAAS,EAAC,OAAO,YACnD,KAAK,GACI,EACd,KAAC,eAAe,IAAC,IAAI,EAAE,cAAc,GAAI,IACpC,GACa,CAC7B,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 {KitTypography} from 'aristid-ds';\nimport {type FunctionComponent, type ReactNode} from 'react';\nimport styled from 'styled-components';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faChevronRight} from '@fortawesome/free-solid-svg-icons';\n\nconst StyledValue = styled(KitTypography.Text)`\n color: var(--general-utilities-disabled);\n`;\n\nconst StyledConfigurationItem = styled.li`\n list-style: none;\n\n &:first-child {\n margin-top: calc(var(--general-spacing-xs) * 1px);\n }\n\n > button {\n color: var(--general-utilities-text-primary);\n border: none;\n background: transparent;\n display: flex;\n width: 100%;\n height: 40px;\n align-items: center;\n padding: 0 calc(var(--general-spacing-xs) * 1px);\n gap: calc(var(--general-spacing-xs) * 1px);\n border-radius: calc(var(--general-spacing-xs) * 1px);\n text-align: left;\n cursor: pointer;\n\n &:hover {\n background: var(--general-utilities-main-light);\n\n ${StyledValue} {\n color: var(--general-utilities-text-primary);\n }\n }\n\n .title {\n flex: 1 1 auto;\n }\n\n .value {\n flex: 0 1 auto;\n text-align: right;\n }\n\n > svg {\n flex: 0 0 calc(var(--general-spacing-s) * 1px);\n }\n }\n`;\n\ninterface ISettingItemProps {\n icon: ReactNode;\n title: string;\n onClick: () => void;\n value?: string;\n}\n\nexport const SettingItem: FunctionComponent<ISettingItemProps> = ({icon, title, value = '', onClick}) => (\n <StyledConfigurationItem>\n <button onClick={onClick}>\n {icon}\n <KitTypography.Text size=\"fontSize5\" ellipsis className=\"title\">\n {title}\n </KitTypography.Text>\n <StyledValue size=\"fontSize5\" ellipsis className=\"value\">\n {value}\n </StyledValue>\n <FontAwesomeIcon icon={faChevronRight} />\n </button>\n </StyledConfigurationItem>\n);\n"]}
@@ -4,7 +4,6 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
4
4
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
5
  import styled from 'styled-components';
6
6
  import { KitInput, KitTypography } from 'aristid-ds';
7
- import { FaFilter, FaList, FaSortAlphaDown } from 'react-icons/fa';
8
7
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
9
8
  import { ConfigureDisplay } from '../configure-display/ConfigureDisplay';
10
9
  import { SortItems } from '../sort-items/SortItems';
@@ -15,6 +14,8 @@ import { useOpenViewSettings } from '../open-view-settings/useOpenViewSettings';
15
14
  import { SavedViews } from '../../list-saved-views/SavedViews';
16
15
  import { ViewActionsButtons } from '../save-view/ViewActionsButtons';
17
16
  import { useFiltersContext } from '../../../../components/Filters';
17
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
18
+ import { faFilter, faList, faSortAlphaDown } from '@fortawesome/free-solid-svg-icons';
18
19
  const ContentWrapperStyledDiv = styled.div `
19
20
  display: flex;
20
21
  flex-direction: column;
@@ -33,6 +34,6 @@ export const SettingsPanel = ({ library, page = 'router-menu' }) => {
33
34
  const { filtersData } = useFiltersContext();
34
35
  const { openSettingsPanel, viewName } = useOpenViewSettings({ view, isEnabled: true });
35
36
  // TODO: look for MemoryRouter
36
- return (_jsxs(ContentWrapperStyledDiv, { children: [page === 'router-menu' && (_jsxs(_Fragment, { children: [_jsxs("nav", { children: [_jsx(ViewNameStyledKitInput, { disabled: true, value: viewName }), _jsx(KitTypography.Title, { level: "h4", children: t('explorer.router-menu') }), _jsxs(ConfigurationStyledMenu, { children: [_jsx(SettingItem, { icon: _jsx(FaList, {}), title: t('explorer.configure-display'), onClick: () => openSettingsPanel('configure-display') }), view.entrypoint.type === 'library' && (_jsxs(_Fragment, { children: [_jsx(SettingItem, { icon: _jsx(FaFilter, {}), title: t('explorer.filters'), value: String(t('explorer.active-items-number', { count: filtersData.filters.length })), onClick: () => openSettingsPanel('filter-items') }), _jsx(SettingItem, { icon: _jsx(FaSortAlphaDown, {}), title: t('explorer.sort-items'), onClick: () => openSettingsPanel('sort-items') })] }))] })] }), _jsx(ViewActionsButtons, {})] })), page === 'configure-display' && _jsx(ConfigureDisplay, { libraryId: library }), page === 'sort-items' && _jsx(SortItems, { libraryId: library }), page === 'filter-items' && _jsx(FilterItems, { libraryId: library }), page === 'viewList.my-views' && _jsx(SavedViews, {})] }));
37
+ return (_jsxs(ContentWrapperStyledDiv, { children: [page === 'router-menu' && (_jsxs(_Fragment, { children: [_jsxs("nav", { children: [_jsx(ViewNameStyledKitInput, { disabled: true, value: viewName }), _jsx(KitTypography.Title, { level: "h4", children: t('explorer.router-menu') }), _jsxs(ConfigurationStyledMenu, { children: [_jsx(SettingItem, { icon: _jsx(FontAwesomeIcon, { icon: faList }), title: t('explorer.configure-display'), onClick: () => openSettingsPanel('configure-display') }), view.entrypoint.type === 'library' && (_jsxs(_Fragment, { children: [_jsx(SettingItem, { icon: _jsx(FontAwesomeIcon, { icon: faFilter }), title: t('explorer.filters'), value: String(t('explorer.active-items-number', { count: filtersData.filters.length })), onClick: () => openSettingsPanel('filter-items') }), _jsx(SettingItem, { icon: _jsx(FontAwesomeIcon, { icon: faSortAlphaDown }), title: t('explorer.sort-items'), onClick: () => openSettingsPanel('sort-items') })] }))] })] }), _jsx(ViewActionsButtons, {})] })), page === 'configure-display' && _jsx(ConfigureDisplay, { libraryId: library }), page === 'sort-items' && _jsx(SortItems, { libraryId: library }), page === 'filter-items' && _jsx(FilterItems, { libraryId: library }), page === 'viewList.my-views' && _jsx(SavedViews, {})] }));
37
38
  };
38
39
  //# sourceMappingURL=SettingsPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPanel.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/router-menu/SettingsPanel.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,gBAAgB,EAAC,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;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ACpB,KAAC,WAAW,IACR,IAAI,EAAE,KAAC,MAAM,KAAG,EAChB,KAAK,EAAE,CAAC,CAAC,4BAA4B,CAAC,EACtC,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,GACvD,EACD,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,IAAI,CACnC,8BACI,KAAC,WAAW,IACR,IAAI,EAAE,KAAC,QAAQ,KAAG,EAClB,KAAK,EAAE,CAAC,CAAC,kBAAkB,CAAC,EAC5B,KAAK,EAAE,MAAM,CACT,CAAC,CAAC,8BAA8B,EAAE,EAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,EAAC,CAAC,CACzE,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAClD,EACF,KAAC,WAAW,IACR,IAAI,EAAE,KAAC,eAAe,KAAG,EACzB,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAC/B,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAChD,IACH,CACN,IACqB,IACxB,EACN,KAAC,kBAAkB,KAAG,IACvB,CACN,EACA,IAAI,KAAK,mBAAmB,IAAI,KAAC,gBAAgB,IAAC,SAAS,EAAE,OAAO,GAAI,EACxE,IAAI,KAAK,YAAY,IAAI,KAAC,SAAS,IAAC,SAAS,EAAE,OAAO,GAAI,EAC1D,IAAI,KAAK,cAAc,IAAI,KAAC,WAAW,IAAC,SAAS,EAAE,OAAO,GAAI,EAC9D,IAAI,KAAK,mBAAmB,IAAI,KAAC,UAAU,KAAG,IACzB,CAC7B,CAAC;AACN,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 styled from 'styled-components';\nimport {type FunctionComponent} from 'react';\nimport {KitInput, KitTypography} from 'aristid-ds';\nimport {FaFilter, FaList, FaSortAlphaDown} from 'react-icons/fa';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {ConfigureDisplay} from '../configure-display/ConfigureDisplay';\nimport {SortItems} from '../sort-items/SortItems';\nimport {SettingItem} from './SettingItem';\nimport {FilterItems} from '../filter-items/FilterItems';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {type SettingsPanelPages} from '../open-view-settings/EditSettingsContext';\nimport {useOpenViewSettings} from '../open-view-settings/useOpenViewSettings';\nimport {SavedViews} from '../../list-saved-views/SavedViews';\nimport {ViewActionsButtons} from '../save-view/ViewActionsButtons';\nimport {useFiltersContext} from '_ui/components/Filters';\n\nconst ContentWrapperStyledDiv = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n height: 100%;\n`;\n\nconst ViewNameStyledKitInput = styled(KitInput)`\n margin-bottom: calc(var(--general-spacing-s) * 1px);\n`;\n\nconst ConfigurationStyledMenu = styled.menu`\n padding: 0;\n`;\n\ninterface ISettingsPanelProps {\n library: string;\n page?: SettingsPanelPages;\n}\n\nexport const SettingsPanel: FunctionComponent<ISettingsPanelProps> = ({library, page = 'router-menu'}) => {\n const {t} = useSharedTranslation();\n\n const {view} = useViewSettingsContext();\n const {filtersData} = useFiltersContext();\n const {openSettingsPanel, viewName} = useOpenViewSettings({view, isEnabled: true});\n\n // TODO: look for MemoryRouter\n return (\n <ContentWrapperStyledDiv>\n {page === 'router-menu' && (\n <>\n <nav>\n <ViewNameStyledKitInput disabled value={viewName} />\n <KitTypography.Title level=\"h4\">{t('explorer.router-menu')}</KitTypography.Title>\n <ConfigurationStyledMenu>\n <SettingItem\n icon={<FaList />}\n title={t('explorer.configure-display')}\n onClick={() => openSettingsPanel('configure-display')}\n />\n {view.entrypoint.type === 'library' && (\n <>\n <SettingItem\n icon={<FaFilter />}\n title={t('explorer.filters')}\n value={String(\n t('explorer.active-items-number', {count: filtersData.filters.length}),\n )}\n onClick={() => openSettingsPanel('filter-items')}\n />\n <SettingItem\n icon={<FaSortAlphaDown />}\n title={t('explorer.sort-items')}\n onClick={() => openSettingsPanel('sort-items')}\n />\n </>\n )}\n </ConfigurationStyledMenu>\n </nav>\n <ViewActionsButtons />\n </>\n )}\n {page === 'configure-display' && <ConfigureDisplay libraryId={library} />}\n {page === 'sort-items' && <SortItems libraryId={library} />}\n {page === 'filter-items' && <FilterItems libraryId={library} />}\n {page === 'viewList.my-views' && <SavedViews />}\n </ContentWrapperStyledDiv>\n );\n};\n"]}
1
+ {"version":3,"file":"SettingsPanel.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/router-menu/SettingsPanel.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,gBAAgB,EAAC,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AAErF,OAAO,EAAC,mBAAmB,EAAC,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAC,UAAU,EAAC,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAEp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AC,EAC5B,KAAK,EAAE,MAAM,CACT,CAAC,CAAC,8BAA8B,EAAE,EAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,EAAC,CAAC,CACzE,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAClD,EACF,KAAC,WAAW,IACR,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,eAAe,GAAI,EAChD,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAC/B,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAChD,IACH,CACN,IACqB,IACxB,EACN,KAAC,kBAAkB,KAAG,IACvB,CACN,EACA,IAAI,KAAK,mBAAmB,IAAI,KAAC,gBAAgB,IAAC,SAAS,EAAE,OAAO,GAAI,EACxE,IAAI,KAAK,YAAY,IAAI,KAAC,SAAS,IAAC,SAAS,EAAE,OAAO,GAAI,EAC1D,IAAI,KAAK,cAAc,IAAI,KAAC,WAAW,IAAC,SAAS,EAAE,OAAO,GAAI,EAC9D,IAAI,KAAK,mBAAmB,IAAI,KAAC,UAAU,KAAG,IACzB,CAC7B,CAAC;AACN,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 styled from 'styled-components';\nimport {type FunctionComponent} from 'react';\nimport {KitInput, KitTypography} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {ConfigureDisplay} from '../configure-display/ConfigureDisplay';\nimport {SortItems} from '../sort-items/SortItems';\nimport {SettingItem} from './SettingItem';\nimport {FilterItems} from '../filter-items/FilterItems';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {type SettingsPanelPages} from '../open-view-settings/EditSettingsContext';\nimport {useOpenViewSettings} from '../open-view-settings/useOpenViewSettings';\nimport {SavedViews} from '../../list-saved-views/SavedViews';\nimport {ViewActionsButtons} from '../save-view/ViewActionsButtons';\nimport {useFiltersContext} from '_ui/components/Filters';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faFilter, faList, faSortAlphaDown} from '@fortawesome/free-solid-svg-icons';\n\nconst ContentWrapperStyledDiv = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n height: 100%;\n`;\n\nconst ViewNameStyledKitInput = styled(KitInput)`\n margin-bottom: calc(var(--general-spacing-s) * 1px);\n`;\n\nconst ConfigurationStyledMenu = styled.menu`\n padding: 0;\n`;\n\ninterface ISettingsPanelProps {\n library: string;\n page?: SettingsPanelPages;\n}\n\nexport const SettingsPanel: FunctionComponent<ISettingsPanelProps> = ({library, page = 'router-menu'}) => {\n const {t} = useSharedTranslation();\n\n const {view} = useViewSettingsContext();\n const {filtersData} = useFiltersContext();\n const {openSettingsPanel, viewName} = useOpenViewSettings({view, isEnabled: true});\n\n // TODO: look for MemoryRouter\n return (\n <ContentWrapperStyledDiv>\n {page === 'router-menu' && (\n <>\n <nav>\n <ViewNameStyledKitInput disabled value={viewName} />\n <KitTypography.Title level=\"h4\">{t('explorer.router-menu')}</KitTypography.Title>\n <ConfigurationStyledMenu>\n <SettingItem\n icon={<FontAwesomeIcon icon={faList} />}\n title={t('explorer.configure-display')}\n onClick={() => openSettingsPanel('configure-display')}\n />\n {view.entrypoint.type === 'library' && (\n <>\n <SettingItem\n icon={<FontAwesomeIcon icon={faFilter} />}\n title={t('explorer.filters')}\n value={String(\n t('explorer.active-items-number', {count: filtersData.filters.length}),\n )}\n onClick={() => openSettingsPanel('filter-items')}\n />\n <SettingItem\n icon={<FontAwesomeIcon icon={faSortAlphaDown} />}\n title={t('explorer.sort-items')}\n onClick={() => openSettingsPanel('sort-items')}\n />\n </>\n )}\n </ConfigurationStyledMenu>\n </nav>\n <ViewActionsButtons />\n </>\n )}\n {page === 'configure-display' && <ConfigureDisplay libraryId={library} />}\n {page === 'sort-items' && <SortItems libraryId={library} />}\n {page === 'filter-items' && <FilterItems libraryId={library} />}\n {page === 'viewList.my-views' && <SavedViews />}\n </ContentWrapperStyledDiv>\n );\n};\n"]}
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FaTimes, FaSave } from 'react-icons/fa';
3
2
  import { KitModal, KitButton, AntForm, KitInputWrapper, KitInput } from 'aristid-ds';
4
3
  import { useLang } from '../../../../hooks';
5
4
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
6
5
  import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
6
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
7
+ import { faTimes, faSave } from '@fortawesome/free-solid-svg-icons';
7
8
  const sortWithDefaultAtFirst = defaultLang => (a, b) => (b === defaultLang ? 1 : 0) - (a === defaultLang ? 1 : 0);
8
9
  export const LabelViewFormModal = ({ viewData, isOpen, onSubmit, onClose }) => {
9
10
  const { t } = useSharedTranslation();
@@ -26,7 +27,7 @@ export const LabelViewFormModal = ({ viewData, isOpen, onSubmit, onClose }) => {
26
27
  // TODO: remove appElement and put in the test : "KitModal.setAppElement(document.body) once exposed"
27
28
  , {
28
29
  // TODO: remove appElement and put in the test : "KitModal.setAppElement(document.body) once exposed"
29
- appElement: document.getElementById('root'), title: t('explorer.viewList.save-view-as'), showCloseIcon: false, close: _toggleModal, isOpen: isOpen, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: _toggleModal, icon: _jsx(FaTimes, {}), children: t('global.close') }), _jsx(KitButton, { type: "primary", onClick: _handleSaveView, icon: _jsx(FaSave, {}), children: t('global.save') })] }), children: _jsx(AntForm, { name: "label", form: form, initialValues: initialValues, onFinish: _onSubmit, children: _jsx(KitInputWrapper, { label: String(t('explorer.viewList.view-name')), children: [...availableLangs].sort(sortWithDefaultAtFirst(defaultLang)).map(lang => (_jsx(AntForm.Item, { name: lang, validateTrigger: "onBlur", rules: [
30
+ appElement: document.getElementById('root'), title: t('explorer.viewList.save-view-as'), showCloseIcon: false, close: _toggleModal, isOpen: isOpen, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: _toggleModal, icon: _jsx(FontAwesomeIcon, { icon: faTimes }), children: t('global.close') }), _jsx(KitButton, { type: "primary", onClick: _handleSaveView, icon: _jsx(FontAwesomeIcon, { icon: faSave }), children: t('global.save') })] }), children: _jsx(AntForm, { name: "label", form: form, initialValues: initialValues, onFinish: _onSubmit, children: _jsx(KitInputWrapper, { label: String(t('explorer.viewList.view-name')), children: [...availableLangs].sort(sortWithDefaultAtFirst(defaultLang)).map(lang => (_jsx(AntForm.Item, { name: lang, validateTrigger: "onBlur", rules: [
30
31
  {
31
32
  required: lang === defaultLang,
32
33
  message: String(t('errors.standard_field_required')),
@@ -1 +1 @@
1
- {"version":3,"file":"LabelViewFormModal.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACnF,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AASrF,MAAM,sBAAsB,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC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AAC,OAAO,KAAG,YAC/D,CAAC,CAAC,cAAc,CAAC,GACV,EACZ,KAAC,SAAS,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,KAAC,MAAM,KAAG,YAC/D,CAAC,CAAC,aAAa,CAAC,GACT,IACb,YAGP,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,YAC/E,KAAC,eAAe,IAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,YAC3D,CAAC,GAAG,cAAc,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACvE,KAAC,OAAO,CAAC,IAAI,IAET,IAAI,EAAE,IAAI,EACV,eAAe,EAAC,QAAQ,EACxB,KAAK,EAAE;wBACH;4BACI,QAAQ,EAAE,IAAI,KAAK,WAAW;4BAC9B,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC;yBACvD;qBACJ,YAED,KAAC,QAAQ,IACL,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,IAAI,KAAK,WAAW,EAC9B,WAAW,EAAE,0BAA0B,GACzC,IAdG,IAAI,CAeE,CAClB,CAAC,GACY,GACZ,GACH,CACd,CAAC;AACN,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 FunctionComponent} from 'react';\nimport {FaTimes, FaSave} from 'react-icons/fa';\nimport {KitModal, KitButton, AntForm, KitInputWrapper, KitInput} from 'aristid-ds';\nimport {useLang} from '_ui/hooks';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\n\ninterface ISaveViewProps {\n viewData?: Record<string, string> | null;\n isOpen: boolean;\n onSubmit: (label: Record<string, string>, id?: string | undefined) => void;\n onClose: () => void;\n}\n\nconst sortWithDefaultAtFirst = defaultLang => (a, b) => (b === defaultLang ? 1 : 0) - (a === defaultLang ? 1 : 0);\n\nexport const LabelViewFormModal: FunctionComponent<ISaveViewProps> = ({viewData, isOpen, onSubmit, onClose}) => {\n const {t} = useSharedTranslation();\n const {defaultLang, availableLangs} = useLang();\n const {view} = useViewSettingsContext();\n\n const [form] = AntForm.useForm();\n const initialValues = viewData ? viewData : view.viewId ? view.viewLabels : {};\n\n const _toggleModal = () => {\n onClose();\n };\n\n const _handleSaveView = () => {\n form.submit();\n };\n\n const _onSubmit = values => {\n onSubmit(values);\n onClose();\n };\n\n const _preventCloseSettingsPanel = e => e.stopPropagation();\n\n return (\n <KitModal\n // TODO: remove appElement and put in the test : \"KitModal.setAppElement(document.body) once exposed\"\n appElement={document.getElementById('root')}\n title={t('explorer.viewList.save-view-as')}\n showCloseIcon={false}\n close={_toggleModal}\n isOpen={isOpen}\n footer={\n <>\n <KitButton type=\"secondary\" onClick={_toggleModal} icon={<FaTimes />}>\n {t('global.close')}\n </KitButton>\n <KitButton type=\"primary\" onClick={_handleSaveView} icon={<FaSave />}>\n {t('global.save')}\n </KitButton>\n </>\n }\n >\n <AntForm name=\"label\" form={form} initialValues={initialValues} onFinish={_onSubmit}>\n <KitInputWrapper label={String(t('explorer.viewList.view-name'))}>\n {[...availableLangs].sort(sortWithDefaultAtFirst(defaultLang)).map(lang => (\n <AntForm.Item\n key={lang}\n name={lang}\n validateTrigger=\"onBlur\"\n rules={[\n {\n required: lang === defaultLang,\n message: String(t('errors.standard_field_required')),\n },\n ]}\n >\n <KitInput\n label={lang}\n required={lang === defaultLang}\n onMouseDown={_preventCloseSettingsPanel}\n />\n </AntForm.Item>\n ))}\n </KitInputWrapper>\n </AntForm>\n </KitModal>\n );\n};\n"]}
1
+ {"version":3,"file":"LabelViewFormModal.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACnF,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,mCAAmC,CAAC;AASlE,MAAM,sBAAsB,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAElH,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAC,EAAE,EAAE;IAC3G,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,WAAW,EAAE,cAAc,EAAC,GAAG,OAAO,EAAE,CAAC;IAChD,MAAM,EAAC,IAAI,EAAC,GAAG,sBAAsB,EAAE,CAAC;IAExC,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CA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AW,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACvE,KAAC,OAAO,CAAC,IAAI,IAET,IAAI,EAAE,IAAI,EACV,eAAe,EAAC,QAAQ,EACxB,KAAK,EAAE;wBACH;4BACI,QAAQ,EAAE,IAAI,KAAK,WAAW;4BAC9B,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC;yBACvD;qBACJ,YAED,KAAC,QAAQ,IACL,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,IAAI,KAAK,WAAW,EAC9B,WAAW,EAAE,0BAA0B,GACzC,IAdG,IAAI,CAeE,CAClB,CAAC,GACY,GACZ,GACH,CACd,CAAC;AACN,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 FunctionComponent} from 'react';\nimport {KitModal, KitButton, AntForm, KitInputWrapper, KitInput} from 'aristid-ds';\nimport {useLang} from '_ui/hooks';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faTimes, faSave} from '@fortawesome/free-solid-svg-icons';\n\ninterface ISaveViewProps {\n viewData?: Record<string, string> | null;\n isOpen: boolean;\n onSubmit: (label: Record<string, string>, id?: string | undefined) => void;\n onClose: () => void;\n}\n\nconst sortWithDefaultAtFirst = defaultLang => (a, b) => (b === defaultLang ? 1 : 0) - (a === defaultLang ? 1 : 0);\n\nexport const LabelViewFormModal: FunctionComponent<ISaveViewProps> = ({viewData, isOpen, onSubmit, onClose}) => {\n const {t} = useSharedTranslation();\n const {defaultLang, availableLangs} = useLang();\n const {view} = useViewSettingsContext();\n\n const [form] = AntForm.useForm();\n const initialValues = viewData ? viewData : view.viewId ? view.viewLabels : {};\n\n const _toggleModal = () => {\n onClose();\n };\n\n const _handleSaveView = () => {\n form.submit();\n };\n\n const _onSubmit = values => {\n onSubmit(values);\n onClose();\n };\n\n const _preventCloseSettingsPanel = e => e.stopPropagation();\n\n return (\n <KitModal\n // TODO: remove appElement and put in the test : \"KitModal.setAppElement(document.body) once exposed\"\n appElement={document.getElementById('root')}\n title={t('explorer.viewList.save-view-as')}\n showCloseIcon={false}\n close={_toggleModal}\n isOpen={isOpen}\n footer={\n <>\n <KitButton type=\"secondary\" onClick={_toggleModal} icon={<FontAwesomeIcon icon={faTimes} />}>\n {t('global.close')}\n </KitButton>\n <KitButton type=\"primary\" onClick={_handleSaveView} icon={<FontAwesomeIcon icon={faSave} />}>\n {t('global.save')}\n </KitButton>\n </>\n }\n >\n <AntForm name=\"label\" form={form} initialValues={initialValues} onFinish={_onSubmit}>\n <KitInputWrapper label={String(t('explorer.viewList.view-name'))}>\n {[...availableLangs].sort(sortWithDefaultAtFirst(defaultLang)).map(lang => (\n <AntForm.Item\n key={lang}\n name={lang}\n validateTrigger=\"onBlur\"\n rules={[\n {\n required: lang === defaultLang,\n message: String(t('errors.standard_field_required')),\n },\n ]}\n >\n <KitInput\n label={lang}\n required={lang === defaultLang}\n onMouseDown={_preventCloseSettingsPanel}\n />\n </AntForm.Item>\n ))}\n </KitInputWrapper>\n </AntForm>\n </KitModal>\n );\n};\n"]}
@@ -5,7 +5,6 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
5
5
  import { useState } from 'react';
6
6
  import { LabelViewFormModal } from './LabelViewFormModal';
7
7
  import { KitButton } from 'aristid-ds';
8
- import { FaSdCard } from 'react-icons/fa';
9
8
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
10
9
  import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
11
10
  import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
@@ -15,6 +14,8 @@ import { mapViewTypeFromExplorerToLegacy } from '../../_constants';
15
14
  import { useTransformFilters } from '../../../../components/Filters/useTransformFilters';
16
15
  import { useFiltersContext } from '../../../../components/Filters/useFiltersContext';
17
16
  import { FiltersActionTypes } from '../../../../components/Filters/context/filtersReducer';
17
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
18
+ import { faSdCard } from '@fortawesome/free-solid-svg-icons';
18
19
  export const useCreateNewView = () => {
19
20
  const { t } = useSharedTranslation();
20
21
  const { toValidFilters } = useTransformFilters();
@@ -58,7 +59,7 @@ export const useCreateNewView = () => {
58
59
  }
59
60
  };
60
61
  return {
61
- createNewViewButton: (_jsxs(_Fragment, { children: [_jsx(LabelViewFormModal, { isOpen: isModalOpen, onSubmit: _createView, onClose: _toggleModal }), _jsx(KitButton, { type: "action", icon: _jsx(FaSdCard, {}), onClick: _toggleModal, children: t('explorer.viewList.save-view-as') })] })),
62
+ createNewViewButton: (_jsxs(_Fragment, { children: [_jsx(LabelViewFormModal, { isOpen: isModalOpen, onSubmit: _createView, onClose: _toggleModal }), _jsx(KitButton, { type: "action", icon: _jsx(FontAwesomeIcon, { icon: faSdCard }), onClick: _toggleModal, children: t('explorer.viewList.save-view-as') })] })),
62
63
  };
63
64
  };
64
65
  //# sourceMappingURL=useCreateNewView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateNewView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useCreateNewView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAA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AAC;AACN,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 {useState} from 'react';\nimport {LabelViewFormModal} from './LabelViewFormModal';\nimport {KitButton} from 'aristid-ds';\nimport {FaSdCard} from 'react-icons/fa';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport useExecuteSaveViewMutation from '_ui/hooks/useExecuteSaveViewMutation';\nimport {prepareViewForRequest} from './prepareViewForRequest';\nimport {mapViewTypeFromExplorerToLegacy} from '../../_constants';\nimport {type IViewDisplay} from '_ui/types';\nimport {useTransformFilters} from '_ui/components/Filters/useTransformFilters';\nimport {useFiltersContext} from '_ui/components/Filters/useFiltersContext';\nimport {FiltersActionTypes} from '_ui/components/Filters/context/filtersReducer';\nimport {type UIFilter} from '_ui/components/Filters/_types';\n\nexport const useCreateNewView = () => {\n const {t} = useSharedTranslation();\n const {toValidFilters} = useTransformFilters();\n const {view, dispatch} = useViewSettingsContext();\n const {filtersData, dispatch: filtersDispatch} = useFiltersContext();\n const {saveView} = useExecuteSaveViewMutation();\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const _toggleModal = () => {\n setIsModalOpen(!isModalOpen);\n };\n\n const _createView = async (label: Record<string, string>) => {\n const mappedView = prepareViewForRequest(view, filtersData.filters, label);\n\n const {data} = await saveView({\n view: mappedView,\n });\n\n if (data) {\n const validFilters = toValidFilters(data.saveView.filters);\n dispatch({\n type: ViewSettingsActionTypes.UPDATE_VIEWS,\n payload: {\n id: data.saveView.id,\n ownerId: data.saveView.created_by.id,\n label: data.saveView.label,\n shared: data.saveView.shared,\n filters: validFilters,\n sort: data.saveView.sort ?? [],\n display: (data.saveView.display as IViewDisplay) ?? {\n type: mapViewTypeFromExplorerToLegacy[view.viewType],\n },\n attributes: data.saveView?.attributes?.map(({id}) => id) ?? [],\n },\n });\n filtersDispatch({\n type: FiltersActionTypes.UPDATE_VIEWS,\n payload: {\n ...filtersData,\n viewId: data.saveView.id,\n filters: validFilters as UIFilter[],\n },\n });\n }\n };\n\n return {\n createNewViewButton: (\n <>\n <LabelViewFormModal isOpen={isModalOpen} onSubmit={_createView} onClose={_toggleModal} />\n <KitButton type=\"action\" icon={<FaSdCard />} onClick={_toggleModal}>\n {t('explorer.viewList.save-view-as')}\n </KitButton>\n </>\n ),\n };\n};\n"]}
1
+ {"version":3,"file":"useCreateNewView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useCreateNewView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,0BAA0B,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,+BAA+B,EAAC,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAC,mBAAmB,EAAC,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAC,kBAAkB,EAAC,MAAM,+CAA+C,CAAC;AAEjF,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,mCAAm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AAY;oBACrB,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE;oBAC9B,OAAO,EAAG,IAAI,CAAC,QAAQ,CAAC,OAAwB,IAAI;wBAChD,IAAI,EAAE,+BAA+B,CAAC,IAAI,CAAC,QAAQ,CAAC;qBACvD;oBACD,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE;iBACjE;aACJ,CAAC,CAAC;YACH,eAAe,CAAC;gBACZ,IAAI,EAAE,kBAAkB,CAAC,YAAY;gBACrC,OAAO,EAAE;oBACL,GAAG,WAAW;oBACd,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;oBACxB,OAAO,EAAE,YAA0B;iBACtC;aACJ,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACH,mBAAmB,EAAE,CACjB,8BACI,KAAC,kBAAkB,IAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,GAAI,EACzF,KAAC,SAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,QAAQ,GAAI,EAAE,OAAO,EAAE,YAAY,YACpF,CAAC,CAAC,gCAAgC,CAAC,GAC5B,IACb,CACN;KACJ,CAAC;AACN,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 {useState} from 'react';\nimport {LabelViewFormModal} from './LabelViewFormModal';\nimport {KitButton} from 'aristid-ds';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport useExecuteSaveViewMutation from '_ui/hooks/useExecuteSaveViewMutation';\nimport {prepareViewForRequest} from './prepareViewForRequest';\nimport {mapViewTypeFromExplorerToLegacy} from '../../_constants';\nimport {type IViewDisplay} from '_ui/types';\nimport {useTransformFilters} from '_ui/components/Filters/useTransformFilters';\nimport {useFiltersContext} from '_ui/components/Filters/useFiltersContext';\nimport {FiltersActionTypes} from '_ui/components/Filters/context/filtersReducer';\nimport {type UIFilter} from '_ui/components/Filters/_types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faSdCard} from '@fortawesome/free-solid-svg-icons';\n\nexport const useCreateNewView = () => {\n const {t} = useSharedTranslation();\n const {toValidFilters} = useTransformFilters();\n const {view, dispatch} = useViewSettingsContext();\n const {filtersData, dispatch: filtersDispatch} = useFiltersContext();\n const {saveView} = useExecuteSaveViewMutation();\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const _toggleModal = () => {\n setIsModalOpen(!isModalOpen);\n };\n\n const _createView = async (label: Record<string, string>) => {\n const mappedView = prepareViewForRequest(view, filtersData.filters, label);\n\n const {data} = await saveView({\n view: mappedView,\n });\n\n if (data) {\n const validFilters = toValidFilters(data.saveView.filters);\n dispatch({\n type: ViewSettingsActionTypes.UPDATE_VIEWS,\n payload: {\n id: data.saveView.id,\n ownerId: data.saveView.created_by.id,\n label: data.saveView.label,\n shared: data.saveView.shared,\n filters: validFilters,\n sort: data.saveView.sort ?? [],\n display: (data.saveView.display as IViewDisplay) ?? {\n type: mapViewTypeFromExplorerToLegacy[view.viewType],\n },\n attributes: data.saveView?.attributes?.map(({id}) => id) ?? [],\n },\n });\n filtersDispatch({\n type: FiltersActionTypes.UPDATE_VIEWS,\n payload: {\n ...filtersData,\n viewId: data.saveView.id,\n filters: validFilters as UIFilter[],\n },\n });\n }\n };\n\n return {\n createNewViewButton: (\n <>\n <LabelViewFormModal isOpen={isModalOpen} onSubmit={_createView} onClose={_toggleModal} />\n <KitButton type=\"action\" icon={<FontAwesomeIcon icon={faSdCard} />} onClick={_toggleModal}>\n {t('explorer.viewList.save-view-as')}\n </KitButton>\n </>\n ),\n };\n};\n"]}
@@ -4,7 +4,6 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
4
4
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
5
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
6
6
  import { KitButton, KitModal, KitTypography } from 'aristid-ds';
7
- import { FaTimes, FaTrash } from 'react-icons/fa';
8
7
  import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
9
8
  import { useState } from 'react';
10
9
  import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
@@ -12,6 +11,8 @@ import useExecuteDeleteViewMutation from '../../../../hooks/useExecuteDeleteView
12
11
  import { localizedTranslation } from '@leav/utils';
13
12
  import { useLang } from '../../../../hooks';
14
13
  import styled from 'styled-components';
14
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
15
+ import { faTimes, faTrash } from '@fortawesome/free-solid-svg-icons';
15
16
  const StyledButton = styled.button `
16
17
  all: unset;
17
18
  `;
@@ -38,10 +39,10 @@ export const useDeleteView = () => {
38
39
  };
39
40
  const iconDelete = (viewItem) => (_jsx(StyledButton, { className: "delete", title: t('explorer.viewList.delete-view'), onClick: () => {
40
41
  setDataViewOnAction({ id: viewItem.id, label: viewItem.label });
41
- }, children: _jsx(FaTrash, {}) }));
42
+ }, children: _jsx(FontAwesomeIcon, { icon: faTrash }) }));
42
43
  return {
43
44
  iconDelete,
44
- deleteModal: dataViewOnAction.id && dataViewOnAction.label && (_jsx(KitModal, { appElement: document.getElementById('root'), title: t('explorer.viewList.confirm-delete-view'), isOpen: !!dataViewOnAction.id && !!dataViewOnAction.label, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: () => setDataViewOnAction({ id: null, label: null }), icon: _jsx(FaTimes, {}), children: t('global.close') }), _jsx(KitButton, { type: "primary", danger: true, onClick: _onDeleteConfirm, icon: _jsx(FaTrash, {}), children: t('global.delete') })] }), children: _jsx(KitTypography.Text, { size: "fontSize3", weight: "medium", children: localizedTranslation(dataViewOnAction.label, availableLangs) }) })),
45
+ deleteModal: dataViewOnAction.id && dataViewOnAction.label && (_jsx(KitModal, { appElement: document.getElementById('root'), title: t('explorer.viewList.confirm-delete-view'), isOpen: !!dataViewOnAction.id && !!dataViewOnAction.label, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { type: "secondary", onClick: () => setDataViewOnAction({ id: null, label: null }), icon: _jsx(FontAwesomeIcon, { icon: faTimes }), children: t('global.close') }), _jsx(KitButton, { type: "primary", danger: true, onClick: _onDeleteConfirm, icon: _jsx(FontAwesomeIcon, { icon: faTrash }), children: t('global.delete') })] }), children: _jsx(KitTypography.Text, { size: "fontSize3", weight: "medium", children: localizedTranslation(dataViewOnAction.label, availableLangs) }) })),
45
46
  };
46
47
  };
47
48
  //# sourceMappingURL=useDeleteView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDeleteView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useDeleteView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAsB,QAAQ,EAAC,MAAM,OAAO,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,4BAA4B,MAAM,qEAAqE,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EA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,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAC,CAAC,CAAC;QAClE,CAAC,YAED,KAAC,OAAO,KAAG,GACA,CAClB,CAAC;IAEF,OAAO;QACH,UAAU;QACV,WAAW,EAAE,gBAAgB,CAAC,EAAE,IAAI,gBAAgB,CAAC,KAAK,IAAI,CAC1D,KAAC,QAAQ,IACL,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,EAC3C,KAAK,EAAE,CAAC,CAAC,uCAAuC,CAAC,EACjD,MAAM,EAAE,CAAC,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC,gBAAgB,CAAC,KAAK,EACzD,MAAM,EACF,8BACI,KAAC,SAAS,IACN,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,EAC3D,IAAI,EAAE,KAAC,OAAO,KAAG,YAEhB,CAAC,CAAC,cAAc,CAAC,GACV,EACZ,KAAC,SAAS,IAAC,IAAI,EAAC,SAAS,EAAC,MAAM,QAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAC,OAAO,KAAG,YACxE,CAAC,CAAC,eAAe,CAAC,GACX,IACb,YAGP,KAAC,aAAa,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,YAC/C,oBAAoB,CAAC,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,GAC5C,GACd,CACd;KACJ,CAAC;AACN,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 {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {KitButton, KitModal, KitTypography} from 'aristid-ds';\nimport {FaTimes, FaTrash} from 'react-icons/fa';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {type ComponentProps, useState} from 'react';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport useExecuteDeleteViewMutation from '_ui/hooks/useExecuteDeleteViewMutation/useExecuteDeleteViewMutation';\nimport {localizedTranslation} from '@leav/utils';\nimport {useLang} from '_ui/hooks';\nimport {type IUserView, type IDataViewOnAction} from '../../_types';\nimport styled from 'styled-components';\nimport {type Button} from 'antd';\n\nconst StyledButton = styled.button`\n all: unset;\n`;\n\nexport const useDeleteView = () => {\n const {t} = useSharedTranslation();\n const {availableLangs} = useLang();\n const {deleteView} = useExecuteDeleteViewMutation();\n const {dispatch} = useViewSettingsContext();\n const [dataViewOnAction, setDataViewOnAction] = useState<IDataViewOnAction>({id: null, label: null});\n\n const _onDeleteConfirm: ComponentProps<typeof Button>['onClick'] = async () => {\n if (!dataViewOnAction.id) {\n return;\n }\n const {data} = await deleteView(dataViewOnAction.id);\n\n if (data) {\n dispatch({\n type: ViewSettingsActionTypes.DELETE_VIEW,\n payload: {\n id: dataViewOnAction.id,\n },\n });\n }\n setDataViewOnAction({id: null, label: null});\n };\n\n const iconDelete = (viewItem: IUserView) => (\n <StyledButton\n className=\"delete\"\n title={t('explorer.viewList.delete-view')}\n onClick={() => {\n setDataViewOnAction({id: viewItem.id, label: viewItem.label});\n }}\n >\n <FaTrash />\n </StyledButton>\n );\n\n return {\n iconDelete,\n deleteModal: dataViewOnAction.id && dataViewOnAction.label && (\n <KitModal\n appElement={document.getElementById('root')}\n title={t('explorer.viewList.confirm-delete-view')}\n isOpen={!!dataViewOnAction.id && !!dataViewOnAction.label}\n footer={\n <>\n <KitButton\n type=\"secondary\"\n onClick={() => setDataViewOnAction({id: null, label: null})}\n icon={<FaTimes />}\n >\n {t('global.close')}\n </KitButton>\n <KitButton type=\"primary\" danger onClick={_onDeleteConfirm} icon={<FaTrash />}>\n {t('global.delete')}\n </KitButton>\n </>\n }\n >\n <KitTypography.Text size=\"fontSize3\" weight=\"medium\">\n {localizedTranslation(dataViewOnAction.label, availableLangs)}\n </KitTypography.Text>\n </KitModal>\n ),\n };\n};\n"]}
1
+ {"version":3,"file":"useDeleteView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useDeleteView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAsB,QAAQ,EAAC,MAAM,OAAO,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AACnF,OAAO,4BAA4B,MAAM,qEAAqE,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,mCAAmC,CAAC;AAEnE,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAA;;CAEjC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAC9B,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,EAAC,cAAc,EAAC,GAAG,OAAO,EAAE,CAAC;IACnC,MAAM,EAAC,UAAU,EAAC,GAAG,4BAA4B,EAAE,CAAC;IACpD,MAAM,EAAC,QAAQ,EAAC,GAAG,sBAAsB,EAAE,CAAC;IAC5C,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,C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,CAAC,KAAK,EACzD,MAAM,EACF,8BACI,KAAC,SAAS,IACN,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,EAC3D,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,YAEvC,CAAC,CAAC,cAAc,CAAC,GACV,EACZ,KAAC,SAAS,IACN,IAAI,EAAC,SAAS,EACd,MAAM,QACN,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,YAEvC,CAAC,CAAC,eAAe,CAAC,GACX,IACb,YAGP,KAAC,aAAa,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,YAC/C,oBAAoB,CAAC,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,GAC5C,GACd,CACd;KACJ,CAAC;AACN,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 {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {KitButton, KitModal, KitTypography} from 'aristid-ds';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {type ComponentProps, useState} from 'react';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport useExecuteDeleteViewMutation from '_ui/hooks/useExecuteDeleteViewMutation/useExecuteDeleteViewMutation';\nimport {localizedTranslation} from '@leav/utils';\nimport {useLang} from '_ui/hooks';\nimport {type IUserView, type IDataViewOnAction} from '../../_types';\nimport styled from 'styled-components';\nimport {type Button} from 'antd';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faTimes, faTrash} from '@fortawesome/free-solid-svg-icons';\n\nconst StyledButton = styled.button`\n all: unset;\n`;\n\nexport const useDeleteView = () => {\n const {t} = useSharedTranslation();\n const {availableLangs} = useLang();\n const {deleteView} = useExecuteDeleteViewMutation();\n const {dispatch} = useViewSettingsContext();\n const [dataViewOnAction, setDataViewOnAction] = useState<IDataViewOnAction>({id: null, label: null});\n\n const _onDeleteConfirm: ComponentProps<typeof Button>['onClick'] = async () => {\n if (!dataViewOnAction.id) {\n return;\n }\n const {data} = await deleteView(dataViewOnAction.id);\n\n if (data) {\n dispatch({\n type: ViewSettingsActionTypes.DELETE_VIEW,\n payload: {\n id: dataViewOnAction.id,\n },\n });\n }\n setDataViewOnAction({id: null, label: null});\n };\n\n const iconDelete = (viewItem: IUserView) => (\n <StyledButton\n className=\"delete\"\n title={t('explorer.viewList.delete-view')}\n onClick={() => {\n setDataViewOnAction({id: viewItem.id, label: viewItem.label});\n }}\n >\n <FontAwesomeIcon icon={faTrash} />\n </StyledButton>\n );\n\n return {\n iconDelete,\n deleteModal: dataViewOnAction.id && dataViewOnAction.label && (\n <KitModal\n appElement={document.getElementById('root')}\n title={t('explorer.viewList.confirm-delete-view')}\n isOpen={!!dataViewOnAction.id && !!dataViewOnAction.label}\n footer={\n <>\n <KitButton\n type=\"secondary\"\n onClick={() => setDataViewOnAction({id: null, label: null})}\n icon={<FontAwesomeIcon icon={faTimes} />}\n >\n {t('global.close')}\n </KitButton>\n <KitButton\n type=\"primary\"\n danger\n onClick={_onDeleteConfirm}\n icon={<FontAwesomeIcon icon={faTrash} />}\n >\n {t('global.delete')}\n </KitButton>\n </>\n }\n >\n <KitTypography.Text size=\"fontSize3\" weight=\"medium\">\n {localizedTranslation(dataViewOnAction.label, availableLangs)}\n </KitTypography.Text>\n </KitModal>\n ),\n };\n};\n"]}
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
3
  // This file is released under LGPL V3
4
4
  // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
- import { FaEdit } from 'react-icons/fa';
6
5
  import { useViewSettingsContext } from '../store-view-settings/useViewSettingsContext';
7
6
  import { useState } from 'react';
8
7
  import { ViewSettingsActionTypes } from '../store-view-settings/viewSettingsReducer';
@@ -10,6 +9,8 @@ import useExecuteUpdateViewMutation from '../../_queries/useExecuteUpdateViewMut
10
9
  import { LabelViewFormModal } from './LabelViewFormModal';
11
10
  import styled from 'styled-components';
12
11
  import { useSharedTranslation } from '../../../../hooks/useSharedTranslation';
12
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
13
+ import { faEdit } from '@fortawesome/free-solid-svg-icons';
13
14
  const StyledButton = styled.button `
14
15
  all: unset;
15
16
  `;
@@ -39,7 +40,7 @@ export const useEditLabelView = () => {
39
40
  });
40
41
  }
41
42
  };
42
- const iconEditLabel = (viewItem) => (_jsx(StyledButton, { className: "edit", title: t('explorer.viewList.edit-view'), onClick: () => setDataViewOnAction({ id: viewItem.id, label: viewItem.label }), children: _jsx(FaEdit, {}) }));
43
+ const iconEditLabel = (viewItem) => (_jsx(StyledButton, { className: "edit", title: t('explorer.viewList.edit-view'), onClick: () => setDataViewOnAction({ id: viewItem.id, label: viewItem.label }), children: _jsx(FontAwesomeIcon, { icon: faEdit }) }));
43
44
  return {
44
45
  iconEditLabel,
45
46
  editViewModal: dataViewOnAction.id && dataViewOnAction.label && (_jsx(LabelViewFormModal, { viewData: dataViewOnAction.label, isOpen: true, onSubmit: _onEditLabel, onClose: () => setDataViewOnAction({ id: null, label: null }) })),
@@ -1 +1 @@
1
- {"version":3,"file":"useEditLabelView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useEditLabelView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,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AAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,QAAmB,EAAE,EAAE,CAAC,CAC3C,KAAC,YAAY,IACT,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,CAAC,CAAC,6BAA6B,CAAC,EACvC,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,EAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAC,CAAC,YAE5E,KAAC,MAAM,KAAG,GACC,CAClB,CAAC;IAEF,OAAO;QACH,aAAa;QACb,aAAa,EAAE,gBAAgB,CAAC,EAAE,IAAI,gBAAgB,CAAC,KAAK,IAAI,CAC5D,KAAC,kBAAkB,IACf,QAAQ,EAAE,gBAAgB,CAAC,KAAK,EAChC,MAAM,QACN,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,GAC7D,CACL;KACJ,CAAC;AACN,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 {FaEdit} from 'react-icons/fa';\nimport {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {useState} from 'react';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {type IDataViewOnAction, type IUserView} from '../../_types';\nimport useExecuteUpdateViewMutation from '../../_queries/useExecuteUpdateViewMutation';\nimport {LabelViewFormModal} from './LabelViewFormModal';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\n\nconst StyledButton = styled.button`\n all: unset;\n`;\n\nexport const useEditLabelView = () => {\n const {t} = useSharedTranslation();\n const {updateView} = useExecuteUpdateViewMutation();\n const {dispatch} = useViewSettingsContext();\n const [dataViewOnAction, setDataViewOnAction] = useState<IDataViewOnAction>({id: null, label: null});\n\n const _onEditLabel = async (label: Record<string, string>) => {\n if (!dataViewOnAction.id) {\n return;\n }\n const mappedView = {\n id: dataViewOnAction.id,\n label,\n };\n\n const {data} = await updateView({\n view: mappedView,\n });\n\n if (data) {\n dispatch({\n type: ViewSettingsActionTypes.RENAME_VIEW,\n payload: {\n id: data.updateView.id,\n label: data.updateView.label,\n },\n });\n }\n };\n\n const iconEditLabel = (viewItem: IUserView) => (\n <StyledButton\n className=\"edit\"\n title={t('explorer.viewList.edit-view')}\n onClick={() => setDataViewOnAction({id: viewItem.id, label: viewItem.label})}\n >\n <FaEdit />\n </StyledButton>\n );\n\n return {\n iconEditLabel,\n editViewModal: dataViewOnAction.id && dataViewOnAction.label && (\n <LabelViewFormModal\n viewData={dataViewOnAction.label}\n isOpen\n onSubmit={_onEditLabel}\n onClose={() => setDataViewOnAction({id: null, label: null})}\n />\n ),\n };\n};\n"]}
1
+ {"version":3,"file":"useEditLabelView.js","sourceRoot":"","sources":["../../../../../src/components/Explorer/manage-view-settings/save-view/useEditLabelView.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,uBAAuB,EAAC,MAAM,4CAA4C,CAAC;AAEnF,OAAO,4BAA4B,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAEzD,MAAM,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C,KAAK,EAAC,CAAC,YAE5E,KAAC,eAAe,IAAC,IAAI,EAAE,MAAM,GAAI,GACtB,CAClB,CAAC;IAEF,OAAO;QACH,aAAa;QACb,aAAa,EAAE,gBAAgB,CAAC,EAAE,IAAI,gBAAgB,CAAC,KAAK,IAAI,CAC5D,KAAC,kBAAkB,IACf,QAAQ,EAAE,gBAAgB,CAAC,KAAK,EAChC,MAAM,QACN,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,GAC7D,CACL;KACJ,CAAC;AACN,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 {useViewSettingsContext} from '../store-view-settings/useViewSettingsContext';\nimport {useState} from 'react';\nimport {ViewSettingsActionTypes} from '../store-view-settings/viewSettingsReducer';\nimport {type IDataViewOnAction, type IUserView} from '../../_types';\nimport useExecuteUpdateViewMutation from '../../_queries/useExecuteUpdateViewMutation';\nimport {LabelViewFormModal} from './LabelViewFormModal';\nimport styled from 'styled-components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {faEdit} from '@fortawesome/free-solid-svg-icons';\n\nconst StyledButton = styled.button`\n all: unset;\n`;\n\nexport const useEditLabelView = () => {\n const {t} = useSharedTranslation();\n const {updateView} = useExecuteUpdateViewMutation();\n const {dispatch} = useViewSettingsContext();\n const [dataViewOnAction, setDataViewOnAction] = useState<IDataViewOnAction>({id: null, label: null});\n\n const _onEditLabel = async (label: Record<string, string>) => {\n if (!dataViewOnAction.id) {\n return;\n }\n const mappedView = {\n id: dataViewOnAction.id,\n label,\n };\n\n const {data} = await updateView({\n view: mappedView,\n });\n\n if (data) {\n dispatch({\n type: ViewSettingsActionTypes.RENAME_VIEW,\n payload: {\n id: data.updateView.id,\n label: data.updateView.label,\n },\n });\n }\n };\n\n const iconEditLabel = (viewItem: IUserView) => (\n <StyledButton\n className=\"edit\"\n title={t('explorer.viewList.edit-view')}\n onClick={() => setDataViewOnAction({id: viewItem.id, label: viewItem.label})}\n >\n <FontAwesomeIcon icon={faEdit} />\n </StyledButton>\n );\n\n return {\n iconEditLabel,\n editViewModal: dataViewOnAction.id && dataViewOnAction.label && (\n <LabelViewFormModal\n viewData={dataViewOnAction.label}\n isOpen\n onSubmit={_onEditLabel}\n onClose={() => setDataViewOnAction({id: null, label: null})}\n />\n ),\n };\n};\n"]}