cec-nuxt-lib 0.10.3 → 0.10.4

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.d.mts CHANGED
@@ -4,4 +4,5 @@ interface ModuleOptions {
4
4
  }
5
5
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
6
 
7
- export { type ModuleOptions, _default as default };
7
+ export { _default as default };
8
+ export type { ModuleOptions };
package/dist/module.json CHANGED
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "name": "cec-nuxt-lib",
3
3
  "configKey": "cec-nuxt-lib",
4
- "version": "0.10.3"
4
+ "version": "0.10.4",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.1",
7
+ "unbuild": "3.5.0"
8
+ }
5
9
  }
@@ -1,70 +1,47 @@
1
- <script setup lang="ts">
2
- import { useState, useRuntimeConfig } from '#app';
3
- import { useRoute } from 'vue-router';
1
+ <script setup>
2
+ import { useState, useRuntimeConfig } from "#app";
3
+ import { useRoute } from "vue-router";
4
4
  const config = useRuntimeConfig();
5
5
  const baseUrl = config.app.baseURL;
6
- const page = useState('page');
6
+ const page = useState("page");
7
7
  const route = useRoute();
8
-
9
8
  const trimPath = (str) => {
10
- if (str === '/' || !str) {
9
+ if (str === "/" || !str) {
11
10
  return str;
12
11
  }
13
- return str.replace(/\/$/, '');
12
+ return str.replace(/\/$/, "");
14
13
  };
15
-
16
- const makeLink = (i, routes, length) => {
17
- if (baseUrl !== '/') {
18
- return i ? routes.slice(0, i + 1).join('/') : '/';
14
+ const makeLink = (i, routes2, length2) => {
15
+ if (baseUrl !== "/") {
16
+ return i ? routes2.slice(0, i + 1).join("/") : "/";
19
17
  } else {
20
- return routes.slice(0, i + length).join('/');
18
+ return routes2.slice(0, i + length2).join("/");
21
19
  }
22
20
  };
23
-
24
21
  const toTitleCase = (str) => {
25
- return str
26
- .split(/\s/)
27
- .map((e) => toSentenceCase(e))
28
- .join(' ');
22
+ return str.split(/\s/).map((e) => toSentenceCase(e)).join(" ");
29
23
  };
30
-
31
24
  const toSentenceCase = (str, notLast) => {
32
- return !str.length
33
- ? ''
34
- : notLast
35
- ? `${str[0].toUpperCase()}${str.slice(1).replace(/[-_]/g, ' ')}`
36
- : `${str[0].toUpperCase()}${str.slice(1).replace(/_/g, ' ')}`;
25
+ return !str.length ? "" : notLast ? `${str[0].toUpperCase()}${str.slice(1).replace(/[-_]/g, " ")}` : `${str[0].toUpperCase()}${str.slice(1).replace(/_/g, " ")}`;
37
26
  };
38
-
39
- // Make arrays of the items in the paths
40
27
  let routeTrim = trimPath(route.path);
41
- let routes = routeTrim.split('/');
42
- let classic = trimPath(page.value.classicPath).split('/');
28
+ let routes = routeTrim.split("/");
29
+ let classic = trimPath(page.value.classicPath).split("/");
43
30
  const length = classic.length;
44
-
45
- // Build an array of hrefs
46
- let hrefs =
47
- baseUrl !== '/'
48
- ? `${page.value.classicPath}${routeTrim === '/' ? '' : routeTrim}`.split(
49
- '/'
50
- )
51
- : routes.reduce((acc, e, i) => {
52
- if (classic[i]) {
53
- return [...acc, classic[i]];
54
- } else {
55
- return [...acc, e];
56
- }
57
- }, []);
58
-
59
- // Sentence case for the breadcrumb display
60
- const links = hrefs.map((e, i) =>
61
- !i
62
- ? 'Home'
63
- : routeTrim.includes('digital-contact-card')
64
- ? toSentenceCase(e, hrefs.length - 1 - i)
65
- : toSentenceCase(e, 1)
31
+ let hrefs = baseUrl !== "/" ? `${page.value.classicPath}${routeTrim === "/" ? "" : routeTrim}`.split(
32
+ "/"
33
+ ) : routes.reduce((acc, e, i) => {
34
+ if (classic[i]) {
35
+ return [...acc, classic[i]];
36
+ } else {
37
+ return [...acc, e];
38
+ }
39
+ }, []);
40
+ const links = hrefs.map(
41
+ (e, i) => !i ? "Home" : routeTrim.includes("digital-contact-card") ? toSentenceCase(e, hrefs.length - 1 - i) : toSentenceCase(e, 1)
66
42
  );
67
43
  </script>
44
+
68
45
  <template>
69
46
  <div class="cec-breadcrumb-bg">
70
47
  <div class="container">
@@ -75,7 +52,7 @@ const links = hrefs.map((e, i) =>
75
52
  <li class="breadcrumb-item" v-for="(l, i) in links" :key="i">
76
53
  <!-- Node we are on -->
77
54
  <span v-if="i === links.length - 1">{{
78
- links.includes('Parties') ? toTitleCase(l) : l
55
+ links.includes("Parties") ? toTitleCase(l) : l
79
56
  }}</span>
80
57
  <!-- Nuxt links -->
81
58
  <template v-else-if="i + 1 >= length">
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;