@timus-networks/theme 2.4.18 → 2.4.24

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": "@timus-networks/theme",
3
3
  "configKey": "themeOptions",
4
- "version": "2.4.18",
4
+ "version": "2.4.24",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'node:path';
2
- import { defineNuxtModule, createResolver, useNuxt, addImportsDir, addPlugin } from 'nuxt/kit';
2
+ import { defineNuxtModule, createResolver, useNuxt, addImportsDir, addPlugin } from '@nuxt/kit';
3
3
 
4
4
 
5
5
 
@@ -11,7 +11,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
11
11
  const __dirname = __cjs_path__.dirname(__filename);
12
12
  const require = __cjs_mod__.createRequire(import.meta.url);
13
13
  const name = "@timus-networks/theme";
14
- const version = "2.4.18";
14
+ const version = "2.4.24";
15
15
  const description = "A comprehensive Nuxt.js module providing a tailored theme experience with integrated TailwindCSS support for applications.";
16
16
  const type = "module";
17
17
  const exports = {
@@ -36,7 +36,8 @@ const scripts = {
36
36
  fix: "npm run lint:prettier && npm run lint:eslint -- --fix && npm run lint:stylelint -- --fix",
37
37
  pub: "npm publish",
38
38
  sass: "node generate-sass.js",
39
- build: "nuxt-module-build build",
39
+ "clean-composables": "node remove-composable.js",
40
+ build: "nuxt-module-build build && npm run clean-composables",
40
41
  "release-old": "npm run build && changelogen --release && npm run pub && git push --follow-tags",
41
42
  version: "standard-version --release-as ${npm_config_type:-patch}",
42
43
  release: "npm run version && npm run build && npm run pub && git push --follow-tags origin main"
@@ -1,5 +1,5 @@
1
1
  export declare function useBreadcrumb(): {
2
- activeTab: import("vue").Ref<string, string>;
2
+ activeTab: import("vue").Ref<import("vue-router").LocationQueryValue | import("vue-router").LocationQueryValue[], import("vue-router").LocationQueryValue | import("vue-router").LocationQueryValue[] | import("vue-router").LocationQueryValue[]>;
3
3
  tabChanged: (tab: {
4
4
  paneName: string;
5
5
  }, _$event?: any) => void;
@@ -3,7 +3,7 @@ import { useRoute, useRouter } from "#app";
3
3
  export function useBreadcrumb() {
4
4
  const route = useRoute();
5
5
  const router = useRouter();
6
- const activeTab = ref("");
6
+ const activeTab = ref(route.query.tab);
7
7
  const breadcrumbTimeout = ref(null);
8
8
  const tabList = ref([]);
9
9
  onUnmounted(() => {
@@ -29,21 +29,22 @@ export function useBreadcrumb() {
29
29
  const found = tabList.value.find((item) => item === (tab || route.query.tab));
30
30
  activeTab.value = found || tabList.value[0];
31
31
  initial && tabChanged({ paneName: activeTab.value });
32
- }, 100);
32
+ }, 50);
33
33
  };
34
34
  const setupBreadcrumbs = (tabs) => {
35
+ console.log("CpMS");
35
36
  tabList.value = tabs;
36
- setActiveTab(tabs[0], true);
37
- watch(
38
- () => route.query,
39
- (current, before) => {
40
- if (before && current.tab && before.tab && current.tab !== before.tab) {
41
- setActiveTab(current.tab);
42
- }
43
- },
44
- { deep: true, immediate: true }
45
- );
37
+ !activeTab.value && setActiveTab(tabs[0], true);
46
38
  };
39
+ watch(
40
+ () => route.query,
41
+ (current, before) => {
42
+ if (before && current.tab && before.tab && current.tab !== before.tab) {
43
+ setActiveTab(current.tab);
44
+ }
45
+ },
46
+ { deep: true, immediate: true }
47
+ );
47
48
  return {
48
49
  activeTab,
49
50
  tabChanged,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timus-networks/theme",
3
- "version": "2.4.18",
3
+ "version": "2.4.24",
4
4
  "description": "A comprehensive Nuxt.js module providing a tailored theme experience with integrated TailwindCSS support for applications.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -25,7 +25,8 @@
25
25
  "fix": "npm run lint:prettier && npm run lint:eslint -- --fix && npm run lint:stylelint -- --fix",
26
26
  "pub": "npm publish",
27
27
  "sass": "node generate-sass.js",
28
- "build": "nuxt-module-build build",
28
+ "clean-composables": "node remove-composable.js",
29
+ "build": "nuxt-module-build build && npm run clean-composables",
29
30
  "release-old": "npm run build && changelogen --release && npm run pub && git push --follow-tags",
30
31
  "version": "standard-version --release-as ${npm_config_type:-patch}",
31
32
  "release": "npm run version && npm run build && npm run pub && git push --follow-tags origin main"
@@ -1,53 +0,0 @@
1
- import { onUnmounted, ref, watch } from "vue";
2
- import { useRoute, useRouter } from "#app";
3
- export function useBreadcrumb() {
4
- const route = useRoute();
5
- const router = useRouter();
6
- const activeTab = ref("");
7
- const breadcrumbTimeout = ref(null);
8
- const tabList = ref([]);
9
- onUnmounted(() => {
10
- if (breadcrumbTimeout.value) {
11
- clearTimeout(breadcrumbTimeout.value);
12
- }
13
- });
14
- const tabChanged = (tab, _$event = null) => {
15
- if (breadcrumbTimeout.value) {
16
- clearTimeout(breadcrumbTimeout.value);
17
- }
18
- router.push({
19
- path: route.path,
20
- query: {
21
- ...route.query,
22
- ...tab.paneName && { tab: tab.paneName },
23
- ...route.query.page && { page: route.query?.tab !== tab.paneName ? 1 : route.query.page }
24
- }
25
- });
26
- };
27
- const setActiveTab = (tab, initial = false) => {
28
- breadcrumbTimeout.value = setTimeout(() => {
29
- const found = tabList.value.find((item) => item === (tab || route.query.tab));
30
- activeTab.value = found || tabList.value[0];
31
- initial && tabChanged({ paneName: activeTab.value });
32
- }, 100);
33
- };
34
- const setupBreadcrumbs = (tabs) => {
35
- tabList.value = tabs;
36
- setActiveTab(tabs[0], true);
37
- watch(
38
- () => route.query,
39
- (current, before) => {
40
- if (before && current.tab && before.tab && current.tab !== before.tab) {
41
- setActiveTab(current.tab);
42
- }
43
- },
44
- { deep: true, immediate: true }
45
- );
46
- };
47
- return {
48
- activeTab,
49
- tabChanged,
50
- setActiveTab,
51
- setupBreadcrumbs
52
- };
53
- }