@leav/ui 1.8.0-73498354 → 1.8.0-c4bc6f9a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_gqlTypes/index.d.ts +54 -72
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.d.ts +2 -2
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/_types.js.map +1 -1
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.d.ts +2 -2
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js.map +1 -1
- package/dist/components/Notifications/hooks/useNotificationSubscription.d.ts +3 -9
- package/dist/hooks/useGetLibraryDetailExtendedQuery/useGetLibraryDetailExtendedQuery.d.ts +1 -1
- package/dist/hooks/useGetRecordUpdatesSubscription/useGetRecordUpdatesSubscription.d.ts +3 -9
- package/dist/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.js.map +1 -1
- package/package.json +2 -2
|
@@ -8215,7 +8215,7 @@ export declare const CheckApplicationExistenceDocument: Apollo.DocumentNode;
|
|
|
8215
8215
|
* },
|
|
8216
8216
|
* });
|
|
8217
8217
|
*/
|
|
8218
|
-
export declare function useCheckApplicationExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckApplicationExistenceQuery, CheckApplicationExistenceQueryVariables>): Apollo.
|
|
8218
|
+
export declare function useCheckApplicationExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckApplicationExistenceQuery, CheckApplicationExistenceQueryVariables>): Apollo.QueryResult<CheckApplicationExistenceQuery, Exact<{
|
|
8219
8219
|
id?: InputMaybe<Scalars["ID"]["input"]>;
|
|
8220
8220
|
endpoint?: InputMaybe<Scalars["String"]["input"]>;
|
|
8221
8221
|
}>>;
|
|
@@ -8251,7 +8251,7 @@ export declare function useGetApplicationByIdQuery(baseOptions: Apollo.QueryHook
|
|
|
8251
8251
|
skip?: boolean;
|
|
8252
8252
|
} | {
|
|
8253
8253
|
skip: boolean;
|
|
8254
|
-
})): Apollo.
|
|
8254
|
+
})): Apollo.QueryResult<GetApplicationByIdQuery, Exact<{
|
|
8255
8255
|
id: Scalars["ID"]["input"];
|
|
8256
8256
|
}>>;
|
|
8257
8257
|
export declare function useGetApplicationByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetApplicationByIdQuery, GetApplicationByIdQueryVariables>): Apollo.LazyQueryResultTuple<GetApplicationByIdQuery, Exact<{
|
|
@@ -8279,7 +8279,7 @@ export declare const GetApplicationModulesDocument: Apollo.DocumentNode;
|
|
|
8279
8279
|
* },
|
|
8280
8280
|
* });
|
|
8281
8281
|
*/
|
|
8282
|
-
export declare function useGetApplicationModulesQuery(baseOptions?: Apollo.QueryHookOptions<GetApplicationModulesQuery, GetApplicationModulesQueryVariables>): Apollo.
|
|
8282
|
+
export declare function useGetApplicationModulesQuery(baseOptions?: Apollo.QueryHookOptions<GetApplicationModulesQuery, GetApplicationModulesQueryVariables>): Apollo.QueryResult<GetApplicationModulesQuery, Exact<{
|
|
8283
8283
|
[key: string]: never;
|
|
8284
8284
|
}>>;
|
|
8285
8285
|
export declare function useGetApplicationModulesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetApplicationModulesQuery, GetApplicationModulesQueryVariables>): Apollo.LazyQueryResultTuple<GetApplicationModulesQuery, Exact<{
|
|
@@ -8338,7 +8338,7 @@ export declare function useCheckAttributeExistenceQuery(baseOptions: Apollo.Quer
|
|
|
8338
8338
|
skip?: boolean;
|
|
8339
8339
|
} | {
|
|
8340
8340
|
skip: boolean;
|
|
8341
|
-
})): Apollo.
|
|
8341
|
+
})): Apollo.QueryResult<CheckAttributeExistenceQuery, Exact<{
|
|
8342
8342
|
id: Scalars["ID"]["input"];
|
|
8343
8343
|
}>>;
|
|
8344
8344
|
export declare function useCheckAttributeExistenceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CheckAttributeExistenceQuery, CheckAttributeExistenceQueryVariables>): Apollo.LazyQueryResultTuple<CheckAttributeExistenceQuery, Exact<{
|
|
@@ -8392,7 +8392,7 @@ export declare const GetAttributeByIdDocument: Apollo.DocumentNode;
|
|
|
8392
8392
|
* },
|
|
8393
8393
|
* });
|
|
8394
8394
|
*/
|
|
8395
|
-
export declare function useGetAttributeByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetAttributeByIdQuery, GetAttributeByIdQueryVariables>): Apollo.
|
|
8395
|
+
export declare function useGetAttributeByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetAttributeByIdQuery, GetAttributeByIdQueryVariables>): Apollo.QueryResult<GetAttributeByIdQuery, Exact<{
|
|
8396
8396
|
id?: InputMaybe<Scalars["ID"]["input"]>;
|
|
8397
8397
|
}>>;
|
|
8398
8398
|
export declare function useGetAttributeByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAttributeByIdQuery, GetAttributeByIdQueryVariables>): Apollo.LazyQueryResultTuple<GetAttributeByIdQuery, Exact<{
|
|
@@ -8426,7 +8426,7 @@ export declare function useGetAttributesByLibQuery(baseOptions: Apollo.QueryHook
|
|
|
8426
8426
|
skip?: boolean;
|
|
8427
8427
|
} | {
|
|
8428
8428
|
skip: boolean;
|
|
8429
|
-
})): Apollo.
|
|
8429
|
+
})): Apollo.QueryResult<GetAttributesByLibQuery, Exact<{
|
|
8430
8430
|
library: Scalars["String"]["input"];
|
|
8431
8431
|
}>>;
|
|
8432
8432
|
export declare function useGetAttributesByLibLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAttributesByLibQuery, GetAttributesByLibQueryVariables>): Apollo.LazyQueryResultTuple<GetAttributesByLibQuery, Exact<{
|
|
@@ -8457,7 +8457,7 @@ export declare const GetAttributesDocument: Apollo.DocumentNode;
|
|
|
8457
8457
|
* },
|
|
8458
8458
|
* });
|
|
8459
8459
|
*/
|
|
8460
|
-
export declare function useGetAttributesQuery(baseOptions?: Apollo.QueryHookOptions<GetAttributesQuery, GetAttributesQueryVariables>): Apollo.
|
|
8460
|
+
export declare function useGetAttributesQuery(baseOptions?: Apollo.QueryHookOptions<GetAttributesQuery, GetAttributesQueryVariables>): Apollo.QueryResult<GetAttributesQuery, Exact<{
|
|
8461
8461
|
pagination?: InputMaybe<Pagination>;
|
|
8462
8462
|
sort?: InputMaybe<SortAttributes>;
|
|
8463
8463
|
filters?: InputMaybe<AttributesFiltersInput>;
|
|
@@ -8491,7 +8491,7 @@ export declare const GetVersionProfilesDocument: Apollo.DocumentNode;
|
|
|
8491
8491
|
* },
|
|
8492
8492
|
* });
|
|
8493
8493
|
*/
|
|
8494
|
-
export declare function useGetVersionProfilesQuery(baseOptions?: Apollo.QueryHookOptions<GetVersionProfilesQuery, GetVersionProfilesQueryVariables>): Apollo.
|
|
8494
|
+
export declare function useGetVersionProfilesQuery(baseOptions?: Apollo.QueryHookOptions<GetVersionProfilesQuery, GetVersionProfilesQueryVariables>): Apollo.QueryResult<GetVersionProfilesQuery, Exact<{
|
|
8495
8495
|
filters?: InputMaybe<VersionProfilesFiltersInput>;
|
|
8496
8496
|
sort?: InputMaybe<SortVersionProfilesInput>;
|
|
8497
8497
|
}>>;
|
|
@@ -8527,7 +8527,7 @@ export declare function useGetVersionableAttributesByLibraryQuery(baseOptions: A
|
|
|
8527
8527
|
skip?: boolean;
|
|
8528
8528
|
} | {
|
|
8529
8529
|
skip: boolean;
|
|
8530
|
-
})): Apollo.
|
|
8530
|
+
})): Apollo.QueryResult<GetVersionableAttributesByLibraryQuery, Exact<{
|
|
8531
8531
|
libraryId: Scalars["String"]["input"];
|
|
8532
8532
|
}>>;
|
|
8533
8533
|
export declare function useGetVersionableAttributesByLibraryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetVersionableAttributesByLibraryQuery, GetVersionableAttributesByLibraryQueryVariables>): Apollo.LazyQueryResultTuple<GetVersionableAttributesByLibraryQuery, Exact<{
|
|
@@ -8588,7 +8588,7 @@ export declare function useExportQuery(baseOptions: Apollo.QueryHookOptions<Expo
|
|
|
8588
8588
|
skip?: boolean;
|
|
8589
8589
|
} | {
|
|
8590
8590
|
skip: boolean;
|
|
8591
|
-
})): Apollo.
|
|
8591
|
+
})): Apollo.QueryResult<ExportQuery, Exact<{
|
|
8592
8592
|
library: Scalars["ID"]["input"];
|
|
8593
8593
|
filters?: InputMaybe<Array<RecordFilterInput> | RecordFilterInput>;
|
|
8594
8594
|
profile?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -8689,7 +8689,7 @@ export declare function useGetDirectoryDataQuery(baseOptions: Apollo.QueryHookOp
|
|
|
8689
8689
|
skip?: boolean;
|
|
8690
8690
|
} | {
|
|
8691
8691
|
skip: boolean;
|
|
8692
|
-
})): Apollo.
|
|
8692
|
+
})): Apollo.QueryResult<GetDirectoryDataQuery, Exact<{
|
|
8693
8693
|
library: Scalars["ID"]["input"];
|
|
8694
8694
|
directoryId: Scalars["String"]["input"];
|
|
8695
8695
|
}>>;
|
|
@@ -8720,15 +8720,9 @@ export declare const UploadUpdateDocument: Apollo.DocumentNode;
|
|
|
8720
8720
|
* },
|
|
8721
8721
|
* });
|
|
8722
8722
|
*/
|
|
8723
|
-
export declare function useUploadUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions<UploadUpdateSubscription, UploadUpdateSubscriptionVariables>): {
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
data?: UploadUpdateSubscription;
|
|
8727
|
-
error?: Apollo.ApolloError;
|
|
8728
|
-
variables?: Exact<{
|
|
8729
|
-
filters?: InputMaybe<UploadFiltersInput>;
|
|
8730
|
-
}>;
|
|
8731
|
-
};
|
|
8723
|
+
export declare function useUploadUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions<UploadUpdateSubscription, UploadUpdateSubscriptionVariables>): Apollo.SubscriptionResult<UploadUpdateSubscription, Exact<{
|
|
8724
|
+
filters?: InputMaybe<UploadFiltersInput>;
|
|
8725
|
+
}>>;
|
|
8732
8726
|
export type UploadUpdateSubscriptionHookResult = ReturnType<typeof useUploadUpdateSubscription>;
|
|
8733
8727
|
export type UploadUpdateSubscriptionResult = Apollo.SubscriptionResult<UploadUpdateSubscription>;
|
|
8734
8728
|
export declare const UploadDocument: Apollo.DocumentNode;
|
|
@@ -8806,7 +8800,7 @@ export declare const CheckLibraryExistenceDocument: Apollo.DocumentNode;
|
|
|
8806
8800
|
* },
|
|
8807
8801
|
* });
|
|
8808
8802
|
*/
|
|
8809
|
-
export declare function useCheckLibraryExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckLibraryExistenceQuery, CheckLibraryExistenceQueryVariables>): Apollo.
|
|
8803
|
+
export declare function useCheckLibraryExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckLibraryExistenceQuery, CheckLibraryExistenceQueryVariables>): Apollo.QueryResult<CheckLibraryExistenceQuery, Exact<{
|
|
8810
8804
|
id?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
8811
8805
|
}>>;
|
|
8812
8806
|
export declare function useCheckLibraryExistenceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CheckLibraryExistenceQuery, CheckLibraryExistenceQueryVariables>): Apollo.LazyQueryResultTuple<CheckLibraryExistenceQuery, Exact<{
|
|
@@ -8859,7 +8853,7 @@ export declare const GetLibrariesDocument: Apollo.DocumentNode;
|
|
|
8859
8853
|
* },
|
|
8860
8854
|
* });
|
|
8861
8855
|
*/
|
|
8862
|
-
export declare function useGetLibrariesQuery(baseOptions?: Apollo.QueryHookOptions<GetLibrariesQuery, GetLibrariesQueryVariables>): Apollo.
|
|
8856
|
+
export declare function useGetLibrariesQuery(baseOptions?: Apollo.QueryHookOptions<GetLibrariesQuery, GetLibrariesQueryVariables>): Apollo.QueryResult<GetLibrariesQuery, Exact<{
|
|
8863
8857
|
[key: string]: never;
|
|
8864
8858
|
}>>;
|
|
8865
8859
|
export declare function useGetLibrariesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibrariesQuery, GetLibrariesQueryVariables>): Apollo.LazyQueryResultTuple<GetLibrariesQuery, Exact<{
|
|
@@ -8888,7 +8882,7 @@ export declare const GetLibraryByIdDocument: Apollo.DocumentNode;
|
|
|
8888
8882
|
* },
|
|
8889
8883
|
* });
|
|
8890
8884
|
*/
|
|
8891
|
-
export declare function useGetLibraryByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetLibraryByIdQuery, GetLibraryByIdQueryVariables>): Apollo.
|
|
8885
|
+
export declare function useGetLibraryByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetLibraryByIdQuery, GetLibraryByIdQueryVariables>): Apollo.QueryResult<GetLibraryByIdQuery, Exact<{
|
|
8892
8886
|
id?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
8893
8887
|
}>>;
|
|
8894
8888
|
export declare function useGetLibraryByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibraryByIdQuery, GetLibraryByIdQueryVariables>): Apollo.LazyQueryResultTuple<GetLibraryByIdQuery, Exact<{
|
|
@@ -8917,7 +8911,7 @@ export declare const GetLibraryPermissionsDocument: Apollo.DocumentNode;
|
|
|
8917
8911
|
* },
|
|
8918
8912
|
* });
|
|
8919
8913
|
*/
|
|
8920
|
-
export declare function useGetLibraryPermissionsQuery(baseOptions?: Apollo.QueryHookOptions<GetLibraryPermissionsQuery, GetLibraryPermissionsQueryVariables>): Apollo.
|
|
8914
|
+
export declare function useGetLibraryPermissionsQuery(baseOptions?: Apollo.QueryHookOptions<GetLibraryPermissionsQuery, GetLibraryPermissionsQueryVariables>): Apollo.QueryResult<GetLibraryPermissionsQuery, Exact<{
|
|
8921
8915
|
libraryId?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
8922
8916
|
}>>;
|
|
8923
8917
|
export declare function useGetLibraryPermissionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibraryPermissionsQuery, GetLibraryPermissionsQueryVariables>): Apollo.LazyQueryResultTuple<GetLibraryPermissionsQuery, Exact<{
|
|
@@ -8951,7 +8945,7 @@ export declare function useGetLibraryPreviewsSettingsQuery(baseOptions: Apollo.Q
|
|
|
8951
8945
|
skip?: boolean;
|
|
8952
8946
|
} | {
|
|
8953
8947
|
skip: boolean;
|
|
8954
|
-
})): Apollo.
|
|
8948
|
+
})): Apollo.QueryResult<GetLibraryPreviewsSettingsQuery, Exact<{
|
|
8955
8949
|
id: Scalars["ID"]["input"];
|
|
8956
8950
|
}>>;
|
|
8957
8951
|
export declare function useGetLibraryPreviewsSettingsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibraryPreviewsSettingsQuery, GetLibraryPreviewsSettingsQueryVariables>): Apollo.LazyQueryResultTuple<GetLibraryPreviewsSettingsQuery, Exact<{
|
|
@@ -9013,7 +9007,7 @@ export declare function useIsAllowedQuery(baseOptions: Apollo.QueryHookOptions<I
|
|
|
9013
9007
|
skip?: boolean;
|
|
9014
9008
|
} | {
|
|
9015
9009
|
skip: boolean;
|
|
9016
|
-
})): Apollo.
|
|
9010
|
+
})): Apollo.QueryResult<IsAllowedQuery, Exact<{
|
|
9017
9011
|
type: PermissionTypes;
|
|
9018
9012
|
actions: Array<PermissionsActions> | PermissionsActions;
|
|
9019
9013
|
applyTo?: InputMaybe<Scalars["ID"]["input"]>;
|
|
@@ -9194,7 +9188,7 @@ export declare function useDoesFileExistAsChildQuery(baseOptions: Apollo.QueryHo
|
|
|
9194
9188
|
skip?: boolean;
|
|
9195
9189
|
} | {
|
|
9196
9190
|
skip: boolean;
|
|
9197
|
-
})): Apollo.
|
|
9191
|
+
})): Apollo.QueryResult<DoesFileExistAsChildQuery, Exact<{
|
|
9198
9192
|
parentNode?: InputMaybe<Scalars["ID"]["input"]>;
|
|
9199
9193
|
treeId: Scalars["ID"]["input"];
|
|
9200
9194
|
filename: Scalars["String"]["input"];
|
|
@@ -9234,7 +9228,7 @@ export declare function useGetFileDataQuery(baseOptions: Apollo.QueryHookOptions
|
|
|
9234
9228
|
skip?: boolean;
|
|
9235
9229
|
} | {
|
|
9236
9230
|
skip: boolean;
|
|
9237
|
-
})): Apollo.
|
|
9231
|
+
})): Apollo.QueryResult<GetFileDataQuery, Exact<{
|
|
9238
9232
|
library: Scalars["ID"]["input"];
|
|
9239
9233
|
fileId: Scalars["String"]["input"];
|
|
9240
9234
|
previewsStatusAttribute: Scalars["ID"]["input"];
|
|
@@ -9275,7 +9269,7 @@ export declare function useRecordFormQuery(baseOptions: Apollo.QueryHookOptions<
|
|
|
9275
9269
|
skip?: boolean;
|
|
9276
9270
|
} | {
|
|
9277
9271
|
skip: boolean;
|
|
9278
|
-
})): Apollo.
|
|
9272
|
+
})): Apollo.QueryResult<RecordFormQuery, Exact<{
|
|
9279
9273
|
libraryId: Scalars["String"]["input"];
|
|
9280
9274
|
formId: Scalars["String"]["input"];
|
|
9281
9275
|
recordId?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -9310,15 +9304,9 @@ export declare const RecordUpdateDocument: Apollo.DocumentNode;
|
|
|
9310
9304
|
* },
|
|
9311
9305
|
* });
|
|
9312
9306
|
*/
|
|
9313
|
-
export declare function useRecordUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions<RecordUpdateSubscription, RecordUpdateSubscriptionVariables>): {
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
data?: RecordUpdateSubscription;
|
|
9317
|
-
error?: Apollo.ApolloError;
|
|
9318
|
-
variables?: Exact<{
|
|
9319
|
-
filters?: InputMaybe<RecordUpdateFilterInput>;
|
|
9320
|
-
}>;
|
|
9321
|
-
};
|
|
9307
|
+
export declare function useRecordUpdateSubscription(baseOptions?: Apollo.SubscriptionHookOptions<RecordUpdateSubscription, RecordUpdateSubscriptionVariables>): Apollo.SubscriptionResult<RecordUpdateSubscription, Exact<{
|
|
9308
|
+
filters?: InputMaybe<RecordUpdateFilterInput>;
|
|
9309
|
+
}>>;
|
|
9322
9310
|
export type RecordUpdateSubscriptionHookResult = ReturnType<typeof useRecordUpdateSubscription>;
|
|
9323
9311
|
export type RecordUpdateSubscriptionResult = Apollo.SubscriptionResult<RecordUpdateSubscription>;
|
|
9324
9312
|
export declare const GetRecordsFromLibraryDocument: Apollo.DocumentNode;
|
|
@@ -9345,7 +9333,7 @@ export declare function useGetRecordsFromLibraryQuery(baseOptions: Apollo.QueryH
|
|
|
9345
9333
|
skip?: boolean;
|
|
9346
9334
|
} | {
|
|
9347
9335
|
skip: boolean;
|
|
9348
|
-
})): Apollo.
|
|
9336
|
+
})): Apollo.QueryResult<GetRecordsFromLibraryQuery, Exact<{
|
|
9349
9337
|
libraryId: Scalars["ID"]["input"];
|
|
9350
9338
|
pagination?: InputMaybe<RecordsPagination>;
|
|
9351
9339
|
filters?: InputMaybe<Array<InputMaybe<RecordFilterInput>> | InputMaybe<RecordFilterInput>>;
|
|
@@ -9457,7 +9445,7 @@ export declare const CheckTreeExistenceDocument: Apollo.DocumentNode;
|
|
|
9457
9445
|
* },
|
|
9458
9446
|
* });
|
|
9459
9447
|
*/
|
|
9460
|
-
export declare function useCheckTreeExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckTreeExistenceQuery, CheckTreeExistenceQueryVariables>): Apollo.
|
|
9448
|
+
export declare function useCheckTreeExistenceQuery(baseOptions?: Apollo.QueryHookOptions<CheckTreeExistenceQuery, CheckTreeExistenceQueryVariables>): Apollo.QueryResult<CheckTreeExistenceQuery, Exact<{
|
|
9461
9449
|
id?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
9462
9450
|
}>>;
|
|
9463
9451
|
export declare function useCheckTreeExistenceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CheckTreeExistenceQuery, CheckTreeExistenceQueryVariables>): Apollo.LazyQueryResultTuple<CheckTreeExistenceQuery, Exact<{
|
|
@@ -9511,7 +9499,7 @@ export declare const GetTreeByIdDocument: Apollo.DocumentNode;
|
|
|
9511
9499
|
* },
|
|
9512
9500
|
* });
|
|
9513
9501
|
*/
|
|
9514
|
-
export declare function useGetTreeByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetTreeByIdQuery, GetTreeByIdQueryVariables>): Apollo.
|
|
9502
|
+
export declare function useGetTreeByIdQuery(baseOptions?: Apollo.QueryHookOptions<GetTreeByIdQuery, GetTreeByIdQueryVariables>): Apollo.QueryResult<GetTreeByIdQuery, Exact<{
|
|
9515
9503
|
id?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
9516
9504
|
}>>;
|
|
9517
9505
|
export declare function useGetTreeByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetTreeByIdQuery, GetTreeByIdQueryVariables>): Apollo.LazyQueryResultTuple<GetTreeByIdQuery, Exact<{
|
|
@@ -9541,7 +9529,7 @@ export declare const GetTreeLibrariesDocument: Apollo.DocumentNode;
|
|
|
9541
9529
|
* },
|
|
9542
9530
|
* });
|
|
9543
9531
|
*/
|
|
9544
|
-
export declare function useGetTreeLibrariesQuery(baseOptions?: Apollo.QueryHookOptions<GetTreeLibrariesQuery, GetTreeLibrariesQueryVariables>): Apollo.
|
|
9532
|
+
export declare function useGetTreeLibrariesQuery(baseOptions?: Apollo.QueryHookOptions<GetTreeLibrariesQuery, GetTreeLibrariesQueryVariables>): Apollo.QueryResult<GetTreeLibrariesQuery, Exact<{
|
|
9545
9533
|
treeId?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
9546
9534
|
library?: InputMaybe<Scalars["String"]["input"]>;
|
|
9547
9535
|
}>>;
|
|
@@ -9571,7 +9559,7 @@ export declare const GetTreesDocument: Apollo.DocumentNode;
|
|
|
9571
9559
|
* },
|
|
9572
9560
|
* });
|
|
9573
9561
|
*/
|
|
9574
|
-
export declare function useGetTreesQuery(baseOptions?: Apollo.QueryHookOptions<GetTreesQuery, GetTreesQueryVariables>): Apollo.
|
|
9562
|
+
export declare function useGetTreesQuery(baseOptions?: Apollo.QueryHookOptions<GetTreesQuery, GetTreesQueryVariables>): Apollo.QueryResult<GetTreesQuery, Exact<{
|
|
9575
9563
|
[key: string]: never;
|
|
9576
9564
|
}>>;
|
|
9577
9565
|
export declare function useGetTreesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetTreesQuery, GetTreesQueryVariables>): Apollo.LazyQueryResultTuple<GetTreesQuery, Exact<{
|
|
@@ -9634,7 +9622,7 @@ export declare function useTreeNodeChildrenQuery(baseOptions: Apollo.QueryHookOp
|
|
|
9634
9622
|
skip?: boolean;
|
|
9635
9623
|
} | {
|
|
9636
9624
|
skip: boolean;
|
|
9637
|
-
})): Apollo.
|
|
9625
|
+
})): Apollo.QueryResult<TreeNodeChildrenQuery, Exact<{
|
|
9638
9626
|
treeId: Scalars["ID"]["input"];
|
|
9639
9627
|
node?: InputMaybe<Scalars["ID"]["input"]>;
|
|
9640
9628
|
pagination?: InputMaybe<Pagination>;
|
|
@@ -9681,7 +9669,7 @@ export declare function useGetTreeNodeChildrenWithAccessByDefaultPermissionQuery
|
|
|
9681
9669
|
skip?: boolean;
|
|
9682
9670
|
} | {
|
|
9683
9671
|
skip: boolean;
|
|
9684
|
-
})): Apollo.
|
|
9672
|
+
})): Apollo.QueryResult<GetTreeNodeChildrenWithAccessByDefaultPermissionQueryQuery, Exact<{
|
|
9685
9673
|
treeId: Scalars["ID"]["input"];
|
|
9686
9674
|
node?: InputMaybe<Scalars["ID"]["input"]>;
|
|
9687
9675
|
pagination?: InputMaybe<Pagination>;
|
|
@@ -9726,7 +9714,7 @@ export declare function useGetUserDataQuery(baseOptions: Apollo.QueryHookOptions
|
|
|
9726
9714
|
skip?: boolean;
|
|
9727
9715
|
} | {
|
|
9728
9716
|
skip: boolean;
|
|
9729
|
-
})): Apollo.
|
|
9717
|
+
})): Apollo.QueryResult<GetUserDataQuery, Exact<{
|
|
9730
9718
|
keys: Array<Scalars["String"]["input"]> | Scalars["String"]["input"];
|
|
9731
9719
|
global?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
9732
9720
|
}>>;
|
|
@@ -9911,7 +9899,7 @@ export declare function useGetViewQuery(baseOptions: Apollo.QueryHookOptions<Get
|
|
|
9911
9899
|
skip?: boolean;
|
|
9912
9900
|
} | {
|
|
9913
9901
|
skip: boolean;
|
|
9914
|
-
})): Apollo.
|
|
9902
|
+
})): Apollo.QueryResult<GetViewQuery, Exact<{
|
|
9915
9903
|
viewId: Scalars["String"]["input"];
|
|
9916
9904
|
}>>;
|
|
9917
9905
|
export declare function useGetViewLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetViewQuery, GetViewQueryVariables>): Apollo.LazyQueryResultTuple<GetViewQuery, Exact<{
|
|
@@ -9945,7 +9933,7 @@ export declare function useGetViewsListQuery(baseOptions: Apollo.QueryHookOption
|
|
|
9945
9933
|
skip?: boolean;
|
|
9946
9934
|
} | {
|
|
9947
9935
|
skip: boolean;
|
|
9948
|
-
})): Apollo.
|
|
9936
|
+
})): Apollo.QueryResult<GetViewsListQuery, Exact<{
|
|
9949
9937
|
libraryId: Scalars["String"]["input"];
|
|
9950
9938
|
}>>;
|
|
9951
9939
|
export declare function useGetViewsListLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetViewsListQuery, GetViewsListQueryVariables>): Apollo.LazyQueryResultTuple<GetViewsListQuery, Exact<{
|
|
@@ -10004,7 +9992,7 @@ export declare function useAttributeWithValuesForMassEditionQuery(baseOptions: A
|
|
|
10004
9992
|
skip?: boolean;
|
|
10005
9993
|
} | {
|
|
10006
9994
|
skip: boolean;
|
|
10007
|
-
})): Apollo.
|
|
9995
|
+
})): Apollo.QueryResult<AttributeWithValuesForMassEditionQuery, Exact<{
|
|
10008
9996
|
attributeId: Scalars["ID"]["input"];
|
|
10009
9997
|
}>>;
|
|
10010
9998
|
export declare function useAttributeWithValuesForMassEditionLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AttributeWithValuesForMassEditionQuery, AttributeWithValuesForMassEditionQueryVariables>): Apollo.LazyQueryResultTuple<AttributeWithValuesForMassEditionQuery, Exact<{
|
|
@@ -10038,7 +10026,7 @@ export declare function useGetAttributesByLibWithPermissionsQuery(baseOptions: A
|
|
|
10038
10026
|
skip?: boolean;
|
|
10039
10027
|
} | {
|
|
10040
10028
|
skip: boolean;
|
|
10041
|
-
})): Apollo.
|
|
10029
|
+
})): Apollo.QueryResult<GetAttributesByLibWithPermissionsQuery, Exact<{
|
|
10042
10030
|
library: Scalars["String"]["input"];
|
|
10043
10031
|
}>>;
|
|
10044
10032
|
export declare function useGetAttributesByLibWithPermissionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAttributesByLibWithPermissionsQuery, GetAttributesByLibWithPermissionsQueryVariables>): Apollo.LazyQueryResultTuple<GetAttributesByLibWithPermissionsQuery, Exact<{
|
|
@@ -10067,7 +10055,7 @@ export declare const ExplorerAttributesDocument: Apollo.DocumentNode;
|
|
|
10067
10055
|
* },
|
|
10068
10056
|
* });
|
|
10069
10057
|
*/
|
|
10070
|
-
export declare function useExplorerAttributesQuery(baseOptions?: Apollo.QueryHookOptions<ExplorerAttributesQuery, ExplorerAttributesQueryVariables>): Apollo.
|
|
10058
|
+
export declare function useExplorerAttributesQuery(baseOptions?: Apollo.QueryHookOptions<ExplorerAttributesQuery, ExplorerAttributesQueryVariables>): Apollo.QueryResult<ExplorerAttributesQuery, Exact<{
|
|
10071
10059
|
ids?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
10072
10060
|
}>>;
|
|
10073
10061
|
export declare function useExplorerAttributesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExplorerAttributesQuery, ExplorerAttributesQueryVariables>): Apollo.LazyQueryResultTuple<ExplorerAttributesQuery, Exact<{
|
|
@@ -10101,7 +10089,7 @@ export declare function useExplorerLinkAttributeQuery(baseOptions: Apollo.QueryH
|
|
|
10101
10089
|
skip?: boolean;
|
|
10102
10090
|
} | {
|
|
10103
10091
|
skip: boolean;
|
|
10104
|
-
})): Apollo.
|
|
10092
|
+
})): Apollo.QueryResult<ExplorerLinkAttributeQuery, Exact<{
|
|
10105
10093
|
id: Scalars["ID"]["input"];
|
|
10106
10094
|
}>>;
|
|
10107
10095
|
export declare function useExplorerLinkAttributeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExplorerLinkAttributeQuery, ExplorerLinkAttributeQueryVariables>): Apollo.LazyQueryResultTuple<ExplorerLinkAttributeQuery, Exact<{
|
|
@@ -10137,7 +10125,7 @@ export declare function useCountValuesOccurrencesQuery(baseOptions: Apollo.Query
|
|
|
10137
10125
|
skip?: boolean;
|
|
10138
10126
|
} | {
|
|
10139
10127
|
skip: boolean;
|
|
10140
|
-
})): Apollo.
|
|
10128
|
+
})): Apollo.QueryResult<CountValuesOccurrencesQuery, Exact<{
|
|
10141
10129
|
library: Scalars["ID"]["input"];
|
|
10142
10130
|
attribute: Scalars["ID"]["input"];
|
|
10143
10131
|
recordFilters?: InputMaybe<Array<InputMaybe<RecordFilterInput>> | InputMaybe<RecordFilterInput>>;
|
|
@@ -10180,7 +10168,7 @@ export declare function useExplorerLibraryDataQuery(baseOptions: Apollo.QueryHoo
|
|
|
10180
10168
|
skip?: boolean;
|
|
10181
10169
|
} | {
|
|
10182
10170
|
skip: boolean;
|
|
10183
|
-
})): Apollo.
|
|
10171
|
+
})): Apollo.QueryResult<ExplorerLibraryDataQuery, Exact<{
|
|
10184
10172
|
libraryId: Scalars["ID"]["input"];
|
|
10185
10173
|
attributeIds: Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"];
|
|
10186
10174
|
pagination?: InputMaybe<RecordsPagination>;
|
|
@@ -10227,7 +10215,7 @@ export declare function useExplorerLinkDataQuery(baseOptions: Apollo.QueryHookOp
|
|
|
10227
10215
|
skip?: boolean;
|
|
10228
10216
|
} | {
|
|
10229
10217
|
skip: boolean;
|
|
10230
|
-
})): Apollo.
|
|
10218
|
+
})): Apollo.QueryResult<ExplorerLinkDataQuery, Exact<{
|
|
10231
10219
|
attributeIds: Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"];
|
|
10232
10220
|
parentLibraryId: Scalars["ID"]["input"];
|
|
10233
10221
|
parentRecordId?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -10267,7 +10255,7 @@ export declare function useGetLibraryAttributesQuery(baseOptions: Apollo.QueryHo
|
|
|
10267
10255
|
skip?: boolean;
|
|
10268
10256
|
} | {
|
|
10269
10257
|
skip: boolean;
|
|
10270
|
-
})): Apollo.
|
|
10258
|
+
})): Apollo.QueryResult<GetLibraryAttributesQuery, Exact<{
|
|
10271
10259
|
libraryId: Scalars["ID"]["input"];
|
|
10272
10260
|
}>>;
|
|
10273
10261
|
export declare function useGetLibraryAttributesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetLibraryAttributesQuery, GetLibraryAttributesQueryVariables>): Apollo.LazyQueryResultTuple<GetLibraryAttributesQuery, Exact<{
|
|
@@ -10301,7 +10289,7 @@ export declare function useExplorerLibraryDetailsQuery(baseOptions: Apollo.Query
|
|
|
10301
10289
|
skip?: boolean;
|
|
10302
10290
|
} | {
|
|
10303
10291
|
skip: boolean;
|
|
10304
|
-
})): Apollo.
|
|
10292
|
+
})): Apollo.QueryResult<ExplorerLibraryDetailsQuery, Exact<{
|
|
10305
10293
|
libraryId: Scalars["ID"]["input"];
|
|
10306
10294
|
}>>;
|
|
10307
10295
|
export declare function useExplorerLibraryDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExplorerLibraryDetailsQuery, ExplorerLibraryDetailsQueryVariables>): Apollo.LazyQueryResultTuple<ExplorerLibraryDetailsQuery, Exact<{
|
|
@@ -10330,7 +10318,7 @@ export declare const LibraryExportProfilesDocument: Apollo.DocumentNode;
|
|
|
10330
10318
|
* },
|
|
10331
10319
|
* });
|
|
10332
10320
|
*/
|
|
10333
|
-
export declare function useLibraryExportProfilesQuery(baseOptions?: Apollo.QueryHookOptions<LibraryExportProfilesQuery, LibraryExportProfilesQueryVariables>): Apollo.
|
|
10321
|
+
export declare function useLibraryExportProfilesQuery(baseOptions?: Apollo.QueryHookOptions<LibraryExportProfilesQuery, LibraryExportProfilesQueryVariables>): Apollo.QueryResult<LibraryExportProfilesQuery, Exact<{
|
|
10334
10322
|
libraryId?: InputMaybe<Array<Scalars["ID"]["input"]> | Scalars["ID"]["input"]>;
|
|
10335
10323
|
}>>;
|
|
10336
10324
|
export declare function useLibraryExportProfilesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<LibraryExportProfilesQuery, LibraryExportProfilesQueryVariables>): Apollo.LazyQueryResultTuple<LibraryExportProfilesQuery, Exact<{
|
|
@@ -10365,7 +10353,7 @@ export declare function useExplorerSelectionIdsQuery(baseOptions: Apollo.QueryHo
|
|
|
10365
10353
|
skip?: boolean;
|
|
10366
10354
|
} | {
|
|
10367
10355
|
skip: boolean;
|
|
10368
|
-
})): Apollo.
|
|
10356
|
+
})): Apollo.QueryResult<ExplorerSelectionIdsQuery, Exact<{
|
|
10369
10357
|
libraryId: Scalars["ID"]["input"];
|
|
10370
10358
|
filters?: InputMaybe<Array<InputMaybe<RecordFilterInput>> | InputMaybe<RecordFilterInput>>;
|
|
10371
10359
|
}>>;
|
|
@@ -10395,7 +10383,7 @@ export declare const MeDocument: Apollo.DocumentNode;
|
|
|
10395
10383
|
* },
|
|
10396
10384
|
* });
|
|
10397
10385
|
*/
|
|
10398
|
-
export declare function useMeQuery(baseOptions?: Apollo.QueryHookOptions<MeQuery, MeQueryVariables>): Apollo.
|
|
10386
|
+
export declare function useMeQuery(baseOptions?: Apollo.QueryHookOptions<MeQuery, MeQueryVariables>): Apollo.QueryResult<MeQuery, Exact<{
|
|
10399
10387
|
[key: string]: never;
|
|
10400
10388
|
}>>;
|
|
10401
10389
|
export declare function useMeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MeQuery, MeQueryVariables>): Apollo.LazyQueryResultTuple<MeQuery, Exact<{
|
|
@@ -10456,7 +10444,7 @@ export declare function useSmartFilterListValuesQuery(baseOptions: Apollo.QueryH
|
|
|
10456
10444
|
skip?: boolean;
|
|
10457
10445
|
} | {
|
|
10458
10446
|
skip: boolean;
|
|
10459
|
-
})): Apollo.
|
|
10447
|
+
})): Apollo.QueryResult<SmartFilterListValuesQuery, Exact<{
|
|
10460
10448
|
library: Scalars["ID"]["input"];
|
|
10461
10449
|
attribute: Scalars["ID"]["input"];
|
|
10462
10450
|
recordFilters?: InputMaybe<Array<InputMaybe<RecordFilterInput>> | InputMaybe<RecordFilterInput>>;
|
|
@@ -10488,15 +10476,9 @@ export declare const NotificationDocument: Apollo.DocumentNode;
|
|
|
10488
10476
|
* },
|
|
10489
10477
|
* });
|
|
10490
10478
|
*/
|
|
10491
|
-
export declare function useNotificationSubscription(baseOptions?: Apollo.SubscriptionHookOptions<NotificationSubscription, NotificationSubscriptionVariables>): {
|
|
10492
|
-
|
|
10493
|
-
|
|
10494
|
-
data?: NotificationSubscription;
|
|
10495
|
-
error?: Apollo.ApolloError;
|
|
10496
|
-
variables?: Exact<{
|
|
10497
|
-
[key: string]: never;
|
|
10498
|
-
}>;
|
|
10499
|
-
};
|
|
10479
|
+
export declare function useNotificationSubscription(baseOptions?: Apollo.SubscriptionHookOptions<NotificationSubscription, NotificationSubscriptionVariables>): Apollo.SubscriptionResult<NotificationSubscription, Exact<{
|
|
10480
|
+
[key: string]: never;
|
|
10481
|
+
}>>;
|
|
10500
10482
|
export type NotificationSubscriptionHookResult = ReturnType<typeof useNotificationSubscription>;
|
|
10501
10483
|
export type NotificationSubscriptionResult = Apollo.SubscriptionResult<NotificationSubscription>;
|
|
10502
10484
|
export declare const GetRecordHistoryDocument: Apollo.DocumentNode;
|
|
@@ -10524,7 +10506,7 @@ export declare function useGetRecordHistoryQuery(baseOptions: Apollo.QueryHookOp
|
|
|
10524
10506
|
skip?: boolean;
|
|
10525
10507
|
} | {
|
|
10526
10508
|
skip: boolean;
|
|
10527
|
-
})): Apollo.
|
|
10509
|
+
})): Apollo.QueryResult<GetRecordHistoryQuery, Exact<{
|
|
10528
10510
|
record: LogTopicRecordFilterInput;
|
|
10529
10511
|
attributeId?: InputMaybe<Scalars["String"]["input"]>;
|
|
10530
10512
|
actions?: InputMaybe<Array<LogAction> | LogAction>;
|
|
@@ -10564,7 +10546,7 @@ export declare function useTreeDataQueryQuery(baseOptions: Apollo.QueryHookOptio
|
|
|
10564
10546
|
skip?: boolean;
|
|
10565
10547
|
} | {
|
|
10566
10548
|
skip: boolean;
|
|
10567
|
-
})): Apollo.
|
|
10549
|
+
})): Apollo.QueryResult<TreeDataQueryQuery, Exact<{
|
|
10568
10550
|
treeId: Scalars["ID"]["input"];
|
|
10569
10551
|
}>>;
|
|
10570
10552
|
export declare function useTreeDataQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<TreeDataQueryQuery, TreeDataQueryQueryVariables>): Apollo.LazyQueryResultTuple<TreeDataQueryQuery, Exact<{
|
|
@@ -5,7 +5,7 @@ import { type IAttribute, type IField, type IFilter, type ISearchSelection, type
|
|
|
5
5
|
import { type IValueVersion } from '../../../../types/values';
|
|
6
6
|
import { type IView, type IViewDisplay } from '../../../../types/views';
|
|
7
7
|
import { type PermissionsActions, type SortOrder } from '../../../../_gqlTypes';
|
|
8
|
-
import { type
|
|
8
|
+
import { type GraphQLError, type GraphQLErrorExtensions } from 'graphql';
|
|
9
9
|
import { type ILibraryDetailExtended, type ILibraryDetailExtendedLinkedTree } from '../../../../_queries/libraries/getLibraryDetailExtendQuery';
|
|
10
10
|
export type IRecordPreview = {
|
|
11
11
|
small: string;
|
|
@@ -38,7 +38,7 @@ export interface ISidebarState {
|
|
|
38
38
|
visible: boolean;
|
|
39
39
|
type: SidebarContentType;
|
|
40
40
|
}
|
|
41
|
-
export type SearchStateError = Override<
|
|
41
|
+
export type SearchStateError = Override<GraphQLError, {
|
|
42
42
|
extensions: GraphQLErrorExtensions & {
|
|
43
43
|
record?: {
|
|
44
44
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../../src/components/LibraryItemsList/hooks/useSearchReducer/_types.ts"],"names":[],"mappings":"","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 Override} from '@leav/utils';\nimport {type ILang} from '_ui/types/misc';\nimport {type IRecordIdentityWhoAmI} from '_ui/types/records';\nimport {\n type IAttribute,\n type IField,\n type IFilter,\n type ISearchSelection,\n type SearchMode,\n type SidebarContentType,\n} from '_ui/types/search';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type IView, type IViewDisplay} from '_ui/types/views';\nimport {type PermissionsActions, type SortOrder} from '_ui/_gqlTypes';\nimport {type
|
|
1
|
+
{"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../../src/components/LibraryItemsList/hooks/useSearchReducer/_types.ts"],"names":[],"mappings":"","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 Override} from '@leav/utils';\nimport {type ILang} from '_ui/types/misc';\nimport {type IRecordIdentityWhoAmI} from '_ui/types/records';\nimport {\n type IAttribute,\n type IField,\n type IFilter,\n type ISearchSelection,\n type SearchMode,\n type SidebarContentType,\n} from '_ui/types/search';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type IView, type IViewDisplay} from '_ui/types/views';\nimport {type PermissionsActions, type SortOrder} from '_ui/_gqlTypes';\nimport {type GraphQLError, type GraphQLErrorExtensions} from 'graphql';\nimport {\n type ILibraryDetailExtended,\n type ILibraryDetailExtendedLinkedTree,\n} from '_ui/_queries/libraries/getLibraryDetailExtendQuery';\n\nexport type IRecordPreview = {\n small: string;\n medium: string;\n big: string;\n pages: string;\n} | null;\n\nexport interface IRecordWhoAmI {\n id: string;\n label?: string;\n preview?: IRecordPreview;\n color?: string;\n library?: {\n id: string;\n label: Record<string, string>;\n };\n}\n\nexport interface ISearchRecord {\n whoAmI: IRecordIdentityWhoAmI;\n index: number;\n fields: {[x: string]: any};\n}\n\nexport interface ISearchSort {\n field: string;\n order: SortOrder;\n}\n\nexport interface ISidebarState {\n visible: boolean;\n type: SidebarContentType;\n}\n\nexport type SearchStateError = Override<\n GraphQLError,\n {\n extensions: GraphQLErrorExtensions & {\n record?: {\n id: string;\n library: string;\n };\n fields?: {\n [key: string]: string;\n };\n action?: PermissionsActions;\n };\n }\n>;\n\nexport interface ISearchState {\n library: ILibraryDetailExtended;\n records: ISearchRecord[];\n totalCount: number;\n errors?: readonly SearchStateError[];\n loading: boolean;\n pagination: number;\n offset: number;\n sort?: ISearchSort[];\n attributes: IAttribute[];\n trees: ILibraryDetailExtendedLinkedTree[];\n fields: IField[];\n fullText: string;\n filters: IFilter[];\n display: IViewDisplay;\n view: IViewState;\n userViewsOrder: string[];\n sharedViewsOrder: string[];\n lang: ILang;\n valuesVersions: IValueVersion;\n sideBar: ISidebarState;\n selection: ISearchSelection;\n showTransparency: boolean;\n mode: SearchMode;\n}\n\nexport interface IViewState {\n current: IView | null;\n reload: boolean;\n sync: boolean;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type GraphQLErrors } from '@apollo/client/errors';
|
|
2
2
|
import { type IAttribute, type IField, type IFilter, type ISelectedRecord, SidebarContentType } from '../../../../types/search';
|
|
3
3
|
import { type IValueVersion } from '../../../../types/values';
|
|
4
4
|
import { type IView, type IViewDisplay } from '../../../../types/views';
|
|
@@ -37,7 +37,7 @@ export declare enum SearchActionTypes {
|
|
|
37
37
|
interface ISearchResult {
|
|
38
38
|
type: SearchActionTypes.UPDATE_RESULT;
|
|
39
39
|
records: ISearchRecord[];
|
|
40
|
-
errors?:
|
|
40
|
+
errors?: GraphQLErrors;
|
|
41
41
|
totalCount: number;
|
|
42
42
|
}
|
|
43
43
|
export type SearchAction = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchReducer.js","sourceRoot":"","sources":["../../../../../src/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,MAAM,2DAA2D,CAAC;AAC1F,OAAO,EAKH,UAAU,EACV,kBAAkB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAN,IAAY,iBA8BX;AA9BD,WAAY,iBAAiB;IACzB,oDAA+B,CAAA;IAC/B,4CAAuB,CAAA;IACvB,sDAAiC,CAAA;IACjC,8CAAyB,CAAA;IACzB,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;IACrB,gDAA2B,CAAA;IAC3B,sDAAiC,CAAA;IACjC,8CAAyB,CAAA;IACzB,kDAA6B,CAAA;IAC7B,gDAA2B,CAAA;IAC3B,wDAAmC,CAAA;IACnC,oDAA+B,CAAA;IAC/B,gDAA2B,CAAA;IAC3B,kEAA6C,CAAA;IAC7C,sEAAiD,CAAA;IACjD,gDAA2B,CAAA;IAC3B,oDAA+B,CAAA;IAC/B,wDAAmC,CAAA;IACnC,sDAAiC,CAAA;IACjC,oDAA+B,CAAA;IAC/B,gEAA2C,CAAA;IAC3C,gEAA2C,CAAA;IAC3C,sDAAiC,CAAA;IACjC,gDAA2B,CAAA;IAC3B,oDAA+B,CAAA;IAC/B,wEAAmD,CAAA;IACnD,8CAAyB,CAAA;IACzB,wDAAmC,CAAA;AACvC,CAAC,EA9BW,iBAAiB,KAAjB,iBAAiB,QA8B5B;AAuCD,MAAM,CAAC,MAAM,kBAAkB,GAAiB;IAC5C,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;IACX,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,EAAE;IACd,MAAM,EAA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AG,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;iBACrD;aACJ,CAAC;QACN,KAAK,iBAAiB,CAAC,UAAU;YAC7B,OAAO;gBACH,GAAG,KAAK;gBACR,SAAS,EAAE;oBACP,QAAQ,EAAE,EAAE;oBACZ,WAAW,EAAE,IAAI;iBACpB;aACJ,CAAC;QACN,KAAK,iBAAiB,CAAC,eAAe;YAClC,OAAO;gBACH,GAAG,KAAK;gBACR,SAAS,EAAE;oBACP,QAAQ,EAAE,EAAE;oBACZ,WAAW,EAAE,KAAK;iBACrB;aACJ,CAAC;QACN;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,aAAa,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 GraphQLFormattedError} from 'graphql';\nimport getFieldsFromView from '_ui/components/LibraryItemsList/helpers/getFieldsFromView';\nimport {\n type IAttribute,\n type IField,\n type IFilter,\n type ISelectedRecord,\n SearchMode,\n SidebarContentType,\n} from '_ui/types/search';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type IView, type IViewDisplay} from '_ui/types/views';\nimport {ViewSizes, ViewTypes} from '_ui/_gqlTypes';\nimport {defaultView} from '../../constants';\nimport {type SearchStateError, type ISearchRecord, type ISearchSort, type ISearchState} from './_types';\n\nexport enum SearchActionTypes {\n UPDATE_RESULT = 'UPDATE_RESULT',\n SET_ERROR = 'SET_ERROR',\n SET_PAGINATION = 'SET_PAGINATION',\n SET_OFFSET = 'SET_OFFSET',\n SET_LOADING = 'SET_LOADING',\n SET_SORT = 'SET_SORT',\n CANCEL_SORT = 'CANCEL_SORT',\n SET_ATTRIBUTES = 'SET_ATTRIBUTES',\n SET_FIELDS = 'SET_FIELDS',\n SET_FULLTEXT = 'SET_FULLTEXT',\n SET_FILTERS = 'SET_FILTERS',\n SET_VIEW_RELOAD = 'SET_VIEW_RELOAD',\n SET_VIEW_SYNC = 'SET_VIEW_SYNC',\n CHANGE_VIEW = 'CHANGE_VIEW',\n SET_USER_VIEWS_ORDER = 'SET_USER_VIEWS_ORDER',\n SET_SHARED_VIEWS_ORDER = 'SET_SHARED_VIEWS_ORDER',\n SET_DISPLAY = 'SET_DISPLAY',\n RESET_FILTERS = 'RESET_FILTERS',\n DISABLE_FILTERS = 'DISABLE_FILTERS',\n ENABLE_FILTERS = 'ENABLE_FILTERS',\n APPLY_FILTERS = 'APPLY_FILTERS',\n SET_VALUES_VERSIONS = 'SET_VALUES_VERSIONS',\n TOGGLE_TRANSPARENCY = 'TOGGLE_TRANSPARENCY',\n TOGGLE_SIDEBAR = 'TOGGLE_SIDEBAR',\n SET_SIDEBAR = 'SET_SIDEBAR',\n SET_SELECTION = 'SET_SELECTION',\n TOGGLE_RECORD_SELECTION = 'TOGGLE_RECORD_SELECTION',\n SELECT_ALL = 'SELECT_ALL',\n CLEAR_SELECTION = 'CLEAR_SELECTION',\n}\n\ninterface ISearchResult {\n type: SearchActionTypes.UPDATE_RESULT;\n records: ISearchRecord[];\n errors?: readonly GraphQLFormattedError[];\n totalCount: number;\n}\n\nexport type SearchAction =\n | ({type: SearchActionTypes.UPDATE_RESULT} & ISearchResult)\n | {type: SearchActionTypes.SET_PAGINATION; page: number}\n | {type: SearchActionTypes.SET_OFFSET; offset: number}\n | {type: SearchActionTypes.SET_LOADING; loading: boolean}\n | {type: SearchActionTypes.SET_SORT; sort: ISearchSort[]}\n | {type: SearchActionTypes.CANCEL_SORT}\n | {type: SearchActionTypes.SET_ATTRIBUTES; attributes: IAttribute[]}\n | {type: SearchActionTypes.SET_FIELDS; fields: IField[]}\n | {type: SearchActionTypes.SET_FULLTEXT; fullText: string}\n | {type: SearchActionTypes.SET_FILTERS; filters: IFilter[]}\n | {type: SearchActionTypes.SET_VIEW_RELOAD; reload: boolean}\n | {type: SearchActionTypes.SET_VIEW_SYNC; sync: boolean}\n | {type: SearchActionTypes.CHANGE_VIEW; view: IView}\n | {type: SearchActionTypes.SET_DISPLAY; display: IViewDisplay}\n | {type: SearchActionTypes.SET_USER_VIEWS_ORDER; userViewsOrder: string[]}\n | {type: SearchActionTypes.SET_SHARED_VIEWS_ORDER; sharedViewsOrder: string[]}\n | {type: SearchActionTypes.RESET_FILTERS}\n | {type: SearchActionTypes.DISABLE_FILTERS}\n | {type: SearchActionTypes.ENABLE_FILTERS}\n | {type: SearchActionTypes.APPLY_FILTERS}\n | {type: SearchActionTypes.SET_VALUES_VERSIONS; valuesVersions: IValueVersion}\n | {type: SearchActionTypes.TOGGLE_TRANSPARENCY}\n | {type: SearchActionTypes.TOGGLE_SIDEBAR}\n | {type: SearchActionTypes.SET_SIDEBAR; sidebarType: SidebarContentType; visible: boolean}\n | {type: SearchActionTypes.SET_SELECTION; selected: ISelectedRecord[]}\n | {type: SearchActionTypes.TOGGLE_RECORD_SELECTION; record: ISelectedRecord}\n | {type: SearchActionTypes.SELECT_ALL}\n | {type: SearchActionTypes.CLEAR_SELECTION};\n\nexport const initialSearchState: ISearchState = {\n library: null,\n errors: [],\n records: [],\n totalCount: 0,\n loading: false,\n pagination: 20,\n offset: 0,\n attributes: [],\n trees: [],\n fields: [],\n fullText: '',\n filters: [],\n display: {type: ViewTypes.list, size: ViewSizes.MEDIUM},\n view: {current: defaultView, reload: false, sync: true},\n userViewsOrder: [],\n sharedViewsOrder: [],\n valuesVersions: {},\n lang: null,\n sideBar: {\n visible: false,\n type: SidebarContentType.FILTERS,\n },\n selection: {\n selected: [],\n allSelected: false,\n },\n showTransparency: false,\n mode: SearchMode.SEARCH,\n};\n\nconst checkSync = (\n state: ISearchState,\n toCheck: {sort: boolean; filters: boolean; display: boolean; fields: boolean; valuesVersions: boolean},\n): boolean => {\n let isSync = true;\n\n if (toCheck.sort) {\n isSync = JSON.stringify(state.sort) === JSON.stringify(state.view.current?.sort);\n }\n\n if (toCheck.filters) {\n isSync = isSync && JSON.stringify(state.view.current?.filters) === JSON.stringify(state.filters);\n }\n\n if (toCheck.display) {\n isSync =\n isSync &&\n state.display.type === state.view.current?.display?.type &&\n state.display.size === state.view.current?.display?.size;\n }\n\n if (toCheck.fields) {\n const viewFieldsKeys = state.view.current.attributes ?? [];\n\n isSync = isSync && state.fields.map(f => f.id).join('.') === viewFieldsKeys.join('.');\n }\n\n return isSync;\n};\n\nconst searchReducer = (state: ISearchState, action: SearchAction): ISearchState => {\n let isSync = checkSync(state, {\n sort: action.type !== SearchActionTypes.SET_SORT,\n filters: action.type !== SearchActionTypes.SET_FILTERS,\n display: action.type !== SearchActionTypes.SET_DISPLAY,\n fields: action.type !== SearchActionTypes.SET_FIELDS,\n valuesVersions: action.type !== SearchActionTypes.SET_VALUES_VERSIONS,\n });\n\n switch (action.type) {\n case SearchActionTypes.UPDATE_RESULT: {\n return {\n ...state,\n records: action.records ?? state.records,\n totalCount: action.totalCount ?? state.totalCount,\n errors: (action.errors as SearchStateError[]) ?? [],\n loading: false,\n };\n }\n case SearchActionTypes.SET_PAGINATION:\n return {...state, pagination: action.page, loading: true};\n case SearchActionTypes.SET_OFFSET:\n return {...state, offset: action.offset, loading: true};\n case SearchActionTypes.SET_LOADING:\n return {...state, loading: action.loading};\n case SearchActionTypes.SET_SORT:\n isSync = isSync && JSON.stringify(state.view.current.sort) === JSON.stringify(action.sort);\n\n return {...state, sort: action.sort, view: {...state.view, sync: isSync}};\n case SearchActionTypes.CANCEL_SORT:\n const {sort, ...newState} = state;\n\n isSync = isSync && typeof state.view.current.sort === 'undefined';\n\n return {...newState, view: {...state.view, sync: isSync}, loading: true};\n case SearchActionTypes.SET_ATTRIBUTES:\n return {...state, attributes: action.attributes};\n case SearchActionTypes.SET_FIELDS:\n const viewFieldsKeys = state.view.current.attributes ?? [];\n\n isSync = isSync && action.fields.map(f => f.id).join('.') === viewFieldsKeys.join('.');\n\n return {...state, fields: action.fields, view: {...state.view, sync: isSync}, loading: true};\n case SearchActionTypes.SET_FULLTEXT:\n return {...state, fullText: action.fullText};\n case SearchActionTypes.SET_FILTERS:\n isSync = isSync && JSON.stringify(state.view.current.filters) === JSON.stringify(action.filters);\n return {...state, filters: action.filters, view: {...state.view, sync: isSync}};\n case SearchActionTypes.CHANGE_VIEW:\n return {\n ...state,\n view: {\n current: action.view,\n reload: true,\n sync: true,\n },\n fields: getFieldsFromView(action.view, state.library, state.lang),\n filters: action.view.filters,\n sort: action.view.sort,\n display: action.view.display,\n valuesVersions: action.view.valuesVersions,\n };\n case SearchActionTypes.SET_VIEW_RELOAD:\n return {...state, view: {...state.view, reload: action.reload}};\n case SearchActionTypes.SET_VIEW_SYNC:\n return {...state, view: {...state.view, sync: action.sync}};\n case SearchActionTypes.SET_DISPLAY:\n isSync =\n isSync &&\n action.display.type === state.view.current.display.type &&\n action.display.size === state.view.current.display.size;\n return {...state, display: action.display, view: {...state.view, sync: isSync}};\n case SearchActionTypes.SET_USER_VIEWS_ORDER:\n return {...state, userViewsOrder: action.userViewsOrder};\n case SearchActionTypes.SET_SHARED_VIEWS_ORDER:\n return {...state, sharedViewsOrder: action.sharedViewsOrder};\n case SearchActionTypes.RESET_FILTERS:\n return {...state, filters: [], loading: true};\n case SearchActionTypes.DISABLE_FILTERS:\n return {\n ...state,\n filters: state.filters.map(f => ({...f, active: false})),\n loading: true,\n };\n case SearchActionTypes.ENABLE_FILTERS:\n return {\n ...state,\n filters: state.filters.map(f => ({...f, active: true})),\n loading: true,\n };\n case SearchActionTypes.APPLY_FILTERS:\n // Reset pagination when applying filters as this may lead to unexpected behavior\n // if new filters return less results\n return {\n ...state,\n offset: 0,\n loading: true,\n };\n case SearchActionTypes.SET_VALUES_VERSIONS: {\n isSync =\n isSync && JSON.stringify(state.view.current.valuesVersions) === JSON.stringify(action.valuesVersions);\n return {\n ...state,\n view: {...state.view, sync: isSync},\n valuesVersions: {...state.valuesVersions, ...action.valuesVersions},\n };\n }\n case SearchActionTypes.TOGGLE_TRANSPARENCY:\n return {...state, showTransparency: !state.showTransparency};\n case SearchActionTypes.TOGGLE_SIDEBAR:\n return {...state, sideBar: {...state.sideBar, visible: !state.sideBar.visible}};\n case SearchActionTypes.SET_SIDEBAR:\n return {...state, sideBar: {...state.sideBar, type: action.sidebarType, visible: action.visible}};\n case SearchActionTypes.SET_SELECTION:\n return {...state, selection: {...state.selection, selected: action.selected, allSelected: false}};\n case SearchActionTypes.TOGGLE_RECORD_SELECTION:\n const currentlySelected = state.selection.selected.findIndex(s => s.id === action.record.id) > -1;\n\n return {\n ...state,\n selection: {\n ...state.selection,\n selected: currentlySelected\n ? state.selection.selected.filter(s => s.id !== action.record.id)\n : [...state.selection.selected, action.record],\n },\n };\n case SearchActionTypes.SELECT_ALL:\n return {\n ...state,\n selection: {\n selected: [],\n allSelected: true,\n },\n };\n case SearchActionTypes.CLEAR_SELECTION:\n return {\n ...state,\n selection: {\n selected: [],\n allSelected: false,\n },\n };\n default:\n return state;\n }\n};\n\nexport default searchReducer;\n"]}
|
|
1
|
+
{"version":3,"file":"searchReducer.js","sourceRoot":"","sources":["../../../../../src/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,MAAM,2DAA2D,CAAC;AAC1F,OAAO,EAKH,UAAU,EACV,kBAAkB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAN,IAAY,iBA8BX;AA9BD,WAAY,iBAAiB;IACzB,oDAA+B,CAAA;IAC/B,4CAAuB,CAAA;IACvB,sDAAiC,CAAA;IACjC,8CAAyB,CAAA;IACzB,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;IACrB,gDAA2B,CAAA;IAC3B,sDAAiC,CAAA;IACjC,8CAAyB,CAAA;IACzB,kDAA6B,CAAA;IAC7B,gDAA2B,CAA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SAAS,EAAE,EAAC,GAAG,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAC,EAAC,CAAC;QACtG,KAAK,iBAAiB,CAAC,uBAAuB;YAC1C,MAAM,iBAAiB,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YAElG,OAAO;gBACH,GAAG,KAAK;gBACR,SAAS,EAAE;oBACP,GAAG,KAAK,CAAC,SAAS;oBAClB,QAAQ,EAAE,iBAAiB;wBACvB,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;wBACjE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;iBACrD;aACJ,CAAC;QACN,KAAK,iBAAiB,CAAC,UAAU;YAC7B,OAAO;gBACH,GAAG,KAAK;gBACR,SAAS,EAAE;oBACP,QAAQ,EAAE,EAAE;oBACZ,WAAW,EAAE,IAAI;iBACpB;aACJ,CAAC;QACN,KAAK,iBAAiB,CAAC,eAAe;YAClC,OAAO;gBACH,GAAG,KAAK;gBACR,SAAS,EAAE;oBACP,QAAQ,EAAE,EAAE;oBACZ,WAAW,EAAE,KAAK;iBACrB;aACJ,CAAC;QACN;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,aAAa,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 GraphQLErrors} from '@apollo/client/errors';\nimport getFieldsFromView from '_ui/components/LibraryItemsList/helpers/getFieldsFromView';\nimport {\n type IAttribute,\n type IField,\n type IFilter,\n type ISelectedRecord,\n SearchMode,\n SidebarContentType,\n} from '_ui/types/search';\nimport {type IValueVersion} from '_ui/types/values';\nimport {type IView, type IViewDisplay} from '_ui/types/views';\nimport {ViewSizes, ViewTypes} from '_ui/_gqlTypes';\nimport {defaultView} from '../../constants';\nimport {type ISearchRecord, type ISearchSort, type ISearchState} from './_types';\n\nexport enum SearchActionTypes {\n UPDATE_RESULT = 'UPDATE_RESULT',\n SET_ERROR = 'SET_ERROR',\n SET_PAGINATION = 'SET_PAGINATION',\n SET_OFFSET = 'SET_OFFSET',\n SET_LOADING = 'SET_LOADING',\n SET_SORT = 'SET_SORT',\n CANCEL_SORT = 'CANCEL_SORT',\n SET_ATTRIBUTES = 'SET_ATTRIBUTES',\n SET_FIELDS = 'SET_FIELDS',\n SET_FULLTEXT = 'SET_FULLTEXT',\n SET_FILTERS = 'SET_FILTERS',\n SET_VIEW_RELOAD = 'SET_VIEW_RELOAD',\n SET_VIEW_SYNC = 'SET_VIEW_SYNC',\n CHANGE_VIEW = 'CHANGE_VIEW',\n SET_USER_VIEWS_ORDER = 'SET_USER_VIEWS_ORDER',\n SET_SHARED_VIEWS_ORDER = 'SET_SHARED_VIEWS_ORDER',\n SET_DISPLAY = 'SET_DISPLAY',\n RESET_FILTERS = 'RESET_FILTERS',\n DISABLE_FILTERS = 'DISABLE_FILTERS',\n ENABLE_FILTERS = 'ENABLE_FILTERS',\n APPLY_FILTERS = 'APPLY_FILTERS',\n SET_VALUES_VERSIONS = 'SET_VALUES_VERSIONS',\n TOGGLE_TRANSPARENCY = 'TOGGLE_TRANSPARENCY',\n TOGGLE_SIDEBAR = 'TOGGLE_SIDEBAR',\n SET_SIDEBAR = 'SET_SIDEBAR',\n SET_SELECTION = 'SET_SELECTION',\n TOGGLE_RECORD_SELECTION = 'TOGGLE_RECORD_SELECTION',\n SELECT_ALL = 'SELECT_ALL',\n CLEAR_SELECTION = 'CLEAR_SELECTION',\n}\n\ninterface ISearchResult {\n type: SearchActionTypes.UPDATE_RESULT;\n records: ISearchRecord[];\n errors?: GraphQLErrors;\n totalCount: number;\n}\n\nexport type SearchAction =\n | ({type: SearchActionTypes.UPDATE_RESULT} & ISearchResult)\n | {type: SearchActionTypes.SET_PAGINATION; page: number}\n | {type: SearchActionTypes.SET_OFFSET; offset: number}\n | {type: SearchActionTypes.SET_LOADING; loading: boolean}\n | {type: SearchActionTypes.SET_SORT; sort: ISearchSort[]}\n | {type: SearchActionTypes.CANCEL_SORT}\n | {type: SearchActionTypes.SET_ATTRIBUTES; attributes: IAttribute[]}\n | {type: SearchActionTypes.SET_FIELDS; fields: IField[]}\n | {type: SearchActionTypes.SET_FULLTEXT; fullText: string}\n | {type: SearchActionTypes.SET_FILTERS; filters: IFilter[]}\n | {type: SearchActionTypes.SET_VIEW_RELOAD; reload: boolean}\n | {type: SearchActionTypes.SET_VIEW_SYNC; sync: boolean}\n | {type: SearchActionTypes.CHANGE_VIEW; view: IView}\n | {type: SearchActionTypes.SET_DISPLAY; display: IViewDisplay}\n | {type: SearchActionTypes.SET_USER_VIEWS_ORDER; userViewsOrder: string[]}\n | {type: SearchActionTypes.SET_SHARED_VIEWS_ORDER; sharedViewsOrder: string[]}\n | {type: SearchActionTypes.RESET_FILTERS}\n | {type: SearchActionTypes.DISABLE_FILTERS}\n | {type: SearchActionTypes.ENABLE_FILTERS}\n | {type: SearchActionTypes.APPLY_FILTERS}\n | {type: SearchActionTypes.SET_VALUES_VERSIONS; valuesVersions: IValueVersion}\n | {type: SearchActionTypes.TOGGLE_TRANSPARENCY}\n | {type: SearchActionTypes.TOGGLE_SIDEBAR}\n | {type: SearchActionTypes.SET_SIDEBAR; sidebarType: SidebarContentType; visible: boolean}\n | {type: SearchActionTypes.SET_SELECTION; selected: ISelectedRecord[]}\n | {type: SearchActionTypes.TOGGLE_RECORD_SELECTION; record: ISelectedRecord}\n | {type: SearchActionTypes.SELECT_ALL}\n | {type: SearchActionTypes.CLEAR_SELECTION};\n\nexport const initialSearchState: ISearchState = {\n library: null,\n errors: [],\n records: [],\n totalCount: 0,\n loading: false,\n pagination: 20,\n offset: 0,\n attributes: [],\n trees: [],\n fields: [],\n fullText: '',\n filters: [],\n display: {type: ViewTypes.list, size: ViewSizes.MEDIUM},\n view: {current: defaultView, reload: false, sync: true},\n userViewsOrder: [],\n sharedViewsOrder: [],\n valuesVersions: {},\n lang: null,\n sideBar: {\n visible: false,\n type: SidebarContentType.FILTERS,\n },\n selection: {\n selected: [],\n allSelected: false,\n },\n showTransparency: false,\n mode: SearchMode.SEARCH,\n};\n\nconst checkSync = (\n state: ISearchState,\n toCheck: {sort: boolean; filters: boolean; display: boolean; fields: boolean; valuesVersions: boolean},\n): boolean => {\n let isSync = true;\n\n if (toCheck.sort) {\n isSync = JSON.stringify(state.sort) === JSON.stringify(state.view.current?.sort);\n }\n\n if (toCheck.filters) {\n isSync = isSync && JSON.stringify(state.view.current?.filters) === JSON.stringify(state.filters);\n }\n\n if (toCheck.display) {\n isSync =\n isSync &&\n state.display.type === state.view.current?.display?.type &&\n state.display.size === state.view.current?.display?.size;\n }\n\n if (toCheck.fields) {\n const viewFieldsKeys = state.view.current.attributes ?? [];\n\n isSync = isSync && state.fields.map(f => f.id).join('.') === viewFieldsKeys.join('.');\n }\n\n return isSync;\n};\n\nconst searchReducer = (state: ISearchState, action: SearchAction): ISearchState => {\n let isSync = checkSync(state, {\n sort: action.type !== SearchActionTypes.SET_SORT,\n filters: action.type !== SearchActionTypes.SET_FILTERS,\n display: action.type !== SearchActionTypes.SET_DISPLAY,\n fields: action.type !== SearchActionTypes.SET_FIELDS,\n valuesVersions: action.type !== SearchActionTypes.SET_VALUES_VERSIONS,\n });\n\n switch (action.type) {\n case SearchActionTypes.UPDATE_RESULT: {\n return {\n ...state,\n records: action.records ?? state.records,\n totalCount: action.totalCount ?? state.totalCount,\n errors: action.errors ?? [],\n loading: false,\n };\n }\n case SearchActionTypes.SET_PAGINATION:\n return {...state, pagination: action.page, loading: true};\n case SearchActionTypes.SET_OFFSET:\n return {...state, offset: action.offset, loading: true};\n case SearchActionTypes.SET_LOADING:\n return {...state, loading: action.loading};\n case SearchActionTypes.SET_SORT:\n isSync = isSync && JSON.stringify(state.view.current.sort) === JSON.stringify(action.sort);\n\n return {...state, sort: action.sort, view: {...state.view, sync: isSync}};\n case SearchActionTypes.CANCEL_SORT:\n const {sort, ...newState} = state;\n\n isSync = isSync && typeof state.view.current.sort === 'undefined';\n\n return {...newState, view: {...state.view, sync: isSync}, loading: true};\n case SearchActionTypes.SET_ATTRIBUTES:\n return {...state, attributes: action.attributes};\n case SearchActionTypes.SET_FIELDS:\n const viewFieldsKeys = state.view.current.attributes ?? [];\n\n isSync = isSync && action.fields.map(f => f.id).join('.') === viewFieldsKeys.join('.');\n\n return {...state, fields: action.fields, view: {...state.view, sync: isSync}, loading: true};\n case SearchActionTypes.SET_FULLTEXT:\n return {...state, fullText: action.fullText};\n case SearchActionTypes.SET_FILTERS:\n isSync = isSync && JSON.stringify(state.view.current.filters) === JSON.stringify(action.filters);\n return {...state, filters: action.filters, view: {...state.view, sync: isSync}};\n case SearchActionTypes.CHANGE_VIEW:\n return {\n ...state,\n view: {\n current: action.view,\n reload: true,\n sync: true,\n },\n fields: getFieldsFromView(action.view, state.library, state.lang),\n filters: action.view.filters,\n sort: action.view.sort,\n display: action.view.display,\n valuesVersions: action.view.valuesVersions,\n };\n case SearchActionTypes.SET_VIEW_RELOAD:\n return {...state, view: {...state.view, reload: action.reload}};\n case SearchActionTypes.SET_VIEW_SYNC:\n return {...state, view: {...state.view, sync: action.sync}};\n case SearchActionTypes.SET_DISPLAY:\n isSync =\n isSync &&\n action.display.type === state.view.current.display.type &&\n action.display.size === state.view.current.display.size;\n return {...state, display: action.display, view: {...state.view, sync: isSync}};\n case SearchActionTypes.SET_USER_VIEWS_ORDER:\n return {...state, userViewsOrder: action.userViewsOrder};\n case SearchActionTypes.SET_SHARED_VIEWS_ORDER:\n return {...state, sharedViewsOrder: action.sharedViewsOrder};\n case SearchActionTypes.RESET_FILTERS:\n return {...state, filters: [], loading: true};\n case SearchActionTypes.DISABLE_FILTERS:\n return {\n ...state,\n filters: state.filters.map(f => ({...f, active: false})),\n loading: true,\n };\n case SearchActionTypes.ENABLE_FILTERS:\n return {\n ...state,\n filters: state.filters.map(f => ({...f, active: true})),\n loading: true,\n };\n case SearchActionTypes.APPLY_FILTERS:\n // Reset pagination when applying filters as this may lead to unexpected behavior\n // if new filters return less results\n return {\n ...state,\n offset: 0,\n loading: true,\n };\n case SearchActionTypes.SET_VALUES_VERSIONS: {\n isSync =\n isSync && JSON.stringify(state.view.current.valuesVersions) === JSON.stringify(action.valuesVersions);\n return {\n ...state,\n view: {...state.view, sync: isSync},\n valuesVersions: {...state.valuesVersions, ...action.valuesVersions},\n };\n }\n case SearchActionTypes.TOGGLE_TRANSPARENCY:\n return {...state, showTransparency: !state.showTransparency};\n case SearchActionTypes.TOGGLE_SIDEBAR:\n return {...state, sideBar: {...state.sideBar, visible: !state.sideBar.visible}};\n case SearchActionTypes.SET_SIDEBAR:\n return {...state, sideBar: {...state.sideBar, type: action.sidebarType, visible: action.visible}};\n case SearchActionTypes.SET_SELECTION:\n return {...state, selection: {...state.selection, selected: action.selected, allSelected: false}};\n case SearchActionTypes.TOGGLE_RECORD_SELECTION:\n const currentlySelected = state.selection.selected.findIndex(s => s.id === action.record.id) > -1;\n\n return {\n ...state,\n selection: {\n ...state.selection,\n selected: currentlySelected\n ? state.selection.selected.filter(s => s.id !== action.record.id)\n : [...state.selection.selected, action.record],\n },\n };\n case SearchActionTypes.SELECT_ALL:\n return {\n ...state,\n selection: {\n selected: [],\n allSelected: true,\n },\n };\n case SearchActionTypes.CLEAR_SELECTION:\n return {\n ...state,\n selection: {\n selected: [],\n allSelected: false,\n },\n };\n default:\n return state;\n }\n};\n\nexport default searchReducer;\n"]}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export declare const useNotificationsSubscription: () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
data?: import("../../../_gqlTypes").NotificationSubscription;
|
|
5
|
-
error?: import("@apollo/client").ApolloError;
|
|
6
|
-
variables?: import("../../../_gqlTypes").Exact<{
|
|
7
|
-
[key: string]: never;
|
|
8
|
-
}>;
|
|
9
|
-
};
|
|
1
|
+
export declare const useNotificationsSubscription: () => import("@apollo/client").SubscriptionResult<import("../../../_gqlTypes").NotificationSubscription, import("../../../_gqlTypes").Exact<{
|
|
2
|
+
[key: string]: never;
|
|
3
|
+
}>>;
|
|
10
4
|
export default useNotificationsSubscription;
|
|
@@ -2,4 +2,4 @@ import { type IGetLibraryDetailExtendedQuery, type IGetLibraryDetailExtendedVari
|
|
|
2
2
|
export interface IUseGetLibraryDetailExtendedQueryHookParams {
|
|
3
3
|
library: string;
|
|
4
4
|
}
|
|
5
|
-
export default function useGetLibraryDetailExtendedQuery({ library }: IUseGetLibraryDetailExtendedQueryHookParams): import("@apollo/client").
|
|
5
|
+
export default function useGetLibraryDetailExtendedQuery({ library }: IUseGetLibraryDetailExtendedQueryHookParams): import("@apollo/client").QueryResult<IGetLibraryDetailExtendedQuery, IGetLibraryDetailExtendedVariables>;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { type RecordUpdateFilterInput } from '../../_gqlTypes';
|
|
2
|
-
export declare const useGetRecordUpdatesSubscription: (filters: RecordUpdateFilterInput, skip?: boolean) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
data?: import("../../_gqlTypes").RecordUpdateSubscription;
|
|
6
|
-
error?: import("@apollo/client").ApolloError;
|
|
7
|
-
variables?: import("../../_gqlTypes").Exact<{
|
|
8
|
-
filters?: import("../../_gqlTypes").InputMaybe<RecordUpdateFilterInput>;
|
|
9
|
-
}>;
|
|
10
|
-
};
|
|
2
|
+
export declare const useGetRecordUpdatesSubscription: (filters: RecordUpdateFilterInput, skip?: boolean) => import("@apollo/client").SubscriptionResult<import("../../_gqlTypes").RecordUpdateSubscription, import("../../_gqlTypes").Exact<{
|
|
3
|
+
filters?: import("../../_gqlTypes").InputMaybe<RecordUpdateFilterInput>;
|
|
4
|
+
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetRecordValuesQuery.js","sourceRoot":"","sources":["../../../src/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"useGetRecordValuesQuery.js","sourceRoot":"","sources":["../../../src/hooks/useGetRecordValuesQuery/useGetRecordValuesQuery.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AAEtE,OAAO,EAAmB,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,qBAAqB,EAA0B,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAClG,OAAO,EACH,sBAAsB,GAIzB,MAAM,+CAA+C,CAAC;AAWvD,MAAM,wBAAwB,GAAG,CAAC,SAAmB,EAAuB,EAAE,CAC1E,SAAS,CAAC,MAAM,CAAC,CAAC,UAA+B,EAAE,QAAgB,EAAE,CAAS,EAAE,EAAE;IAC9E,IAAI,CAAC,EAAE,CAAC;QACJ,UAAU,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,oBAAoB,CAAC,EAAE,EAAC,CAAC,CAAC;IACzD,CAAC;IAED,UAAU,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAC,CAAC,CAAC;IAExF,OAAO,UAAU,CAAC;AACtB,CAAC,EAAE,EAAE,CAAC,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GA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C;QAE3C,OAAO,WAAW,CAAC;IACvB,CAAC,CAAC;IAEF,aAAa;IACb,OAAO;QACH,GAAG,KAAK;QACR,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,OAAO,SAAS,KAAK,SAAS;QACxD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,aAAa;KACzB,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\n\nimport {type QueryResult, useQuery} from '@apollo/client';\nimport {type Override} from '@leav/utils';\nimport {useState} from 'react';\nimport {RecordFilterCondition, type RecordFilterInput, RecordFilterOperator} from '_ui/_gqlTypes';\nimport {\n getRecordColumnsValues,\n type GetRecordColumnsValuesRecord,\n type IGetRecordColumnsValues,\n type IGetRecordColumnsValuesVariables,\n} from '../../_queries/records/getRecordColumnsValues';\n\nexport interface IColumnsValuesByRecord {\n [recordId: string]: GetRecordColumnsValuesRecord;\n}\n\nexport type IUseGetRecordColumnsValuesQueryHook = Override<\n QueryResult<IGetRecordColumnsValues>,\n {data: IColumnsValuesByRecord}\n>;\n\nconst _recordIdsToQueryFilters = (recordIds: string[]): RecordFilterInput[] =>\n recordIds.reduce((allFilters: RecordFilterInput[], recordId: string, i: number) => {\n if (i) {\n allFilters.push({operator: RecordFilterOperator.OR});\n }\n\n allFilters.push({field: 'id', condition: RecordFilterCondition.EQUAL, value: recordId});\n\n return allFilters;\n }, []);\n\nexport const useGetRecordValuesQuery = (\n libraryId: string,\n columns: string[],\n recordIds: string[],\n skip?: boolean,\n): IUseGetRecordColumnsValuesQueryHook => {\n const [queryData, setQueryData] = useState<IColumnsValuesByRecord>();\n\n const _convertQueryResult = (queryResult: IGetRecordColumnsValues): IColumnsValuesByRecord =>\n (queryResult.records.list ?? []).reduce((valuesByRecord, recordValues) => {\n valuesByRecord[recordValues._id] = recordValues;\n return valuesByRecord;\n }, {});\n\n const query = useQuery<IGetRecordColumnsValues, IGetRecordColumnsValuesVariables>(getRecordColumnsValues(columns), {\n variables: {\n library: libraryId,\n // Turn records ids into filters with OR operators\n filters: _recordIdsToQueryFilters(recordIds),\n },\n skip: skip || !libraryId || !columns.length || !recordIds.length,\n onCompleted: data => {\n const cleanData: IColumnsValuesByRecord = _convertQueryResult(data);\n setQueryData(cleanData);\n },\n });\n\n const customRefetch = async (refetchRecordIds: string[]) => {\n const customVariables = {\n filters: _recordIdsToQueryFilters(refetchRecordIds ?? []),\n };\n\n const refetchData = await query.refetch(customVariables);\n\n const cleanData: IColumnsValuesByRecord = _convertQueryResult(refetchData.data);\n setQueryData({...queryData, ...cleanData});\n\n return refetchData;\n };\n\n // @ts-ignore\n return {\n ...query,\n loading: query.loading || typeof queryData === undefined,\n data: queryData,\n refetch: customRefetch,\n };\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leav/ui",
|
|
3
|
-
"version": "1.8.0-
|
|
3
|
+
"version": "1.8.0-c4bc6f9a",
|
|
4
4
|
"description": "Shared React components and hooks",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepublishOnly": "yarn build",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"license": "LGPL3",
|
|
25
25
|
"repository": "https://github.com/leav-solutions/leav-engine",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@apollo/client": "3.
|
|
27
|
+
"@apollo/client": "3.8.1",
|
|
28
28
|
"@babel/preset-env": "7.29.0",
|
|
29
29
|
"@babel/preset-react": "7.28.5",
|
|
30
30
|
"@graphql-codegen/add": "5.0.3",
|