bt-core-app 2.2.44 → 2.2.46

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,25 +1,26 @@
1
1
  import { defineComponent as _, openBlock as r, createBlock as n, unref as e, withCtx as t, renderSlot as d, createVNode as l, createCommentVNode as N, createTextVNode as $, toDisplayString as S, createElementBlock as u, Fragment as c, renderList as V, mergeProps as C } from "vue";
2
2
  import { useCosmetics as b } from "../composables/cosmetics.mjs";
3
3
  import { useAuth as L } from "../composables/auth.mjs";
4
+ import { useAuthActions as A } from "../composables/auth-actions.mjs";
4
5
  import { useMenu as B } from "../composables/menu.mjs";
5
6
  import { VNavigationDrawer as g } from "../bt-core/core/node_modules/vuetify/lib/components/VNavigationDrawer/VNavigationDrawer.mjs";
6
7
  import { VListGroup as z } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListGroup.mjs";
7
8
  import { VList as f } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VList.mjs";
8
9
  import { VListItem as s } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListItem.mjs";
9
10
  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";
11
+ import { VImg as h } from "../bt-core/core/node_modules/vuetify/lib/components/VImg/VImg.mjs";
11
12
  import { VRow as G } from "../bt-core/core/node_modules/vuetify/lib/components/VGrid/VRow.mjs";
12
13
  import { VBtn as M } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
13
14
  import { VIcon as P } from "../bt-core/core/node_modules/vuetify/lib/components/VIcon/VIcon.mjs";
14
- const W = /* @__PURE__ */ _({
15
+ const Y = /* @__PURE__ */ _({
15
16
  __name: "BT-Nav-Sidebar",
16
17
  props: {
17
18
  iconSrc: {},
18
19
  title: {}
19
20
  },
20
21
  setup(T) {
21
- const { state: m, toggleDrawerStick: k } = b(), { isLoggedIn: y, logout: v } = L(), w = B();
22
- return (i, p) => (r(), n(e(g), {
22
+ const { state: m, toggleDrawerStick: k } = b(), { isLoggedIn: y } = L(), { logoutAsync: v } = A(), w = B();
23
+ return (a, p) => (r(), n(e(g), {
23
24
  "disabled-resize-watcher": "",
24
25
  "expand-on-hover": "",
25
26
  rail: !e(m).drawerStick,
@@ -28,7 +29,7 @@ const W = /* @__PURE__ */ _({
28
29
  "onUpdate:modelValue": p[1] || (p[1] = (o) => e(m).drawer = o)
29
30
  }, {
30
31
  append: t(() => [
31
- d(i.$slots, "bottom-list", {}, () => [
32
+ d(a.$slots, "bottom-list", {}, () => [
32
33
  e(y) ? (r(), n(e(f), {
33
34
  key: 0,
34
35
  class: "ma-0 pa-0"
@@ -47,17 +48,17 @@ const W = /* @__PURE__ */ _({
47
48
  ])
48
49
  ]),
49
50
  default: t(() => [
50
- d(i.$slots, "default", {}, () => [
51
+ d(a.$slots, "default", {}, () => [
51
52
  l(e(f), { class: "pt-1" }, {
52
53
  default: t(() => [
53
54
  l(e(s), {
54
55
  nav: "",
55
- title: i.title
56
+ title: a.title
56
57
  }, {
57
58
  prepend: t(() => [
58
59
  l(e(D), { size: "36" }, {
59
60
  default: t(() => [
60
- l(e(A), { src: i.iconSrc }, null, 8, ["src"])
61
+ l(e(h), { src: a.iconSrc }, null, 8, ["src"])
61
62
  ]),
62
63
  _: 1
63
64
  })
@@ -88,11 +89,11 @@ const W = /* @__PURE__ */ _({
88
89
  ]),
89
90
  _: 1
90
91
  }, 8, ["title"]),
91
- d(i.$slots, "top-list")
92
+ d(a.$slots, "top-list")
92
93
  ]),
93
94
  _: 3
94
95
  }),
95
- d(i.$slots, "middle-list", {}, () => [
96
+ d(a.$slots, "middle-list", {}, () => [
96
97
  e(y) ? (r(), n(e(f), {
97
98
  key: 0,
98
99
  nav: ""
@@ -102,21 +103,21 @@ const W = /* @__PURE__ */ _({
102
103
  o.isGroup ? (r(), n(e(z), {
103
104
  key: `${o.displayName}a`
104
105
  }, {
105
- activator: t(({ props: a }) => [
106
- l(e(s), C({ ref_for: !0 }, a, {
106
+ activator: t(({ props: i }) => [
107
+ l(e(s), C({ ref_for: !0 }, i, {
107
108
  color: "primary",
108
109
  "prepend-icon": o.icon,
109
110
  title: o.displayName
110
111
  }), null, 16, ["prepend-icon", "title"])
111
112
  ]),
112
113
  default: t(() => [
113
- (r(!0), u(c, null, V(o.items, (a) => (r(), n(e(s), {
114
- key: a.displayName,
114
+ (r(!0), u(c, null, V(o.items, (i) => (r(), n(e(s), {
115
+ key: i.displayName,
115
116
  color: "primary",
116
- "prepend-icon": a.icon,
117
- title: a.displayName,
118
- value: a.displayName,
119
- to: { name: a.routeName }
117
+ "prepend-icon": i.icon,
118
+ title: i.displayName,
119
+ value: i.displayName,
120
+ to: { name: i.routeName }
120
121
  }, null, 8, ["prepend-icon", "title", "value", "to"]))), 128))
121
122
  ]),
122
123
  _: 2
@@ -140,5 +141,5 @@ const W = /* @__PURE__ */ _({
140
141
  }
141
142
  });
142
143
  export {
143
- W as default
144
+ Y as default
144
145
  };
@@ -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,40 +1,42 @@
1
1
  import { default as r } from "./components/BT-Assistant-Menu.vue.mjs";
2
- import { default as t } from "./components/BT-Banner.vue.mjs";
3
- import { default as l } from "./components/BT-Blade-Steps.vue.mjs";
4
- import { default as u } from "./components/BT-Cron-Span.vue.mjs";
5
- import { default as d } from "./components/BT-Date-Select.vue.mjs";
6
- import { default as B } from "./components/BT-Dialog-Confirm.vue.mjs";
7
- import { default as x } from "./components/BT-Dialog-Select.vue.mjs";
8
- import { default as S } from "./components/BT-Dialog-Number.vue.mjs";
9
- import { default as c } from "./components/BT-Dialog-Date.vue.mjs";
10
- import { default as F } from "./components/BT-Demo-Profile-Select.vue.mjs";
11
- import { default as C } from "./components/BT-Color-Picker-Menu.vue.mjs";
12
- import { default as k } from "./components/BT-Firebase-Notification.vue.mjs";
2
+ import { default as t } from "./components/BT-Auth-Loader.vue.mjs";
3
+ import { default as l } from "./components/BT-Banner.vue.mjs";
4
+ import { default as u } from "./components/BT-Blade-Steps.vue.mjs";
5
+ import { default as s } from "./components/BT-Cron-Span.vue.mjs";
6
+ import { default as B } from "./components/BT-Date-Select.vue.mjs";
7
+ import { default as x } from "./components/BT-Dialog-Confirm.vue.mjs";
8
+ import { default as S } from "./components/BT-Dialog-Select.vue.mjs";
9
+ import { default as c } from "./components/BT-Dialog-Number.vue.mjs";
10
+ import { default as F } from "./components/BT-Dialog-Date.vue.mjs";
11
+ import { default as C } from "./components/BT-Demo-Profile-Select.vue.mjs";
12
+ import { default as h } from "./components/BT-Color-Picker-Menu.vue.mjs";
13
+ import { default as A } from "./components/BT-Firebase-Notification.vue.mjs";
13
14
  import { default as N } from "./components/BT-Form.vue.mjs";
14
- import { default as h } from "./components/BT-Form-Builder.vue.mjs";
15
- import { default as A } from "./components/BT-Form-Field.vue.mjs";
16
- import { default as v } from "./components/BT-Square-Check.vue.mjs";
17
- import { default as y } from "./components/BT-Select-Simple.vue.mjs";
18
- import { default as E } from "./components/BT-Field-Select-Simple.vue.mjs";
19
- import { default as H } from "./components/BT-Tour.vue.mjs";
15
+ import { default as q } from "./components/BT-Form-Builder.vue.mjs";
16
+ import { default as j } from "./components/BT-Form-Field.vue.mjs";
17
+ import { default as w } from "./components/BT-Square-Check.vue.mjs";
18
+ import { default as z } from "./components/BT-Select-Simple.vue.mjs";
19
+ import { default as G } from "./components/BT-Field-Select-Simple.vue.mjs";
20
+ import { default as I } from "./components/BT-Tour.vue.mjs";
20
21
  export {
21
22
  r as BTAssistantMenu,
22
- t as BTBanner,
23
- l as BTBladeSteps,
24
- C as BTColorPickerMenu,
25
- u as BTCronSpan,
26
- d as BTDateSelect,
27
- F as BTDemoProfileSelect,
28
- B as BTDialogConfirm,
29
- c as BTDialogDate,
30
- S as BTDialogNumber,
31
- x as BTDialogSelect,
32
- E as BTFieldSelectSimple,
33
- k as BTFirebaseNotification,
23
+ t as BTAuthLoader,
24
+ l as BTBanner,
25
+ u as BTBladeSteps,
26
+ h as BTColorPickerMenu,
27
+ s as BTCronSpan,
28
+ B as BTDateSelect,
29
+ C as BTDemoProfileSelect,
30
+ x as BTDialogConfirm,
31
+ F as BTDialogDate,
32
+ c as BTDialogNumber,
33
+ S as BTDialogSelect,
34
+ G as BTFieldSelectSimple,
35
+ A as BTFirebaseNotification,
34
36
  N as BTForm,
35
- h as BTFormBuilder,
36
- A as BTFormField,
37
- y as BTSelectSimple,
38
- v as BTSquareCheck,
39
- H as BTTour
37
+ q as BTFormBuilder,
38
+ j as BTFormField,
39
+ z as BTSelectSimple,
40
+ w as BTSquareCheck,
41
+ I as BTTour
40
42
  };
@@ -0,0 +1,9 @@
1
+ import { ShallowRef } from 'vue';
2
+
3
+ export interface BTAuthActions {
4
+ actionLoadingMsg: ShallowRef<string | undefined>;
5
+ actionErrorMsg: ShallowRef<string | undefined>;
6
+ authenticateAsync: () => Promise<void>;
7
+ logoutAsync: (navPathRedirect?: string) => Promise<void>;
8
+ }
9
+ export declare function useAuthActions(): BTAuthActions;
@@ -0,0 +1,30 @@
1
+ import { useRoute as p, useRouter as m } from "vue-router";
2
+ import { useActions as h } from "./actions.mjs";
3
+ import { useAuth as d } from "./auth.mjs";
4
+ import { useFirebase as A } from "./firebase.mjs";
5
+ import { isNullOrEmpty as L } from "./helpers.mjs";
6
+ let t;
7
+ function O() {
8
+ t ?? (t = h());
9
+ const { credentials: s, logout: u, setAuth: a } = d(), { register: c, unregister: g } = A(), e = p(), i = m();
10
+ async function l() {
11
+ var r;
12
+ t.persistLoading("Authenticating");
13
+ const o = (r = e.query) == null ? void 0 : r.code;
14
+ o != null && a(o), s.value.userLoginID != null && await c();
15
+ const n = e.query.redirect_path;
16
+ t.releaseLoading(), L(n) ? i.push({ name: "home" }) : window.location.href = n;
17
+ }
18
+ async function f(o) {
19
+ t.persistLoading("Logging Out"), await g(), u(), t.releaseLoading(), o != null && e.path != o && i.push({ path: o });
20
+ }
21
+ return {
22
+ actionErrorMsg: t.actionErrorMsg,
23
+ actionLoadingMsg: t.actionLoadingMsg,
24
+ authenticateAsync: l,
25
+ logoutAsync: f
26
+ };
27
+ }
28
+ export {
29
+ O as useAuthActions
30
+ };
@@ -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 */
@@ -241,6 +241,7 @@ function ue(u) {
241
241
  isLoggedIn: L(() => i.value.isLoggedIn === !0),
242
242
  login: Z,
243
243
  logout: y,
244
+ // logoutAsync,
244
245
  refreshTokenExpired: U,
245
246
  resetAuthState: O,
246
247
  setAuth: T,
@@ -23,8 +23,8 @@ export interface BTFirebase {
23
23
  actionLoadingMsg: any;
24
24
  app: FirebaseApp;
25
25
  messaging: Messaging;
26
- initiate: () => Promise<void>;
27
26
  permission: Ref<NotificationPermission>;
27
+ register: () => Promise<void>;
28
28
  unregister: () => Promise<void>;
29
29
  }
30
30
  export declare function useFirebaseListener(handler?: (payload: MessagePayload) => void): void;
@@ -1,88 +1,88 @@
1
- import { ref as w } from "vue";
2
- import { useActions as v } from "./actions.mjs";
1
+ import { ref as b } from "vue";
2
+ import { useActions as w } from "./actions.mjs";
3
3
  import { appendUrl as u } from "./helpers.mjs";
4
4
  import { useDataUrl as d } from "./urls.mjs";
5
5
  import "../bt-core/core/node_modules/firebase/app/dist/esm/index.esm.mjs";
6
- import { getMessaging as R, onRegistered as F, onUnregistered as h, onMessage as L, register as k, unregister as D } from "../bt-core/core/node_modules/@firebase/messaging/dist/esm/index.esm.mjs";
6
+ import { getMessaging as v, onRegistered as R, onUnregistered as F, onMessage as h, register as L, unregister as k } from "../bt-core/core/node_modules/@firebase/messaging/dist/esm/index.esm.mjs";
7
7
  import { getDetailedDeviceType as m } from "./devices.mjs";
8
- import { initializeApp as E } from "../bt-core/core/node_modules/@firebase/app/dist/esm/index.esm.mjs";
8
+ import { initializeApp as D } from "../bt-core/core/node_modules/@firebase/app/dist/esm/index.esm.mjs";
9
9
  let t, g;
10
- function S(e) {
10
+ function P(e) {
11
11
  g = e;
12
12
  }
13
- function p() {
13
+ function S() {
14
14
  return t;
15
15
  }
16
- function q(e) {
17
- const { actionLoadingMsg: y, apiPost: c } = v();
16
+ function p(e) {
17
+ if (t != null)
18
+ return t;
19
+ const { actionLoadingMsg: y, apiPost: l } = w();
18
20
  var a = "", n = "";
19
21
  (e == null ? void 0 : e.finalRegisterURL) != null ? a = e.finalRegisterURL : a = u(d(), (e == null ? void 0 : e.registerUrl) ?? "FirebaseNotifications/Register"), (e == null ? void 0 : e.finalUnregisterURL) != null ? n = e.finalUnregisterURL : n = u(d(), (e == null ? void 0 : e.unregisterURL) ?? "FirebaseNotifications/Unregister");
20
- const l = E(e.config), i = R(l), o = w(typeof window < "u" && "Notification" in window ? Notification.permission : "default");
22
+ const c = D(e.config), i = v(c), o = b(typeof window < "u" && "Notification" in window ? Notification.permission : "default");
21
23
  async function f() {
22
- F(i, async (r) => {
23
- console.log("Firebase Installation ID received:", r);
24
+ if (o.value === "granted")
24
25
  try {
25
- await c({
26
- data: {
27
- token: r,
28
- deviceType: m()
29
- },
30
- finalUrl: a,
31
- throwError: !0
32
- });
33
- } catch (s) {
34
- console.log("firebase initiation error"), console.log(s);
26
+ const r = await navigator.serviceWorker.ready;
27
+ await L(
28
+ i,
29
+ {
30
+ vapidKey: e.vapidPublicKey,
31
+ serviceWorkerRegistration: r
32
+ }
33
+ );
34
+ } catch (r) {
35
+ console.log("Error triggering firebase register:", r);
35
36
  }
36
- }), h(i, async (r) => {
37
- console.log("Firebase Installation ID unregistered:", r);
38
- try {
39
- await c({
40
- data: {
41
- token: r,
42
- deviceType: m()
43
- },
44
- finalUrl: n,
45
- throwError: !0
46
- });
47
- } catch (s) {
48
- console.log("firebase backend unregister notification error", s);
49
- }
50
- }), L(i, (r) => {
51
- g != null && g(r);
52
- }), o.value === "granted" && await U();
53
37
  }
54
38
  async function U() {
55
39
  try {
56
- const r = await navigator.serviceWorker.ready;
57
- await k(
58
- i,
59
- {
60
- vapidKey: e.vapidPublicKey,
61
- serviceWorkerRegistration: r
62
- }
63
- );
40
+ await k(i), console.log("Successfully requested Firebase unregistration.");
64
41
  } catch (r) {
65
- console.log("Error triggering firebase register:", r);
42
+ throw console.log("Error calling firebase unregister:", r), r;
66
43
  }
67
44
  }
68
- async function b() {
45
+ return R(i, async (r) => {
46
+ console.log("Firebase Installation ID received:", r);
69
47
  try {
70
- await D(i), console.log("Successfully requested Firebase unregistration.");
71
- } catch (r) {
72
- throw console.log("Error calling firebase unregister:", r), r;
48
+ await l({
49
+ data: {
50
+ token: r,
51
+ deviceType: m()
52
+ },
53
+ finalUrl: a,
54
+ throwError: !0
55
+ });
56
+ } catch (s) {
57
+ console.log("firebase initiation error"), console.log(s);
73
58
  }
74
- }
75
- return t == null && e.initiateImmediately && f(), t ?? (t = {
59
+ }), F(i, async (r) => {
60
+ console.log("Firebase Installation ID unregistered:", r);
61
+ try {
62
+ await l({
63
+ data: {
64
+ token: r,
65
+ deviceType: m()
66
+ },
67
+ finalUrl: n,
68
+ throwError: !0
69
+ });
70
+ } catch (s) {
71
+ console.log("firebase backend unregister notification error", s);
72
+ }
73
+ }), h(i, (r) => {
74
+ g != null && g(r);
75
+ }), t == null && e.initiateImmediately && f(), t ?? (t = {
76
76
  actionLoadingMsg: y,
77
- app: l,
77
+ app: c,
78
78
  messaging: i,
79
- initiate: f,
80
79
  permission: o,
81
- unregister: b
80
+ register: f,
81
+ unregister: U
82
82
  }), t;
83
83
  }
84
84
  export {
85
- q as createFirebase,
86
- p as useFirebase,
87
- S as useFirebaseListener
85
+ p as createFirebase,
86
+ S as useFirebase,
87
+ P as useFirebaseListener
88
88
  };