@anzusystems/common-admin 1.47.0-beta.358 → 1.47.0-beta.359

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/labs.d.ts CHANGED
@@ -7,18 +7,12 @@ import { ComponentOptionsMixin } from 'vue';
7
7
  import { ComponentProvideOptions } from 'vue';
8
8
  import { ComputedRef } from 'vue';
9
9
  import { DefineComponent } from 'vue';
10
- import { FilterField } from './filterFactory';
11
- import { FilterField as FilterField_2 } from '../filters/filterFactory';
12
10
  import { InjectionKey } from 'vue';
13
11
  import { Method } from 'axios';
14
12
  import { PublicProps } from 'vue';
15
13
  import { Ref } from 'vue';
16
14
  import { ShallowUnwrapRef } from 'vue';
17
- import { SortOrderType as SortOrderType_2 } from '../../composables/system/datatableColumns';
18
- import { UseApiFetchListReturnType as UseApiFetchListReturnType_2 } from '../api/useApiFetchList';
19
15
  import { UseDebounceFnReturn } from '@vueuse/shared';
20
- import { UserAdminConfigDataFilterBookmark as UserAdminConfigDataFilterBookmark_2 } from '../../types/UserAdminConfig';
21
- import { UserAdminConfigDataPinnedWidgets as UserAdminConfigDataPinnedWidgets_2 } from '../../types/UserAdminConfig';
22
16
  import { VNode } from 'vue';
23
17
  import { VNodeProps } from 'vue';
24
18
 
@@ -40,9 +34,9 @@ onBookmarkLoadAfter?: (() => any) | undefined;
40
34
  "onUpdate:showDetail"?: ((value: boolean) => any) | undefined;
41
35
  }>, {
42
36
  userId: IntegerIdNullable;
37
+ client: () => AxiosInstance;
43
38
  enableTop: boolean;
44
39
  hideButtons: boolean;
45
- client: () => AxiosInstance;
46
40
  formName: string;
47
41
  store: FilterStoreIdentifier | boolean;
48
42
  alwaysVisible: boolean;
@@ -65,8 +59,8 @@ onSubmit?: (() => any) | undefined;
65
59
  onBookmarkLoadAfter?: (() => any) | undefined;
66
60
  }>, {
67
61
  userId: IntegerIdNullable;
68
- hideButtons: boolean;
69
62
  client: () => AxiosInstance;
63
+ hideButtons: boolean;
70
64
  formName: string;
71
65
  disableFilterUrlSync: boolean;
72
66
  store: FilterStoreIdentifier | boolean;
@@ -207,7 +201,7 @@ declare function __VLS_template(): {
207
201
  declare function __VLS_template_2(): {
208
202
  attrs: Partial<{}>;
209
203
  slots: Partial<Record<string, (_: {
210
- itemConfig: FilterField_2;
204
+ itemConfig: FilterField;
211
205
  }) => any>> & {
212
206
  bookmarks?(_: {}): any;
213
207
  detail?(_: {}): any;
@@ -332,7 +326,7 @@ itemTitle: string;
332
326
  itemValue: string;
333
327
  filterSortBy: {
334
328
  key: string;
335
- order: SortOrderType_2;
329
+ order: SortOrderType;
336
330
  } | null;
337
331
  prefetch: "hover" | "focus" | "mounted" | false;
338
332
  searchMinChars: number;
@@ -449,6 +443,7 @@ export declare const ASubjectSelect: <TItem>(__VLS_props: NonNullable<Awaited<ty
449
443
  } & Partial<{}>> & PublicProps;
450
444
  expose(exposed: ShallowUnwrapRef< {
451
445
  open: () => void;
446
+ closeSidebarOnMobile: () => void;
452
447
  }>): void;
453
448
  attrs: any;
454
449
  slots: {
@@ -579,10 +574,36 @@ declare type DatetimeUTCNullable = string | null;
579
574
  */
580
575
  declare type DocId = string;
581
576
 
577
+ declare type ExecuteRequestParams<T> = {
578
+ urlTemplate?: string;
579
+ urlParams?: UrlParams;
580
+ object?: T;
581
+ };
582
+
583
+ declare type FetchByIdsParams = {
584
+ urlTemplate?: string;
585
+ urlParams?: UrlParams;
586
+ };
587
+
582
588
  declare type FetchItemsMinimalByIdsType = ((ids: IntegerId[]) => Promise<any[]>) | ((ids: DocId[]) => Promise<any[]>);
583
589
 
584
590
  declare type FetchItemsMinimalType = (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => Promise<any[]>;
585
591
 
592
+ declare type FetchListBatchParams = {
593
+ urlTemplate?: string;
594
+ urlParams?: UrlParams;
595
+ sortBy?: string;
596
+ sortDesc?: boolean;
597
+ batchSize?: number;
598
+ forceElastic?: boolean;
599
+ };
600
+
601
+ declare type FetchListParams = {
602
+ urlTemplate?: string;
603
+ urlParams?: UrlParams;
604
+ forceElastic?: boolean;
605
+ };
606
+
586
607
  declare interface FilerRenderOptions {
587
608
  skip: boolean;
588
609
  xs: number | undefined;
@@ -596,7 +617,7 @@ export declare type FilterConfig<F extends readonly MakeFilterOption<string>[] =
596
617
  general: GeneralFilterOptions;
597
618
  touched: boolean;
598
619
  fields: {
599
- [P in F[number]['name']]: FilterField_3;
620
+ [P in F[number]['name']]: FilterField;
600
621
  };
601
622
  };
602
623
 
@@ -608,7 +629,7 @@ export declare type FilterData<F extends readonly MakeFilterOption<string>[] = r
608
629
 
609
630
  export declare const FilterDataKey: InjectionKey<FilterData>;
610
631
 
611
- declare interface FilterField_3 {
632
+ declare interface FilterField {
612
633
  name: string;
613
634
  type: FilterType;
614
635
  variant: FilterVariant;
@@ -755,34 +776,60 @@ declare type UrlParams = {
755
776
  };
756
777
 
757
778
  declare type UseApiAnyRequestReturnType<R, T = R> = {
758
- executeRequest: (urlTemplateOverride?: string, urlParamsOverride?: UrlParams | undefined, object?: T | undefined) => Promise<R>;
779
+ executeRequest: (params?: ExecuteRequestParams<T>) => Promise<R>;
759
780
  abortRequest: () => void;
760
781
  };
761
782
 
762
- export declare const useApiFetchByIds: <R>(client: AxiosClientFn, system: string, entity: string, urlTemplate?: string | undefined, urlParams?: UrlParams | undefined, options?: AxiosRequestConfig, isSearchApi?: boolean, field?: string) => UseApiFetchByIdsReturnType<R>;
783
+ export declare const useApiFetchByIds: <R>(params: UseApiFetchByIdsParams) => UseApiFetchByIdsReturnType<R>;
784
+
785
+ declare type UseApiFetchByIdsParams = {
786
+ client: AxiosClientFn;
787
+ system: string;
788
+ entity: string;
789
+ urlTemplate?: string;
790
+ urlParams?: UrlParams;
791
+ options?: AxiosRequestConfig;
792
+ isSearchApi?: boolean;
793
+ field?: string;
794
+ silentConsoleError?: boolean;
795
+ };
763
796
 
764
797
  declare type UseApiFetchByIdsReturnType<R> = {
765
- executeFetch: (ids: DocId[] | IntegerId[], urlTemplateOverride?: string, urlParamsOverride?: UrlParams | undefined) => Promise<R>;
798
+ executeFetch: (ids: DocId[] | IntegerId[], params?: FetchByIdsParams) => Promise<R>;
766
799
  abortFetch: () => void;
767
800
  };
768
801
 
769
- /**
770
- * @template R Response type override, optional
771
- */
772
- export declare const useApiFetchList: <R>(client: AxiosClientFn, system: string, entity: string, urlTemplate?: string | undefined, urlParams?: UrlParams | undefined, options?: AxiosRequestConfig) => UseApiFetchListReturnType<R>;
802
+ export declare const useApiFetchList: <R>(params: UseApiFetchListParams) => UseApiFetchListReturnType<R>;
773
803
 
774
- /**
775
- * @template R Response type override
776
- */
777
- export declare const useApiFetchListBatch: <R>(client: AxiosClientFn, system: string, entity: string, urlTemplate?: string | undefined, urlParams?: UrlParams | undefined, options?: AxiosRequestConfig) => UseApiFetchListBatchReturnType<R>;
804
+ export declare const useApiFetchListBatch: <R>(params: UseApiFetchListBatchParams) => UseApiFetchListBatchReturnType<R>;
805
+
806
+ declare type UseApiFetchListBatchParams = {
807
+ client: AxiosClientFn;
808
+ system: string;
809
+ entity: string;
810
+ urlTemplate?: string;
811
+ urlParams?: UrlParams;
812
+ options?: AxiosRequestConfig;
813
+ silentConsoleError?: boolean;
814
+ };
778
815
 
779
816
  declare type UseApiFetchListBatchReturnType<R> = {
780
- executeFetch: (filterData: FilterData<any>, filterConfig: FilterConfig<any>, urlTemplateOverride?: string, urlParamsOverride?: UrlParams, sortBy?: string, sortDesc?: boolean, batchSize?: number, forceElastic?: boolean) => Promise<R>;
817
+ executeFetch: (filterData: FilterData<any>, filterConfig: FilterConfig<any>, params?: FetchListBatchParams) => Promise<R>;
781
818
  abortFetch: () => void;
782
819
  };
783
820
 
821
+ declare type UseApiFetchListParams = {
822
+ client: AxiosClientFn;
823
+ system: string;
824
+ entity: string;
825
+ urlTemplate?: string;
826
+ urlParams?: UrlParams;
827
+ options?: AxiosRequestConfig;
828
+ silentConsoleError?: boolean;
829
+ };
830
+
784
831
  declare type UseApiFetchListReturnType<R> = {
785
- executeFetch: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, urlTemplateOverride?: string | undefined, urlParamsOverride?: UrlParams | undefined, forceElastic?: boolean) => Promise<R>;
832
+ executeFetch: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, params?: FetchListParams) => Promise<R>;
786
833
  abortFetch: () => void;
787
834
  };
788
835
 
@@ -804,11 +851,18 @@ export declare function useApiQueryBuilder(): {
804
851
  q: Ref<string[], string[]>;
805
852
  };
806
853
 
807
- /**
808
- * @template T Type used for request payload, by default, same as Response type
809
- * @template R Response type override, optional
810
- */
811
- export declare const useApiRequest: <R, T = R>(client: AxiosClientFn, method: Method, system: string, entity: string, urlTemplate?: string | undefined, urlParams?: UrlParams | undefined, options?: AxiosRequestConfig) => UseApiAnyRequestReturnType<R, T>;
854
+ export declare const useApiRequest: <R, T = R>(params: UseApiRequestParams) => UseApiAnyRequestReturnType<R, T>;
855
+
856
+ declare type UseApiRequestParams = {
857
+ client: AxiosClientFn;
858
+ method: Method;
859
+ system: string;
860
+ entity: string;
861
+ urlTemplate?: string;
862
+ urlParams?: UrlParams;
863
+ options?: AxiosRequestConfig;
864
+ silentConsoleError?: boolean;
865
+ };
812
866
 
813
867
  export declare function useFilterHelpers<F extends readonly MakeFilterOption<string>[] = readonly MakeFilterOption<string>[]>(filterData: FilterData<F>, filterConfig: FilterConfig<F>, moreOptions?: Partial<FilterHelpersMoreOptions>): {
814
868
  loadStoredFilters: (pagination: Ref<Pagination>, callback?: AnyFn) => boolean;
@@ -822,7 +876,7 @@ export declare function useFilterHelpers<F extends readonly MakeFilterOption<str
822
876
  };
823
877
 
824
878
  export declare function useJobApi<JobType extends JobBase = JobBase>(client: () => AxiosInstance, system: string): {
825
- useFetchJobList: () => UseApiFetchListReturnType_2<JobType[]>;
879
+ useFetchJobList: () => UseApiFetchListReturnType<JobType[]>;
826
880
  fetchJob: (id: number) => Promise<JobType>;
827
881
  createJob: (data: JobType) => Promise<JobType>;
828
882
  deleteJob: (id: number) => Promise<JobType>;
@@ -880,7 +934,7 @@ export declare const UserAdminConfigTypeDefault: "pinnedWidgets";
880
934
 
881
935
  export declare type UserAdminConfigTypeType = (typeof UserAdminConfigType)[keyof typeof UserAdminConfigType];
882
936
 
883
- export declare function useSubjectSelect<TItem>(datatableConfig: any, datatableHiddenColumns: any, system: string, subject: string, executeFetch: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, urlTemplateOverride?: string | undefined, urlParamsOverride?: UrlParams | undefined, forceElastic?: boolean) => Promise<TItem[]>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, filterSortBy?: DatatableSortBy | null, urlTemplateOverride?: string | undefined, urlParamsOverride?: UrlParams | undefined, forceElastic?: boolean, enableActions?: boolean): {
937
+ export declare function useSubjectSelect<TItem>(datatableConfig: any, datatableHiddenColumns: any, system: string, subject: string, executeFetch: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, params?: FetchListParams) => Promise<TItem[]>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, filterSortBy?: DatatableSortBy | null, fetchParams?: FetchListParams | undefined, enableActions?: boolean): {
884
938
  items: Ref<TItem[], TItem[]>;
885
939
  selected: Ref<TItem[], TItem[]>;
886
940
  pagination: Ref<Pagination, Pagination>;
@@ -905,10 +959,10 @@ export declare function useSubjectSelect<TItem>(datatableConfig: any, datatableH
905
959
  };
906
960
 
907
961
  export declare function useUserAdminConfigApi(client: () => AxiosInstance, system: string, entity?: string, endPoint?: string): {
908
- useFetchUserAdminConfigList: () => UseApiFetchListReturnType_2<UserAdminConfig<UserAdminConfigDataFilterBookmark_2 | UserAdminConfigDataPinnedWidgets_2<string>>[]>;
909
- fetchUserAdminConfig: (id: IntegerId) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark_2 | UserAdminConfigDataPinnedWidgets_2<string>>>;
910
- createUserAdminConfig: (data: UserAdminConfig) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark_2 | UserAdminConfigDataPinnedWidgets_2<string>>>;
911
- updateUserAdminConfig: (id: IntegerId, data: UserAdminConfig) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark_2 | UserAdminConfigDataPinnedWidgets_2<string>>>;
962
+ useFetchUserAdminConfigList: () => UseApiFetchListReturnType<UserAdminConfig<UserAdminConfigDataFilterBookmark | UserAdminConfigDataPinnedWidgets<string>>[]>;
963
+ fetchUserAdminConfig: (id: IntegerId) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark | UserAdminConfigDataPinnedWidgets<string>>>;
964
+ createUserAdminConfig: (data: UserAdminConfig) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark | UserAdminConfigDataPinnedWidgets<string>>>;
965
+ updateUserAdminConfig: (id: IntegerId, data: UserAdminConfig) => Promise<UserAdminConfig<UserAdminConfigDataFilterBookmark | UserAdminConfigDataPinnedWidgets<string>>>;
912
966
  deleteUserAdminConfig: (id: IntegerId) => Promise<unknown>;
913
967
  updateUserAdminConfigPositions: (ids: IntegerId[]) => Promise<{
914
968
  userAdminConfigs: IntegerId[];