bt-core-app 1.3.9 → 1.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "1.3.9",
3
+ "version": "1.4.1",
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": {
@@ -20,12 +20,12 @@
20
20
  "dependencies": {
21
21
  "@vuepic/vue-datepicker": "^8.3.1",
22
22
  "localforage": "^1.10.0",
23
- "luxon": "^3.4.4",
24
23
  "thenby": "^1.3.4",
25
24
  "vuejs-confirm-dialog": "^0.5.1"
26
25
  },
27
26
  "peerDependencies": {
28
27
  "@vueuse/core": "^10.4.1",
28
+ "luxon": "^3.4.4",
29
29
  "pinia": "^2.0.24",
30
30
  "vue": "^3.4.21",
31
31
  "vue-router": "^4.0.0",
@@ -10,7 +10,7 @@
10
10
  <script setup lang="ts">
11
11
  import { computed, inject, ref } from 'vue'
12
12
  import { usePresets } from '../composables/presets'
13
- import { VBtn } from 'vuetify/components'
13
+ // import { VBtn } from 'vuetify/components'
14
14
 
15
15
  interface BtnProps {
16
16
  icon?: string
@@ -3,7 +3,7 @@
3
3
  </template>
4
4
 
5
5
  <script setup lang="ts">
6
- import { useFilters } from '../index'
6
+ import { useFilters } from '../composables/filters'
7
7
  import { computed } from 'vue'
8
8
 
9
9
  interface Props {
@@ -65,7 +65,7 @@
65
65
  <script setup lang="ts">
66
66
  import { computed, onMounted, ref } from 'vue';
67
67
  import { isLengthyArray, isArrayOfLength, nestedValue } from '../composables/helpers'
68
- import { useFilters } from '../index'
68
+ import { useFilters } from '../composables/filters'
69
69
  import { useList } from '../composables/list';
70
70
  import { type SelectDialogProps } from '../composables/dialogs'
71
71
 
@@ -1,5 +1,5 @@
1
1
  import { TableColumn } from "./list"
2
- import { isLengthyArray, fromCamelCase, nestedValue } from "../index"
2
+ import { isLengthyArray, fromCamelCase, nestedValue } from "../composables/helpers"
3
3
 
4
4
  export interface CSVProps {
5
5
  canExportCSV?: boolean
@@ -1,6 +1,4 @@
1
- import { firstBy } from 'thenby';
2
- import { type MaybeRefOrGetter, toValue } from 'vue';
3
-
1
+ import { firstBy } from 'thenby'
4
2
 
5
3
  export function appendUrl(originalVal?: string, additionalVal?: string) {
6
4
  let original = originalVal ?? ''
@@ -410,19 +408,13 @@ export function getMinDateString() {
410
408
  return '0001-01-01T00:00:00Z'
411
409
  }
412
410
 
413
- //#end region
414
-
415
- //#region math
416
-
417
411
  /**
418
412
  * rounds the given value to a certain number of decimal places
419
413
  * @param v
420
414
  * @param dPlaces
421
415
  * @returns
422
416
  */
423
- export function roundTo(v: MaybeRefOrGetter<number>, dPlaces: number) {
424
- const val = toValue(v)
425
-
417
+ export function roundTo(val: number, dPlaces: number) {
426
418
  let m = '1';
427
419
  let i = 0;
428
420
 
@@ -521,44 +513,6 @@ export function containsSearch(value?: string, str?: string) {
521
513
  return value.toLowerCase().includes(str.toLowerCase());
522
514
  }
523
515
 
524
- // export function deepSelect(obj: any, propSelector: Function = (obj: any) => obj) {
525
- // if (obj == null) {
526
- // return []
527
- // }
528
-
529
- // if (Array.isArray(obj)) {
530
- // let rr: any[] = []
531
- // obj.forEach(e => {
532
- // rr.push(e)
533
- // const d = deepSelect(e, propSelector)
534
- // if (isLengthyArray(d))
535
- // rr.push(...d)
536
- // })
537
- // return rr
538
- // }
539
- // else {
540
- // let arr = propSelector(obj)
541
- // if (isLengthyArray(arr)) {
542
- // let r = [...arr.reduce((a: any, b: any) => {
543
- // a.push(b)
544
- // const v = deepSelect(b, propSelector)
545
- // if (isLengthyArray(v)) {
546
- // a.push(...v)
547
- // }
548
- // return a
549
- // }, [])]
550
-
551
- // if (!Array.isArray(obj)) {
552
- // r.unshift(obj)
553
- // }
554
-
555
- // return r
556
- // }
557
-
558
- // return []
559
- // }
560
- // }
561
-
562
516
  /**must be an object. Returns a flat map of all items in the prop selector */
563
517
  export function deepSelect(obj: any, propSelector: Function = (obj: any) => obj) {
564
518
  if (obj == null) {
@@ -597,9 +551,8 @@ export function DataURIToBlob(dataURI: any) {
597
551
  export function extractErrorDescription(error: any) {
598
552
  var msg = '';
599
553
  if (error) {
600
- if (error.message) {
601
- msg = error.message;
602
- }
554
+ if (error.message)
555
+ msg = error.message
603
556
 
604
557
  if (error.response && error.response.data) {
605
558
  if (error.response.data.errors) {
@@ -1,13 +1,13 @@
1
1
  import type { GetOptions, OnCanDoAsync, OnDoAsync, OnDoSuccessAsync, OnGetAsync, OnGetSuccessAsync } from './actions'
2
2
  import type { BladeVariant } from '../types'
3
3
  import { useCSV } from '../composables/csv'
4
- import { isLengthyArray, hasSearch } from '../index'
4
+ import { isLengthyArray, hasSearch } from '../composables/helpers'
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
9
  import { useActions } from '../composables/actions'
10
- import { StorageMode, StoreMode, useStoreDefinition } from '../index'
10
+ import { StorageMode, StoreMode, useStoreDefinition } from '../composables/stores'
11
11
 
12
12
  export interface RefreshOptions {
13
13
  deepRefresh?: boolean,
package/src/index.ts CHANGED
@@ -37,7 +37,6 @@ export { createStoreBuilder, createStoreDefinition, useStore, useStoreDefinition
37
37
  export type { UseTrackerOptions } from './composables/track'
38
38
  export { useTracker } from './composables/track'
39
39
  export { createUrl, useUrls, useAuthUrl, useDbName, useDataUrl } from './composables/urls'
40
- // export { useApi, useAuth, useDates, useDemo, useFilters, useNavigation, usePresets, usePWA, useStore } from './useApi'
41
40
  export * from './types'
42
41
  export type { CoreApp, CreateCoreOptions } from './core'
43
42
  export { createCore } from './core'
package/src/main.ts ADDED
@@ -0,0 +1,6 @@
1
+ // import { createApp } from 'vue'
2
+ // import { createVuetify } from 'vuetify'
3
+
4
+ // const vuetify = createVuetify()
5
+
6
+ // createApp().use(vuetify).mount('#app')
package/vite.config.ts CHANGED
@@ -12,16 +12,16 @@ export default defineConfig({
12
12
  globals: true,
13
13
  environment: 'happy-dom'
14
14
  },
15
- optimizeDeps: {
16
- include: ['vuetify']
17
- },
15
+ // optimizeDeps: {
16
+ // include: ['vuetify']
17
+ // },
18
18
  build: {
19
19
  lib: {
20
20
  entry: path.resolve(__dirname, './src/index.ts'),
21
21
  formats: ['es']
22
22
  },
23
23
  rollupOptions: {
24
- external: ['vue'],
24
+ external: ['vue', 'vuetify'],
25
25
  output: {
26
26
  globals: {
27
27
  vue: 'Vue'
@@ -30,10 +30,10 @@ export default defineConfig({
30
30
  }
31
31
  },
32
32
  plugins: [
33
- // vue({
34
- // template: { transformAssetUrls }
35
- // }),
36
- vue(),
33
+ vue({
34
+ template: { transformAssetUrls }
35
+ }),
36
+ // vue(),
37
37
  dts(),
38
38
  vuetify({ autoImport: true })
39
39
  ],