cec-nuxt-lib 0.0.3 → 0.0.5

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,5 +1,5 @@
1
1
  {
2
2
  "name": "cec-vue-lib",
3
3
  "configKey": "cec-vue-lib",
4
- "version": "0.0.3"
4
+ "version": "0.0.5"
5
5
  }
@@ -1,19 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { useRoute } from 'vue-router';
3
2
  import { useState } from '#app';
4
3
  const path = useState('path');
5
- const route = useRoute();
6
- let length = path.value.split('/').length - 1;
7
- const truePath = route.path === '/' ? path.value : path.value + route.path;
8
- let routes = route.path.split('/');
9
-
10
- const makeLink = (i) => {
11
- let diff = i - length;
12
- if (!diff) {
13
- return '/';
14
- }
15
- return routes.slice(0, diff + 1).join('/');
16
- };
17
4
 
18
5
  const toTitleCase = (str) => {
19
6
  return str
@@ -22,17 +9,8 @@ const toTitleCase = (str) => {
22
9
  .join(' ');
23
10
  };
24
11
 
25
- let hrefs = truePath.split('/');
26
- const links = hrefs.map((e, i) =>
27
- !e
28
- ? 'Home'
29
- : truePath.includes('/parties/') && i === hrefs.length - 1
30
- ? toTitleCase(e)
31
- : `${e[0].toUpperCase()}${e
32
- .slice(1)
33
- .replace(/[-_]/g, ' ')
34
- .replace(/\shmo\s/, ' HMO ')}`
35
- );
12
+ let hrefs = path.value === '/' ? [''] : path.value.split('/');
13
+ const links = hrefs.map((e, i) => (!e ? 'Home' : toTitleCase(e)));
36
14
  </script>
37
15
  <template>
38
16
  <div class="cec-breadcrumb-bg">
@@ -43,10 +21,6 @@ const links = hrefs.map((e, i) =>
43
21
  <ol class="breadcrumb cec-breadcrumb my-0 py-2">
44
22
  <li class="breadcrumb-item" v-for="(l, i) in links" :key="i">
45
23
  <span v-if="i === links.length - 1">{{ l }}</span>
46
- <NuxtLink v-else-if="i >= length" :to="makeLink(i)">
47
- {{ l }}</NuxtLink
48
- >
49
- <a v-else-if="!i" href="/home-page">{{ l }}</a>
50
24
  <a v-else :href="'/' + hrefs.slice(1, i + 1).join('/')">
51
25
  {{ l }}</a
52
26
  >
@@ -139,7 +139,7 @@ onMounted(() => {
139
139
  <a
140
140
  class="navbar-brand border border-0 border-secondary"
141
141
  title="Home"
142
- href="/home.aspx"
142
+ href="/"
143
143
  >
144
144
  <img
145
145
  title="Home page"
@@ -0,0 +1,13 @@
1
+ <script setup>
2
+ import { useState } from '#app';
3
+ const siblings = useState('siblings');
4
+ </script>
5
+
6
+ <template>
7
+ <h2>In this section</h2>
8
+ <ul>
9
+ <li v-for="item in siblings">
10
+ <a :href="item.path">{{ item.displayName }}</a>
11
+ </li>
12
+ </ul>
13
+ </template>
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.3",
2
+ "version": "0.0.5",
3
3
  "name": "cec-nuxt-lib",
4
4
  "description": "Nuxt components and assets",
5
5
  "license": "MIT",