bt-core-app 1.1.4 → 1.1.7
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/bt-core-app.js +16462 -21769
- package/dist/composables/actions.d.ts +3 -3
- package/dist/composables/api.d.ts +1 -1
- package/dist/composables/auth.d.ts +1 -1
- package/dist/composables/dialogs.d.ts +1 -1
- package/dist/composables/document-meta.d.ts +5 -4
- package/dist/composables/list.d.ts +202 -0
- package/dist/composables/navigation.d.ts +1 -2
- package/dist/composables/rules.d.ts +1 -2
- package/dist/composables/stores.d.ts +2 -2
- package/dist/index.d.ts +40 -13
- package/package.json +2 -1
- package/src/composables/actions-tracker.ts +2 -2
- package/src/composables/actions.ts +4 -4
- package/src/composables/api.ts +2 -2
- package/src/composables/auth.ts +2 -2
- package/src/composables/dates.ts +0 -1
- package/src/composables/dialogs.ts +5 -5
- package/src/composables/document-meta.ts +7 -3
- package/src/composables/filters.ts +1 -1
- package/src/composables/forage.ts +1 -1
- package/src/composables/list.ts +8 -8
- package/src/composables/navigation.ts +3 -3
- package/src/composables/resizable.ts +2 -2
- package/src/composables/rules.ts +2 -2
- package/src/composables/stores.ts +5 -5
- package/src/index.ts +46 -13
- package/tsconfig.json +0 -5
- package/vite.config.ts +10 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ShallowRef, ComputedRef } from 'vue';
|
|
2
|
-
import { DoActionOptions } from '
|
|
3
|
-
import { BTApi, PathOptions } from '
|
|
4
|
-
import { BTStore } from '
|
|
2
|
+
import { DoActionOptions } from '../composables/actions-tracker';
|
|
3
|
+
import { BTApi, PathOptions } from '../composables/api';
|
|
4
|
+
import { BTStore } from '../composables/stores';
|
|
5
5
|
import { BladeMode } from '../types';
|
|
6
6
|
|
|
7
7
|
export type OnCanDoAsync = (item: any) => Promise<string | undefined>;
|
|
@@ -50,7 +50,7 @@ export interface PathOptions {
|
|
|
50
50
|
useLocalCache?: boolean;
|
|
51
51
|
}
|
|
52
52
|
type FindPath = (navName?: string) => string | undefined;
|
|
53
|
-
interface UseApiOptions {
|
|
53
|
+
export interface UseApiOptions {
|
|
54
54
|
auth?: BTAuth;
|
|
55
55
|
/**overrides the default */
|
|
56
56
|
buildHeaders?: (path: PathOptions) => HeadersInit;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { BTDemo } from '
|
|
1
|
+
import { BTDemo } from '../composables/demo';
|
|
2
2
|
import { RouteLocationNormalized } from 'vue-router';
|
|
3
3
|
|
|
4
4
|
export interface UseDocumentMetaOptions {
|
|
5
5
|
demo?: BTDemo;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
export declare function useDocumentMeta(options?: UseDocumentMetaOptions): {
|
|
7
|
+
export interface BTDocumentMeta {
|
|
9
8
|
updateMeta: (to: RouteLocationNormalized) => void;
|
|
10
|
-
}
|
|
9
|
+
}
|
|
10
|
+
/**routes with meta object */
|
|
11
|
+
export declare function useDocumentMeta(options?: UseDocumentMetaOptions): BTDocumentMeta;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { StorageMode, StoreMode } from '../index';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import { BladeVariant } from '../types';
|
|
4
|
+
import { OnCanDoAsync, OnDoAsync, OnDoSuccessAsync, OnGetAsync, OnGetSuccessAsync } from './actions';
|
|
5
|
+
|
|
6
|
+
export interface RefreshOptions {
|
|
7
|
+
deepRefresh?: boolean;
|
|
8
|
+
resetSearch?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TableColumn {
|
|
11
|
+
align?: 'start' | 'end' | 'center';
|
|
12
|
+
csv?: boolean;
|
|
13
|
+
csvArray?: boolean;
|
|
14
|
+
csvFilter?: string;
|
|
15
|
+
csvText?: string;
|
|
16
|
+
hide?: boolean;
|
|
17
|
+
itemText?: string;
|
|
18
|
+
level?: number;
|
|
19
|
+
maxWidth?: string;
|
|
20
|
+
minWidth?: string;
|
|
21
|
+
prefix?: string;
|
|
22
|
+
searchable?: boolean;
|
|
23
|
+
sublevel?: number;
|
|
24
|
+
suffix?: string;
|
|
25
|
+
textFilter?: string;
|
|
26
|
+
textFunction?: Function;
|
|
27
|
+
title?: string;
|
|
28
|
+
value?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CustomFilterParam {
|
|
31
|
+
name: string;
|
|
32
|
+
filterFunction: () => string;
|
|
33
|
+
onFilterResult: Function | null;
|
|
34
|
+
}
|
|
35
|
+
export interface ListEvents {
|
|
36
|
+
(e: 'change', item: any): void;
|
|
37
|
+
(e: 'deleted', item: any): void;
|
|
38
|
+
(e: 'input', item: any): void;
|
|
39
|
+
(e: 'select', item: any): void;
|
|
40
|
+
(e: 'mouse-over-item', item: any): void;
|
|
41
|
+
}
|
|
42
|
+
export interface ListProps {
|
|
43
|
+
additionalUrl?: string;
|
|
44
|
+
bladeName?: string;
|
|
45
|
+
canAdd?: boolean;
|
|
46
|
+
canDelete?: boolean;
|
|
47
|
+
canEdit?: boolean;
|
|
48
|
+
canRestore?: boolean;
|
|
49
|
+
canShowInactive?: boolean;
|
|
50
|
+
canSelect?: boolean;
|
|
51
|
+
canUnselect?: boolean;
|
|
52
|
+
confirmOnDelete?: boolean;
|
|
53
|
+
customFilters?: CustomFilterParam[];
|
|
54
|
+
defaultFilters?: string[];
|
|
55
|
+
dividers?: boolean;
|
|
56
|
+
eager?: boolean;
|
|
57
|
+
errorMsg?: string;
|
|
58
|
+
headers?: TableColumn[];
|
|
59
|
+
hideActions?: boolean;
|
|
60
|
+
hideColumns?: boolean;
|
|
61
|
+
hideFilters?: boolean;
|
|
62
|
+
hideRefresh?: boolean;
|
|
63
|
+
hideSubtoolbarSettings?: boolean;
|
|
64
|
+
includeDetails?: boolean;
|
|
65
|
+
isSingle?: boolean;
|
|
66
|
+
itemBladeName?: string;
|
|
67
|
+
itemID?: string;
|
|
68
|
+
items?: any[];
|
|
69
|
+
itemsPerPage?: number;
|
|
70
|
+
itemText?: string;
|
|
71
|
+
lines?: 'one' | 'two' | 'three';
|
|
72
|
+
loadingMsg?: string;
|
|
73
|
+
localOnly?: boolean;
|
|
74
|
+
nav?: string;
|
|
75
|
+
/**for defining if deletable (show button or not) */
|
|
76
|
+
onCanDelete?: (item: any) => boolean;
|
|
77
|
+
/**when trying to delete in api */
|
|
78
|
+
onCanDeleteAsync?: OnCanDoAsync;
|
|
79
|
+
onGetSaveAsync?: OnDoSuccessAsync;
|
|
80
|
+
onCanRestore?: (item: any) => boolean;
|
|
81
|
+
onCanRestoreAsync?: OnCanDoAsync;
|
|
82
|
+
onCanSaveAsync?: OnCanDoAsync;
|
|
83
|
+
onCanSelectItem?: (item: any) => boolean;
|
|
84
|
+
onDeleteAsync?: OnDoAsync;
|
|
85
|
+
onDeleteSuccessAsync?: OnDoAsync;
|
|
86
|
+
onFilter?: Function;
|
|
87
|
+
onGetAsync?: OnGetAsync;
|
|
88
|
+
onGetSuccessAsync?: OnGetSuccessAsync;
|
|
89
|
+
onRestoreAsync?: OnDoSuccessAsync;
|
|
90
|
+
onRestoreSuccessAsync?: OnDoSuccessAsync;
|
|
91
|
+
onSaveAsync?: OnDoSuccessAsync;
|
|
92
|
+
onSaveSuccessAsync?: OnDoSuccessAsync;
|
|
93
|
+
onSelectItem?: (item: any) => void;
|
|
94
|
+
params?: any;
|
|
95
|
+
proxyID?: string;
|
|
96
|
+
proxyQueryKey?: string;
|
|
97
|
+
refreshToggle?: boolean;
|
|
98
|
+
searchProps?: string[];
|
|
99
|
+
searchQueryKey?: string;
|
|
100
|
+
selectProps?: string[];
|
|
101
|
+
sortBy?: string;
|
|
102
|
+
sortOrder?: 'Ascending' | 'Descending';
|
|
103
|
+
showListOnly?: boolean;
|
|
104
|
+
showTableOnly?: boolean;
|
|
105
|
+
showSearch?: boolean;
|
|
106
|
+
startShowingInactive?: boolean;
|
|
107
|
+
storeMode?: StoreMode;
|
|
108
|
+
storageMode?: StorageMode;
|
|
109
|
+
useInterEvents?: boolean;
|
|
110
|
+
useServerPagination?: boolean;
|
|
111
|
+
useBladeSrc?: boolean;
|
|
112
|
+
useRouteSrc?: boolean;
|
|
113
|
+
variant?: BladeVariant;
|
|
114
|
+
}
|
|
115
|
+
export interface GroupedHeaderOption {
|
|
116
|
+
position: number;
|
|
117
|
+
values: TableColumn[];
|
|
118
|
+
}
|
|
119
|
+
export interface UseListOptions {
|
|
120
|
+
storeMode?: StoreMode;
|
|
121
|
+
storageMode?: StorageMode;
|
|
122
|
+
useBladeSrc?: boolean;
|
|
123
|
+
useRouteSrc?: boolean;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* PROPS first
|
|
127
|
+
* ROUTE second
|
|
128
|
+
* BLADE third
|
|
129
|
+
* @param props
|
|
130
|
+
* @param emit
|
|
131
|
+
* @param options
|
|
132
|
+
*/
|
|
133
|
+
export declare function useList(props: ListProps, emit?: ListEvents, options?: UseListOptions): {
|
|
134
|
+
add: (variant: BladeVariant) => void;
|
|
135
|
+
asyncItems: import('vue').Ref<any[]>;
|
|
136
|
+
currentPage: import('vue').Ref<number>;
|
|
137
|
+
deleteItem: (dItem: MaybeRefOrGetter<any>) => void;
|
|
138
|
+
displayHeaders: import('vue').ComputedRef<never[]>;
|
|
139
|
+
errorMsg: import('vue').ComputedRef<string | undefined>;
|
|
140
|
+
exportToCSV: () => void;
|
|
141
|
+
filteredItems: import('vue').ShallowRef<any[]>;
|
|
142
|
+
filters: import('vue').ComputedRef<string[]>;
|
|
143
|
+
filtersChanged: import('vue').ComputedRef<boolean>;
|
|
144
|
+
headerOptions: import('vue').Ref<{
|
|
145
|
+
align?: "center" | "start" | "end" | undefined;
|
|
146
|
+
csv?: boolean | undefined;
|
|
147
|
+
csvArray?: boolean | undefined;
|
|
148
|
+
csvFilter?: string | undefined;
|
|
149
|
+
csvText?: string | undefined;
|
|
150
|
+
hide?: boolean | undefined;
|
|
151
|
+
itemText?: string | undefined;
|
|
152
|
+
level?: number | undefined;
|
|
153
|
+
maxWidth?: string | undefined;
|
|
154
|
+
minWidth?: string | undefined;
|
|
155
|
+
prefix?: string | undefined;
|
|
156
|
+
searchable?: boolean | undefined;
|
|
157
|
+
sublevel?: number | undefined;
|
|
158
|
+
suffix?: string | undefined;
|
|
159
|
+
textFilter?: string | undefined;
|
|
160
|
+
textFunction?: Function | undefined;
|
|
161
|
+
title?: string | undefined;
|
|
162
|
+
value?: string | undefined;
|
|
163
|
+
}[]>;
|
|
164
|
+
isDeletable: import('vue').ComputedRef<(item: any) => boolean>;
|
|
165
|
+
isLoading: import('vue').ComputedRef<boolean>;
|
|
166
|
+
isRestorable: import('vue').ComputedRef<(item: any) => boolean>;
|
|
167
|
+
loadingMsg: import('vue').ComputedRef<string | undefined>;
|
|
168
|
+
refresh: (options?: RefreshOptions) => Promise<void>;
|
|
169
|
+
restoreItem: (dItem: MaybeRefOrGetter<any>) => void;
|
|
170
|
+
searchString: import('vue').Ref<string | undefined>;
|
|
171
|
+
selectedFilters: import('vue').Ref<number[]>;
|
|
172
|
+
selectItem: (rItem: any, variant: BladeVariant) => void;
|
|
173
|
+
serverFilters: import('vue').Ref<string[]>;
|
|
174
|
+
showError: import('vue').ShallowRef<boolean>;
|
|
175
|
+
showInactive: import('vue').Ref<boolean>;
|
|
176
|
+
showSearch: import('vue').ShallowRef<boolean>;
|
|
177
|
+
sortOrder: import('vue').Ref<"Ascending" | "Descending" | undefined>;
|
|
178
|
+
subtitleOptions: import('vue').ComputedRef<GroupedHeaderOption[]>;
|
|
179
|
+
tableHeaders: import('vue').ComputedRef<{
|
|
180
|
+
align?: "center" | "start" | "end" | undefined;
|
|
181
|
+
csv?: boolean | undefined;
|
|
182
|
+
csvArray?: boolean | undefined;
|
|
183
|
+
csvFilter?: string | undefined;
|
|
184
|
+
csvText?: string | undefined;
|
|
185
|
+
hide?: boolean | undefined;
|
|
186
|
+
itemText?: string | undefined;
|
|
187
|
+
level?: number | undefined;
|
|
188
|
+
maxWidth?: string | undefined;
|
|
189
|
+
minWidth?: string | undefined;
|
|
190
|
+
prefix?: string | undefined;
|
|
191
|
+
searchable?: boolean | undefined;
|
|
192
|
+
sublevel?: number | undefined;
|
|
193
|
+
suffix?: string | undefined;
|
|
194
|
+
textFilter?: string | undefined;
|
|
195
|
+
textFunction?: Function | undefined;
|
|
196
|
+
title?: string | undefined;
|
|
197
|
+
value?: string | undefined;
|
|
198
|
+
}[]>;
|
|
199
|
+
titleOptions: import('vue').ComputedRef<GroupedHeaderOption[]>;
|
|
200
|
+
toggleSearch: () => void;
|
|
201
|
+
totalPages: import('vue').Ref<number>;
|
|
202
|
+
};
|
|
@@ -81,9 +81,8 @@ export interface BTNavigation {
|
|
|
81
81
|
findSingleDisplay: (navName?: string) => string | undefined;
|
|
82
82
|
updateNavigationProperties: (navName?: string | NavigationItem) => void;
|
|
83
83
|
}
|
|
84
|
-
interface UseNavigationOptions {
|
|
84
|
+
export interface UseNavigationOptions {
|
|
85
85
|
defaultCacheExpiryHours?: number;
|
|
86
86
|
navItems?: NavigationItem[];
|
|
87
87
|
}
|
|
88
88
|
export declare function createNavigation(options: UseNavigationOptions): BTNavigation;
|
|
89
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BTAuth } from './auth';
|
|
2
2
|
import { BaseModel } from '../types';
|
|
3
|
-
import { PathOptions, BTApi } from '
|
|
3
|
+
import { PathOptions, BTApi } from '../composables/api';
|
|
4
4
|
import { StoreDefinition } from 'pinia';
|
|
5
5
|
|
|
6
6
|
export type StoreMode = 'whole-last-updated' | 'partial-last-updated' | 'session';
|
|
@@ -37,7 +37,7 @@ export interface BTStore extends StoreDefinition<any, {}, {}, {
|
|
|
37
37
|
export interface ApiError {
|
|
38
38
|
message: string;
|
|
39
39
|
}
|
|
40
|
-
interface UseStoreOptions {
|
|
40
|
+
export interface UseStoreOptions {
|
|
41
41
|
/**ideally required. Otherwise will struggle to find url path */
|
|
42
42
|
api?: BTApi;
|
|
43
43
|
/**ideally required. For setting unique local storage keys */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,43 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export { useActionsTracker } from './composables/actions-tracker';
|
|
2
|
+
export type { BTActions, GetOptions, DeleteOptions, RestoreOptions, SaveOptions, ApiActionOptions, UseActionsOptions } from './composables/actions';
|
|
3
|
+
export { useActions } from './composables/actions';
|
|
4
|
+
export type { BTApi, UseApiOptions, PathOptions, QueryParams } from './composables/api';
|
|
5
|
+
export { createApi } from './composables/api';
|
|
6
|
+
export type { BTAuth, AuthItem, AuthSubscription, BaseAuthCredentials, CreateAuthOptions } from './composables/auth';
|
|
7
|
+
export { createAuth } from './composables/auth';
|
|
8
|
+
export type { BTCosmetics, BaseCosmeticTheme, UseCosmeticsOptions } from './composables/cosmetics';
|
|
9
|
+
export { createCosmetics } from './composables/cosmetics';
|
|
10
|
+
export * from './composables/csv';
|
|
11
|
+
export type { BTDates, CreateDatesOptions } from './composables/dates';
|
|
12
|
+
export { createDates } from './composables/dates';
|
|
13
|
+
export type { BTDemo } from './composables/demo';
|
|
14
|
+
export { createDemo } from './composables/demo';
|
|
15
|
+
export * from './composables/dialogs';
|
|
16
|
+
export type { BTDocumentMeta, UseDocumentMetaOptions } from './composables/document-meta';
|
|
17
|
+
export { useDocumentMeta } from './composables/document-meta';
|
|
5
18
|
export * from './composables/draggable';
|
|
6
|
-
export
|
|
19
|
+
export type { BTFilters, UseFiltersOptions } from './composables/filters';
|
|
20
|
+
export { createFilters } from './composables/filters';
|
|
21
|
+
export { useLocalDb, useLocalCache } from './composables/forage';
|
|
7
22
|
export * from './composables/helpers';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
23
|
+
export { useId } from './composables/id';
|
|
24
|
+
export type { TableColumn, CustomFilterParam, ListEvents, ListProps, GroupedHeaderOption, UseListOptions } from './composables/list';
|
|
25
|
+
export { useList } from './composables/list';
|
|
26
|
+
export type { BTNavigation, ExternalParty, ExternalNavigation, NavigationItem, UseNavigationOptions } from './composables/navigation';
|
|
27
|
+
export { createNavigation } from './composables/navigation';
|
|
28
|
+
export type { BTPresets, CreatePresetsOptions } from './composables/presets';
|
|
29
|
+
export { createPresets } from './composables/presets';
|
|
30
|
+
export type { BTPWA, SWEvent } from './composables/pwa';
|
|
31
|
+
export { createPWA } from './composables/pwa';
|
|
10
32
|
export * from './composables/resizable';
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
33
|
+
export type { UseRulesOptions } from './composables/rules';
|
|
34
|
+
export { useRules } from './composables/rules';
|
|
35
|
+
export type { BTStore, StoreMode, StorageMode, LocalMeta, LocallyStoredItem, StoreGetAllReturn, StoreGetReturn, UseStoreOptions, CreateStoreBuilderOptions, CreateStoreOptions } from './composables/stores';
|
|
36
|
+
export { createStoreBuilder, createStore, createWholeLastUpdateStore, createSessionStore } from './composables/stores';
|
|
37
|
+
export type { UseTrackerOptions } from './composables/track';
|
|
38
|
+
export { useTracker } from './composables/track';
|
|
39
|
+
export { useUrl } from './composables/urls';
|
|
40
|
+
export { useApi, useAuth, useCosmetics, useDates, useDemo, useFilters, useNavigation, usePresets, usePWA, useStore } from './useApi';
|
|
41
|
+
export * from './types';
|
|
42
|
+
export type { CoreApp, CreateCoreOptions } from './core';
|
|
43
|
+
export { createCore } from './core';
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bt-core-app",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Core app tools for some basic features like navigation, authentication, server apis, and cosmetics",
|
|
5
5
|
"homepage": "https://github.com/BlitzItTech/bt-core",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/BlitzItTech/bt-core/issues"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
10
11
|
"scripts": {
|
|
11
12
|
"dev": "vite",
|
|
12
13
|
"build": "vue-tsc && vite build",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed, ref, shallowRef } from 'vue'
|
|
2
2
|
import type { ShallowRef, Ref } from 'vue'
|
|
3
|
-
import { useConfirmAsync } from '
|
|
3
|
+
import { useConfirmAsync } from '../composables/dialogs'
|
|
4
4
|
import { watchArray } from '@vueuse/core'
|
|
5
|
-
import { useId } from '
|
|
5
|
+
import { useId } from '../composables/id'
|
|
6
6
|
|
|
7
7
|
interface LoadingMsg {
|
|
8
8
|
id: string,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BladeMode } from '
|
|
2
|
-
import { BTStore } from '
|
|
3
|
-
import { BTApi, type PathOptions } from '
|
|
4
|
-
import { useActionsTracker, type DoActionOptions } from '
|
|
1
|
+
import type { BladeMode } from '../types'
|
|
2
|
+
import { BTStore } from '../composables/stores'
|
|
3
|
+
import { BTApi, type PathOptions } from '../composables/api'
|
|
4
|
+
import { useActionsTracker, type DoActionOptions } from '../composables/actions-tracker'
|
|
5
5
|
import { ShallowRef, ComputedRef } from 'vue'
|
|
6
6
|
|
|
7
7
|
export type OnCanDoAsync = (item: any) => Promise<string | undefined>
|
package/src/composables/api.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toValue } from 'vue'
|
|
2
|
-
import { appendUrl } from '
|
|
2
|
+
import { appendUrl } from '../composables/helpers'
|
|
3
3
|
import { type BTAuth } from './auth'
|
|
4
4
|
|
|
5
5
|
export interface QueryParams {
|
|
@@ -58,7 +58,7 @@ type FindPath = (navName?: string) => string | undefined
|
|
|
58
58
|
// type BuildQuery = (params: any) => string
|
|
59
59
|
// type BuildUrl = (path: PathOptions) => string
|
|
60
60
|
|
|
61
|
-
interface UseApiOptions {
|
|
61
|
+
export interface UseApiOptions {
|
|
62
62
|
auth?: BTAuth
|
|
63
63
|
/**overrides the default */
|
|
64
64
|
buildHeaders?: (path: PathOptions) => HeadersInit
|
package/src/composables/auth.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isLengthyArray } from '
|
|
1
|
+
import { isLengthyArray } from '../composables/helpers';
|
|
2
2
|
import { DateTime } from 'luxon'
|
|
3
3
|
import { type RemovableRef, useStorage } from '@vueuse/core'
|
|
4
|
-
import { type BTDemo } from '
|
|
4
|
+
import { type BTDemo } from '../composables/demo'
|
|
5
5
|
import { useRouter } from 'vue-router'
|
|
6
6
|
import { toValue } from 'vue'
|
|
7
7
|
|
package/src/composables/dates.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// import { openDialog } from 'vue3-promise-dialog'
|
|
2
2
|
import { createConfirmDialog } from 'vuejs-confirm-dialog'
|
|
3
|
-
import BTConfirmDialog from '
|
|
4
|
-
import BTSelectDateDialog from '
|
|
5
|
-
import BTSelectDialog from '
|
|
6
|
-
import BTTextDialog from '
|
|
7
|
-
import { type ListProps } from '
|
|
3
|
+
import BTConfirmDialog from '../components/Dialog-Confirm.vue'
|
|
4
|
+
import BTSelectDateDialog from '../components/Dialog-Select-Date.vue'
|
|
5
|
+
import BTSelectDialog from '../components/Dialog-Select.vue'
|
|
6
|
+
import BTTextDialog from '../components/Dialog-Text.vue'
|
|
7
|
+
import { type ListProps } from '../composables/list'
|
|
8
8
|
|
|
9
9
|
export interface ConfirmDialogProps {
|
|
10
10
|
cancelText?: string
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { type RouteLocationNormalized } from 'vue-router'
|
|
2
|
-
import { BTDemo } from '
|
|
3
|
-
import { type Environment } from '
|
|
2
|
+
import { BTDemo } from '../composables/demo'
|
|
3
|
+
import { type Environment } from '../composables/urls'
|
|
4
4
|
|
|
5
5
|
export interface UseDocumentMetaOptions {
|
|
6
6
|
demo?: BTDemo
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export interface BTDocumentMeta {
|
|
10
|
+
updateMeta: (to: RouteLocationNormalized) => void
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
/**routes with meta object */
|
|
10
|
-
export function useDocumentMeta(options?: UseDocumentMetaOptions) {
|
|
14
|
+
export function useDocumentMeta(options?: UseDocumentMetaOptions): BTDocumentMeta {
|
|
11
15
|
|
|
12
16
|
function updateMeta(to: RouteLocationNormalized) {
|
|
13
17
|
const nearestWithTitle = to.matched.slice().reverse().find(r => r.meta && r.meta.title);
|
package/src/composables/list.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { GetOptions, OnCanDoAsync, OnDoAsync, OnDoSuccessAsync, OnGetAsync, OnGetSuccessAsync } from './actions'
|
|
2
|
-
import type { BladeVariant } from '
|
|
3
|
-
import { useCSV } from '
|
|
2
|
+
import type { BladeVariant } from '../types'
|
|
3
|
+
import { useCSV } from '../composables/csv'
|
|
4
4
|
import { isLengthyArray, hasSearch } from '../index'
|
|
5
5
|
import { firstBy } from 'thenby'
|
|
6
6
|
import { computed, ref, onMounted, toValue, shallowRef, MaybeRefOrGetter, watch } from 'vue'
|
|
7
7
|
import { useRoute, useRouter } from 'vue-router'
|
|
8
8
|
import { useArrayDifference, useArrayUnique, watchArray, watchDebounced } from '@vueuse/core'
|
|
9
|
-
import { useActions } from '
|
|
9
|
+
import { useActions } from '../composables/actions'
|
|
10
10
|
import { StorageMode, StoreMode, useStore } from '../index'
|
|
11
11
|
|
|
12
|
+
export interface RefreshOptions {
|
|
13
|
+
deepRefresh?: boolean,
|
|
14
|
+
resetSearch?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
export interface TableColumn {
|
|
13
18
|
align?: 'start' | 'end' | 'center'
|
|
14
19
|
csv?: boolean,
|
|
@@ -412,11 +417,6 @@ export function useList(props: ListProps, emit?: ListEvents, options?: UseListOp
|
|
|
412
417
|
}
|
|
413
418
|
}
|
|
414
419
|
|
|
415
|
-
interface RefreshOptions {
|
|
416
|
-
deepRefresh?: boolean,
|
|
417
|
-
resetSearch?: boolean
|
|
418
|
-
}
|
|
419
|
-
|
|
420
420
|
async function refresh(options?: RefreshOptions) {
|
|
421
421
|
showError.value = false
|
|
422
422
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//nav item needs to have a 'ignore Suspension' prop
|
|
2
|
-
import { useUrl } from '
|
|
3
|
-
import { appendUrl, deepSelect } from '
|
|
2
|
+
import { useUrl } from '../composables/urls'
|
|
3
|
+
import { appendUrl, deepSelect } from '../composables/helpers'
|
|
4
4
|
import { ref, type Ref } from 'vue'
|
|
5
5
|
import { type AuthItem } from './auth'
|
|
6
6
|
|
|
@@ -94,7 +94,7 @@ export interface BTNavigation {
|
|
|
94
94
|
updateNavigationProperties: (navName?: string | NavigationItem) => void
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
interface UseNavigationOptions {
|
|
97
|
+
export interface UseNavigationOptions {
|
|
98
98
|
defaultCacheExpiryHours?: number
|
|
99
99
|
navItems?: NavigationItem[]
|
|
100
100
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { toValue, useEventListener, useParentElement } from "@vueuse/core"
|
|
2
2
|
import { type ComponentPublicInstance, type Ref, ref } from 'vue'
|
|
3
3
|
import type { Position, MaybeRefOrGetter } from "@vueuse/core"
|
|
4
|
-
import { copyDeep } from "
|
|
5
|
-
import { type BladeVariant } from "
|
|
4
|
+
import { copyDeep } from "../composables/helpers"
|
|
5
|
+
import { type BladeVariant } from "../types"
|
|
6
6
|
|
|
7
7
|
export type ResizeHandle = 't' | 'r' | 'b' | 'l' | 'tr' | 'br' | 'bl' | 'tl'
|
|
8
8
|
|
package/src/composables/rules.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineStore, StoreDefinition } from 'pinia'
|
|
2
2
|
import { ref, type Ref } from 'vue'
|
|
3
|
-
import { type PathOptions, type BTApi } from '
|
|
3
|
+
import { type PathOptions, type BTApi } from '../composables/api'
|
|
4
4
|
import { DateTime } from 'luxon'
|
|
5
5
|
import { toValue } from 'vue'
|
|
6
|
-
import { appendUrl, getMinDateString } from '
|
|
6
|
+
import { appendUrl, getMinDateString } from '../composables/helpers'
|
|
7
7
|
import { firstBy } from 'thenby'
|
|
8
|
-
import { useLocalDb } from '
|
|
9
|
-
import { BaseModel } from '
|
|
8
|
+
import { useLocalDb } from '../composables/forage'
|
|
9
|
+
import { BaseModel } from '../types'
|
|
10
10
|
import { BTAuth } from './auth'
|
|
11
11
|
|
|
12
12
|
export type StoreMode = 'whole-last-updated' | 'partial-last-updated' | 'session'
|
|
@@ -50,7 +50,7 @@ export interface ApiError {
|
|
|
50
50
|
message: string
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
interface UseStoreOptions {
|
|
53
|
+
export interface UseStoreOptions {
|
|
54
54
|
/**ideally required. Otherwise will struggle to find url path */
|
|
55
55
|
api?: BTApi
|
|
56
56
|
/**ideally required. For setting unique local storage keys */
|