bt-core-app 2.2.43 → 2.2.45

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.
@@ -1,108 +1,7 @@
1
- import { defineComponent as V, ref as p, computed as c, openBlock as l, createBlock as u, unref as t, withCtx as r, createVNode as o, createTextVNode as n, createCommentVNode as d } from "vue";
2
- import { useFirebase as b } from "../composables/firebase.mjs";
3
- import { VCardItem as C } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardItem.mjs";
4
- import { VCard as x } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCard.mjs";
5
- import { VIcon as k } from "../bt-core/core/node_modules/vuetify/lib/components/VIcon/VIcon.mjs";
6
- import { VCardTitle as T } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardTitle.mjs";
7
- import { VCardSubtitle as _ } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardSubtitle.mjs";
8
- import { VCardText as B } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardText.mjs";
9
- import { VCardActions as q } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardActions.mjs";
10
- import { VSpacer as P } from "../bt-core/core/node_modules/vuetify/lib/components/VGrid/VSpacer.mjs";
11
- import { VBtn as v } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
12
- const J = /* @__PURE__ */ V({
13
- __name: "BT-Firebase-Notification",
14
- setup(S) {
15
- const { initiate: y, permission: a } = b(), s = p(!1), f = p(!1), g = c(() => !(f.value || a.value === "granted")), m = c(() => a.value === "denied");
16
- async function w() {
17
- if (!("Notification" in window)) {
18
- alert("This browser does not support desktop notifications.");
19
- return;
20
- }
21
- s.value = !0;
22
- try {
23
- const i = await Notification.requestPermission();
24
- a.value = i, i === "granted" ? (console.log("Notification permission granted."), await y()) : console.log("Notification permission denied.");
25
- } catch (i) {
26
- console.error("Error requesting notification permission:", i);
27
- } finally {
28
- s.value = !1;
29
- }
30
- }
31
- function N() {
32
- f.value = !0;
33
- }
34
- return (i, e) => g.value ? (l(), u(t(x), {
35
- key: 0,
36
- class: "mx-auto my-4",
37
- "max-width": "400",
38
- variant: "outlined"
39
- }, {
40
- default: r(() => [
41
- o(t(C), null, {
42
- prepend: r(() => [
43
- o(t(k), {
44
- icon: "$bell-ring",
45
- color: "primary",
46
- size: "large"
47
- })
48
- ]),
49
- default: r(() => [
50
- o(t(T), null, {
51
- default: r(() => e[0] || (e[0] = [
52
- n("Enable Notifications")
53
- ])),
54
- _: 1
55
- }),
56
- o(t(_), null, {
57
- default: r(() => e[1] || (e[1] = [
58
- n("Stay updated with the latest alerts and updates.")
59
- ])),
60
- _: 1
61
- })
62
- ]),
63
- _: 1
64
- }),
65
- m.value ? (l(), u(t(B), {
66
- key: 0,
67
- class: "text-error text-caption"
68
- }, {
69
- default: r(() => e[2] || (e[2] = [
70
- n(" Notifications are blocked in your browser settings. Please enable them manually in your browser address bar. ")
71
- ])),
72
- _: 1
73
- })) : d("", !0),
74
- o(t(q), null, {
75
- default: r(() => [
76
- o(t(P)),
77
- m.value ? d("", !0) : (l(), u(t(v), {
78
- key: 0,
79
- color: "primary",
80
- variant: "flat",
81
- loading: s.value,
82
- onClick: w
83
- }, {
84
- default: r(() => e[3] || (e[3] = [
85
- n(" Turn On ")
86
- ])),
87
- _: 1
88
- }, 8, ["loading"])),
89
- o(t(v), {
90
- variant: "text",
91
- onClick: N
92
- }, {
93
- default: r(() => e[4] || (e[4] = [
94
- n(" Not Now ")
95
- ])),
96
- _: 1
97
- })
98
- ]),
99
- _: 1
100
- })
101
- ]),
102
- _: 1
103
- })) : d("", !0);
104
- }
105
- });
1
+ import o from "./BT-Firebase-Notification.vue2.mjs";
2
+ import "./BT-Firebase-Notification.vue3.mjs";
3
+ import t from "../_virtual/_plugin-vue_export-helper.mjs";
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a91a9189"]]);
106
5
  export {
107
- J as default
6
+ e as default
108
7
  };
@@ -1,4 +1,82 @@
1
- import f from "./BT-Firebase-Notification.vue.mjs";
1
+ import { defineComponent as k, ref as d, computed as f, openBlock as n, createBlock as m, unref as s, withCtx as o, createElementVNode as c, createElementBlock as x, createCommentVNode as a, createTextVNode as p, createVNode as B } from "vue";
2
+ import { useFirebase as V } from "../composables/firebase.mjs";
3
+ import "pinia";
4
+ import "../bt-core/core/node_modules/thenby/thenBy.module.mjs";
5
+ import "../composables/forage.mjs";
6
+ import "vue-router";
7
+ import "@vueuse/core";
8
+ import { useAuth as h } from "../composables/auth.mjs";
9
+ import "../composables/blade.mjs";
10
+ import "../bt-core/core/node_modules/@datasert/cronjs-matcher/dist/index.mjs";
11
+ import "../composables/pwa.mjs";
12
+ import { VBanner as C } from "../bt-core/core/node_modules/vuetify/lib/components/VBanner/VBanner.mjs";
13
+ import { VBtn as g } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
14
+ const _ = {
15
+ key: 0,
16
+ class: "text-error text-caption mt-1"
17
+ }, G = /* @__PURE__ */ k({
18
+ __name: "BT-Firebase-Notification",
19
+ setup(E) {
20
+ const { register: v, permission: i } = V(), { isLoggedIn: w } = h(), r = d(!1), l = d(!1), b = f(() => !(!w.value || l.value || i.value === "granted")), u = f(() => i.value === "denied");
21
+ async function N() {
22
+ if (!("Notification" in window)) {
23
+ alert("This browser does not support desktop notifications.");
24
+ return;
25
+ }
26
+ r.value = !0;
27
+ try {
28
+ const t = await Notification.requestPermission();
29
+ i.value = t, t === "granted" ? (console.log("Notification permission granted."), await v()) : console.log("Notification permission denied.");
30
+ } catch (t) {
31
+ console.error("Error requesting notification permission:", t);
32
+ } finally {
33
+ r.value = !1;
34
+ }
35
+ }
36
+ function y() {
37
+ l.value = !0;
38
+ }
39
+ return (t, e) => b.value ? (n(), m(s(C), {
40
+ key: 0,
41
+ class: "floating-banner elevation-4 rounded-lg mx-auto",
42
+ color: "surface",
43
+ "bg-color": "primary",
44
+ icon: "$bell-ring",
45
+ lines: "two"
46
+ }, {
47
+ text: o(() => [
48
+ e[0] || (e[0] = c("div", { class: "font-weight-bold" }, "Enable Notifications", -1)),
49
+ e[1] || (e[1] = c("div", null, "Stay updated with the latest alerts and updates.", -1)),
50
+ u.value ? (n(), x("div", _, " Notifications are blocked in your browser settings. Please enable them manually in your browser address bar. ")) : a("", !0)
51
+ ]),
52
+ actions: o(() => [
53
+ u.value ? a("", !0) : (n(), m(s(g), {
54
+ key: 0,
55
+ color: "white",
56
+ variant: "flat",
57
+ loading: r.value,
58
+ onClick: N
59
+ }, {
60
+ default: o(() => e[2] || (e[2] = [
61
+ p(" Turn On ")
62
+ ])),
63
+ _: 1
64
+ }, 8, ["loading"])),
65
+ B(s(g), {
66
+ variant: "text",
67
+ color: "white",
68
+ onClick: y
69
+ }, {
70
+ default: o(() => e[3] || (e[3] = [
71
+ p(" Not Now ")
72
+ ])),
73
+ _: 1
74
+ })
75
+ ]),
76
+ _: 1
77
+ })) : a("", !0);
78
+ }
79
+ });
2
80
  export {
3
- f as default
81
+ G as default
4
82
  };
@@ -6,8 +6,8 @@ import { VNavigationDrawer as g } from "../bt-core/core/node_modules/vuetify/lib
6
6
  import { VListGroup as z } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListGroup.mjs";
7
7
  import { VList as f } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VList.mjs";
8
8
  import { VListItem as s } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListItem.mjs";
9
- import { VAvatar as D } from "../bt-core/core/node_modules/vuetify/lib/components/VAvatar/VAvatar.mjs";
10
- import { VImg as A } from "../bt-core/core/node_modules/vuetify/lib/components/VImg/VImg.mjs";
9
+ import { VAvatar as A } from "../bt-core/core/node_modules/vuetify/lib/components/VAvatar/VAvatar.mjs";
10
+ import { VImg as D } from "../bt-core/core/node_modules/vuetify/lib/components/VImg/VImg.mjs";
11
11
  import { VRow as G } from "../bt-core/core/node_modules/vuetify/lib/components/VGrid/VRow.mjs";
12
12
  import { VBtn as M } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
13
13
  import { VIcon as P } from "../bt-core/core/node_modules/vuetify/lib/components/VIcon/VIcon.mjs";
@@ -18,7 +18,7 @@ const W = /* @__PURE__ */ _({
18
18
  title: {}
19
19
  },
20
20
  setup(T) {
21
- const { state: m, toggleDrawerStick: k } = b(), { isLoggedIn: y, logout: v } = L(), w = B();
21
+ const { state: m, toggleDrawerStick: k } = b(), { isLoggedIn: y, logoutAsync: v } = L(), w = B();
22
22
  return (i, p) => (r(), n(e(g), {
23
23
  "disabled-resize-watcher": "",
24
24
  "expand-on-hover": "",
@@ -55,9 +55,9 @@ const W = /* @__PURE__ */ _({
55
55
  title: i.title
56
56
  }, {
57
57
  prepend: t(() => [
58
- l(e(D), { size: "36" }, {
58
+ l(e(A), { size: "36" }, {
59
59
  default: t(() => [
60
- l(e(A), { src: i.iconSrc }, null, 8, ["src"])
60
+ l(e(D), { src: i.iconSrc }, null, 8, ["src"])
61
61
  ]),
62
62
  _: 1
63
63
  })
@@ -16,9 +16,9 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
16
16
  transparent: boolean;
17
17
  usedHeight: number;
18
18
  }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
- close: (...args: any[]) => void;
20
19
  cancel: (...args: any[]) => void;
21
20
  change: (...args: any[]) => void;
21
+ close: (...args: any[]) => void;
22
22
  open: (...args: any[]) => void;
23
23
  "update:modelValue": (...args: any[]) => void;
24
24
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SignProps>, {
@@ -27,9 +27,9 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
27
27
  transparent: boolean;
28
28
  usedHeight: number;
29
29
  }>>> & Readonly<{
30
- onClose?: ((...args: any[]) => any) | undefined;
31
30
  onCancel?: ((...args: any[]) => any) | undefined;
32
31
  onChange?: ((...args: any[]) => any) | undefined;
32
+ onClose?: ((...args: any[]) => any) | undefined;
33
33
  onOpen?: ((...args: any[]) => any) | undefined;
34
34
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
35
35
  }>, {
@@ -32,8 +32,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
32
32
  onChange?: ((...args: any[]) => any) | undefined;
33
33
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
34
34
  }>, {
35
- width: string;
36
35
  height: string;
36
+ width: string;
37
37
  color: string;
38
38
  fullscreen: boolean;
39
39
  usedHeight: number;
@@ -61,8 +61,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
61
61
  }>>> & Readonly<{
62
62
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
63
63
  }>, {
64
- width: string;
65
64
  height: string;
65
+ width: string;
66
66
  ripple: boolean;
67
67
  iconSize: string;
68
68
  falseIcon: string;
@@ -1,3 +1,4 @@
1
+ import { BTFirebase } from './firebase.ts';
1
2
  import { PermissionGroup } from './navigation.ts';
2
3
  import { Ref, ComputedRef } from 'vue';
3
4
  import { Router } from 'vue-router';
@@ -33,6 +34,7 @@ export interface CreateAuthOptions {
33
34
  defaultTimeZone?: string;
34
35
  /**expiry token date format. Defaults to 'd/MM/yyyy h:mm:ss a' */
35
36
  expiryTokenFormat?: string;
37
+ firebase?: BTFirebase;
36
38
  /**OVERRIDES CORE DEFAULT. retrieve the auth item */
37
39
  getAuthItem?: (navName?: string | AuthItem) => AuthItem | null;
38
40
  /**OVERRIDES DEFAULT. the url to start the OAuth 2.0 process */
@@ -81,6 +83,7 @@ export interface BTAuth {
81
83
  isLoggedIn: ComputedRef<boolean>;
82
84
  login: (redirectPath?: string, query?: any) => void;
83
85
  logout: (navNameRedirect?: string) => void;
86
+ logoutAsync: (navNameRedirect?: string) => Promise<void>;
84
87
  refreshTokenExpired: () => boolean;
85
88
  resetAuthState: () => void;
86
89
  setAuth: (jwtToken?: string) => void;