bt-core-app 2.2.13 → 2.2.15

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.
Files changed (44) hide show
  1. package/dist/components/BT-Background-Task.vue.d.ts +1 -1
  2. package/dist/components/BT-Banner.vue.d.ts +35 -0
  3. package/dist/components/BT-Banner.vue.mjs +115 -0
  4. package/dist/components/BT-Banner.vue2.mjs +4 -0
  5. package/dist/components/BT-Blade-Item.vue.d.ts +2 -2
  6. package/dist/components/BT-Blade-Items.vue.d.ts +5 -5
  7. package/dist/components/BT-Blade-Steps.vue.d.ts +5 -5
  8. package/dist/components/BT-Blade.vue.d.ts +2 -2
  9. package/dist/components/BT-Btn.vue.d.ts +1 -1
  10. package/dist/components/BT-Col.vue.d.ts +2 -2
  11. package/dist/components/BT-Field-Checkbox.vue.d.ts +3 -3
  12. package/dist/components/BT-Field-Date.vue.d.ts +3 -3
  13. package/dist/components/BT-Field-Entity.vue.d.ts +2 -2
  14. package/dist/components/BT-Field-Select-Simple.vue.d.ts +3 -3
  15. package/dist/components/BT-Field-Select.vue.d.ts +3 -3
  16. package/dist/components/BT-Field-String.vue.d.ts +3 -3
  17. package/dist/components/BT-Field-Switch.vue.d.ts +3 -3
  18. package/dist/components/BT-Field-Tags.vue.d.ts +3 -3
  19. package/dist/components/BT-Field-Textarea.vue.d.ts +3 -3
  20. package/dist/components/BT-Field-Trigger.vue.d.ts +3 -3
  21. package/dist/components/BT-Field.vue.d.ts +2 -2
  22. package/dist/components/BT-Form-Field.vue.d.ts +2 -2
  23. package/dist/components/BT-Numpad.vue.d.ts +2 -2
  24. package/dist/components/BT-Select-Inline.vue.d.ts +1 -1
  25. package/dist/components/BT-Select-List-Box.vue.d.ts +5 -5
  26. package/dist/components/BT-Select-Simple.vue.d.ts +1 -1
  27. package/dist/components/BT-Select.vue.d.ts +1 -1
  28. package/dist/components/BT-Signature-Overlay.vue.d.ts +1 -1
  29. package/dist/components/BT-Square-Check.vue.d.ts +1 -1
  30. package/dist/components.mjs +34 -32
  31. package/dist/composables/banners.d.ts +40 -0
  32. package/dist/composables/banners.mjs +43 -0
  33. package/dist/composables/blade.mjs +7 -7
  34. package/dist/composables/forms.mjs +17 -18
  35. package/dist/composables/graph-pro.mjs +14 -15
  36. package/dist/composables/list.mjs +9 -10
  37. package/dist/composables.mjs +231 -229
  38. package/dist/index-components.d.ts +2 -1
  39. package/dist/index-composables.d.ts +2 -0
  40. package/dist/index.d.ts +4 -1
  41. package/dist/index.mjs +261 -257
  42. package/dist/node_modules/bt-core-app/dist/bt-core-app.mjs +1617 -1638
  43. package/dist/style.css +1 -1
  44. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ export interface UseBannersOptions {
2
+ getBanners?: (sets: BannerOption[]) => Promise<BannerOption[]>;
3
+ banners?: BannerOption[];
4
+ }
5
+ export interface BannerOption {
6
+ bannerName: string;
7
+ canIgnore?: boolean;
8
+ noText?: string;
9
+ onRespond?: (confirm?: boolean) => Promise<void>;
10
+ subtitle?: string;
11
+ text?: string;
12
+ title?: string;
13
+ yesText?: string;
14
+ }
15
+ export interface BannerData extends BannerOption {
16
+ doShow: boolean;
17
+ isComplete: boolean;
18
+ }
19
+ export interface NextStageOptions {
20
+ neverAgain?: boolean;
21
+ respond?: boolean;
22
+ }
23
+ export declare function useBanners(name: string, opt: UseBannersOptions): {
24
+ currentBannerInd: import('vue').Ref<number, number>;
25
+ displayBanners: import('vue').ComputedRef<{
26
+ doShow: boolean;
27
+ isComplete: boolean;
28
+ bannerName: string;
29
+ canIgnore?: boolean | undefined;
30
+ noText?: string | undefined;
31
+ onRespond?: ((confirm?: boolean | undefined) => Promise<void>) | undefined;
32
+ subtitle?: string | undefined;
33
+ text?: string | undefined;
34
+ title?: string | undefined;
35
+ yesText?: string | undefined;
36
+ }[]>;
37
+ isLoading: import('vue').Ref<boolean, boolean>;
38
+ nextStage: (opt: NextStageOptions) => Promise<void>;
39
+ previousStage: () => void;
40
+ };
@@ -0,0 +1,43 @@
1
+ import { useStorage as N } from "@vueuse/core";
2
+ import { ref as i, computed as c } from "vue";
3
+ function w(g, o) {
4
+ const a = N(`${g}-ls`, {
5
+ bannersToIgnore: []
6
+ }), f = i([]), r = c(() => f.value.filter((e) => e.doShow)), n = i(-1), v = c(() => {
7
+ if (n.value >= 0 && r.value.length > n.value)
8
+ return r.value[n.value];
9
+ }), l = c(() => {
10
+ var e;
11
+ return (e = v.value) == null ? void 0 : e.bannerName;
12
+ }), t = i(!1);
13
+ async function m(e) {
14
+ var d;
15
+ t.value = !0;
16
+ var u = !!e.neverAgain || e.respond === !0 || e.respond === !1;
17
+ u && l.value != null && !a.value.bannersToIgnore.some((p) => p == l.value) && a.value.bannersToIgnore.push(l.value), ((d = v.value) == null ? void 0 : d.onRespond) != null && (e.respond === !0 || e.respond === !1) && (await v.value.onRespond(e.respond), v.value.isComplete = !0);
18
+ var s = n.value + 1;
19
+ console.log(s), console.log(r.value), s < r.value.length ? n.value = s : n.value = -1, a.value.currentBannerName = l.value, t.value = !1;
20
+ }
21
+ function b() {
22
+ n.value >= 0 && n.value--, a.value.currentBannerName = l.value;
23
+ }
24
+ async function B() {
25
+ var e = [];
26
+ o.getBanners != null ? e = await o.getBanners(o.banners ?? []) : e = o.banners ?? [], f.value = e.map((u) => ({
27
+ ...u,
28
+ bannerName: u.bannerName,
29
+ doShow: !a.value.bannersToIgnore.some((s) => u.bannerName == s),
30
+ isComplete: !1
31
+ })), m({});
32
+ }
33
+ return B(), {
34
+ currentBannerInd: n,
35
+ displayBanners: r,
36
+ isLoading: t,
37
+ nextStage: m,
38
+ previousStage: b
39
+ };
40
+ }
41
+ export {
42
+ w as useBanners
43
+ };
@@ -1,10 +1,10 @@
1
1
  import { ref as g, computed as n, onMounted as z } from "vue";
2
2
  import { useResizeObserver as S } from "@vueuse/core";
3
3
  import { useDraggable as k } from "./draggable.mjs";
4
- import { useResizable as s } from "./resizable.mjs";
5
- import { twiddleThumbs as G } from "../node_modules/bt-core-app/dist/bt-core-app.mjs";
4
+ import { useResizable as C } from "./resizable.mjs";
5
+ import { twiddleThumbs as G } from "./helpers.mjs";
6
6
  const r = g([]);
7
- function $(e) {
7
+ function q(e) {
8
8
  const x = (e == null ? void 0 : e.bladeGroup) ?? "default";
9
9
  function A(l) {
10
10
  return r.value.findIndex((u) => u.bladeGroup == x && u.bladeName == l);
@@ -65,8 +65,8 @@ function $(e) {
65
65
  updateBlade: y
66
66
  };
67
67
  }
68
- function j(e) {
69
- const x = (e == null ? void 0 : e.blade) ?? g(null), A = (e == null ? void 0 : e.bladeBasic) == !0, c = g(), y = e == null ? void 0 : e.bladeName, l = (e == null ? void 0 : e.mobileBreakpoint) ?? 600, u = (e == null ? void 0 : e.bladeGroup) ?? "default", b = (e == null ? void 0 : e.handle) ?? g(null), d = g(!1), m = g((e == null ? void 0 : e.variant) ?? "page"), { turnResizingOn: v } = s(x), { turnDraggableOn: E } = k(x, b);
68
+ function H(e) {
69
+ const x = (e == null ? void 0 : e.blade) ?? g(null), A = (e == null ? void 0 : e.bladeBasic) == !0, c = g(), y = e == null ? void 0 : e.bladeName, l = (e == null ? void 0 : e.mobileBreakpoint) ?? 600, u = (e == null ? void 0 : e.bladeGroup) ?? "default", b = (e == null ? void 0 : e.handle) ?? g(null), d = g(!1), m = g((e == null ? void 0 : e.variant) ?? "page"), { turnResizingOn: v } = C(x), { turnDraggableOn: E } = k(x, b);
70
70
  function F(a) {
71
71
  if (a != null && a.all) {
72
72
  const N = (a == null ? void 0 : a.mode) ?? "remove";
@@ -151,6 +151,6 @@ function j(e) {
151
151
  };
152
152
  }
153
153
  export {
154
- j as useBlade,
155
- $ as useGlobalBlades
154
+ H as useBlade,
155
+ q as useGlobalBlades
156
156
  };
@@ -1,17 +1,16 @@
1
1
  import { ref as h, computed as c } from "vue";
2
- import { moveInArray as x, distinct as R } from "./helpers.mjs";
3
- import { copyDeep as F } from "../node_modules/bt-core-app/dist/bt-core-app.mjs";
4
- function E(r) {
2
+ import { copyDeep as x, moveInArray as F, distinct as R } from "./helpers.mjs";
3
+ function D(r) {
5
4
  const i = h(), o = h(), a = c(() => {
6
5
  var e;
7
6
  return (e = o.value) == null ? void 0 : e.type;
8
7
  }), n = h();
9
8
  function m(e) {
10
- var l = F(e);
9
+ var l = x(e);
11
10
  return l.prop = s(e.type) ? p(e.type) : void 0, l;
12
11
  }
13
12
  function v(e) {
14
- var l = F(e);
13
+ var l = x(e);
15
14
  return l.fields.forEach((t) => {
16
15
  t.prop = s(t.type) ? p(t.type) : void 0;
17
16
  }), l;
@@ -65,11 +64,11 @@ function E(r) {
65
64
  }
66
65
  function q(e) {
67
66
  var l, t;
68
- ((l = n.value) == null ? void 0 : l.slides) != null && x((t = n.value) == null ? void 0 : t.slides, e, e + 1);
67
+ ((l = n.value) == null ? void 0 : l.slides) != null && F((t = n.value) == null ? void 0 : t.slides, e, e + 1);
69
68
  }
70
69
  function C(e) {
71
70
  var l, t;
72
- ((l = n.value) == null ? void 0 : l.slides) != null && x((t = n.value) == null ? void 0 : t.slides, e, e - 1);
71
+ ((l = n.value) == null ? void 0 : l.slides) != null && F((t = n.value) == null ? void 0 : t.slides, e, e - 1);
73
72
  }
74
73
  function N() {
75
74
  var t;
@@ -136,7 +135,7 @@ function E(r) {
136
135
  selectSlide: S
137
136
  };
138
137
  }
139
- const O = [
138
+ const E = [
140
139
  {
141
140
  description: "For your customer to read",
142
141
  icon: "$information",
@@ -205,21 +204,21 @@ const O = [
205
204
  }
206
205
  ];
207
206
  let d;
208
- function B(r) {
207
+ function O(r) {
209
208
  return d = r ?? {
210
209
  // customModelProps: [],
211
210
  requirementSets: [],
212
211
  templates: []
213
212
  }, d;
214
213
  }
215
- function G(r) {
214
+ function B(r) {
216
215
  var i = (d == null ? void 0 : d.templates) ?? [];
217
216
  return r != null ? i.filter((o) => o.group == r) : i;
218
217
  }
219
- function J() {
218
+ function G() {
220
219
  return d;
221
220
  }
222
- function z(r) {
221
+ function J(r) {
223
222
  let i, o = {
224
223
  ...r,
225
224
  slides: []
@@ -247,10 +246,10 @@ function z(r) {
247
246
  }, i;
248
247
  }
249
248
  export {
250
- O as Fields,
251
- z as createAForm,
252
- B as createForms,
253
- J as useFormSource,
254
- G as useFormTemplates,
255
- E as useForms
249
+ E as Fields,
250
+ J as createAForm,
251
+ O as createForms,
252
+ G as useFormSource,
253
+ B as useFormTemplates,
254
+ D as useForms
256
255
  };
@@ -1,14 +1,13 @@
1
- import { BTDateFormat as x } from "../node_modules/bt-core-app/dist/bt-core-app.mjs";
1
+ import { BTDateFormat as x, useDates as O } from "./dates.mjs";
2
2
  import { useColorizer as v } from "./colorizer.mjs";
3
- import { useDates as O } from "./dates.mjs";
4
3
  import { useFilters as K } from "./filters.mjs";
5
4
  import { nestedValue as $, group as I } from "./helpers.mjs";
6
5
  import { t as J } from "../bt-core/core/node_modules/thenby/thenBy.module.mjs";
7
6
  let D;
8
- function Q() {
7
+ function N() {
9
8
  return D;
10
9
  }
11
- function U(z) {
10
+ function Q(z) {
12
11
  const S = K();
13
12
  function G(e, a, u) {
14
13
  const r = v();
@@ -36,7 +35,7 @@ function U(z) {
36
35
  }
37
36
  };
38
37
  }
39
- function T(e, a) {
38
+ function Y(e, a) {
40
39
  const u = v();
41
40
  return {
42
41
  chartType: "bar",
@@ -58,7 +57,7 @@ function U(z) {
58
57
  }
59
58
  };
60
59
  }
61
- function Y(e, a, u) {
60
+ function T(e, a, u) {
62
61
  const r = v();
63
62
  var l = {
64
63
  chartType: "pie",
@@ -78,7 +77,7 @@ function U(z) {
78
77
  };
79
78
  return l;
80
79
  }
81
- function p(e, a) {
80
+ function A(e, a) {
82
81
  const u = v();
83
82
  return {
84
83
  chartType: "pie",
@@ -100,7 +99,7 @@ function U(z) {
100
99
  }
101
100
  };
102
101
  }
103
- function A(e, a) {
102
+ function E(e, a) {
104
103
  var u = {
105
104
  chartType: e.chartType ?? "line",
106
105
  data: {
@@ -119,7 +118,7 @@ function U(z) {
119
118
  n ?? (n = s), h ?? (h = s), s < n && (n = s), s > h && (h = s);
120
119
  });
121
120
  });
122
- var b = r.tzDate(n).startOf(c), i = b.toFormat(x), E = r.tzDate(h).endOf(c), X = E.toFormat(x);
121
+ var b = r.tzDate(n).startOf(c), i = b.toFormat(x), p = r.tzDate(h).endOf(c), X = p.toFormat(x);
123
122
  if (i < X)
124
123
  for (; i < X; )
125
124
  l != null ? L.push(l(i)) : e.labelFormatString != null ? L.push(b.toFormat(e.labelFormatString)) : L.push(i), b = b.plus(g), i = b.toFormat(x);
@@ -190,16 +189,16 @@ function U(z) {
190
189
  }), u;
191
190
  }
192
191
  return D ?? (D = {
193
- getBarChartData: T,
192
+ getBarChartData: Y,
194
193
  getDataForChartJS: G,
195
- getGraphData: A,
196
- getPieChartData: p,
197
- getPieData: Y,
194
+ getGraphData: E,
195
+ getPieChartData: A,
196
+ getPieData: T,
198
197
  getXY: k,
199
198
  getRawXY: P
200
199
  }), D;
201
200
  }
202
201
  export {
203
- U as createGraphs,
204
- Q as useGraphs
202
+ Q as createGraphs,
203
+ N as useGraphs
205
204
  };
@@ -1,16 +1,15 @@
1
1
  import { useCSV as ca } from "./csv.mjs";
2
- import { isLengthyArray as q, nestedValue as _, hasSearch as ia } from "./helpers.mjs";
2
+ import { isNullOrEmpty as Ie, isLengthyArray as q, nestedValue as _, hasSearch as ia } from "./helpers.mjs";
3
3
  import { t as j } from "../bt-core/core/node_modules/thenby/thenBy.module.mjs";
4
4
  import { ref as y, toValue as V, computed as v, shallowRef as p, watch as C, onMounted as da } from "vue";
5
- import { useArrayUnique as fa, useArrayDifference as Ie, watchDebounced as sa, watchArray as oe } from "@vueuse/core";
5
+ import { useArrayUnique as fa, useArrayDifference as oe, watchDebounced as sa, watchArray as Fe } from "@vueuse/core";
6
6
  import { useActions as va } from "./actions.mjs";
7
7
  import { useStoreDefinition as ya } from "./stores.mjs";
8
8
  import { useNavigation as ma } from "./navigation.mjs";
9
9
  import { useBlade as ha } from "./blade.mjs";
10
10
  import { useDialogConfirm as ga } from "./dialog-items.mjs";
11
- import { isNullOrEmpty as Fe } from "../node_modules/bt-core-app/dist/bt-core-app.mjs";
12
11
  import { useUrlUpdater as Sa } from "./routing.mjs";
13
- function Ma(a, F, r) {
12
+ function Ua(a, F, r) {
14
13
  var ge, Se, Pe, Ae;
15
14
  const we = ca(), xe = ma(), Ne = Sa(), ee = (r == null ? void 0 : r.idSelector) ?? a.idSelector ?? ((e) => e.id), n = (r == null ? void 0 : r.isNotSetup) == !0 ? void 0 : ha({
16
15
  bladeGroup: a.bladeGroup,
@@ -29,7 +28,7 @@ function Ma(a, F, r) {
29
28
  ...re.value
30
29
  ]).value), M = y((a.defaultFilters ?? []).map((e) => $.value.indexOf(e)));
31
30
  let J = y([...M.value]);
32
- const Ce = v(() => Ie(J, M).value.length > 0 || Ie(M, J).value.length > 0), Ue = y([]), x = y(Me());
31
+ const Ce = v(() => oe(J, M).value.length > 0 || oe(M, J).value.length > 0), Ue = y([]), x = y(Me());
33
32
  function Me() {
34
33
  var e, l, t, u;
35
34
  if (w) {
@@ -74,7 +73,7 @@ function Ma(a, F, r) {
74
73
  }) : void 0
75
74
  }), fe = v(() => a.errorMsg ?? Ge.value), X = y(), se = v(() => X.value ?? a.loadingMsg ?? Le.value), Re = v(() => se.value != null), Y = p(!1), K = p($e());
76
75
  function $e() {
77
- return a.startShowingSearch ? !0 : !Fe(ce());
76
+ return a.startShowingSearch ? !0 : !Ie(ce());
78
77
  }
79
78
  const Z = y(0), ve = v(() => {
80
79
  let e, l = [];
@@ -96,7 +95,7 @@ function Ma(a, F, r) {
96
95
  var B, m, P, R;
97
96
  typeof d == "string" ? ((B = r.route) == null ? void 0 : B.query[d]) != null && (t[d] = (m = r.route) == null ? void 0 : m.query[d]) : ((P = r.route) == null ? void 0 : P.query[d.key]) != null && (t[d.value] = (R = r.route) == null ? void 0 : R.query[d.key]);
98
97
  })), t;
99
- }), Qe = v(() => (e) => a.onCanDelete != null ? a.onCanDelete(e) : !(e != null && e.isInactive === !0)), We = v(() => (e) => a.onCanIntegrate != null ? a.onCanIntegrate(e) : !(!q(le.value) || U.value == null || (e == null ? void 0 : e.isInactive) === !0)), _e = v(() => (e) => U.value != null ? !Fe(_(e, U.value.localIDProp)) : !1), je = v(() => (e) => T.value ? a.onCanRestore != null ? a.onCanRestore(e) : (e == null ? void 0 : e.isInactive) === !0 : !1), me = a.onUpdateAsyncItem ?? ((e, l) => {
98
+ }), Qe = v(() => (e) => a.onCanDelete != null ? a.onCanDelete(e) : !(e != null && e.isInactive === !0)), We = v(() => (e) => a.onCanIntegrate != null ? a.onCanIntegrate(e) : !(!q(le.value) || U.value == null || (e == null ? void 0 : e.isInactive) === !0)), _e = v(() => (e) => U.value != null ? !Ie(_(e, U.value.localIDProp)) : !1), je = v(() => (e) => T.value ? a.onCanRestore != null ? a.onCanRestore(e) : (e == null ? void 0 : e.isInactive) === !0 : !1), me = a.onUpdateAsyncItem ?? ((e, l) => {
100
99
  l.hasOwnProperty("rowVersion") && (e.rowVersion = l.rowVersion), l.hasOwnProperty("version") && (e.version = l.version), l.hasOwnProperty("isDeleted") && (e.isDeleted = l.isDeleted), l.hasOwnProperty("isInactive") && (e.isInactive = l.isInactive), l.hasOwnProperty("id") && (e.id = l.id);
101
100
  }), H = v(() => Q.value.filter((e) => !e.hide)), ze = v(() => {
102
101
  let e = new Array();
@@ -399,9 +398,9 @@ function Ma(a, F, r) {
399
398
  G();
400
399
  }), C(() => a.proxyID, () => {
401
400
  g();
402
- }), oe([f], () => {
401
+ }), Fe([f], () => {
403
402
  G();
404
- }, { deep: !0 }), oe([() => a.items], () => {
403
+ }, { deep: !0 }), Fe([() => a.items], () => {
405
404
  g();
406
405
  }, { deep: !0 }), r != null && r.isNotSetup ? (r == null ? void 0 : r.isNotSetup) == !0 && a.eager == !0 && g({ deepRefresh: ((Se = (ge = r == null ? void 0 : r.route) == null ? void 0 : ge.params) == null ? void 0 : Se.refresh) == "true" || ((Ae = (Pe = r == null ? void 0 : r.route) == null ? void 0 : Pe.query) == null ? void 0 : Ae.refresh) == "true" }) : da(async () => {
407
406
  var e, l, t, u;
@@ -456,5 +455,5 @@ function Ma(a, F, r) {
456
455
  };
457
456
  }
458
457
  export {
459
- Ma as useList
458
+ Ua as useList
460
459
  };