@leav/ui 1.10.0 → 1.11.0

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 (139) hide show
  1. package/dist/_gqlTypes/index.d.ts +14 -1
  2. package/dist/_gqlTypes/index.js +39 -15
  3. package/dist/_gqlTypes/index.js.map +1 -1
  4. package/dist/_utils/index.d.ts +0 -1
  5. package/dist/_utils/index.js +0 -3
  6. package/dist/_utils/index.js.map +1 -1
  7. package/dist/components/Explorer/_queries/useExplorerCountData.js +3 -4
  8. package/dist/components/Explorer/_queries/useExplorerCountData.js.map +1 -1
  9. package/dist/components/Filters/filter-items/CommonFilterItem.js +8 -6
  10. package/dist/components/Filters/filter-items/CommonFilterItem.js.map +1 -1
  11. package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js +6 -1
  12. package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -1
  13. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js +11 -19
  14. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -1
  15. package/dist/components/Filters/filter-items/filter-type/TextAttributeDropDown.js +27 -18
  16. package/dist/components/Filters/filter-items/filter-type/TextAttributeDropDown.js.map +1 -1
  17. package/dist/components/Notifications/InitNotificationsSubscription.d.ts +4 -2
  18. package/dist/components/Notifications/InitNotificationsSubscription.js.map +1 -1
  19. package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -0
  20. package/dist/components/RecordEdition/EditRecord/EditRecord.js +2 -26
  21. package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
  22. package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js +2 -2
  23. package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js.map +1 -1
  24. package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +1 -19
  25. package/dist/components/RecordEdition/EditRecordContent/_types.js +0 -5
  26. package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
  27. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.d.ts +0 -3
  28. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/explorer/LinkFieldExplorer.js.map +1 -1
  29. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +1 -1
  30. package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
  31. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +1 -2
  32. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +7 -9
  33. package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
  34. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +2 -33
  35. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -1
  36. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js +11 -0
  37. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/useRecordInformations.js.map +1 -1
  38. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.d.ts +1 -0
  39. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js +4 -20
  40. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordSummary.js.map +1 -1
  41. package/dist/components/RecordHistory/RecordHistory.d.ts +1 -0
  42. package/dist/components/RecordHistory/RecordHistory.js +3 -3
  43. package/dist/components/RecordHistory/RecordHistory.js.map +1 -1
  44. package/dist/components/RecordHistory/RecordHistoryGoUpButton.d.ts +1 -0
  45. package/dist/components/RecordHistory/RecordHistoryGoUpButton.js +3 -3
  46. package/dist/components/RecordHistory/RecordHistoryGoUpButton.js.map +1 -1
  47. package/dist/components/RecordHistory/RecordHistoryLogEntry.js +7 -5
  48. package/dist/components/RecordHistory/RecordHistoryLogEntry.js.map +1 -1
  49. package/dist/components/RecordHistory/_queries/recordHistoryQuery.js +38 -14
  50. package/dist/components/RecordHistory/_queries/recordHistoryQuery.js.map +1 -1
  51. package/dist/components/RecordHistory/_types.d.ts +2 -2
  52. package/dist/components/RecordHistory/_types.js.map +1 -1
  53. package/dist/hooks/useRedirectToLogin/useRedirectToLogin.d.ts +2 -1
  54. package/dist/hooks/useRedirectToLogin/useRedirectToLogin.js +32 -4
  55. package/dist/hooks/useRedirectToLogin/useRedirectToLogin.js.map +1 -1
  56. package/dist/locales/en/shared.json +3 -31
  57. package/dist/locales/fr/shared.json +3 -31
  58. package/package.json +5 -5
  59. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.d.ts +0 -3
  60. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.js +0 -2
  61. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.js.map +0 -1
  62. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.d.ts +0 -1
  63. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js +0 -5
  64. package/dist/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.js.map +0 -1
  65. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.d.ts +0 -1
  66. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js +0 -5
  67. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.js.map +0 -1
  68. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.d.ts +0 -7
  69. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js +0 -20
  70. package/dist/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.js.map +0 -1
  71. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.d.ts +0 -11
  72. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js +0 -35
  73. package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js.map +0 -1
  74. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.d.ts +0 -2
  75. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js +0 -6
  76. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.js.map +0 -1
  77. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.d.ts +0 -52
  78. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.js +0 -144
  79. package/dist/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.js.map +0 -1
  80. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.d.ts +0 -9
  81. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js +0 -19
  82. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.js.map +0 -1
  83. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.d.ts +0 -2
  84. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.js +0 -6
  85. package/dist/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.js.map +0 -1
  86. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.d.ts +0 -5
  87. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.js +0 -21
  88. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.js.map +0 -1
  89. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.d.ts +0 -2
  90. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js +0 -6
  91. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/index.js.map +0 -1
  92. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.d.ts +0 -6
  93. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js +0 -14
  94. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/DeleteValueBtn.js.map +0 -1
  95. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.d.ts +0 -2
  96. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.js +0 -6
  97. package/dist/components/RecordEdition/EditRecordContent/shared/DeleteValueBtn/index.js.map +0 -1
  98. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.d.ts +0 -9
  99. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js +0 -28
  100. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/FieldFooter.js.map +0 -1
  101. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.d.ts +0 -2
  102. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.js +0 -6
  103. package/dist/components/RecordEdition/EditRecordContent/shared/FieldFooter/index.js.map +0 -1
  104. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.d.ts +0 -6
  105. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.js +0 -25
  106. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/InheritedFieldLabel.js.map +0 -1
  107. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.d.ts +0 -2
  108. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.js +0 -6
  109. package/dist/components/RecordEdition/EditRecordContent/shared/InheritedFieldLabel/index.js.map +0 -1
  110. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.d.ts +0 -7
  111. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.js +0 -33
  112. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/NoValue.js.map +0 -1
  113. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.d.ts +0 -2
  114. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.js +0 -6
  115. package/dist/components/RecordEdition/EditRecordContent/shared/NoValue/index.js.map +0 -1
  116. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.d.ts +0 -2
  117. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.js +0 -13
  118. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/UpdatedFieldIcon.js.map +0 -1
  119. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.d.ts +0 -2
  120. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.js +0 -6
  121. package/dist/components/RecordEdition/EditRecordContent/shared/UpdatedFieldIcon/index.js.map +0 -1
  122. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.d.ts +0 -10
  123. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js +0 -24
  124. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/ValueDetailsBtn.js.map +0 -1
  125. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.d.ts +0 -2
  126. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.js +0 -6
  127. package/dist/components/RecordEdition/EditRecordContent/shared/ValueDetailsBtn/index.js.map +0 -1
  128. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.d.ts +0 -13
  129. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js +0 -41
  130. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js.map +0 -1
  131. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.d.ts +0 -2
  132. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.js +0 -6
  133. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/index.js.map +0 -1
  134. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.d.ts +0 -8
  135. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.js +0 -34
  136. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/ValuesVersionIndicator.js.map +0 -1
  137. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.d.ts +0 -2
  138. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.js +0 -6
  139. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionIndicator/index.js.map +0 -1
@@ -411,42 +411,21 @@
411
411
  },
412
412
  "record_edition": {
413
413
  "no_form_error": "Aucun formulaire disponible",
414
- "invalid_format": "Format non valide",
415
414
  "missing_attribute": "Attribut manquant",
416
415
  "modified_at": "Modifié le",
417
416
  "created_at": "Créée le",
418
- "link_created_at": "Lié le",
419
417
  "add_value": "Ajouter une valeur",
420
- "add_value_link": "Ajouter une liaison",
421
418
  "delete_value": "Supprimer cette valeur",
422
- "delete_value_confirm": "Êtes-vous sûr de vouloir supprimer cette valeur ?",
423
419
  "whoAmI": "Informations",
424
420
  "no_value": "Pas de valeur",
425
- "value_details": "Infos valeur",
426
- "link_details": "Infos liaison",
427
- "by": "par",
428
- "no_matching_value": "Aucune valeur correspondante",
429
- "copy_value": "Copier",
430
421
  "select": "Sélectionner",
431
- "new_value": "Nouvelle valeur",
432
- "advanced_search": "Recherche avancée",
433
- "search_elements": "Rechercher des éléments",
434
422
  "values_list": "Liste de valeurs",
435
423
  "new_record": "Créer",
436
- "value_details_section": "Valeur",
437
- "link_value_details_section": "Élément lié",
438
- "attribute_details_section": "Plus d'infos...",
439
- "path_section": "Chemin",
440
- "start_typing_message": "Commencez à taper pour chercher des éléments",
441
- "metadata_section": "Propriétés de la valeur",
442
- "metadata_section_link": "Propriétés de la liaison",
443
- "value_length": "{{length}} caractère(s)",
444
424
  "delete_all": "Tout supprimer",
445
425
  "delete_all_values": "Supprimer toutes les valeurs",
446
426
  "delete_all_values_confirm": "Êtes-vous sûr de vouloir supprimer toutes les valeurs?",
447
427
  "delete_link": "Supprimer la liaison",
448
428
  "delete_link_description": "Êtes-vous sûr de vouloir supprimer la liaison?",
449
- "value_details_tooltip": "Plus d'informations",
450
429
  "attribute": {
451
430
  "id": "Identifiant",
452
431
  "info_title": "Infos attribut",
@@ -467,8 +446,6 @@
467
446
  "format_rich_text": "Texte Enrichi"
468
447
  },
469
448
  "date_range_value": "Du {{from}} au {{to}}",
470
- "external_update_warning": "Cet élément a été modifié par {{modifiers}}",
471
- "field_external_update": "Ce champ a été modifié",
472
449
  "create": "Créer",
473
450
  "create_and_edit": "Créer et éditer",
474
451
  "cancel_confirm_modal_title": "Confirmer l'abandon?",
@@ -477,9 +454,6 @@
477
454
  "inherited_value": "Valeur héritée",
478
455
  "calculated_value": "Valeur calculée",
479
456
  "overrided_value": "Valeur surchargée",
480
- "date_range_from_to": "du {{- from}} au {{- to}}",
481
- "link_search_result_count": "Résultats ({{count}}/{{total}})",
482
- "suggestions_count": "Suggestions ({{count}})",
483
457
  "search_not_found": "Aucune correspondance",
484
458
  "press_enter_to": "Appuyer sur Entrer pour ",
485
459
  "select_this_value": "Sélectionner cette valeur",
@@ -498,8 +472,8 @@
498
472
  "select_an_option": "Sélectionner une option"
499
473
  },
500
474
  "replace-by-existing-item": "Remplacer par un élément existant",
501
- "open_sidebar": "Ouvrir le panneau latéral",
502
- "close_sidebar": "Fermer le panneau latéral"
475
+ "open_sidebar": "Afficher les informations",
476
+ "close_sidebar": "Masquer les informations"
503
477
  },
504
478
  "record_summary": {
505
479
  "preview_title": "Cliquez ici pour voir l’aperçu.",
@@ -510,15 +484,13 @@
510
484
  "created_at_value": "{{date}} par {{user}}",
511
485
  "modified_at": "Modifié le",
512
486
  "modified_at_value": "{{date}} par {{user}}",
513
- "new_record": "Nouvel élément",
514
487
  "id_entity": "Identifiant entité",
515
488
  "creation": "Création",
516
489
  "last_modification": "Dernière modification",
517
490
  "date_by_user": "Le {{date}} par {{user}}",
518
- "open_preview_modal": "Ouvrir la modale d'aperçu",
519
491
  "informations": "Informations",
520
- "chat": "Chat",
521
492
  "history": "Historique",
493
+ "entity": "{{entity}}",
522
494
  "entity_overview": "Fiche {{entity}}",
523
495
  "attribute": "Attribut",
524
496
  "attribute_format": "Format de l'attribut",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leav/ui",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "Shared React components and hooks",
5
5
  "scripts": {
6
6
  "prepublishOnly": "yarn build",
@@ -28,7 +28,7 @@
28
28
  "@babel/preset-env": "7.29.0",
29
29
  "@babel/preset-react": "7.28.5",
30
30
  "@graphql-codegen/add": "5.0.3",
31
- "@graphql-codegen/cli": "6.1.3",
31
+ "@graphql-codegen/cli": "6.2.1",
32
32
  "@graphql-codegen/typescript": "5.0.9",
33
33
  "@graphql-codegen/typescript-operations": "5.0.9",
34
34
  "@graphql-codegen/typescript-react-apollo": "4.4.1",
@@ -42,7 +42,7 @@
42
42
  "@types/lodash.isequal": "^4",
43
43
  "@types/react": "18.2.14",
44
44
  "@types/react-dom": "18.2.6",
45
- "aristid-ds": "15.2.0-bc3380f",
45
+ "aristid-ds": "15.2.0-e049fb9",
46
46
  "babel-jest": "29.7.0",
47
47
  "graphql": "16.12.0",
48
48
  "i18next": "22.5.1",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@apollo/client": ">=3.8.1",
63
- "aristid-ds": "15.2.0-bc3380f",
63
+ "aristid-ds": "15.2.0-e049fb9",
64
64
  "i18next": ">=22.5.1",
65
65
  "react": "^18.2.0",
66
66
  "react-dom": "^18.2.0",
@@ -74,7 +74,7 @@
74
74
  "@dnd-kit/core": "6.3.1",
75
75
  "@dnd-kit/sortable": "8.0.0",
76
76
  "@dnd-kit/utilities": "3.2.2",
77
- "@leav/utils": "1.10.0",
77
+ "@leav/utils": "1.11.0",
78
78
  "@uidotdev/usehooks": "2.4.1",
79
79
  "dayjs": "^1.11.13",
80
80
  "dompurify": "3.3.2",
@@ -1,3 +0,0 @@
1
- import { type ICommonFieldsReducerState } from '../../_types';
2
- declare const _default: <ValuesType = any>(state: ICommonFieldsReducerState<ValuesType>) => ValuesType;
3
- export default _default;
@@ -1,2 +0,0 @@
1
- export default (state) => state.values[state.activeScope].values;
2
- //# sourceMappingURL=getActiveFieldValues.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getActiveFieldValues.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/getActiveFieldValues.ts"],"names":[],"mappings":"AAKA,eAAe,CAAmB,KAA4C,EAAE,EAAE,CAC9E,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,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 ICommonFieldsReducerState} from '../../_types';\n\nexport default <ValuesType = any>(state: ICommonFieldsReducerState<ValuesType>) =>\n state.values[state.activeScope].values;\n"]}
@@ -1 +0,0 @@
1
- export { default } from './getActiveFieldValues';
@@ -1,5 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- export { default } from './getActiveFieldValues';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,wBAAwB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nexport {default} from './getActiveFieldValues';\n"]}
@@ -1 +0,0 @@
1
- export { default } from './isCurrentVersion';
@@ -1,5 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- export { default } from './isCurrentVersion';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nexport {default} from './isCurrentVersion';\n"]}
@@ -1,7 +0,0 @@
1
- import { type IValueVersion } from '../../../../../types/values';
2
- /**
3
- * Check if given version matches the reference version. As reference version might contains
4
- * trees that are not in the given version, we only check the nodes of given version against reference version.
5
- */
6
- declare const _default: (referenceVersion: IValueVersion, valueVersion: IValueVersion) => boolean;
7
- export default _default;
@@ -1,20 +0,0 @@
1
- /**
2
- * Check if given version matches the reference version. As reference version might contains
3
- * trees that are not in the given version, we only check the nodes of given version against reference version.
4
- */
5
- export default (referenceVersion, valueVersion) => {
6
- if (referenceVersion === valueVersion) {
7
- // Mostly for the case that both are null or undefined
8
- return true;
9
- }
10
- if (!referenceVersion || !valueVersion) {
11
- return false;
12
- }
13
- for (const versionTreeId of Object.keys(valueVersion)) {
14
- if (referenceVersion?.[versionTreeId]?.id !== valueVersion[versionTreeId].id) {
15
- return false;
16
- }
17
- }
18
- return true;
19
- };
20
- //# sourceMappingURL=isCurrentVersion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCurrentVersion.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion/isCurrentVersion.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAe,CAAC,gBAA+B,EAAE,YAA2B,EAAE,EAAE;IAC5E,IAAI,gBAAgB,KAAK,YAAY,EAAE,CAAC;QACpC,sDAAsD;QACtD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,gBAAgB,IAAI,CAAC,YAAY,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,KAAK,MAAM,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACpD,IAAI,gBAAgB,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,YAAY,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC;YAC3E,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {type IValueVersion} from '_ui/types/values';\n\n/**\n * Check if given version matches the reference version. As reference version might contains\n * trees that are not in the given version, we only check the nodes of given version against reference version.\n */\nexport default (referenceVersion: IValueVersion, valueVersion: IValueVersion) => {\n if (referenceVersion === valueVersion) {\n // Mostly for the case that both are null or undefined\n return true;\n }\n\n if (!referenceVersion || !valueVersion) {\n return false;\n }\n\n for (const versionTreeId of Object.keys(valueVersion)) {\n if (referenceVersion?.[versionTreeId]?.id !== valueVersion[versionTreeId].id) {\n return false;\n }\n }\n\n return true;\n};\n"]}
@@ -1,11 +0,0 @@
1
- import { type RecordFormElement } from '../../../../hooks/useGetRecordForm';
2
- /**
3
- * Hook to manage tab visibility and tab click events in the EditRecordContent component
4
- * @returns Object containing the visible tab ID and a handler for tab click events
5
- * @param elements
6
- */
7
- export declare const useTabManagement: (elements: RecordFormElement[]) => {
8
- tabIdVisible: string;
9
- handleTabClick: (tabIdClicked: string) => void;
10
- };
11
- export default useTabManagement;
@@ -1,35 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import { useState, useEffect } from 'react';
5
- /**
6
- * Hook to manage tab visibility and tab click events in the EditRecordContent component
7
- * @returns Object containing the visible tab ID and a handler for tab click events
8
- * @param elements
9
- */
10
- export const useTabManagement = (elements) => {
11
- // State to track the currently visible tab ID
12
- const [tabIdVisible, setTabIdVisible] = useState(undefined);
13
- // Initialize the visible tab ID when the record form is loaded
14
- useEffect(() => {
15
- // When we load the record form, get the ID of the first tab
16
- const firstTabId = elements?.find(e => e.uiElementType === 'tabs')?.settings?.find(s => s.key === 'tabs')
17
- ?.value[0]?.id;
18
- if (firstTabId) {
19
- setTabIdVisible(firstTabId);
20
- }
21
- }, [elements]);
22
- /**
23
- * Handler for tab click events
24
- * @param tabIdClicked The ID of the tab that was clicked
25
- */
26
- const handleTabClick = (tabIdClicked) => {
27
- setTabIdVisible(tabIdClicked);
28
- };
29
- return {
30
- tabIdVisible,
31
- handleTabClick,
32
- };
33
- };
34
- export default useTabManagement;
35
- //# sourceMappingURL=useTabManagement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTabManagement.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordContent/hooks/useTabManagement.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAG1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAA6B,EAAE,EAAE;IAC9D,8CAA8C;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAEhF,+DAA+D;IAC/D,SAAS,CAAC,GAAG,EAAE;QACX,4DAA4D;QAC5D,MAAM,UAAU,GAAG,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC;YACrG,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAEnB,IAAI,UAAU,EAAE,CAAC;YACb,eAAe,CAAC,UAAU,CAAC,CAAC;QAChC,CAAC;IACL,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf;;;OAGG;IACH,MAAM,cAAc,GAAG,CAAC,YAAoB,EAAE,EAAE;QAC5C,eAAe,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC;IAEF,OAAO;QACH,YAAY;QACZ,cAAc;KACjB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {useState, useEffect} from 'react';\nimport {IRecordForm, type RecordFormElement} from '_ui/hooks/useGetRecordForm';\n\n/**\n * Hook to manage tab visibility and tab click events in the EditRecordContent component\n * @returns Object containing the visible tab ID and a handler for tab click events\n * @param elements\n */\nexport const useTabManagement = (elements: RecordFormElement[]) => {\n // State to track the currently visible tab ID\n const [tabIdVisible, setTabIdVisible] = useState<string | undefined>(undefined);\n\n // Initialize the visible tab ID when the record form is loaded\n useEffect(() => {\n // When we load the record form, get the ID of the first tab\n const firstTabId = elements?.find(e => e.uiElementType === 'tabs')?.settings?.find(s => s.key === 'tabs')\n ?.value[0]?.id;\n\n if (firstTabId) {\n setTabIdVisible(firstTabId);\n }\n }, [elements]);\n\n /**\n * Handler for tab click events\n * @param tabIdClicked The ID of the tab that was clicked\n */\n const handleTabClick = (tabIdClicked: string) => {\n setTabIdVisible(tabIdClicked);\n };\n\n return {\n tabIdVisible,\n handleTabClick,\n };\n};\n\nexport default useTabManagement;\n"]}
@@ -1,2 +0,0 @@
1
- import linkFieldReducer from './linkFieldReducer';
2
- export default linkFieldReducer;
@@ -1,6 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import linkFieldReducer from './linkFieldReducer';
5
- export default linkFieldReducer;
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport linkFieldReducer from './linkFieldReducer';\n\nexport default linkFieldReducer;\n"]}
@@ -1,52 +0,0 @@
1
- import { VersionFieldScope, type FormElement, type ICommonFieldsReducerState } from '../../../../../components/RecordEdition/EditRecordContent/_types';
2
- import { type RecordFormElementsValueLinkValue, type RecordFormElementsValueTreeValue } from '../../../../../hooks/useGetRecordForm/useGetRecordForm';
3
- import { type IRecordIdentityWhoAmI } from '../../../../../types/records';
4
- import { type IValueVersion } from '../../../../../types/values';
5
- type AllowedValuesType = RecordFormElementsValueLinkValue | RecordFormElementsValueTreeValue;
6
- export interface ILinkFieldState<ValuesType> extends ICommonFieldsReducerState<ValuesType[]> {
7
- errorMessage: string | string[];
8
- isValuesAddVisible: boolean;
9
- }
10
- export declare enum LinkFieldReducerActionsType {
11
- ADD_VALUES = "ADD_VALUES",
12
- DELETE_VALUE = "DELETE_VALUE",
13
- DELETE_ALL_VALUES = "DELETE_ALL_VALUES",
14
- SET_ERROR_MESSAGE = "SET_ERROR_MESSAGE",
15
- CLEAR_ERROR_MESSAGE = "CLEAR_ERROR_MESSAGE",
16
- SET_IS_VALUES_ADD_VISIBLE = "SET_IS_VALUES_ADD_VISIBLE",
17
- CHANGE_ACTIVE_SCOPE = "CHANGE_ACTIVE_SCOPE",
18
- REFRESH_VALUES = "REFRESH_VALUES"
19
- }
20
- export type LinkFieldReducerActions<ValuesType extends AllowedValuesType> = {
21
- type: LinkFieldReducerActionsType.ADD_VALUES;
22
- values: ValuesType[];
23
- } | {
24
- type: LinkFieldReducerActionsType.DELETE_VALUE;
25
- idValue: string;
26
- } | {
27
- type: LinkFieldReducerActionsType.DELETE_ALL_VALUES;
28
- } | {
29
- type: LinkFieldReducerActionsType.SET_ERROR_MESSAGE;
30
- errorMessage: string | string[];
31
- } | {
32
- type: LinkFieldReducerActionsType.CLEAR_ERROR_MESSAGE;
33
- } | {
34
- type: LinkFieldReducerActionsType.SET_IS_VALUES_ADD_VISIBLE;
35
- isValuesAddVisible: boolean;
36
- } | {
37
- type: LinkFieldReducerActionsType.CHANGE_ACTIVE_SCOPE;
38
- scope: VersionFieldScope;
39
- } | {
40
- type: LinkFieldReducerActionsType.REFRESH_VALUES;
41
- values: ValuesType[];
42
- formVersion: IValueVersion;
43
- };
44
- export declare const virginState: ILinkFieldState<AllowedValuesType>;
45
- export declare const computeInitialState: <ValuesType extends AllowedValuesType>(params: {
46
- element: FormElement<unknown>;
47
- record: IRecordIdentityWhoAmI;
48
- isRecordReadOnly: boolean;
49
- formVersion: IValueVersion;
50
- }) => ILinkFieldState<ValuesType>;
51
- declare const linkFieldReducer: <ValuesType extends AllowedValuesType>(state: ILinkFieldState<ValuesType>, action: LinkFieldReducerActions<ValuesType>) => ILinkFieldState<ValuesType>;
52
- export default linkFieldReducer;
@@ -1,144 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import getActiveFieldValues from '../../../../../components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues';
5
- import isCurrentVersion from '../../../../../components/RecordEdition/EditRecordContent/helpers/isCurrentVersion';
6
- import { VersionFieldScope, } from '../../../../../components/RecordEdition/EditRecordContent/_types';
7
- export var LinkFieldReducerActionsType;
8
- (function (LinkFieldReducerActionsType) {
9
- LinkFieldReducerActionsType["ADD_VALUES"] = "ADD_VALUES";
10
- LinkFieldReducerActionsType["DELETE_VALUE"] = "DELETE_VALUE";
11
- LinkFieldReducerActionsType["DELETE_ALL_VALUES"] = "DELETE_ALL_VALUES";
12
- LinkFieldReducerActionsType["SET_ERROR_MESSAGE"] = "SET_ERROR_MESSAGE";
13
- LinkFieldReducerActionsType["CLEAR_ERROR_MESSAGE"] = "CLEAR_ERROR_MESSAGE";
14
- LinkFieldReducerActionsType["SET_IS_VALUES_ADD_VISIBLE"] = "SET_IS_VALUES_ADD_VISIBLE";
15
- LinkFieldReducerActionsType["CHANGE_ACTIVE_SCOPE"] = "CHANGE_ACTIVE_SCOPE";
16
- LinkFieldReducerActionsType["REFRESH_VALUES"] = "REFRESH_VALUES";
17
- })(LinkFieldReducerActionsType || (LinkFieldReducerActionsType = {}));
18
- export const virginState = {
19
- record: null,
20
- formElement: null,
21
- attribute: null,
22
- isReadOnly: false,
23
- activeScope: VersionFieldScope.CURRENT,
24
- values: {
25
- [VersionFieldScope.CURRENT]: {
26
- version: null,
27
- values: [],
28
- },
29
- [VersionFieldScope.INHERITED]: null,
30
- },
31
- errorMessage: '',
32
- isValuesAddVisible: false,
33
- };
34
- /**
35
- * For given list of values, determine if there is inherited values, inherited/current version and default active scope
36
- */
37
- const _computeScopeAndValues = (params) => {
38
- const { attribute, values, formVersion } = params;
39
- const currentVersion = attribute?.versions_conf?.versionable && attribute?.versions_conf?.profile
40
- ? attribute.versions_conf.profile.trees.reduce((relevantVersion, tree) => {
41
- if (formVersion?.[tree.id]) {
42
- relevantVersion[tree.id] = formVersion[tree.id];
43
- }
44
- return relevantVersion;
45
- }, {})
46
- : null;
47
- const hasInheritedValues = attribute?.versions_conf?.versionable
48
- ? !isCurrentVersion(currentVersion, values?.[0]?.version ?? currentVersion)
49
- : false; // We assume that all values have the same version
50
- const inheritedVersion = hasInheritedValues ? values?.[0]?.version : null;
51
- return {
52
- activeScope: hasInheritedValues ? VersionFieldScope.INHERITED : VersionFieldScope.CURRENT,
53
- values: {
54
- [VersionFieldScope.CURRENT]: {
55
- version: currentVersion ?? null,
56
- values: hasInheritedValues ? [] : values,
57
- },
58
- [VersionFieldScope.INHERITED]: hasInheritedValues ? { version: inheritedVersion ?? null, values } : null,
59
- },
60
- };
61
- };
62
- export const computeInitialState = (params) => {
63
- const { element, record, isRecordReadOnly, formVersion } = params;
64
- const attribute = element.attribute;
65
- const fieldValues = element.values ?? [];
66
- const initialState = {
67
- ...virginState,
68
- attribute,
69
- record,
70
- formElement: element,
71
- isReadOnly: attribute?.readonly || isRecordReadOnly || !attribute?.permissions?.edit_value,
72
- ..._computeScopeAndValues({ attribute, values: fieldValues, formVersion }),
73
- };
74
- return initialState;
75
- };
76
- const linkFieldReducer = (state, action) => {
77
- switch (action.type) {
78
- case LinkFieldReducerActionsType.ADD_VALUES: {
79
- const newValues = [...state.values[state.activeScope].values, ...action.values];
80
- return {
81
- ...state,
82
- values: {
83
- ...state.values,
84
- [state.activeScope]: {
85
- ...state.values[state.activeScope],
86
- values: newValues,
87
- },
88
- },
89
- };
90
- }
91
- case LinkFieldReducerActionsType.DELETE_VALUE: {
92
- const activeValues = getActiveFieldValues(state);
93
- const newValues = activeValues.filter(value => value.id_value !== action.idValue);
94
- return {
95
- ...state,
96
- values: {
97
- ...state.values,
98
- [state.activeScope]: {
99
- ...state.values[state.activeScope],
100
- values: newValues,
101
- },
102
- },
103
- };
104
- }
105
- case LinkFieldReducerActionsType.DELETE_ALL_VALUES: {
106
- return {
107
- ...state,
108
- values: {
109
- ...state.values,
110
- [state.activeScope]: {
111
- ...state.values[state.activeScope],
112
- values: [],
113
- },
114
- },
115
- };
116
- }
117
- case LinkFieldReducerActionsType.SET_ERROR_MESSAGE: {
118
- return { ...state, errorMessage: action.errorMessage };
119
- }
120
- case LinkFieldReducerActionsType.CLEAR_ERROR_MESSAGE: {
121
- return { ...state, errorMessage: '' };
122
- }
123
- case LinkFieldReducerActionsType.SET_IS_VALUES_ADD_VISIBLE: {
124
- return { ...state, isValuesAddVisible: action.isValuesAddVisible };
125
- }
126
- case LinkFieldReducerActionsType.CHANGE_ACTIVE_SCOPE: {
127
- return { ...state, activeScope: action.scope };
128
- }
129
- case LinkFieldReducerActionsType.REFRESH_VALUES: {
130
- return {
131
- ...state,
132
- ..._computeScopeAndValues({
133
- attribute: state.formElement.attribute,
134
- values: action.values,
135
- formVersion: state.values[VersionFieldScope.CURRENT].version,
136
- }),
137
- };
138
- }
139
- default:
140
- return state;
141
- }
142
- };
143
- export default linkFieldReducer;
144
- //# sourceMappingURL=linkFieldReducer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linkFieldReducer.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/reducers/linkFieldReducer/linkFieldReducer.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,oBAAoB,MAA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AC,OAAO,CAAC,CAAC,OAAO;iBAC/D,CAAC;aACL,CAAC;QACN,CAAC;QACD;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport getActiveFieldValues from '_ui/components/RecordEdition/EditRecordContent/helpers/getActiveFieldValues';\nimport isCurrentVersion from '_ui/components/RecordEdition/EditRecordContent/helpers/isCurrentVersion';\nimport {\n VersionFieldScope,\n type FormElement,\n type ICommonFieldsReducerState,\n} from '_ui/components/RecordEdition/EditRecordContent/_types';\nimport {\n type RecordFormElementsValueLinkValue,\n type RecordFormElementsValueTreeValue,\n} from '_ui/hooks/useGetRecordForm/useGetRecordForm';\nimport {type IRecordIdentityWhoAmI} from '_ui/types/records';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type RecordFormAttributeFragment} from '_ui/_gqlTypes';\n\ntype AllowedValuesType = RecordFormElementsValueLinkValue | RecordFormElementsValueTreeValue;\n\nexport interface ILinkFieldState<ValuesType> extends ICommonFieldsReducerState<ValuesType[]> {\n errorMessage: string | string[];\n isValuesAddVisible: boolean;\n}\n\nexport enum LinkFieldReducerActionsType {\n ADD_VALUES = 'ADD_VALUES',\n DELETE_VALUE = 'DELETE_VALUE',\n DELETE_ALL_VALUES = 'DELETE_ALL_VALUES',\n SET_ERROR_MESSAGE = 'SET_ERROR_MESSAGE',\n CLEAR_ERROR_MESSAGE = 'CLEAR_ERROR_MESSAGE',\n SET_IS_VALUES_ADD_VISIBLE = 'SET_IS_VALUES_ADD_VISIBLE',\n CHANGE_ACTIVE_SCOPE = 'CHANGE_ACTIVE_SCOPE',\n REFRESH_VALUES = 'REFRESH_VALUES',\n}\n\nexport type LinkFieldReducerActions<ValuesType extends AllowedValuesType> =\n | {\n type: LinkFieldReducerActionsType.ADD_VALUES;\n values: ValuesType[];\n }\n | {\n type: LinkFieldReducerActionsType.DELETE_VALUE;\n idValue: string;\n }\n | {\n type: LinkFieldReducerActionsType.DELETE_ALL_VALUES;\n }\n | {type: LinkFieldReducerActionsType.SET_ERROR_MESSAGE; errorMessage: string | string[]}\n | {type: LinkFieldReducerActionsType.CLEAR_ERROR_MESSAGE}\n | {type: LinkFieldReducerActionsType.SET_IS_VALUES_ADD_VISIBLE; isValuesAddVisible: boolean}\n | {type: LinkFieldReducerActionsType.CHANGE_ACTIVE_SCOPE; scope: VersionFieldScope}\n | {\n type: LinkFieldReducerActionsType.REFRESH_VALUES;\n values: ValuesType[];\n formVersion: IValueVersion;\n };\n\nexport const virginState: ILinkFieldState<AllowedValuesType> = {\n record: null,\n formElement: null,\n attribute: null,\n isReadOnly: false,\n activeScope: VersionFieldScope.CURRENT,\n values: {\n [VersionFieldScope.CURRENT]: {\n version: null,\n values: [],\n },\n [VersionFieldScope.INHERITED]: null,\n },\n errorMessage: '',\n isValuesAddVisible: false,\n};\n\n/**\n * For given list of values, determine if there is inherited values, inherited/current version and default active scope\n */\nconst _computeScopeAndValues = <ValuesType extends AllowedValuesType>(params: {\n attribute: RecordFormAttributeFragment;\n values: ValuesType[];\n formVersion: IValueVersion;\n}): Pick<ILinkFieldState<ValuesType>, 'values' | 'activeScope'> => {\n const {attribute, values, formVersion} = params;\n\n const currentVersion: IValueVersion =\n attribute?.versions_conf?.versionable && attribute?.versions_conf?.profile\n ? attribute.versions_conf.profile.trees.reduce((relevantVersion, tree) => {\n if (formVersion?.[tree.id]) {\n relevantVersion[tree.id] = formVersion[tree.id];\n }\n\n return relevantVersion;\n }, {})\n : null;\n\n const hasInheritedValues = attribute?.versions_conf?.versionable\n ? !isCurrentVersion(currentVersion, values?.[0]?.version ?? currentVersion)\n : false; // We assume that all values have the same version\n const inheritedVersion = hasInheritedValues ? values?.[0]?.version : null;\n\n return {\n activeScope: hasInheritedValues ? VersionFieldScope.INHERITED : VersionFieldScope.CURRENT,\n values: {\n [VersionFieldScope.CURRENT]: {\n version: currentVersion ?? null,\n values: hasInheritedValues ? [] : values,\n },\n [VersionFieldScope.INHERITED]: hasInheritedValues ? {version: inheritedVersion ?? null, values} : null,\n },\n };\n};\n\nexport const computeInitialState = <ValuesType extends AllowedValuesType>(params: {\n element: FormElement<unknown>;\n record: IRecordIdentityWhoAmI;\n isRecordReadOnly: boolean;\n formVersion: IValueVersion;\n}): ILinkFieldState<ValuesType> => {\n const {element, record, isRecordReadOnly, formVersion} = params;\n\n const attribute = element.attribute;\n\n const fieldValues = (element.values as ValuesType[]) ?? [];\n\n const initialState: ILinkFieldState<ValuesType> = {\n ...virginState,\n attribute,\n record,\n formElement: element,\n isReadOnly: attribute?.readonly || isRecordReadOnly || !attribute?.permissions?.edit_value,\n ..._computeScopeAndValues<ValuesType>({attribute, values: fieldValues, formVersion}),\n };\n\n return initialState;\n};\n\nconst linkFieldReducer = <ValuesType extends AllowedValuesType>(\n state: ILinkFieldState<ValuesType>,\n action: LinkFieldReducerActions<ValuesType>,\n): ILinkFieldState<ValuesType> => {\n switch (action.type) {\n case LinkFieldReducerActionsType.ADD_VALUES: {\n const newValues = [...state.values[state.activeScope].values, ...action.values];\n return {\n ...state,\n values: {\n ...state.values,\n [state.activeScope]: {\n ...state.values[state.activeScope],\n values: newValues,\n },\n },\n };\n }\n case LinkFieldReducerActionsType.DELETE_VALUE: {\n const activeValues = getActiveFieldValues(state);\n const newValues = activeValues.filter(value => value.id_value !== action.idValue);\n\n return {\n ...state,\n values: {\n ...state.values,\n [state.activeScope]: {\n ...state.values[state.activeScope],\n values: newValues,\n },\n },\n };\n }\n case LinkFieldReducerActionsType.DELETE_ALL_VALUES: {\n return {\n ...state,\n values: {\n ...state.values,\n [state.activeScope]: {\n ...state.values[state.activeScope],\n values: [],\n },\n },\n };\n }\n case LinkFieldReducerActionsType.SET_ERROR_MESSAGE: {\n return {...state, errorMessage: action.errorMessage};\n }\n case LinkFieldReducerActionsType.CLEAR_ERROR_MESSAGE: {\n return {...state, errorMessage: ''};\n }\n case LinkFieldReducerActionsType.SET_IS_VALUES_ADD_VISIBLE: {\n return {...state, isValuesAddVisible: action.isValuesAddVisible};\n }\n case LinkFieldReducerActionsType.CHANGE_ACTIVE_SCOPE: {\n return {...state, activeScope: action.scope};\n }\n case LinkFieldReducerActionsType.REFRESH_VALUES: {\n return {\n ...state,\n ..._computeScopeAndValues({\n attribute: state.formElement.attribute,\n values: action.values,\n formVersion: state.values[VersionFieldScope.CURRENT].version,\n }),\n };\n }\n default:\n return state;\n }\n};\n\nexport default linkFieldReducer;\n"]}
@@ -1,9 +0,0 @@
1
- import { type ButtonProps } from 'antd';
2
- import { VersionFieldScope } from '../../_types';
3
- interface IAddValueBtnProps extends ButtonProps {
4
- bordered?: boolean;
5
- linkField?: boolean;
6
- activeScope: VersionFieldScope;
7
- }
8
- declare function AddValueBtn({ bordered, linkField, activeScope, ...props }: IAddValueBtnProps): JSX.Element;
9
- export default AddValueBtn;
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
- // This file is released under LGPL V3
4
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
- import { PlusOutlined } from '@ant-design/icons';
6
- import { themeVars } from '../../../../../antdTheme';
7
- import { BasicButton } from '../../../../../components';
8
- import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
9
- import { VersionFieldScope } from '../../_types';
10
- function AddValueBtn({ bordered = false, linkField = false, activeScope, ...props }) {
11
- const { t } = useSharedTranslation();
12
- return (_jsxs(BasicButton, { bordered: bordered, ...props, style: {
13
- color: activeScope === VersionFieldScope.INHERITED
14
- ? themeVars.inheritedValuesVersionColor
15
- : themeVars.defaultTextColor,
16
- }, children: [_jsx(PlusOutlined, {}), linkField ? t('record_edition.add_value_link') : t('record_edition.add_value')] }));
17
- }
18
- export default AddValueBtn;
19
- //# sourceMappingURL=AddValueBtn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddValueBtn.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/AddValueBtn/AddValueBtn.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAQ/C,SAAS,WAAW,CAAC,EAAC,QAAQ,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAoB;IAChG,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,OAAO,CACH,MAAC,WAAW,IACR,QAAQ,EAAE,QAAQ,KACd,KAAK,EACT,KAAK,EAAE;YACH,KAAK,EACD,WAAW,KAAK,iBAAiB,CAAC,SAAS;gBACvC,CAAC,CAAC,SAAS,CAAC,2BAA2B;gBACvC,CAAC,CAAC,SAAS,CAAC,gBAAgB;SACvC,aAED,KAAC,YAAY,KAAG,EACf,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,IACrE,CACjB,CAAC;AACN,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {PlusOutlined} from '@ant-design/icons';\nimport {type ButtonProps} from 'antd';\nimport {themeVars} from '_ui/antdTheme';\nimport {BasicButton} from '_ui/components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\nimport {VersionFieldScope} from '../../_types';\n\ninterface IAddValueBtnProps extends ButtonProps {\n bordered?: boolean;\n linkField?: boolean;\n activeScope: VersionFieldScope;\n}\n\nfunction AddValueBtn({bordered = false, linkField = false, activeScope, ...props}: IAddValueBtnProps): JSX.Element {\n const {t} = useSharedTranslation();\n return (\n <BasicButton\n bordered={bordered}\n {...props}\n style={{\n color:\n activeScope === VersionFieldScope.INHERITED\n ? themeVars.inheritedValuesVersionColor\n : themeVars.defaultTextColor,\n }}\n >\n <PlusOutlined />\n {linkField ? t('record_edition.add_value_link') : t('record_edition.add_value')}\n </BasicButton>\n );\n}\n\nexport default AddValueBtn;\n"]}
@@ -1,2 +0,0 @@
1
- import AddValueBtn from './AddValueBtn';
2
- export default AddValueBtn;
@@ -1,6 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import AddValueBtn from './AddValueBtn';
5
- export default AddValueBtn;
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/AddValueBtn/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,eAAe,WAAW,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport AddValueBtn from './AddValueBtn';\n\nexport default AddValueBtn;\n"]}
@@ -1,5 +0,0 @@
1
- interface IDeleteAllValuesBtnProps {
2
- onDelete: () => Promise<void>;
3
- }
4
- declare function DeleteAllValuesBtn({ onDelete }: IDeleteAllValuesBtnProps): JSX.Element;
5
- export default DeleteAllValuesBtn;
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
3
- // This file is released under LGPL V3
4
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
5
- import { DeleteOutlined } from '@ant-design/icons';
6
- import { Popconfirm, Tooltip } from 'antd';
7
- import { useState } from 'react';
8
- import { BasicButton } from '../../../../../components';
9
- import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
10
- function DeleteAllValuesBtn({ onDelete }) {
11
- const { t } = useSharedTranslation();
12
- const [isLoading, setIsLoading] = useState(false);
13
- const _handleDelete = async () => {
14
- setIsLoading(true);
15
- await onDelete();
16
- setIsLoading(false);
17
- };
18
- return (_jsx(Popconfirm, { placement: "leftTop", title: t('record_edition.delete_all_values_confirm'), onConfirm: _handleDelete, okText: t('global.submit'), okButtonProps: { 'aria-label': 'delete-confirm-button' }, cancelText: t('global.cancel'), children: _jsx(_Fragment, { children: _jsx(Tooltip, { title: t('record_edition.delete_all_values'), children: _jsx(BasicButton, { "aria-label": "delete-all-values", icon: _jsx(DeleteOutlined, {}), shape: "circle", loading: isLoading }) }) }) }));
19
- }
20
- export default DeleteAllValuesBtn;
21
- //# sourceMappingURL=DeleteAllValuesBtn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeleteAllValuesBtn.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/shared/DeleteAllValuesBtn/DeleteAllValuesBtn.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,UAAU,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAMpE,SAAS,kBAAkB,CAAC,EAAC,QAAQ,EAA2B;IAC5D,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;QAC7B,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,QAAQ,EAAE,CAAC;QACjB,YAAY,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,IACP,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE,CAAC,CAAC,0CAA0C,CAAC,EACpD,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,CAAC,CAAC,eAAe,CAAC,EAC1B,aAAa,EAAE,EAAC,YAAY,EAAE,uBAAuB,EAAC,EACtD,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC,YAG9B,4BACI,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,CAAC,kCAAkC,CAAC,YACjD,KAAC,WAAW,kBACG,mBAAmB,EAC9B,IAAI,EAAE,KAAC,cAAc,KAAG,EACxB,KAAK,EAAC,QAAQ,EACd,OAAO,EAAE,SAAS,GACpB,GACI,GACX,GACM,CAChB,CAAC;AACN,CAAC;AAED,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {DeleteOutlined} from '@ant-design/icons';\nimport {Popconfirm, Tooltip} from 'antd';\nimport {useState} from 'react';\nimport {BasicButton} from '_ui/components';\nimport {useSharedTranslation} from '_ui/hooks/useSharedTranslation';\n\ninterface IDeleteAllValuesBtnProps {\n onDelete: () => Promise<void>;\n}\n\nfunction DeleteAllValuesBtn({onDelete}: IDeleteAllValuesBtnProps): JSX.Element {\n const {t} = useSharedTranslation();\n const [isLoading, setIsLoading] = useState(false);\n\n const _handleDelete = async () => {\n setIsLoading(true);\n await onDelete();\n setIsLoading(false);\n };\n\n return (\n <Popconfirm\n placement=\"leftTop\"\n title={t('record_edition.delete_all_values_confirm')}\n onConfirm={_handleDelete}\n okText={t('global.submit')}\n okButtonProps={{'aria-label': 'delete-confirm-button'}}\n cancelText={t('global.cancel')}\n >\n {/* Do not remove the <></>. Workaround for issue https://github.com/ant-design/ant-design/issues/41206 */}\n <>\n <Tooltip title={t('record_edition.delete_all_values')}>\n <BasicButton\n aria-label=\"delete-all-values\"\n icon={<DeleteOutlined />}\n shape=\"circle\"\n loading={isLoading}\n />\n </Tooltip>\n </>\n </Popconfirm>\n );\n}\n\nexport default DeleteAllValuesBtn;\n"]}
@@ -1,2 +0,0 @@
1
- import DeleteAllValuesBtn from './DeleteAllValuesBtn';
2
- export default DeleteAllValuesBtn;
@@ -1,6 +0,0 @@
1
- // Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
2
- // This file is released under LGPL V3
3
- // License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
4
- import DeleteAllValuesBtn from './DeleteAllValuesBtn';
5
- export default DeleteAllValuesBtn;
6
- //# sourceMappingURL=index.js.map