@leav/ui 1.5.0 → 1.5.1-170d77cc

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 (101) hide show
  1. package/dist/__mocks__/common/attribute.js +1 -0
  2. package/dist/__mocks__/common/attribute.js.map +1 -1
  3. package/dist/__mocks__/common/library.d.ts +9 -0
  4. package/dist/_gqlTypes/index.d.ts +222 -27
  5. package/dist/_gqlTypes/index.js +150 -12
  6. package/dist/_gqlTypes/index.js.map +1 -1
  7. package/dist/_queries/attributes/attributeDetailsFragment.js +1 -0
  8. package/dist/_queries/attributes/attributeDetailsFragment.js.map +1 -1
  9. package/dist/_queries/libraries/libraryDetailsFragment.js +7 -0
  10. package/dist/_queries/libraries/libraryDetailsFragment.js.map +1 -1
  11. package/dist/components/Explorer/DataView.js +4 -3
  12. package/dist/components/Explorer/DataView.js.map +1 -1
  13. package/dist/components/Explorer/Explorer.d.ts +1 -1
  14. package/dist/components/Explorer/Explorer.js +17 -4
  15. package/dist/components/Explorer/Explorer.js.map +1 -1
  16. package/dist/components/Explorer/ExplorerFiltersAndSorts.d.ts +1 -0
  17. package/dist/components/Explorer/ExplorerFiltersAndSorts.js +2 -2
  18. package/dist/components/Explorer/ExplorerFiltersAndSorts.js.map +1 -1
  19. package/dist/components/Explorer/ExplorerToolbar.d.ts +1 -0
  20. package/dist/components/Explorer/ExplorerToolbar.js +2 -2
  21. package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
  22. package/dist/components/Explorer/IdCard.js +2 -2
  23. package/dist/components/Explorer/IdCard.js.map +1 -1
  24. package/dist/components/Explorer/actions-mass/edit-attribute/EditAttributeMassActionModal.d.ts +13 -0
  25. package/dist/components/Explorer/actions-mass/edit-attribute/EditAttributeMassActionModal.js +20 -0
  26. package/dist/components/Explorer/actions-mass/edit-attribute/EditAttributeMassActionModal.js.map +1 -0
  27. package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValueLine.d.ts +10 -0
  28. package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValueLine.js +38 -0
  29. package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValueLine.js.map +1 -0
  30. package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValuesMapping.d.ts +8 -0
  31. package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValuesMapping.js +16 -0
  32. package/dist/components/Explorer/actions-mass/edit-attribute/EditTreeAttributeValuesMapping.js.map +1 -0
  33. package/dist/components/Explorer/actions-mass/edit-attribute/useCountValuesOccurrencesHook.d.ts +10 -0
  34. package/dist/components/Explorer/actions-mass/edit-attribute/useCountValuesOccurrencesHook.js +28 -0
  35. package/dist/components/Explorer/actions-mass/edit-attribute/useCountValuesOccurrencesHook.js.map +1 -0
  36. package/dist/components/Explorer/actions-mass/edit-attribute/useListEditableAttributeHook.d.ts +5 -0
  37. package/dist/components/Explorer/actions-mass/edit-attribute/useListEditableAttributeHook.js +12 -0
  38. package/dist/components/Explorer/actions-mass/edit-attribute/useListEditableAttributeHook.js.map +1 -0
  39. package/dist/components/Explorer/actions-mass/edit-attribute/useListTreeAttributeValuesHook.d.ts +5 -0
  40. package/dist/components/Explorer/actions-mass/edit-attribute/useListTreeAttributeValuesHook.js +20 -0
  41. package/dist/components/Explorer/actions-mass/edit-attribute/useListTreeAttributeValuesHook.js.map +1 -0
  42. package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
  43. package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.d.ts +11 -0
  44. package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js +106 -0
  45. package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js.map +1 -0
  46. package/dist/components/Explorer/actions-mass/useExportMassAction.js +5 -6
  47. package/dist/components/Explorer/actions-mass/useExportMassAction.js.map +1 -1
  48. package/dist/components/Explorer/useLoadView.js +0 -2
  49. package/dist/components/Explorer/useLoadView.js.map +1 -1
  50. package/dist/components/Filters/_types.d.ts +4 -0
  51. package/dist/components/Filters/_types.js.map +1 -1
  52. package/dist/components/Filters/context/filtersReducer.js +20 -11
  53. package/dist/components/Filters/context/filtersReducer.js.map +1 -1
  54. package/dist/components/Filters/context/useFiltersReducer.d.ts +2 -1
  55. package/dist/components/Filters/context/useFiltersReducer.js +9 -5
  56. package/dist/components/Filters/context/useFiltersReducer.js.map +1 -1
  57. package/dist/components/Filters/context/useGetTreeFilters.d.ts +15 -0
  58. package/dist/components/Filters/context/useGetTreeFilters.js +63 -0
  59. package/dist/components/Filters/context/useGetTreeFilters.js.map +1 -0
  60. package/dist/components/Filters/filter-items/filter-type/TextAttributeDropDown.js +24 -7
  61. package/dist/components/Filters/filter-items/filter-type/TextAttributeDropDown.js.map +1 -1
  62. package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js +15 -17
  63. package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js.map +1 -1
  64. package/dist/components/Filters/index.js.map +1 -1
  65. package/dist/components/Filters/prepareFiltersForRequest.js +14 -5
  66. package/dist/components/Filters/prepareFiltersForRequest.js.map +1 -1
  67. package/dist/components/Filters/useFilters.d.ts +4 -0
  68. package/dist/components/Filters/useTransformFilters.d.ts +5 -1
  69. package/dist/components/Filters/useTransformFilters.js +26 -3
  70. package/dist/components/Filters/useTransformFilters.js.map +1 -1
  71. package/dist/components/LibraryPicker/LibrariesList/LibrariesList.js +1 -1
  72. package/dist/components/LibraryPicker/LibrariesList/LibrariesList.js.map +1 -1
  73. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js +1 -1
  74. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js.map +1 -1
  75. package/dist/components/RecordHistory/RecordHistory.js +11 -6
  76. package/dist/components/RecordHistory/RecordHistory.js.map +1 -1
  77. package/dist/components/RecordHistory/RecordHistoryLogEntry.js +13 -7
  78. package/dist/components/RecordHistory/RecordHistoryLogEntry.js.map +1 -1
  79. package/dist/components/SearchModal/SearchModal.js +1 -1
  80. package/dist/components/SearchModal/SearchModal.js.map +1 -1
  81. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +4 -1
  82. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
  83. package/dist/components/TreePicker/TreesList/TreesList.js +1 -1
  84. package/dist/components/TreePicker/TreesList/TreesList.js.map +1 -1
  85. package/dist/constants.d.ts +1 -0
  86. package/dist/constants.js +1 -0
  87. package/dist/constants.js.map +1 -1
  88. package/dist/hooks/useIFrameMessenger/messageHandlers.d.ts +3 -1
  89. package/dist/hooks/useIFrameMessenger/messageHandlers.js +12 -0
  90. package/dist/hooks/useIFrameMessenger/messageHandlers.js.map +1 -1
  91. package/dist/hooks/useIFrameMessenger/schema.d.ts +38 -4
  92. package/dist/hooks/useIFrameMessenger/schema.js +10 -5
  93. package/dist/hooks/useIFrameMessenger/schema.js.map +1 -1
  94. package/dist/hooks/useIFrameMessenger/types.d.ts +20 -2
  95. package/dist/hooks/useIFrameMessenger/types.js.map +1 -1
  96. package/dist/hooks/useIFrameMessenger/useIFrameMessenger.d.ts +2 -0
  97. package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.d.ts +2 -0
  98. package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.d.ts +2 -0
  99. package/dist/locales/en/shared.json +14 -2
  100. package/dist/locales/fr/shared.json +14 -2
  101. package/package.json +6 -7
@@ -88,17 +88,6 @@ export var FormsSortableFields;
88
88
  FormsSortableFields["library"] = "library";
89
89
  FormsSortableFields["system"] = "system";
90
90
  })(FormsSortableFields || (FormsSortableFields = {}));
91
- export var GenerationStatus;
92
- (function (GenerationStatus) {
93
- GenerationStatus["DONE"] = "DONE";
94
- GenerationStatus["GENERATION_FAILED"] = "GENERATION_FAILED";
95
- GenerationStatus["GENERATION_IN_PROGRESS"] = "GENERATION_IN_PROGRESS";
96
- GenerationStatus["GENERATION_IN_PROGRESS_WITH_FAILURE"] = "GENERATION_IN_PROGRESS_WITH_FAILURE";
97
- GenerationStatus["PREPARATION_FAILED"] = "PREPARATION_FAILED";
98
- GenerationStatus["PREPARATION_IN_PROGRESS"] = "PREPARATION_IN_PROGRESS";
99
- GenerationStatus["TRANSMISSION_FAILED"] = "TRANSMISSION_FAILED";
100
- GenerationStatus["TRANSMISSION_IN_PROGRESS"] = "TRANSMISSION_IN_PROGRESS";
101
- })(GenerationStatus || (GenerationStatus = {}));
102
91
  export var IoTypes;
103
92
  (function (IoTypes) {
104
93
  IoTypes["boolean"] = "boolean";
@@ -180,7 +169,9 @@ export var MultiDisplayOption;
180
169
  })(MultiDisplayOption || (MultiDisplayOption = {}));
181
170
  export var NotificationLevel;
182
171
  (function (NotificationLevel) {
172
+ NotificationLevel["error"] = "error";
183
173
  NotificationLevel["info"] = "info";
174
+ NotificationLevel["success"] = "success";
184
175
  NotificationLevel["warning"] = "warning";
185
176
  })(NotificationLevel || (NotificationLevel = {}));
186
177
  export var PermissionTypes;
@@ -316,6 +307,7 @@ export var TaskType;
316
307
  TaskType["IMPORT_CONFIG"] = "IMPORT_CONFIG";
317
308
  TaskType["IMPORT_DATA"] = "IMPORT_DATA";
318
309
  TaskType["INDEXATION"] = "INDEXATION";
310
+ TaskType["SAVE_VALUE_BULK"] = "SAVE_VALUE_BULK";
319
311
  })(TaskType || (TaskType = {}));
320
312
  export var TreeBehavior;
321
313
  (function (TreeBehavior) {
@@ -404,6 +396,7 @@ export const AttributeDetailsFragmentDoc = gql `
404
396
  readonly
405
397
  label
406
398
  description
399
+ required
407
400
  multiple_values
408
401
  multi_link_display_option
409
402
  multi_tree_display_option
@@ -509,6 +502,13 @@ export const LibraryLinkAttributeDetailsFragmentDoc = gql `
509
502
  }
510
503
  }
511
504
  `;
505
+ export const LibraryTreeAttributeDetailsFragmentDoc = gql `
506
+ fragment LibraryTreeAttributeDetails on TreeAttribute {
507
+ linked_tree {
508
+ id
509
+ }
510
+ }
511
+ `;
512
512
  export const LibraryAttributesFragmentDoc = gql `
513
513
  fragment LibraryAttributes on Attribute {
514
514
  id
@@ -517,8 +517,10 @@ export const LibraryAttributesFragmentDoc = gql `
517
517
  type
518
518
  format
519
519
  ...LibraryLinkAttributeDetails
520
+ ...LibraryTreeAttributeDetails
520
521
  }
521
- ${LibraryLinkAttributeDetailsFragmentDoc}`;
522
+ ${LibraryLinkAttributeDetailsFragmentDoc}
523
+ ${LibraryTreeAttributeDetailsFragmentDoc}`;
522
524
  export const LibraryPreviewsSettingsFragmentDoc = gql `
523
525
  fragment LibraryPreviewsSettings on LibraryPreviewsSettings {
524
526
  label
@@ -949,6 +951,7 @@ export const AttributesByLibAttributeWithPermissionsFragmentDoc = gql `
949
951
  label
950
952
  multiple_values
951
953
  system
954
+ required
952
955
  readonly
953
956
  compute
954
957
  permissions {
@@ -3111,6 +3114,40 @@ export function useSaveValueBatchMutation(baseOptions) {
3111
3114
  const options = { ...defaultOptions, ...baseOptions };
3112
3115
  return Apollo.useMutation(SaveValueBatchDocument, options);
3113
3116
  }
3117
+ export const SaveValueBulkDocument = gql `
3118
+ mutation SAVE_VALUE_BULK($libraryId: ID!, $recordsFilters: [RecordFilterInput]!, $attributeId: ID!, $mapValues: [MapValueInput!]!) {
3119
+ saveValueBulk(
3120
+ libraryId: $libraryId
3121
+ recordsFilters: $recordsFilters
3122
+ attributeId: $attributeId
3123
+ mapValues: $mapValues
3124
+ )
3125
+ }
3126
+ `;
3127
+ /**
3128
+ * __useSaveValueBulkMutation__
3129
+ *
3130
+ * To run a mutation, you first call `useSaveValueBulkMutation` within a React component and pass it any options that fit your needs.
3131
+ * When your component renders, `useSaveValueBulkMutation` returns a tuple that includes:
3132
+ * - A mutate function that you can call at any time to execute the mutation
3133
+ * - An object with fields that represent the current status of the mutation's execution
3134
+ *
3135
+ * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
3136
+ *
3137
+ * @example
3138
+ * const [saveValueBulkMutation, { data, loading, error }] = useSaveValueBulkMutation({
3139
+ * variables: {
3140
+ * libraryId: // value for 'libraryId'
3141
+ * recordsFilters: // value for 'recordsFilters'
3142
+ * attributeId: // value for 'attributeId'
3143
+ * mapValues: // value for 'mapValues'
3144
+ * },
3145
+ * });
3146
+ */
3147
+ export function useSaveValueBulkMutation(baseOptions) {
3148
+ const options = { ...defaultOptions, ...baseOptions };
3149
+ return Apollo.useMutation(SaveValueBulkDocument, options);
3150
+ }
3114
3151
  export const DeleteViewDocument = gql `
3115
3152
  mutation DELETE_VIEW($viewId: String!) {
3116
3153
  deleteView(viewId: $viewId) {
@@ -3241,6 +3278,58 @@ export function useSaveViewMutation(baseOptions) {
3241
3278
  const options = { ...defaultOptions, ...baseOptions };
3242
3279
  return Apollo.useMutation(SaveViewDocument, options);
3243
3280
  }
3281
+ export const TreeFilterByDefaultValuesDocument = gql `
3282
+ query TreeFilterByDefaultValues($treeId: ID!, $accessRecordByDefaultPermission: AccessRecordByDefaultPermissionInput) {
3283
+ treeNodeChildren(
3284
+ treeId: $treeId
3285
+ accessRecordByDefaultPermission: $accessRecordByDefaultPermission
3286
+ ) {
3287
+ list {
3288
+ accessRecordByDefaultPermission
3289
+ id
3290
+ record {
3291
+ id
3292
+ whoAmI {
3293
+ label
3294
+ id
3295
+ library {
3296
+ id
3297
+ }
3298
+ }
3299
+ }
3300
+ }
3301
+ }
3302
+ }
3303
+ `;
3304
+ /**
3305
+ * __useTreeFilterByDefaultValuesQuery__
3306
+ *
3307
+ * To run a query within a React component, call `useTreeFilterByDefaultValuesQuery` and pass it any options that fit your needs.
3308
+ * When your component renders, `useTreeFilterByDefaultValuesQuery` returns an object from Apollo Client that contains loading, error, and data properties
3309
+ * you can use to render your UI.
3310
+ *
3311
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
3312
+ *
3313
+ * @example
3314
+ * const { data, loading, error } = useTreeFilterByDefaultValuesQuery({
3315
+ * variables: {
3316
+ * treeId: // value for 'treeId'
3317
+ * accessRecordByDefaultPermission: // value for 'accessRecordByDefaultPermission'
3318
+ * },
3319
+ * });
3320
+ */
3321
+ export function useTreeFilterByDefaultValuesQuery(baseOptions) {
3322
+ const options = { ...defaultOptions, ...baseOptions };
3323
+ return Apollo.useQuery(TreeFilterByDefaultValuesDocument, options);
3324
+ }
3325
+ export function useTreeFilterByDefaultValuesLazyQuery(baseOptions) {
3326
+ const options = { ...defaultOptions, ...baseOptions };
3327
+ return Apollo.useLazyQuery(TreeFilterByDefaultValuesDocument, options);
3328
+ }
3329
+ export function useTreeFilterByDefaultValuesSuspenseQuery(baseOptions) {
3330
+ const options = { ...defaultOptions, ...baseOptions };
3331
+ return Apollo.useSuspenseQuery(TreeFilterByDefaultValuesDocument, options);
3332
+ }
3244
3333
  export const GetAttributesByLibWithPermissionsDocument = gql `
3245
3334
  query getAttributesByLibWithPermissions($library: String!) {
3246
3335
  attributes(filters: {libraries: [$library]}) {
@@ -3371,6 +3460,55 @@ export function useExplorerLinkAttributeSuspenseQuery(baseOptions) {
3371
3460
  const options = { ...defaultOptions, ...baseOptions };
3372
3461
  return Apollo.useSuspenseQuery(ExplorerLinkAttributeDocument, options);
3373
3462
  }
3463
+ export const CountValuesOccurrencesDocument = gql `
3464
+ query CountValuesOccurrences($library: ID!, $attribute: ID!, $recordFilters: [RecordFilterInput]) {
3465
+ countValuesOccurrences(
3466
+ library: $library
3467
+ attribute: $attribute
3468
+ recordFilters: $recordFilters
3469
+ ) {
3470
+ noValueCount
3471
+ occurrences {
3472
+ ... on TreeValueOccurrences {
3473
+ value {
3474
+ id
3475
+ }
3476
+ }
3477
+ count
3478
+ }
3479
+ }
3480
+ }
3481
+ `;
3482
+ /**
3483
+ * __useCountValuesOccurrencesQuery__
3484
+ *
3485
+ * To run a query within a React component, call `useCountValuesOccurrencesQuery` and pass it any options that fit your needs.
3486
+ * When your component renders, `useCountValuesOccurrencesQuery` returns an object from Apollo Client that contains loading, error, and data properties
3487
+ * you can use to render your UI.
3488
+ *
3489
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
3490
+ *
3491
+ * @example
3492
+ * const { data, loading, error } = useCountValuesOccurrencesQuery({
3493
+ * variables: {
3494
+ * library: // value for 'library'
3495
+ * attribute: // value for 'attribute'
3496
+ * recordFilters: // value for 'recordFilters'
3497
+ * },
3498
+ * });
3499
+ */
3500
+ export function useCountValuesOccurrencesQuery(baseOptions) {
3501
+ const options = { ...defaultOptions, ...baseOptions };
3502
+ return Apollo.useQuery(CountValuesOccurrencesDocument, options);
3503
+ }
3504
+ export function useCountValuesOccurrencesLazyQuery(baseOptions) {
3505
+ const options = { ...defaultOptions, ...baseOptions };
3506
+ return Apollo.useLazyQuery(CountValuesOccurrencesDocument, options);
3507
+ }
3508
+ export function useCountValuesOccurrencesSuspenseQuery(baseOptions) {
3509
+ const options = { ...defaultOptions, ...baseOptions };
3510
+ return Apollo.useSuspenseQuery(CountValuesOccurrencesDocument, options);
3511
+ }
3374
3512
  export const ExplorerLibraryDataDocument = gql `
3375
3513
  query ExplorerLibraryData($libraryId: ID!, $attributeIds: [ID!]!, $pagination: RecordsPagination, $filters: [RecordFilterInput], $multipleSort: [RecordSortInput!], $searchQuery: String) {
3376
3514
  records(