@anweb/nuxt-ancore 1.16.12 → 1.16.14

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "AnCore",
3
3
  "configKey": "ancore",
4
- "version": "1.16.12",
4
+ "version": "1.16.14",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -20,6 +20,9 @@ const active = ref(false);
20
20
  const target = ref(null);
21
21
  let raf = 0;
22
22
  let mouseDownOnBackdrop = false;
23
+ const onMouseDown = (e) => {
24
+ mouseDownOnBackdrop = e.target === e.currentTarget;
25
+ };
23
26
  const onSwipeStart = () => {
24
27
  active.value = canSwipe.value;
25
28
  };
@@ -68,7 +71,9 @@ onMounted(() => {
68
71
  aria-modal="true"
69
72
  class="an-dialog -flex -flex__column"
70
73
  :class="[{ '-fullscreen': config.fullscreen }, config.class]"
71
- @click.self="!config.fullscreen && Dialogs.close(props.dialog)"
74
+ @mousedown="onMouseDown"
75
+ @click.self="mouseDownOnBackdrop && !config.fullscreen && Dialogs.close(props.dialog);
76
+ mouseDownOnBackdrop = false"
72
77
  >
73
78
  <component
74
79
  ref="refDialog"
@@ -1,9 +1,9 @@
1
1
  export declare const useAnI18n: (resources?: Record<string, Record<string, string>>) => {
2
2
  t: (key: string, options?: {}) => string;
3
- readonly lang: string;
3
+ lang: import("vue").ComputedRef<string>;
4
4
  set: (value: string) => void;
5
5
  } | {
6
6
  t: import("i18next").TFunction<["translation", ...string[]], undefined>;
7
- readonly lang: string;
7
+ lang: import("vue").ComputedRef<string>;
8
8
  set: (value: string) => void;
9
9
  };
@@ -1,5 +1,5 @@
1
1
  import i18next from "i18next";
2
- import { ref } from "vue";
2
+ import { ref, computed } from "vue";
3
3
  import { useRuntimeConfig, useCookie } from "#app";
4
4
  const nsMap = /* @__PURE__ */ new WeakMap();
5
5
  let nsId = 0;
@@ -23,6 +23,7 @@ export const useAnI18n = (resources) => {
23
23
  console.error("[AnI18n] Failed to set language:", e);
24
24
  }
25
25
  };
26
+ const langReadonly = computed(() => lang.value);
26
27
  if (resources) {
27
28
  let ns = nsMap.get(resources);
28
29
  if (!ns) {
@@ -39,17 +40,13 @@ export const useAnI18n = (resources) => {
39
40
  const nsRef = ns;
40
41
  return {
41
42
  t: (key, options = {}) => i18next.t(key, { ns: [nsRef, "translation"], ...options }),
42
- get lang() {
43
- return lang.value;
44
- },
43
+ lang: langReadonly,
45
44
  set
46
45
  };
47
46
  }
48
47
  return {
49
48
  t: i18next.t,
50
- get lang() {
51
- return lang.value;
52
- },
49
+ lang: langReadonly,
53
50
  set
54
51
  };
55
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anweb/nuxt-ancore",
3
- "version": "1.16.12",
3
+ "version": "1.16.14",
4
4
  "description": "AnCore Nuxt module",
5
5
  "repository": "https://github.com/ANLTD/ancore",
6
6
  "license": "MIT",