bt-core-app 1.4.822 → 1.4.824

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.
@@ -12673,7 +12673,7 @@ function DM(e, t, a) {
12673
12673
  onGetAsync: e.onGetAsync,
12674
12674
  onGetSuccessAsync: e.onGetSuccessAsync
12675
12675
  };
12676
- if (console.log(ue), ue.id === "new")
12676
+ if (ue.id === "new")
12677
12677
  e.onGetNew != null ? v.value = e.onGetNew(ue) : e.onGetNewAsync != null ? v.value = await e.onGetNewAsync(ue) : v.value = {};
12678
12678
  else if (o != null) {
12679
12679
  const Be = await k(ue);
@@ -12697,7 +12697,7 @@ function DM(e, t, a) {
12697
12697
  e.findItem != null ? v.value = e.findItem(Be == null ? void 0 : Be.data) : v.value = (Be == null ? void 0 : Be.data) ?? void 0;
12698
12698
  }
12699
12699
  }
12700
- H(), t && t("fetched", v.value);
12700
+ H(), (a == null ? void 0 : a.onGetItem) != null && a.onGetItem(v.value), t && t("fetched", v.value);
12701
12701
  }
12702
12702
  function te(fe, Ce) {
12703
12703
  const ue = fe.id == null, {
@@ -23077,7 +23077,10 @@ const n7 = ch("v-alert-title"), l7 = ["success", "info", "warning", "error"], r7
23077
23077
  const C = T(() => a.loadingMsg != null), k = T(() => !!(n.hideBladeControls ?? a.hideBladeControls) || !a.bladeName), w = T(() => !!(n.hideNavigation ?? a.hideNavigation) || v.variant.value != "page"), x = T(() => {
23078
23078
  const V = n.noMargins ?? a.noMargins;
23079
23079
  return V ?? u.value;
23080
- }), S = T(() => (a.toolbarVariant ?? (a.variant == "inline" ? "inverted" : "default")) == "inverted" ? void 0 : "primary"), _ = U(!1), A = T(() => {
23080
+ }), S = T(() => {
23081
+ if (a.toolbarVariant != "inverted")
23082
+ return a.bordered || a.variant == "inline" ? "transparent" : "primary";
23083
+ }), _ = U(!1), A = T(() => {
23081
23084
  var V = "";
23082
23085
  return x.value ? V = "" : (a.bordered && !o.value || v.variant.value == "page") && (V = "ma-2"), a.bordered && !o.value && (V = `${V} border-thin pa-1`), a.bladeName != null && l.value == "grow" && (V = `${V} flex-grow-1`), V;
23083
23086
  }), I = T(() => a.bladeName != null ? d.value ? `width: ${c.width}px;` : o.value ? "width: 0px;" : l.value == "grow" ? "" : l.value == "number" ? `width: ${c.width}px;` : l.value == "auto" ? "" : `width: calc(${a.width});` : "");
@@ -33989,6 +33992,8 @@ const IO = /* @__PURE__ */ Qe({
33989
33992
  __name: "BT-Entity",
33990
33993
  props: {
33991
33994
  alternateText: {},
33995
+ assignToObject: {},
33996
+ assignToProp: {},
33992
33997
  inline: { type: Boolean },
33993
33998
  isEditing: { type: Boolean },
33994
33999
  itemText: {},
@@ -34057,7 +34062,11 @@ const IO = /* @__PURE__ */ Qe({
34057
34062
  },
34058
34063
  emits: ["edit", "fetched", "saved"],
34059
34064
  setup(e, { emit: t }) {
34060
- const a = t, n = e, l = Ks(), r = DM(n, a), i = Fi(), o = n.itemText ?? (n.nav != null ? i.findItemText(n.nav) : void 0) ?? void 0, s = T(() => {
34065
+ const a = t, n = e, l = Ks(), r = DM(n, a, {
34066
+ onGetItem: (c) => {
34067
+ console.log(c), n.assignToObject != null && n.assignToProp != null && (n.assignToObject[n.assignToProp] = c);
34068
+ }
34069
+ }), i = Fi(), o = n.itemText ?? (n.nav != null ? i.findItemText(n.nav) : void 0) ?? void 0, s = T(() => {
34061
34070
  var c = St(r.asyncItem);
34062
34071
  return n.textFunction != null && (c = n.textFunction(c)), o != null && (c = Vn(r.asyncItem.value, o)), n.textFilter != null ? l.findFilter(n.textFilter)(c) : c;
34063
34072
  });
package/dist/index.d.ts CHANGED
@@ -2144,7 +2144,7 @@ export declare function useItem<T, TSave, TReturn>(props: ItemProps<T, TSave, TR
2144
2144
  isSaveable: ComputedRef<boolean>;
2145
2145
  loadingMsg: ComputedRef<string | undefined>;
2146
2146
  mode: Ref<BladeMode, BladeMode>;
2147
- refresh: (options?: ItemRefreshOptions) => Promise<void>;
2147
+ refresh: (refreshOptions?: ItemRefreshOptions) => Promise<void>;
2148
2148
  restoreItem: (dItem: any) => Promise<TReturn | undefined>;
2149
2149
  saveItem: (dItem: any, options?: SaveItemOptions) => Promise<TReturn | undefined>;
2150
2150
  showError: ShallowRef<boolean, boolean>;
@@ -2152,6 +2152,7 @@ export declare function useItem<T, TSave, TReturn>(props: ItemProps<T, TSave, TR
2152
2152
  };
2153
2153
 
2154
2154
  export declare interface UseItemOptions {
2155
+ onGetItem?: (item: any) => void;
2155
2156
  onError?: (err: any) => void;
2156
2157
  storeKey?: string;
2157
2158
  storeMode?: StoreMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "1.4.822",
3
+ "version": "1.4.824",
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": {