sprof 0.8.17 → 0.8.19

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.
@@ -12,7 +12,7 @@ export interface UseThemeOptions {
12
12
  platform?: string;
13
13
  /** Ключ в localStorage; меняйте, если на одном домене несколько приложений */
14
14
  storageKey?: string;
15
- /** Тема, если выбор ещё не сделан и системная не определилась */
15
+ /** Тема, если выбор ещё не сделан (по умолчанию — светлая) */
16
16
  defaultTheme?: ThemeName;
17
17
  }
18
18
  export interface UseThemeReturn {
@@ -39,6 +39,10 @@ export declare function _setThemeLockForTests(locked: boolean): void;
39
39
  * `data-brandbook`/`data-platform`: без них переменных не существует вовсе
40
40
  * (история проекта — цвета руками именно из-за этого).
41
41
  *
42
+ * ⚠️ СТАНДАРТ — СВЕТЛАЯ тема (24.09). Системное `prefers-color-scheme` НЕ
43
+ * читаем: у пользователя с тёмной ОС был бы тёмный интерфейс по умолчанию.
44
+ * Тёмную включает сам пользователь, выбор запоминается в localStorage.
45
+ *
42
46
  * ⚠️ Экземпляр СОЗДАЁТСЯ в setup клиента (один на приложение): несколько
43
47
  * вызовов дадут несколько независимых `ref` и рассинхрон при переключении.
44
48
  * Держите его в сторе/провайдере корневого компонента.
package/dist/sprof.js CHANGED
@@ -4590,23 +4590,23 @@ Xe.getAdapter = Fl.getAdapter;
4590
4590
  Xe.HttpStatusCode = jo;
4591
4591
  Xe.default = Xe;
4592
4592
  const {
4593
- Axios: LS,
4594
- AxiosError: qS,
4595
- CanceledError: BS,
4596
- isCancel: HS,
4597
- CancelToken: VS,
4598
- VERSION: US,
4599
- all: NS,
4600
- Cancel: _S,
4601
- isAxiosError: jS,
4602
- spread: WS,
4603
- toFormData: GS,
4604
- AxiosHeaders: YS,
4605
- HttpStatusCode: XS,
4606
- formToJSON: QS,
4607
- getAdapter: ZS,
4608
- mergeConfig: JS,
4609
- create: KS
4593
+ Axios: zS,
4594
+ AxiosError: LS,
4595
+ CanceledError: qS,
4596
+ isCancel: BS,
4597
+ CancelToken: HS,
4598
+ VERSION: VS,
4599
+ all: US,
4600
+ Cancel: NS,
4601
+ isAxiosError: _S,
4602
+ spread: jS,
4603
+ toFormData: WS,
4604
+ AxiosHeaders: GS,
4605
+ HttpStatusCode: YS,
4606
+ formToJSON: XS,
4607
+ getAdapter: QS,
4608
+ mergeConfig: ZS,
4609
+ create: JS
4610
4610
  } = Xe;
4611
4611
  var Ai = /* @__PURE__ */ ((t) => (t.GET = "get", t.POST = "post", t.PUT = "put", t.DELETE = "delete", t))(Ai || {});
4612
4612
  const Ui = /* @__PURE__ */ (() => {
@@ -11832,7 +11832,7 @@ const u0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11832
11832
  PTabsLeft: Vu,
11833
11833
  TabsStore: zr,
11834
11834
  default: Uu
11835
- }, Symbol.toStringTag, { value: "Module" })), M8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11835
+ }, Symbol.toStringTag, { value: "Module" })), P8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11836
11836
  __proto__: null,
11837
11837
  Contacts: _p,
11838
11838
  Forms: gg,
@@ -18444,11 +18444,11 @@ const CS = {
18444
18444
  X0(t), g2(t), pw(t), SS(t), Bb(t);
18445
18445
  }
18446
18446
  };
18447
- function R8(t, e = {}) {
18447
+ function M8(t, e = {}) {
18448
18448
  const { quasarPlugins: n = !0 } = e;
18449
18449
  n && t.use(Jd, { plugins: { Notify: zo, Dialog: Lo } }), CS.install(t), Uu(t), ou(t), Bu(t);
18450
18450
  }
18451
- class I8 extends Ls {
18451
+ class R8 extends Ls {
18452
18452
  constructor() {
18453
18453
  super(...arguments);
18454
18454
  u(this, "label", "Логин");
@@ -18458,7 +18458,7 @@ class I8 extends Ls {
18458
18458
  u(this, "id", "field-auth-login");
18459
18459
  }
18460
18460
  }
18461
- function E8(t, e = {}) {
18461
+ function I8(t, e = {}) {
18462
18462
  const n = e.ftsp ?? cn.Get(), i = A(!1), s = U(() => t.Items), o = U(() => t.Count.value), r = U(() => t.Item), l = U({
18463
18463
  get: () => t.searchStr.value,
18464
18464
  set: (P) => {
@@ -18476,7 +18476,7 @@ function E8(t, e = {}) {
18476
18476
  n.reset(), t.ResetState();
18477
18477
  } };
18478
18478
  }
18479
- function A8(t = cn.Get()) {
18479
+ function E8(t = cn.Get()) {
18480
18480
  const e = wt(t), n = U(() => e.f), i = U(() => e.f.length);
18481
18481
  return { filters: n, count: i, add: (f) => {
18482
18482
  e.setF(f);
@@ -18490,7 +18490,7 @@ function A8(t = cn.Get()) {
18490
18490
  e.resetF();
18491
18491
  } };
18492
18492
  }
18493
- function O8(t = cn.Get()) {
18493
+ function A8(t = cn.Get()) {
18494
18494
  const e = wt(t), n = U({
18495
18495
  get: () => e.p.getPageNum(),
18496
18496
  set: (P) => {
@@ -18524,44 +18524,43 @@ function O8(t = cn.Get()) {
18524
18524
  e.p.setAllLoaded(P);
18525
18525
  }, pagination: o };
18526
18526
  }
18527
- const xS = "(prefers-color-scheme: dark)";
18528
18527
  let Li = !1;
18529
- function D8() {
18528
+ function O8() {
18530
18529
  var t;
18531
18530
  Li = !0, typeof document < "u" && (localStorage == null || localStorage.removeItem("pf-theme"), document.documentElement.setAttribute("data-theme", "light"), (t = document.body) == null || t.classList.remove("body--dark"));
18532
18531
  }
18533
- function F8() {
18532
+ function D8() {
18534
18533
  return Li;
18535
18534
  }
18536
- function z8(t = {}) {
18537
- const { brandbook: e, platform: n, storageKey: i = "pf-theme", defaultTheme: s } = t, o = document.documentElement, r = typeof localStorage < "u" ? localStorage.getItem(i) : null, l = typeof window < "u" && window.matchMedia(xS).matches, c = A(Li ? "light" : r === "dark" || r === "light" ? r : s ?? (l ? "dark" : "light"));
18538
- e && o.setAttribute("data-brandbook", e), n && o.setAttribute("data-platform", n), o.setAttribute("data-theme", c.value), He(
18539
- c,
18540
- (m) => {
18541
- const g = Li ? "light" : m;
18542
- o.setAttribute("data-theme", g), document.body.classList.toggle("body--dark", g === "dark"), typeof localStorage < "u" && (Li ? localStorage.removeItem(i) : localStorage.setItem(i, g));
18535
+ function F8(t = {}) {
18536
+ const { brandbook: e, platform: n, storageKey: i = "pf-theme", defaultTheme: s } = t, o = document.documentElement, r = typeof localStorage < "u" ? localStorage.getItem(i) : null, a = A(Li ? "light" : r === "dark" || r === "light" ? r : s ?? "light");
18537
+ e && o.setAttribute("data-brandbook", e), n && o.setAttribute("data-platform", n), o.setAttribute("data-theme", a.value), He(
18538
+ a,
18539
+ (f) => {
18540
+ const m = Li ? "light" : f;
18541
+ o.setAttribute("data-theme", m), document.body.classList.toggle("body--dark", m === "dark"), typeof localStorage < "u" && (Li ? localStorage.removeItem(i) : localStorage.setItem(i, m));
18543
18542
  },
18544
18543
  { immediate: !0 }
18545
18544
  );
18546
- const f = A(c.value === "dark");
18547
- return He(c, (m) => {
18548
- f.value = m === "dark";
18545
+ const c = A(a.value === "dark");
18546
+ return He(a, (f) => {
18547
+ c.value = f === "dark";
18549
18548
  }), {
18550
- theme: c,
18551
- isDark: f,
18552
- set: (m) => {
18553
- c.value = m;
18549
+ theme: a,
18550
+ isDark: c,
18551
+ set: (f) => {
18552
+ a.value = f;
18554
18553
  },
18555
18554
  toggle: () => {
18556
- c.value = c.value === "dark" ? "light" : "dark";
18555
+ a.value = a.value === "dark" ? "light" : "dark";
18557
18556
  }
18558
18557
  };
18559
18558
  }
18560
- function L8(t = "pf-theme") {
18559
+ function z8(t = "pf-theme") {
18561
18560
  const e = typeof localStorage < "u" ? localStorage.getItem(t) : null;
18562
18561
  return e === "dark" || e === "light" ? e : void 0;
18563
18562
  }
18564
- const q8 = {
18563
+ const L8 = {
18565
18564
  primary: "#476db5",
18566
18565
  secondary: "#8aa5d4",
18567
18566
  accent: "#66c0e4",
@@ -18571,7 +18570,7 @@ const q8 = {
18571
18570
  warning: "#d97a2b",
18572
18571
  dark: "#1e293b",
18573
18572
  "dark-page": "#0f172a"
18574
- }, B8 = {
18573
+ }, q8 = {
18575
18574
  primary: "#5e6ce7",
18576
18575
  secondary: "#4a6088",
18577
18576
  accent: "#ffc353",
@@ -18581,7 +18580,7 @@ const q8 = {
18581
18580
  warning: "#f59433",
18582
18581
  dark: "#1e1e1e",
18583
18582
  "dark-page": "#121212"
18584
- }, kS = 5 * 60 * 1e3, $S = 5 * 1e3;
18583
+ }, xS = 5 * 60 * 1e3, kS = 5 * 1e3;
18585
18584
  let Xa = !1, Oo = 0, Es = !1, Do = !1;
18586
18585
  function ws(t, e, n = "", i = !1) {
18587
18586
  const s = t.UserInfo(), o = {
@@ -18618,11 +18617,11 @@ function ws(t, e, n = "", i = !1) {
18618
18617
  function Fo(t, e, n = !1) {
18619
18618
  Es || (Es = !0, ws(t, "logout", e, n));
18620
18619
  }
18621
- function H8(t) {
18620
+ function B8(t) {
18622
18621
  if (Xa) return;
18623
18622
  Xa = !0, t.on("login", () => {
18624
18623
  const n = Date.now();
18625
- n - Oo < $S || (Oo = n, Es = !1, Do = !1, ws(t, "login"));
18624
+ n - Oo < kS || (Oo = n, Es = !1, Do = !1, ws(t, "login"));
18626
18625
  }), t.on("logout", () => {
18627
18626
  Do = !0, Fo(t, "user");
18628
18627
  }), t.on("session-expired", () => Fo(t, "token-expired")), t.isAuth() && (Oo = Date.now(), Es = !1, ws(t, "login"));
@@ -18631,9 +18630,9 @@ function H8(t) {
18631
18630
  };
18632
18631
  window.addEventListener("pagehide", e), window.addEventListener("beforeunload", e), window.setInterval(() => {
18633
18632
  t.isAuth() && ws(t, "heartbeat");
18634
- }, kS);
18633
+ }, xS);
18635
18634
  }
18636
- const V8 = ["PF", "PFM"];
18635
+ const H8 = ["PF", "PFM"];
18637
18636
  export {
18638
18637
  fa as AuthButtonLogin,
18639
18638
  sc as AuthButtonRefresh,
@@ -18644,7 +18643,7 @@ export {
18644
18643
  cc as AuthFormSettings,
18645
18644
  ji as AuthMethods,
18646
18645
  bo as EmailField,
18647
- I8 as LoginField,
18646
+ R8 as LoginField,
18648
18647
  Uw as PAddDialog,
18649
18648
  Gs as PBadge,
18650
18649
  xe as PButton,
@@ -18666,7 +18665,7 @@ export {
18666
18665
  xi as PDialog,
18667
18666
  ts as PEditDialog,
18668
18667
  Y as PF,
18669
- M8 as PFM,
18668
+ P8 as PFM,
18670
18669
  Nu as PHint,
18671
18670
  Dt as PInput,
18672
18671
  Fr as POptionsListSingle,
@@ -18696,16 +18695,16 @@ export {
18696
18695
  S1 as ScheduleTimeline,
18697
18696
  zr as TabsStore,
18698
18697
  Cn as defaultContactsLabels,
18699
- L8 as getStoredTheme,
18700
- H8 as initAuthLog,
18701
- R8 as installSprof,
18702
- F8 as isThemeLockedLight,
18703
- D8 as lockLightTheme,
18704
- V8 as pfName,
18705
- B8 as quasarBrandExample,
18706
- q8 as quasarBrandRdkb,
18707
- E8 as useCrud,
18708
- A8 as useFilters,
18709
- O8 as usePagination,
18710
- z8 as useTheme
18698
+ z8 as getStoredTheme,
18699
+ B8 as initAuthLog,
18700
+ M8 as installSprof,
18701
+ D8 as isThemeLockedLight,
18702
+ O8 as lockLightTheme,
18703
+ H8 as pfName,
18704
+ q8 as quasarBrandExample,
18705
+ L8 as quasarBrandRdkb,
18706
+ I8 as useCrud,
18707
+ E8 as useFilters,
18708
+ A8 as usePagination,
18709
+ F8 as useTheme
18711
18710
  };