bt-core-app 1.1.3 → 1.1.6
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/index.d.ts +43 -0
- package/package.json +3 -1
- package/src/composables/api.ts +1 -1
- package/src/composables/document-meta.ts +5 -1
- package/src/composables/list.ts +5 -5
- package/src/composables/navigation.ts +1 -1
- package/src/composables/rules.ts +1 -1
- package/src/composables/stores.ts +1 -1
- package/src/index.ts +46 -13
- package/vite.config.ts +13 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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';
|
|
18
|
+
export * from './composables/draggable';
|
|
19
|
+
export type { BTFilters, UseFiltersOptions } from './composables/filters';
|
|
20
|
+
export { createFilters } from './composables/filters';
|
|
21
|
+
export { useLocalDb, useLocalCache } from './composables/forage';
|
|
22
|
+
export * from './composables/helpers';
|
|
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';
|
|
32
|
+
export * from './composables/resizable';
|
|
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.6",
|
|
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",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"msw": "^2.2.10",
|
|
38
39
|
"typescript": "^5.2.2",
|
|
39
40
|
"vite": "^5.1.6",
|
|
41
|
+
"vite-plugin-dts": "^3.8.1",
|
|
40
42
|
"vitest": "^1.4.0",
|
|
41
43
|
"vue": "^3.4.21",
|
|
42
44
|
"vue-tsc": "^1.8.27"
|
package/src/composables/api.ts
CHANGED
|
@@ -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
|
|
@@ -6,8 +6,12 @@ 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
|
@@ -9,6 +9,11 @@ import { useArrayDifference, useArrayUnique, watchArray, watchDebounced } from '
|
|
|
9
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
|
|
|
@@ -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
|
}
|
package/src/composables/rules.ts
CHANGED
|
@@ -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 */
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,49 @@
|
|
|
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'
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// import BTBtn from './components/BT-Btn.vue'
|
|
47
|
+
// import BTCol from './components/BT-Col.vue'
|
|
48
|
+
|
|
49
|
+
// export { BTBtn, BTCol }
|
package/vite.config.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { defineConfig } from 'vite'
|
|
3
3
|
import path from 'path'
|
|
4
4
|
import vue from '@vitejs/plugin-vue'
|
|
5
|
+
import dts from 'vite-plugin-dts'
|
|
5
6
|
|
|
6
7
|
// https://vitejs.dev/config/
|
|
7
8
|
|
|
@@ -14,9 +15,20 @@ export default defineConfig({
|
|
|
14
15
|
lib: {
|
|
15
16
|
entry: path.resolve(__dirname, './src/index.ts'),
|
|
16
17
|
formats: ['es']
|
|
18
|
+
},
|
|
19
|
+
rollupOptions: {
|
|
20
|
+
external: ['vue', 'vuetify'],
|
|
21
|
+
output: {
|
|
22
|
+
globals: {
|
|
23
|
+
vue: 'Vue'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
},
|
|
19
|
-
plugins: [
|
|
28
|
+
plugins: [
|
|
29
|
+
vue(),
|
|
30
|
+
dts({ include: path.resolve(__dirname, './src/index.ts') })
|
|
31
|
+
],
|
|
20
32
|
resolve: {
|
|
21
33
|
alias: {
|
|
22
34
|
'@': path.resolve(__dirname, './src')
|