sprof 0.0.91 → 0.0.93

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.
@@ -3,9 +3,9 @@ export default class Menus {
3
3
  tabs: ITab[];
4
4
  idx: number;
5
5
  key: string;
6
- PreSelectTab(): void;
6
+ preSelect(): void;
7
7
  static Create(key: string, tabs: ITab[]): Menus;
8
- select(i: number): void;
8
+ Select(i?: number): void;
9
9
  GetMenu(): ITab;
10
10
  GetComponent(): globalThis.Component;
11
11
  GetSlug(): string;
package/dist/sprof.js CHANGED
@@ -6185,10 +6185,10 @@ const pd = /* @__PURE__ */ P(hd, [["render", gd], ["__scopeId", "data-v-0ea9a95f
6185
6185
  ei(() => window.addEventListener("resize", l)), ir(() => window.removeEventListener("resize", l));
6186
6186
  const a = ge(() => `calc(100% - ${o.value}px + 1px)`);
6187
6187
  _e(() => {
6188
- i.menus.PreSelectTab();
6188
+ i.menus.Select();
6189
6189
  });
6190
6190
  const c = (d) => {
6191
- i.menus.select(d), n("select");
6191
+ i.menus.Select(d), n("select");
6192
6192
  };
6193
6193
  return (d, h) => (m(), b("div", {
6194
6194
  class: "mainblock",
@@ -6228,7 +6228,7 @@ const pd = /* @__PURE__ */ P(hd, [["render", gd], ["__scopeId", "data-v-0ea9a95f
6228
6228
  ], 4)
6229
6229
  ], 4));
6230
6230
  }
6231
- }), qd = /* @__PURE__ */ P(Hd, [["__scopeId", "data-v-a4a6dfa9"]]);
6231
+ }), qd = /* @__PURE__ */ P(Hd, [["__scopeId", "data-v-5fd9dc74"]]);
6232
6232
  class Wn {
6233
6233
  static Setup(e) {
6234
6234
  this.staticUrl = e;
@@ -10894,21 +10894,25 @@ class Xn {
10894
10894
  u(this, "idx", 0);
10895
10895
  u(this, "key", "");
10896
10896
  }
10897
- PreSelectTab() {
10897
+ preSelect() {
10898
10898
  const e = mt.GetStringQueryParam(this.key);
10899
10899
  if (!e || e === "undefined") {
10900
- this.select(0);
10900
+ this.Select(0);
10901
10901
  return;
10902
10902
  }
10903
10903
  const i = this.tabs.findIndex((n) => n.slug === e);
10904
- i > -1 && this.select(i);
10904
+ i > -1 && this.Select(i);
10905
10905
  }
10906
10906
  static Create(e, i) {
10907
10907
  const n = new Xn();
10908
- return n.key = e, n.tabs = i, n.tabs.length && n.PreSelectTab(), n;
10908
+ return n.key = e, n.tabs = i, n.tabs.length && n.preSelect(), n;
10909
10909
  }
10910
- select(e) {
10911
- this.idx = e, mt.SetQueryParam(this.key, this.GetSlug());
10910
+ Select(e) {
10911
+ if (this.tabs.length) {
10912
+ if (!e)
10913
+ return this.preSelect();
10914
+ this.idx = e, mt.SetQueryParam(this.key, this.GetSlug());
10915
+ }
10912
10916
  }
10913
10917
  GetMenu() {
10914
10918
  return this.tabs[this.idx];