bt-core-app 1.1.6 → 1.1.8

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 (49) hide show
  1. package/dist/components/BT-Span.vue.d.ts +17 -0
  2. package/dist/components/Dialog-Confirm.vue.d.ts +38 -0
  3. package/dist/components/Dialog-Select-Date.vue.d.ts +36 -0
  4. package/dist/components/Dialog-Select.vue.d.ts +48 -0
  5. package/dist/components/Dialog-Text.vue.d.ts +33 -0
  6. package/dist/composables/actions-tracker.d.ts +19 -0
  7. package/dist/composables/actions.d.ts +79 -0
  8. package/dist/composables/api.d.ts +85 -0
  9. package/dist/composables/auth.d.ts +58 -0
  10. package/dist/composables/cosmetics.d.ts +34 -0
  11. package/dist/composables/csv.d.ts +20 -0
  12. package/dist/composables/dates.d.ts +14 -0
  13. package/dist/composables/demo.d.ts +8 -0
  14. package/dist/composables/dialogs.d.ts +75 -0
  15. package/dist/composables/document-meta.d.ts +11 -0
  16. package/dist/composables/draggable.d.ts +56 -0
  17. package/dist/composables/filters.d.ts +10 -0
  18. package/dist/composables/forage.d.ts +7 -0
  19. package/dist/composables/helpers.d.ts +102 -0
  20. package/dist/composables/id.d.ts +1 -0
  21. package/dist/composables/list.d.ts +202 -0
  22. package/dist/composables/navigation.d.ts +88 -0
  23. package/dist/composables/presets.d.ts +7 -0
  24. package/dist/composables/pwa.d.ts +13 -0
  25. package/dist/composables/resizable.d.ts +35 -0
  26. package/dist/composables/rules.d.ts +7 -0
  27. package/dist/composables/stores.d.ts +100 -0
  28. package/dist/composables/track.d.ts +12 -0
  29. package/dist/composables/urls.d.ts +7 -0
  30. package/dist/core.d.ts +18 -0
  31. package/dist/types.d.ts +11 -0
  32. package/dist/useApi.d.ts +30 -0
  33. package/package.json +3 -1
  34. package/src/composables/actions-tracker.ts +2 -2
  35. package/src/composables/actions.ts +4 -4
  36. package/src/composables/api.ts +1 -1
  37. package/src/composables/auth.ts +2 -2
  38. package/src/composables/dates.ts +0 -1
  39. package/src/composables/dialogs.ts +5 -5
  40. package/src/composables/document-meta.ts +2 -2
  41. package/src/composables/filters.ts +1 -1
  42. package/src/composables/forage.ts +1 -1
  43. package/src/composables/list.ts +3 -3
  44. package/src/composables/navigation.ts +2 -2
  45. package/src/composables/resizable.ts +2 -2
  46. package/src/composables/rules.ts +1 -1
  47. package/src/composables/stores.ts +4 -4
  48. package/tsconfig.json +0 -5
  49. package/vite.config.ts +2 -1
@@ -0,0 +1,17 @@
1
+ interface Props {
2
+ filter: string;
3
+ prefix?: string;
4
+ suffix?: string;
5
+ value: any;
6
+ }
7
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
8
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToRuntimeProps<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -0,0 +1,38 @@
1
+ import { ConfirmDialogProps } from '../composables/dialogs';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ConfirmDialogProps>, {
4
+ cancelValue: boolean;
5
+ confirmValue: boolean;
6
+ startIncludeDetails: boolean;
7
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ cancel: (...args: any[]) => void;
9
+ confirm: (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ConfirmDialogProps>, {
11
+ cancelValue: boolean;
12
+ confirmValue: boolean;
13
+ startIncludeDetails: boolean;
14
+ }>>> & {
15
+ onCancel?: ((...args: any[]) => any) | undefined;
16
+ onConfirm?: ((...args: any[]) => any) | undefined;
17
+ }, {
18
+ cancelValue: any;
19
+ confirmValue: any;
20
+ }, {}>;
21
+ export default _default;
22
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
23
+ type __VLS_TypePropsToRuntimeProps<T> = {
24
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
25
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
26
+ } : {
27
+ type: import('vue').PropType<T[K]>;
28
+ required: true;
29
+ };
30
+ };
31
+ type __VLS_WithDefaults<P, D> = {
32
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
33
+ default: D[K];
34
+ }> : P[K];
35
+ };
36
+ type __VLS_Prettify<T> = {
37
+ [K in keyof T]: T[K];
38
+ } & {};
@@ -0,0 +1,36 @@
1
+ import { SelectDateProps } from '../composables/dialogs';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SelectDateProps>, {
4
+ cancelValue: boolean;
5
+ height: string;
6
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ cancel: (...args: any[]) => void;
8
+ confirm: (...args: any[]) => void;
9
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SelectDateProps>, {
10
+ cancelValue: boolean;
11
+ height: string;
12
+ }>>> & {
13
+ onCancel?: ((...args: any[]) => any) | undefined;
14
+ onConfirm?: ((...args: any[]) => any) | undefined;
15
+ }, {
16
+ height: string;
17
+ cancelValue: any;
18
+ }, {}>;
19
+ export default _default;
20
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
21
+ type __VLS_TypePropsToRuntimeProps<T> = {
22
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
23
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
24
+ } : {
25
+ type: import('vue').PropType<T[K]>;
26
+ required: true;
27
+ };
28
+ };
29
+ type __VLS_WithDefaults<P, D> = {
30
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
31
+ default: D[K];
32
+ }> : P[K];
33
+ };
34
+ type __VLS_Prettify<T> = {
35
+ [K in keyof T]: T[K];
36
+ } & {};
@@ -0,0 +1,48 @@
1
+ import { SelectDialogProps } from '../composables/dialogs';
2
+
3
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SelectDialogProps>, {
4
+ cancelValue: boolean;
5
+ height: string;
6
+ showSearch: boolean;
7
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ cancel: (...args: any[]) => void;
9
+ confirm: (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SelectDialogProps>, {
11
+ cancelValue: boolean;
12
+ height: string;
13
+ showSearch: boolean;
14
+ }>>> & {
15
+ onCancel?: ((...args: any[]) => any) | undefined;
16
+ onConfirm?: ((...args: any[]) => any) | undefined;
17
+ }, {
18
+ height: string;
19
+ cancelValue: any;
20
+ showSearch: boolean;
21
+ }, {}>, {
22
+ default?(_: {
23
+ item: any;
24
+ }): any;
25
+ }>;
26
+ export default _default;
27
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
28
+ type __VLS_TypePropsToRuntimeProps<T> = {
29
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
30
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
31
+ } : {
32
+ type: import('vue').PropType<T[K]>;
33
+ required: true;
34
+ };
35
+ };
36
+ type __VLS_WithDefaults<P, D> = {
37
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
38
+ default: D[K];
39
+ }> : P[K];
40
+ };
41
+ type __VLS_Prettify<T> = {
42
+ [K in keyof T]: T[K];
43
+ } & {};
44
+ type __VLS_WithTemplateSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1,33 @@
1
+ import { TextDialogProps } from '../composables/dialogs';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TextDialogProps>, {
4
+ height: string;
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ cancel: (...args: any[]) => void;
7
+ confirm: (...args: any[]) => void;
8
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TextDialogProps>, {
9
+ height: string;
10
+ }>>> & {
11
+ onCancel?: ((...args: any[]) => any) | undefined;
12
+ onConfirm?: ((...args: any[]) => any) | undefined;
13
+ }, {
14
+ height: string;
15
+ }, {}>;
16
+ export default _default;
17
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
18
+ type __VLS_TypePropsToRuntimeProps<T> = {
19
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
20
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
21
+ } : {
22
+ type: import('vue').PropType<T[K]>;
23
+ required: true;
24
+ };
25
+ };
26
+ type __VLS_WithDefaults<P, D> = {
27
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
28
+ default: D[K];
29
+ }> : P[K];
30
+ };
31
+ type __VLS_Prettify<T> = {
32
+ [K in keyof T]: T[K];
33
+ } & {};
@@ -0,0 +1,19 @@
1
+ import { ShallowRef } from 'vue';
2
+
3
+ export interface DoActionOptions {
4
+ completionMsg?: string;
5
+ confirmationMsg?: string;
6
+ errorMsg?: string;
7
+ loadingMsg?: string;
8
+ requireConfirmation?: boolean;
9
+ throwError?: boolean;
10
+ }
11
+ export declare function useActionsTracker(useOptions?: DoActionOptions): {
12
+ actionErrorMsg: ShallowRef<string | undefined>;
13
+ actionLoadingMsg: ShallowRef<string | undefined>;
14
+ actionCompleteMsg: ShallowRef<string | undefined>;
15
+ clearErrors: () => void;
16
+ doAction: (action: any, options?: DoActionOptions) => Promise<any>;
17
+ isLoading: import('vue').ComputedRef<boolean>;
18
+ logError: (err?: string | Error) => void;
19
+ };
@@ -0,0 +1,79 @@
1
+ import { ShallowRef, ComputedRef } from 'vue';
2
+ import { DoActionOptions } from '../composables/actions-tracker';
3
+ import { BTApi, PathOptions } from '../composables/api';
4
+ import { BTStore } from '../composables/stores';
5
+ import { BladeMode } from '../types';
6
+
7
+ export type OnCanDoAsync = (item: any) => Promise<string | undefined>;
8
+ export type OnDoAsync = (item: any) => Promise<string | undefined>;
9
+ export type OnDoSuccessAsync = (item: any) => Promise<any>;
10
+ export type OnGetAsync = (opt?: GetOptions) => Promise<any>;
11
+ export type OnGetSuccessAsync = (item: any, opt?: GetOptions) => Promise<any>;
12
+ export interface GetOptions extends PathOptions, DoActionOptions {
13
+ /**returns an error msg if failed */
14
+ onGetAsync?: OnGetAsync;
15
+ /**called after get occurs successfully */
16
+ onGetSuccessAsync?: OnGetSuccessAsync;
17
+ store?: BTStore;
18
+ }
19
+ export interface DeleteOptions extends PathOptions, DoActionOptions {
20
+ /**Returns a string if cannot */
21
+ onCanDeleteAsync?: OnCanDoAsync;
22
+ /**Will override the default store delete action */
23
+ onDeleteAsync?: OnDoAsync;
24
+ /**Will open a dialog box requesting user confirmation for delete action */
25
+ onDeleteSuccessAsync?: OnDoAsync;
26
+ store?: BTStore;
27
+ }
28
+ export interface RestoreOptions extends PathOptions, DoActionOptions {
29
+ /**Returns a string if cannot */
30
+ onCanRestoreAsync?: OnCanDoAsync;
31
+ /**Will override the default store delete action */
32
+ onRestoreAsync?: OnDoSuccessAsync;
33
+ /**Called after restore succeeds */
34
+ onRestoreSuccessAsync?: OnDoSuccessAsync;
35
+ store?: BTStore;
36
+ }
37
+ export interface SaveOptions extends PathOptions, DoActionOptions {
38
+ /**will seek to post if 'new' otherwise will patch */
39
+ mode?: BladeMode;
40
+ /**called to check whether to proceed with save */
41
+ onCanSaveAsync?: OnCanDoAsync;
42
+ /**
43
+ * retrieves item to save
44
+ * called before seeing whether it can save
45
+ */
46
+ onGetSaveAsync?: OnDoSuccessAsync;
47
+ /**Will override the default store post/patch action */
48
+ onSaveAsync?: OnDoSuccessAsync;
49
+ /**Called after save succeeds */
50
+ onSaveSuccessAsync?: OnDoSuccessAsync;
51
+ store?: BTStore;
52
+ }
53
+ export interface ApiActionOptions extends PathOptions, DoActionOptions {
54
+ api: BTApi;
55
+ }
56
+ export interface UseActionsOptions extends DoActionOptions {
57
+ nav?: string;
58
+ proxyID?: string;
59
+ refresh?: boolean;
60
+ store?: BTStore;
61
+ throwError?: boolean;
62
+ url?: string;
63
+ }
64
+ export interface BTActions {
65
+ apiGet: (doOptions: ApiActionOptions) => Promise<any>;
66
+ apiPost: (doOptions: ApiActionOptions) => Promise<any>;
67
+ actionLoadingMsg: ShallowRef<string | undefined>;
68
+ actionErrorMsg: ShallowRef<string | undefined>;
69
+ clearErrors: () => void;
70
+ deleteItem: (doOptions: DeleteOptions) => Promise<any>;
71
+ doAction: (action: any, options?: DoActionOptions) => Promise<any>;
72
+ getAllItems: (doOptions: GetOptions) => Promise<any>;
73
+ getItem: (doOptions: GetOptions) => Promise<any>;
74
+ isLoading: ComputedRef<boolean>;
75
+ logError: (err?: string | Error) => void;
76
+ restoreItem: (doOptions: RestoreOptions) => Promise<any>;
77
+ saveItem: (doOptions: SaveOptions) => Promise<any>;
78
+ }
79
+ export declare function useActions(options?: UseActionsOptions): BTActions;
@@ -0,0 +1,85 @@
1
+ import { BTAuth } from './auth';
2
+
3
+ export interface QueryParams {
4
+ filterBy?: string;
5
+ includeCount?: boolean;
6
+ includeDetails?: boolean;
7
+ includeInactive?: boolean;
8
+ lastUpdate?: string;
9
+ other?: any;
10
+ properties?: string[] | string;
11
+ query?: string;
12
+ searchString?: string;
13
+ sortOrder?: string;
14
+ sortBy?: string;
15
+ takeFrom?: number;
16
+ takeAmount?: number;
17
+ }
18
+ export interface PathOptions {
19
+ /**always added to end before query {url}/{additionalUrl}?{query} */
20
+ additionalUrl?: string;
21
+ /**application/json or other options */
22
+ contentType?: string;
23
+ /**that data to send in the body for POST, PATCH, and DELETE requests */
24
+ data?: any;
25
+ /** resulting url after building {nav | url}/{additionalUrl}?{params} */
26
+ finalUrl?: string;
27
+ /**override default headers */
28
+ headers?: HeadersInit;
29
+ /**id will be added as a url paramter (/{id}?) rather than as a query parameter */
30
+ id?: string;
31
+ /**where to find the url */
32
+ nav?: string;
33
+ /**headers will not be calculated. Only the given headers in these options will be used */
34
+ overrideHeaders?: boolean;
35
+ /**query parameters */
36
+ params?: QueryParams;
37
+ /**attaches a proxyID to the request */
38
+ proxyID?: string;
39
+ /**whether to refresh the store data and go straight to the server */
40
+ refresh?: boolean;
41
+ /**returns result as a json object. Defaults to true. */
42
+ returnJson?: boolean;
43
+ /**returns result as a string */
44
+ returnText?: boolean;
45
+ /**If false, returns response no matter the status code */
46
+ throwError?: boolean;
47
+ /**if exists then overrides default nav */
48
+ url?: string;
49
+ /**whether to preference using the local cache */
50
+ useLocalCache?: boolean;
51
+ }
52
+ type FindPath = (navName?: string) => string | undefined;
53
+ export interface UseApiOptions {
54
+ auth?: BTAuth;
55
+ /**overrides the default */
56
+ buildHeaders?: (path: PathOptions) => HeadersInit;
57
+ /**build a query. Overrides the default */
58
+ buildQuery?: (params: any) => string;
59
+ /**overrides the default */
60
+ buildUrl?: (path: PathOptions) => string;
61
+ /**defaults to 'application/json' */
62
+ defaultContentType?: string;
63
+ /**returns result as a json object. Defaults to true. */
64
+ defaultReturnJson?: boolean;
65
+ /**returns result as a string */
66
+ defaultReturnText?: boolean;
67
+ /**defaults to true. Will throw an error on fail */
68
+ defaultThrowError?: boolean;
69
+ /**defaults to a function that returns '' */
70
+ findPath?: FindPath;
71
+ /**if true and logged in then will set an authorization header with 'bearer [token]' */
72
+ useBearerToken?: boolean;
73
+ }
74
+ export interface BTApi {
75
+ buildHeaders: (options: PathOptions) => HeadersInit;
76
+ buildQuery: (params: any) => string;
77
+ buildUrl: (path: PathOptions) => string;
78
+ deleteItem: (pathOptions: PathOptions) => Promise<string | undefined>;
79
+ get: <T>(pathOptions: PathOptions) => Promise<T>;
80
+ getAll: <T>(pathOptions: PathOptions) => Promise<T>;
81
+ post: <T>(pathOptions: PathOptions) => Promise<T | undefined>;
82
+ patch: <T>(pathOptions: PathOptions) => Promise<T | undefined>;
83
+ }
84
+ export declare function createApi(options?: UseApiOptions): BTApi;
85
+ export {};
@@ -0,0 +1,58 @@
1
+ import { BTDemo } from '../composables/demo';
2
+ import { RemovableRef } from '@vueuse/core';
3
+
4
+ export interface AuthItem {
5
+ children?: AuthItem[];
6
+ ignoreSuspension?: boolean;
7
+ permissions?: string[];
8
+ requiresAuth?: boolean;
9
+ subscriptions?: string[];
10
+ }
11
+ export interface AuthSubscription {
12
+ code: string;
13
+ value: number;
14
+ }
15
+ export interface BaseAuthCredentials {
16
+ expiresOn?: string;
17
+ isGlobalAdmin?: boolean;
18
+ isLoggedIn?: boolean;
19
+ isSuspended?: boolean;
20
+ permissions?: string;
21
+ subscriptionCode?: string;
22
+ timeZone?: string;
23
+ token?: string;
24
+ userID?: string;
25
+ userPermissions?: string[];
26
+ }
27
+ export type GetAuthUrl = (redirectPath?: string, state?: string) => string;
28
+ export interface CreateAuthOptions {
29
+ defaultTimeZone?: string;
30
+ demo?: BTDemo;
31
+ /**expiry token date format. Defaults to 'd/MM/yyyy h:mm:ss a' */
32
+ expiryTokenFormat?: string;
33
+ /**retrieve the auth item */
34
+ getAuthItem: (navName?: string | AuthItem) => AuthItem | null;
35
+ /**retrieve the url to navigate to for the OAuth 2.0 process */
36
+ getAuthUrl: GetAuthUrl;
37
+ /**sets current credentials on top of default function*/
38
+ setCredentials?: (state: RemovableRef<any>, payload: any) => void;
39
+ /**suboptions */
40
+ subscriptionOptions?: AuthSubscription[];
41
+ }
42
+ export interface BTAuth {
43
+ authState: string;
44
+ canEdit: (navName?: string) => boolean;
45
+ canEditPermit: (permit: string) => boolean;
46
+ canView: (navName?: string) => boolean;
47
+ canViewPermit: (permit: string) => boolean;
48
+ credentials: any;
49
+ doShow: (subcodes?: string[], permissions?: string[], action?: 'view' | 'edit') => boolean;
50
+ doShowByNav: (navName?: string | AuthItem, includeChildren?: boolean) => boolean;
51
+ getAuthUrl: (redirectPath?: string) => string;
52
+ getTimeZone: () => string;
53
+ login: (redirectPath?: string) => void;
54
+ logout: (navNameRedirect?: string) => void;
55
+ setAuth: (jwtToken?: string) => void;
56
+ tryLogin: () => boolean | undefined;
57
+ }
58
+ export declare function createAuth(options: CreateAuthOptions): BTAuth;
@@ -0,0 +1,34 @@
1
+ interface CosmeticData {
2
+ dark?: BaseCosmeticTheme;
3
+ drawer?: boolean;
4
+ drawerStick?: boolean;
5
+ light?: BaseCosmeticTheme;
6
+ theme?: string;
7
+ }
8
+ export interface BaseCosmeticTheme {
9
+ primary: string;
10
+ secondary: string;
11
+ accent: string;
12
+ error: string;
13
+ info: string;
14
+ success: string;
15
+ warning: string;
16
+ }
17
+ export interface UseCosmeticsOptions<T extends BaseCosmeticTheme> {
18
+ defaultDarkTheme?: T;
19
+ defaultLightTheme?: T;
20
+ defaultDrawer?: boolean;
21
+ defaultDrawerStick?: boolean;
22
+ defaultTheme?: string;
23
+ }
24
+ export interface BTCosmetics {
25
+ state: CosmeticData;
26
+ resetCosmetics: (toDefault: boolean) => void;
27
+ setTemporaryColor: (color: string) => void;
28
+ toggleDrawer: () => void;
29
+ toggleDrawerStick: () => void;
30
+ toggleLightDark: () => void;
31
+ undoTemporaryColor: () => void;
32
+ }
33
+ export declare function createCosmetics<T extends BaseCosmeticTheme>(options: UseCosmeticsOptions<T>): BTCosmetics;
34
+ export {};
@@ -0,0 +1,20 @@
1
+ export interface CSVProps {
2
+ canExportCSV?: boolean;
3
+ }
4
+ export declare const csvDefaults: {
5
+ canExportCSV: boolean;
6
+ };
7
+ export interface UseCSVPropsReturn {
8
+ exportToCSV: Function;
9
+ }
10
+ export interface CSVItem {
11
+ header: string;
12
+ itemText?: string;
13
+ value: any;
14
+ }
15
+ declare global {
16
+ interface Navigator {
17
+ msSaveOrOpenBlob: (blob: Blob, fileName: string) => boolean;
18
+ }
19
+ }
20
+ export declare function useCSV(): UseCSVPropsReturn;
@@ -0,0 +1,14 @@
1
+ import { DateTime } from 'luxon';
2
+
3
+ export interface BTDates {
4
+ getToday: () => string;
5
+ getTomorrow: () => string;
6
+ tzDate: (val?: string, fromFormat?: string) => DateTime;
7
+ tzString: (val?: string, format?: string, fromFormat?: string) => string;
8
+ utcDate: (val?: string, fromFormat?: string) => DateTime;
9
+ utcString: (val?: string, format?: string, fromFormat?: string) => string;
10
+ }
11
+ export interface CreateDatesOptions {
12
+ getTimeZone: () => string;
13
+ }
14
+ export declare function createDates(options: CreateDatesOptions): BTDates;
@@ -0,0 +1,8 @@
1
+ import { Ref } from 'vue';
2
+
3
+ export interface BTDemo {
4
+ endDemo: () => void;
5
+ isDemoing: Ref<boolean>;
6
+ startDemo: () => void;
7
+ }
8
+ export declare function createDemo(): BTDemo;
@@ -0,0 +1,75 @@
1
+ import { ListProps } from '../composables/list';
2
+
3
+ export interface ConfirmDialogProps {
4
+ cancelText?: string;
5
+ cancelValue?: any;
6
+ confirmText?: string;
7
+ confirmValue?: any;
8
+ msg?: string;
9
+ maxWidth?: number;
10
+ minWidth?: number;
11
+ title?: string;
12
+ }
13
+ export interface SelectDateProps {
14
+ cancelText?: string;
15
+ cancelValue?: any;
16
+ confirmText?: string;
17
+ dateFrom?: string;
18
+ dateRules?: Function | unknown[];
19
+ format?: string;
20
+ fromNow?: boolean;
21
+ height?: string;
22
+ msg?: string;
23
+ maxWidth?: number;
24
+ minWidth?: number;
25
+ range?: boolean;
26
+ required?: boolean;
27
+ requireTime?: boolean;
28
+ title?: string;
29
+ useTime?: boolean;
30
+ }
31
+ export interface SelectDialogProps extends ListProps {
32
+ cancelText?: string;
33
+ cancelValue?: any;
34
+ canUnselect?: boolean;
35
+ confirmText?: string;
36
+ height?: string;
37
+ itemSubtext?: string;
38
+ itemText?: string;
39
+ itemValue?: string;
40
+ msg?: string;
41
+ maxWidth?: number;
42
+ minWidth?: number;
43
+ multiple?: boolean;
44
+ nav?: string;
45
+ onFilter?: Function;
46
+ required?: boolean;
47
+ subtextFilter?: string;
48
+ subtextFunction?: Function;
49
+ textFilter?: string;
50
+ textFunction?: Function;
51
+ title?: string;
52
+ }
53
+ export interface TextDialogProps extends ListProps {
54
+ cancelText?: string;
55
+ confirmText?: string;
56
+ height?: string;
57
+ label?: string;
58
+ msg?: string;
59
+ maxWidth?: number;
60
+ minWidth?: number;
61
+ required?: boolean;
62
+ title?: string;
63
+ value?: any;
64
+ }
65
+ export declare function useRequireConfirmation(action: any, props: ConfirmDialogProps, requireConfirm: boolean): void;
66
+ export declare function useConfirmAsync(text: string): Promise<boolean>;
67
+ /**
68
+ * Returns undefined if cancelled
69
+ * [] if multiple
70
+ * Null | Obj if single
71
+ * @param opts
72
+ */
73
+ export declare function useSelectDialog(opts?: SelectDialogProps): Promise<any>;
74
+ export declare function useSelectDate(opts?: SelectDateProps): Promise<any>;
75
+ export declare function useTextDialog(opts?: TextDialogProps): Promise<any>;
@@ -0,0 +1,11 @@
1
+ import { BTDemo } from '../composables/demo';
2
+ import { RouteLocationNormalized } from 'vue-router';
3
+
4
+ export interface UseDocumentMetaOptions {
5
+ demo?: BTDemo;
6
+ }
7
+ export interface BTDocumentMeta {
8
+ updateMeta: (to: RouteLocationNormalized) => void;
9
+ }
10
+ /**routes with meta object */
11
+ export declare function useDocumentMeta(options?: UseDocumentMetaOptions): BTDocumentMeta;
@@ -0,0 +1,56 @@
1
+ import { Position } from '@vueuse/core';
2
+ import { ComponentPublicInstance, MaybeRefOrGetter, Ref } from 'vue';
3
+
4
+ export interface UseDraggableOptions {
5
+ /**
6
+ * Only start the dragging when click on the element directly
7
+ *
8
+ * @default false
9
+ */
10
+ preventDefault?: MaybeRefOrGetter<boolean>;
11
+ stopPropagation?: MaybeRefOrGetter<boolean>;
12
+ /**
13
+ * Whether dispatch events in capturing phase
14
+ *
15
+ * @default true
16
+ */
17
+ capture?: boolean;
18
+ /**
19
+ * Element to attach `pointermove` and `pointerup` events to.
20
+ *
21
+ * @default window
22
+ */
23
+ draggingElement?: MaybeRefOrGetter<HTMLElement | SVGElement | Window | Document | null | undefined>;
24
+ /**
25
+ * Element for calculating bounds (If not set, it will use the event's target).
26
+ *
27
+ * @default undefined
28
+ */
29
+ /**
30
+ * Handle that triggers the drag event
31
+ *
32
+ * @default target
33
+ */
34
+ handle?: MaybeRefOrGetter<HTMLElement | SVGElement | null | undefined>;
35
+ /**
36
+ * Initial position of the element.
37
+ *
38
+ * @default { x: 0, y: 0 }
39
+ */
40
+ initialValue?: MaybeRefOrGetter<Position>;
41
+ onStart?: (position: Position, event: PointerEvent) => void | false;
42
+ onMove?: (position: Position, event: PointerEvent) => void;
43
+ onEnd?: (position: Position, event: PointerEvent) => void;
44
+ /**
45
+ * Axis to drag on.
46
+ *
47
+ * @default 'both'
48
+ */
49
+ axis?: 'x' | 'y' | 'both';
50
+ }
51
+ export declare function useDraggable(target: MaybeRefOrGetter<ComponentPublicInstance | null>, //HTMLElement | SVGElement | null | undefined>,
52
+ handle: MaybeRefOrGetter<ComponentPublicInstance | null>, options?: UseDraggableOptions): {
53
+ draggingIsOn: Ref<boolean>;
54
+ turnDraggableOff: () => void;
55
+ turnDraggableOn: () => void;
56
+ };
@@ -0,0 +1,10 @@
1
+ import { BTDates } from './dates';
2
+
3
+ export interface BTFilters {
4
+ findFilter: (mFilter: string | undefined) => Function;
5
+ }
6
+ export interface UseFiltersOptions {
7
+ dates: BTDates;
8
+ }
9
+ export declare function createFilters(options: UseFiltersOptions): BTFilters;
10
+ export type Textfilter = 'toLocationLine' | 'toLocationLineNoCommas' | 'toLongDate' | 'toLongDateAndTime' | 'toPercent' | 'toPrettyCSV' | 'toShortDate' | 'toShortDateAndTime' | 'toTime' | 'toTimeOfDay' | 'toCompanyNameAndLocationLine' | 'toCurrency' | 'toDayDate' | 'toDayMonth' | 'toDayOfWeek' | 'toDayShortDate' | 'toDayShortDateAndTime' | 'toDisplayNumber' | 'toDisplayNumberOver' | 'toDisplayNumberSigned' | 'toFormat';
@@ -0,0 +1,7 @@
1
+ export declare function useLocalDb(): LocalForage;
2
+ export declare function useLocalCache(): {
3
+ clearAsync: (storeName: string) => Promise<void>;
4
+ getAsync: <T>(key: string) => Promise<T | null>;
5
+ removeAsync: (key: string) => Promise<void>;
6
+ saveAsync: <T_1>(data: T_1, key: string) => Promise<void>;
7
+ };