bt-core-app 2.2.21 → 2.2.23

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.
@@ -94,6 +94,7 @@ const re = { key: "0" }, de = { key: "0.5" }, ke = /* @__PURE__ */ F({
94
94
  refreshToggle: { type: Boolean },
95
95
  resetTrackerToggle: { type: Boolean },
96
96
  startEditing: { type: Boolean },
97
+ startRefreshing: { type: Boolean },
97
98
  storeMode: {},
98
99
  storageMode: {},
99
100
  trackChanges: { type: Boolean, default: !0 },
@@ -156,6 +156,7 @@ const Re = {
156
156
  sortDirection: {},
157
157
  sortProp: {},
158
158
  startEditing: { type: Boolean },
159
+ startRefreshing: { type: Boolean },
159
160
  startShowingInactive: { type: Boolean },
160
161
  startShowingSearch: { type: Boolean },
161
162
  storeMode: {},
@@ -175,6 +175,7 @@ const bt = {
175
175
  sortDirection: {},
176
176
  sortProp: {},
177
177
  startEditing: { type: Boolean, default: !0 },
178
+ startRefreshing: { type: Boolean },
178
179
  startShowingInactive: { type: Boolean },
179
180
  startShowingSearch: { type: Boolean },
180
181
  storeMode: {},
@@ -9,7 +9,7 @@ import { VOverlay as P } from "../bt-core/core/node_modules/vuetify/lib/componen
9
9
  const b = {
10
10
  key: 0,
11
11
  class: "align-center justify-center text-center"
12
- }, w = { key: "3" }, K = /* @__PURE__ */ k({
12
+ }, R = { key: "3" }, K = /* @__PURE__ */ k({
13
13
  __name: "BT-Entity",
14
14
  props: {
15
15
  alternateText: {},
@@ -80,6 +80,7 @@ const b = {
80
80
  refreshToggle: { type: Boolean },
81
81
  resetTrackerToggle: { type: Boolean },
82
82
  startEditing: { type: Boolean },
83
+ startRefreshing: { type: Boolean },
83
84
  storeMode: {},
84
85
  storageMode: {},
85
86
  trackChanges: { type: Boolean },
@@ -144,7 +145,7 @@ const b = {
144
145
  item: t(n).asyncItem.value,
145
146
  refresh: t(n).refresh
146
147
  }, () => [
147
- g("span", w, s(e.alternateText), 1)
148
+ g("span", R, s(e.alternateText), 1)
148
149
  ])
149
150
  ], 2))
150
151
  ]),
@@ -1,7 +1,7 @@
1
- import { defineComponent as Y, ref as V, inject as C, computed as m, openBlock as a, createBlock as s, unref as t, normalizeClass as J, withCtx as i, createElementVNode as $, renderSlot as u, createVNode as r, createTextVNode as c, mergeProps as z, createCommentVNode as p, toDisplayString as f, createElementBlock as P, Fragment as O, renderList as W } from "vue";
1
+ import { defineComponent as Y, ref as V, inject as C, computed as m, openBlock as a, createBlock as s, unref as t, normalizeClass as J, withCtx as i, createElementVNode as $, renderSlot as u, createVNode as r, createTextVNode as c, mergeProps as z, createCommentVNode as p, toDisplayString as f, createElementBlock as P, Fragment as R, renderList as W } from "vue";
2
2
  import { useList as Z } from "../composables/list.mjs";
3
3
  import { useFilters as x } from "../composables/filters.mjs";
4
- import { nestedValue as R, isLengthyArray as _ } from "../composables/helpers.mjs";
4
+ import { nestedValue as O, isLengthyArray as _ } from "../composables/helpers.mjs";
5
5
  import { VCol as ee } from "../bt-core/core/node_modules/vuetify/lib/components/VGrid/VCol.mjs";
6
6
  import { VListItem as S } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListItem.mjs";
7
7
  import { VIcon as E } from "../bt-core/core/node_modules/vuetify/lib/components/VIcon/VIcon.mjs";
@@ -122,6 +122,7 @@ const re = { class: "d-flex align-center" }, ue = { class: "d-flex align-center"
122
122
  sortDirection: {},
123
123
  sortProp: {},
124
124
  startEditing: { type: Boolean },
125
+ startRefreshing: { type: Boolean },
125
126
  startShowingInactive: { type: Boolean },
126
127
  startShowingSearch: { type: Boolean },
127
128
  storeMode: {},
@@ -138,10 +139,10 @@ const re = { class: "d-flex align-center" }, ue = { class: "d-flex align-center"
138
139
  // useRouteSrc: false
139
140
  }), D = x(), L = m(() => (e) => {
140
141
  let l = n.subtextFunction != null ? n.subtextFunction(e) : e;
141
- return l = n.itemSubtext != null ? R(l, n.itemSubtext) : l, n.subtextFilter != null ? D.findFilter(n.subtextFilter)(l) : l;
142
+ return l = n.itemSubtext != null ? O(l, n.itemSubtext) : l, n.subtextFilter != null ? D.findFilter(n.subtextFilter)(l) : l;
142
143
  }), k = m(() => (e) => {
143
144
  let l = n.textFunction != null ? n.textFunction(e) : e;
144
- return l = n.itemText != null ? R(l, n.itemText) : l, n.textFilter != null ? D.findFilter(n.textFilter)(l) : l;
145
+ return l = n.itemText != null ? O(l, n.itemText) : l, n.textFilter != null ? D.findFilter(n.textFilter)(l) : l;
145
146
  }), h = m(() => (e) => (n.itemValue ? e[n.itemValue] : e) == n.modelValue);
146
147
  function M() {
147
148
  K.value && (y.value = !0);
@@ -291,7 +292,7 @@ const re = { class: "d-flex align-center" }, ue = { class: "d-flex align-center"
291
292
  "hide-on-leave": ""
292
293
  }, {
293
294
  default: i(() => [
294
- (a(!0), P(O, null, W(t(d).filteredItems.value, (o, B) => (a(), P(O, {
295
+ (a(!0), P(R, null, W(t(d).filteredItems.value, (o, B) => (a(), P(R, {
295
296
  key: `${o.id ?? B}-list-item`
296
297
  }, [
297
298
  u(e.$slots, "item", {
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as m, computed as d, openBlock as u, createBlock as y, unref as o, mergeProps as S } from "vue";
2
2
  import { useList as g } from "../composables/list.mjs";
3
3
  import { useNavigation as B } from "../composables/navigation.mjs";
4
- import { TestRequired as v } from "../composables/rules.mjs";
5
- import { VSelect as f } from "../bt-core/core/node_modules/vuetify/lib/components/VSelect/VSelect.mjs";
4
+ import { TestRequired as f } from "../composables/rules.mjs";
5
+ import { VSelect as v } from "../bt-core/core/node_modules/vuetify/lib/components/VSelect/VSelect.mjs";
6
6
  const D = /* @__PURE__ */ m({
7
7
  __name: "BT-Select-Simple",
8
8
  props: {
@@ -87,6 +87,7 @@ const D = /* @__PURE__ */ m({
87
87
  sortDirection: {},
88
88
  sortProp: {},
89
89
  startEditing: { type: Boolean },
90
+ startRefreshing: { type: Boolean },
90
91
  startShowingInactive: { type: Boolean },
91
92
  startShowingSearch: { type: Boolean },
92
93
  storeMode: {},
@@ -102,9 +103,9 @@ const D = /* @__PURE__ */ m({
102
103
  var e = [
103
104
  ...t.rules ?? []
104
105
  ];
105
- return t.required && e.push(v), e.length > 0 ? e : void 0;
106
+ return t.required && e.push(f), e.length > 0 ? e : void 0;
106
107
  });
107
- return (e, l) => (u(), y(o(f), S({
108
+ return (e, l) => (u(), y(o(v), S({
108
109
  "append-icon": e.canRefresh ? "$refresh" : void 0,
109
110
  clearable: e.canSelectNone,
110
111
  "onClick:appendIcon": l[0] || (l[0] = (h) => o(n).refresh({ deepRefresh: !0 })),
@@ -1,10 +1,10 @@
1
- import { defineComponent as B, computed as f, openBlock as h, createBlock as A, unref as t, mergeProps as I, withCtx as c, renderSlot as p, normalizeProps as a, guardReactiveProps as r, createVNode as m } from "vue";
1
+ import { defineComponent as f, computed as v, openBlock as h, createBlock as A, unref as t, mergeProps as I, withCtx as c, renderSlot as p, normalizeProps as a, guardReactiveProps as r, createVNode as m } from "vue";
2
2
  import { useList as C } from "../composables/list.mjs";
3
3
  import { useNavigation as R } from "../composables/navigation.mjs";
4
4
  import { TestRequired as T } from "../composables/rules.mjs";
5
5
  import { VSelect as P } from "../bt-core/core/node_modules/vuetify/lib/components/VSelect/VSelect.mjs";
6
6
  import { VListItem as u } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListItem.mjs";
7
- const k = /* @__PURE__ */ B({
7
+ const k = /* @__PURE__ */ f({
8
8
  __name: "BT-Select",
9
9
  props: {
10
10
  additionalUrl: {},
@@ -88,6 +88,7 @@ const k = /* @__PURE__ */ B({
88
88
  sortDirection: {},
89
89
  sortProp: {},
90
90
  startEditing: { type: Boolean },
91
+ startRefreshing: { type: Boolean },
91
92
  startShowingInactive: { type: Boolean },
92
93
  startShowingSearch: { type: Boolean },
93
94
  storeMode: {},
@@ -99,7 +100,7 @@ const k = /* @__PURE__ */ B({
99
100
  },
100
101
  emits: ["change", "deleted", "fetched", "input", "select", "confirm", "mouse-over-item"],
101
102
  setup(d, { emit: y }) {
102
- const S = y, g = R(), o = d, v = o.itemText ?? (o.nav != null ? g.findItemText(o.nav) : void 0) ?? void 0, l = C(o, S), s = f(() => {
103
+ const g = y, S = R(), o = d, B = o.itemText ?? (o.nav != null ? S.findItemText(o.nav) : void 0) ?? void 0, l = C(o, g), s = v(() => {
103
104
  var e = [
104
105
  ...o.rules ?? []
105
106
  ];
@@ -111,7 +112,7 @@ const k = /* @__PURE__ */ B({
111
112
  "onClick:appendIcon": i[0] || (i[0] = (n) => t(l).refresh({ deepRefresh: !0 })),
112
113
  "hide-details": s.value == null,
113
114
  items: t(l).filteredItems.value,
114
- "item-title": t(v),
115
+ "item-title": t(B),
115
116
  "item-value": e.itemValue,
116
117
  loading: t(l).isLoading.value,
117
118
  multiple: e.multiple,
@@ -59,6 +59,7 @@ export interface ItemProps<T, TSave, TReturn> {
59
59
  refreshToggle?: boolean;
60
60
  resetTrackerToggle?: boolean;
61
61
  startEditing?: boolean;
62
+ startRefreshing?: boolean;
62
63
  storeMode?: StoreMode;
63
64
  storageMode?: StorageMode;
64
65
  trackChanges?: boolean;
@@ -1,4 +1,4 @@
1
- import { ref as E, computed as f, shallowRef as se, toValue as P, watch as I, onMounted as ye } from "vue";
1
+ import { ref as E, computed as f, shallowRef as se, toValue as M, watch as I, onMounted as ye } from "vue";
2
2
  import { useStoreDefinition as me } from "./stores.mjs";
3
3
  import { useTracker as oe } from "./track.mjs";
4
4
  import { useRoute as we, useRouter as ge } from "vue-router";
@@ -6,10 +6,10 @@ import { useActions as Ae } from "./actions.mjs";
6
6
  import { useBlade as Ie } from "./blade.mjs";
7
7
  import { useNavBack as De, useNavigation as Se } from "./navigation.mjs";
8
8
  import { useDialogConfirm as Ne } from "./dialog-items.mjs";
9
- import { isLengthyArray as Ge } from "./helpers.mjs";
10
- function ke(e, G, c) {
9
+ import { isLengthyArray as Re } from "./helpers.mjs";
10
+ function ke(e, R, c) {
11
11
  var K;
12
- const j = Se(), R = (c == null ? void 0 : c.useBladeSrc) ?? e.useBladeSrc ?? !!e.bladeName, k = (c == null ? void 0 : c.useRouteSrc) ?? e.useRouteSrc ?? e.variant == "page", T = e.proxyKey ?? "proxyID", v = e.nav ?? e.bladeName, z = e.storeMode ?? (c == null ? void 0 : c.storeMode), H = e.storageMode ?? (c == null ? void 0 : c.storageMode), J = (K = j.findItem(v)) == null ? void 0 : K.deleteStrat, D = E(!1), { navBack: U } = De(), t = we(), Q = ge(), i = Ie({
12
+ const j = Se(), G = (c == null ? void 0 : c.useBladeSrc) ?? e.useBladeSrc ?? !!e.bladeName, k = (c == null ? void 0 : c.useRouteSrc) ?? e.useRouteSrc ?? e.variant == "page", T = e.proxyKey ?? "proxyID", v = e.nav ?? e.bladeName, z = e.storeMode ?? (c == null ? void 0 : c.storeMode), H = e.storageMode ?? (c == null ? void 0 : c.storageMode), J = (K = j.findItem(v)) == null ? void 0 : K.deleteStrat, D = E(!1), { navBack: U } = De(), t = we(), Q = ge(), i = Ie({
13
13
  bladeGroup: e.bladeGroup,
14
14
  bladeName: e.bladeName,
15
15
  onUpdate: (a) => {
@@ -24,7 +24,7 @@ function ke(e, G, c) {
24
24
  }), o = f(() => {
25
25
  var l, n;
26
26
  let a = e.proxyID;
27
- return a == null && R && ((l = i == null ? void 0 : i.bladeData) == null ? void 0 : l.data) != null && (a = i.bladeData.data[T]), a == null && k && (a = (n = t == null ? void 0 : t.query) == null ? void 0 : n[T]), a;
27
+ return a == null && G && ((l = i == null ? void 0 : i.bladeData) == null ? void 0 : l.data) != null && (a = i.bladeData.data[T]), a == null && k && (a = (n = t == null ? void 0 : t.query) == null ? void 0 : n[T]), a;
28
28
  }), u = E(), { actionErrorMsg: X, actionLoadingMsg: Y, deleteItem: Z, getItem: _, getAllItems: $, restoreItem: O, saveItem: p } = Ae({
29
29
  nav: v,
30
30
  onError: e.onError ?? (c == null ? void 0 : c.onError),
@@ -38,30 +38,30 @@ function ke(e, G, c) {
38
38
  }), V = f(() => e.errorMsg ?? X.value), L = f(() => e.loadingMsg ?? Y.value), ee = f(() => L.value != null), g = f(() => {
39
39
  var l, n, s;
40
40
  let a = e.itemID;
41
- return a == null && R && ((l = i == null ? void 0 : i.bladeData) == null ? void 0 : l.data) != null && (a = i.bladeData.data.id), a == null && k && (a = ((n = t == null ? void 0 : t.query) == null ? void 0 : n.id) ?? ((s = t == null ? void 0 : t.params) == null ? void 0 : s.id)), a;
42
- }), d = E(g.value == "new" ? "new" : e.startEditing || e.alwaysEditing ? "edit" : "view"), h = se(!1), q = f(() => {
41
+ return a == null && G && ((l = i == null ? void 0 : i.bladeData) == null ? void 0 : l.data) != null && (a = i.bladeData.data.id), a == null && k && (a = ((n = t == null ? void 0 : t.query) == null ? void 0 : n.id) ?? ((s = t == null ? void 0 : t.params) == null ? void 0 : s.id)), a;
42
+ }), d = E(g.value == "new" ? "new" : e.startEditing || e.alwaysEditing ? "edit" : "view"), P = se(!1), q = f(() => {
43
43
  var l;
44
44
  let a = e.params != null ? { ...e.params } : {};
45
- return Ge(e.queryParams) && (t == null ? void 0 : t.query) != null && ((l = e.queryParams) == null || l.forEach((n) => {
45
+ return Re(e.queryParams) && (t == null ? void 0 : t.query) != null && ((l = e.queryParams) == null || l.forEach((n) => {
46
46
  typeof n == "string" ? (t == null ? void 0 : t.query[n]) != null && (a[n] = t == null ? void 0 : t.query[n]) : (t == null ? void 0 : t.query[n.key]) != null && (a[n.value] = t == null ? void 0 : t.query[n.key]);
47
47
  })), a;
48
48
  }), ae = f(() => {
49
49
  if (d.value == "new")
50
50
  return !1;
51
- const a = P(u);
51
+ const a = M(u);
52
52
  return a != null && e.onCanDelete != null ? e.onCanDelete(a) : (a == null ? void 0 : a.isInactive) !== !0;
53
53
  }), le = f(() => {
54
54
  if (d.value == "new")
55
55
  return !1;
56
- const a = P(u);
56
+ const a = M(u);
57
57
  return e.onCanEdit != null ? e.onCanEdit(a) : !0;
58
58
  }), te = f(() => {
59
59
  if (d.value == "new")
60
60
  return !1;
61
- const a = P(u);
61
+ const a = M(u);
62
62
  return e.onCanRestore != null ? e.onCanRestore(a) : (a == null ? void 0 : a.isInactive) === !0;
63
63
  }), ne = f(() => {
64
- const a = P(u);
64
+ const a = M(u);
65
65
  return e.onCanSave != null ? e.onCanSave(a) : !0;
66
66
  }), C = e.onUpdateAsyncItem ?? ((a, l) => {
67
67
  l.hasOwnProperty("rowVersion") && (a.rowVersion = l.rowVersion), l.hasOwnProperty("version") && (a.version = l.version), l.hasOwnProperty("isDeleted") && (a.isDeleted = l.isDeleted), l.hasOwnProperty("isInactive") && (a.isInactive = l.isInactive), l.hasOwnProperty("id") && (a.id = l.id);
@@ -114,8 +114,8 @@ function ke(e, G, c) {
114
114
  e.onRefreshAsync != null ? await e.onRefreshAsync(a) : await w(a);
115
115
  }
116
116
  async function w(a) {
117
- var s, m, A, b, B, N, M, W;
118
- h.value = !1;
117
+ var s, m, A, b, h, N, B, W;
118
+ P.value = !1;
119
119
  var l = e.item ?? ((m = (s = i.bladeData) == null ? void 0 : s.data) == null ? void 0 : m.data) ?? ((b = (A = a == null ? void 0 : a.bladeData) == null ? void 0 : A.data) == null ? void 0 : b.data);
120
120
  if (a != null && a.resetMode) {
121
121
  var n = g.value == "new" ? "new" : e.startEditing || e.alwaysEditing ? "edit" : "view";
@@ -138,7 +138,7 @@ function ke(e, G, c) {
138
138
  proxyID: o.value,
139
139
  params: {
140
140
  ...q.value,
141
- ...R ? (N = (B = i.bladeData) == null ? void 0 : B.data) == null ? void 0 : N.params : {}
141
+ ...G ? (N = (h = i.bladeData) == null ? void 0 : h.data) == null ? void 0 : N.params : {}
142
142
  },
143
143
  refresh: (a == null ? void 0 : a.deepRefresh) ?? !1,
144
144
  onGetAsync: e.onGetAsync,
@@ -159,7 +159,7 @@ function ke(e, G, c) {
159
159
  proxyID: o.value,
160
160
  params: {
161
161
  ...q.value,
162
- ...R ? (W = (M = i.bladeData) == null ? void 0 : M.data) == null ? void 0 : W.params : {}
162
+ ...G ? (W = (B = i.bladeData) == null ? void 0 : B.data) == null ? void 0 : W.params : {}
163
163
  },
164
164
  refresh: (a == null ? void 0 : a.deepRefresh) ?? !1,
165
165
  onGetAsync: e.onGetListAsync,
@@ -168,7 +168,7 @@ function ke(e, G, c) {
168
168
  e.findItem != null ? u.value = e.findItem(r == null ? void 0 : r.data) : u.value = (r == null ? void 0 : r.data) ?? void 0;
169
169
  }
170
170
  }
171
- S(), (c == null ? void 0 : c.onGetItem) != null && c.onGetItem(u.value), G && G("fetched", u.value);
171
+ S(), (c == null ? void 0 : c.onGetItem) != null && c.onGetItem(u.value), R && R("fetched", u.value);
172
172
  }
173
173
  function re(a, l) {
174
174
  const n = a.id == null, {
@@ -176,11 +176,11 @@ function ke(e, G, c) {
176
176
  onCanSaveAsync: m,
177
177
  onGetSaveAsync: A,
178
178
  onSaveAsync: b,
179
- onSaveSuccessAsync: B = (N) => {
179
+ onSaveSuccessAsync: h = (N) => {
180
180
  if (C(u.value, N), (l == null ? void 0 : l.navBack) === !0)
181
181
  e.bladeName ? (i.closeBlade({ bladeName: e.bladeName }), e.closeBladeNames != null && i.closeBlade({ bladeName: e.closeBladeNames })) : U(n);
182
182
  else if (S(), !(l != null && l.stayEditing) && !e.alwaysEditing && x(), l != null && l.updateUrl && n) {
183
- const M = {
183
+ const B = {
184
184
  ...t,
185
185
  params: {
186
186
  ...t.params,
@@ -189,9 +189,9 @@ function ke(e, G, c) {
189
189
  query: {},
190
190
  replace: !0
191
191
  };
192
- Q.replace(M);
192
+ Q.replace(B);
193
193
  }
194
- return G && G("saved", a, n), Promise.resolve(void 0);
194
+ return R && R("saved", a, n), Promise.resolve(void 0);
195
195
  }
196
196
  } = { ...e };
197
197
  return p({
@@ -201,7 +201,7 @@ function ke(e, G, c) {
201
201
  onCanSaveAsync: m,
202
202
  onGetSaveAsync: A,
203
203
  onSaveAsync: b,
204
- onSaveSuccessAsync: B,
204
+ onSaveSuccessAsync: h,
205
205
  proxyID: o.value
206
206
  });
207
207
  }
@@ -218,7 +218,7 @@ function ke(e, G, c) {
218
218
  d.value == "view" ? await F() : await x();
219
219
  }
220
220
  return I(V, (a) => {
221
- h.value = a != null;
221
+ P.value = a != null;
222
222
  }), I(() => e.refreshToggle, () => {
223
223
  w({ deepRefresh: !0 });
224
224
  }), I(() => e.refreshLiteToggle, () => {
@@ -231,7 +231,7 @@ function ke(e, G, c) {
231
231
  w({ deepRefresh: !!e.refreshOnChange });
232
232
  }), ye(async () => {
233
233
  var a;
234
- (e.eager == !0 || e.eagerWithID == !0 && (g.value != null || e.localPredicate != null)) && await w({ deepRefresh: ((a = t == null ? void 0 : t.params) == null ? void 0 : a.refresh) == "true" });
234
+ (e.eager == !0 || e.eagerWithID == !0 && (g.value != null || e.localPredicate != null)) && await w({ deepRefresh: ((a = t == null ? void 0 : t.params) == null ? void 0 : a.refresh) == "true" || !!e.startRefreshing });
235
235
  }), {
236
236
  asyncItem: u,
237
237
  isChangingMode: D,
@@ -253,7 +253,7 @@ function ke(e, G, c) {
253
253
  restoreItem: ie,
254
254
  runRefresh: de,
255
255
  saveItem: re,
256
- showError: h,
256
+ showError: P,
257
257
  toggleMode: ve,
258
258
  ...i
259
259
  };
@@ -134,6 +134,7 @@ export interface ListProps<T, TSave, TReturn> {
134
134
  sortDirection?: 'asc' | 'desc' | -1 | 1;
135
135
  sortProp?: string | string[];
136
136
  startEditing?: boolean;
137
+ startRefreshing?: boolean;
137
138
  startShowingInactive?: boolean;
138
139
  startShowingSearch?: boolean;
139
140
  storeMode?: StoreMode;