@fy-/fws-vue 2.1.6 → 2.1.8

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.
Files changed (40) hide show
  1. package/components/fws/CmsArticleBoxed.vue +23 -20
  2. package/components/fws/CmsArticleSingle.vue +74 -68
  3. package/components/fws/DataTable.vue +132 -125
  4. package/components/fws/FilterData.vue +99 -101
  5. package/components/fws/UserData.vue +33 -32
  6. package/components/fws/UserFlow.vue +163 -155
  7. package/components/fws/UserOAuth2.vue +73 -72
  8. package/components/fws/UserProfile.vue +98 -101
  9. package/components/fws/UserProfileStrict.vue +65 -64
  10. package/components/ssr/ClientOnly.ts +7 -7
  11. package/components/ui/DefaultBreadcrumb.vue +13 -13
  12. package/components/ui/DefaultConfirm.vue +35 -34
  13. package/components/ui/DefaultDateSelection.vue +19 -17
  14. package/components/ui/DefaultDropdown.vue +25 -25
  15. package/components/ui/DefaultDropdownLink.vue +15 -14
  16. package/components/ui/DefaultGallery.vue +179 -168
  17. package/components/ui/DefaultInput.vue +121 -126
  18. package/components/ui/DefaultLoader.vue +17 -17
  19. package/components/ui/DefaultModal.vue +35 -33
  20. package/components/ui/DefaultNotif.vue +50 -52
  21. package/components/ui/DefaultPaging.vue +92 -95
  22. package/components/ui/DefaultSidebar.vue +29 -25
  23. package/components/ui/DefaultTagInput.vue +121 -119
  24. package/components/ui/transitions/CollapseTransition.vue +1 -1
  25. package/components/ui/transitions/ExpandTransition.vue +1 -1
  26. package/components/ui/transitions/FadeTransition.vue +1 -1
  27. package/components/ui/transitions/ScaleTransition.vue +1 -1
  28. package/components/ui/transitions/SlideTransition.vue +3 -3
  29. package/composables/event-bus.ts +10 -8
  30. package/composables/rest.ts +59 -56
  31. package/composables/seo.ts +111 -95
  32. package/composables/ssr.ts +64 -62
  33. package/composables/templating.ts +57 -57
  34. package/composables/translations.ts +13 -13
  35. package/env.d.ts +6 -4
  36. package/index.ts +101 -98
  37. package/package.json +7 -7
  38. package/stores/serverRouter.ts +25 -25
  39. package/stores/user.ts +79 -72
  40. package/types.d.ts +65 -65
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { CalendarDaysIcon } from "@heroicons/vue/24/solid";
2
+ import { CalendarDaysIcon } from '@heroicons/vue/24/solid'
3
3
 
4
4
  defineProps({
5
5
  article: {
@@ -8,13 +8,13 @@ defineProps({
8
8
  },
9
9
  type: {
10
10
  type: String,
11
- default: "blog",
11
+ default: 'blog',
12
12
  },
13
13
  imageDomain: {
14
14
  type: String,
15
- default: "https://s.nocachenocry.com",
15
+ default: 'https://s.nocachenocry.com',
16
16
  },
17
- });
17
+ })
18
18
  </script>
19
19
 
20
20
  <template>
@@ -23,21 +23,22 @@ defineProps({
23
23
  itemtype="https://schema.org/Article"
24
24
  class="p-3 flex flex-col justify-between bg-white noise rounded-lg border border-fv-neutral-200 shadow-md dark:bg-fv-neutral-800 dark:border-fv-neutral-700"
25
25
  >
26
- <meta itemprop="wordCount" :content="article.WordCount" />
27
- <meta itemprop="datePublished" :content="article.CreatedAt.iso" />
28
- <meta itemprop="dateModified" :content="article.UpdatedAt.iso" />
29
- <meta itemprop="inLanguage" :content="article.Locale" />
30
- <meta itemprop="headline" :content="article.Title" />
26
+ <meta itemprop="wordCount" :content="article.WordCount">
27
+ <meta itemprop="datePublished" :content="article.CreatedAt.iso">
28
+ <meta itemprop="dateModified" :content="article.UpdatedAt.iso">
29
+ <meta itemprop="inLanguage" :content="article.Locale">
30
+ <meta itemprop="headline" :content="article.Title">
31
31
  <meta
32
- itemprop="thumbnailUrl"
33
32
  v-if="article.CoverUUID"
33
+ itemprop="thumbnailUrl"
34
34
  :content="`${imageDomain}/${article.CoverUUID}?vars=format=webp:resize=512x512`"
35
- />
35
+ >
36
36
  <RouterLink
37
37
  :to="`/${type}/${article.Slug}`"
38
38
  :title="article.Title"
39
39
  :alt="article.Title"
40
- ><img
40
+ >
41
+ <img
41
42
  v-if="article.CoverUUID"
42
43
  :src="`${imageDomain}/${article.CoverUUID}?vars=format=webp:scale_crop_center=400x195`"
43
44
  loading="lazy"
@@ -46,15 +47,17 @@ defineProps({
46
47
  class="w-full rounded-lg bg-fv-neutral-800 shadow mb-3 flex-grow-0 flex-shrink-0"
47
48
  width="400"
48
49
  height="250"
49
- /></RouterLink>
50
+ >
51
+ </RouterLink>
50
52
  <h2 class="title-1 font-semibold mb-2 flex-grow-0">
51
53
  <RouterLink
52
54
  :to="`/${type}/${article.Slug}`"
53
55
  :title="article.Title"
54
56
  :alt="article.Title"
55
57
  rel="bookmark"
56
- >{{ article.Title }}</RouterLink
57
58
  >
59
+ {{ article.Title }}
60
+ </RouterLink>
58
61
  </h2>
59
62
  <p
60
63
  class="mb-5 font-light text-fv-neutral-500 dark:text-fv-neutral-400 flex-grow"
@@ -76,14 +79,14 @@ defineProps({
76
79
  <meta
77
80
  itemprop="dateModified"
78
81
  :content="new Date(parseInt(article.UpdatedAt.unixms)).toISOString()"
79
- />
80
- <meta itemprop="inLanguage" :content="article.Language__" />
82
+ >
83
+ <meta itemprop="inLanguage" :content="article.Language__">
81
84
  <meta
82
85
  itemprop="dateModified"
83
86
  :content="new Date(parseInt(article.UpdatedAt.unixms)).toISOString()"
84
- />
87
+ >
85
88
  </div>
86
- <!--<span
89
+ <!-- <span
87
90
  ><img
88
91
  class="h-4 shadow"
89
92
  :src="langs[article.Locale]"
@@ -91,7 +94,7 @@ defineProps({
91
94
  height="16"
92
95
  loading="lazy"
93
96
  />
94
- </span>-->
97
+ </span> -->
95
98
  <RouterLink
96
99
  :to="`/${type}/${article.Slug}`"
97
100
  :title="article.Title"
@@ -109,7 +112,7 @@ defineProps({
109
112
  fill-rule="evenodd"
110
113
  d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z"
111
114
  clip-rule="evenodd"
112
- ></path>
115
+ />
113
116
  </svg>
114
117
  </RouterLink>
115
118
  </div>
@@ -1,27 +1,28 @@
1
1
  <script setup lang="ts">
2
- import { ref, watchEffect } from "vue";
3
- import { useRoute } from "vue-router";
4
- import type { Component } from "vue";
5
- import { useRest } from "../../composables/rest";
6
- import { LazyHead, useSeo } from "../../composables/seo";
7
- import type { BreadcrumbLink } from "../../types";
8
- import DefaultBreadcrumb from "../ui/DefaultBreadcrumb.vue";
9
- import { defineWebPage, useSchemaOrg } from "@unhead/schema-org";
2
+ import type { Component } from 'vue'
3
+ import type { LazyHead } from '../../composables/seo'
4
+ import type { BreadcrumbLink } from '../../types'
5
+ import { defineWebPage, useSchemaOrg } from '@unhead/schema-org'
6
+ import { ref, watchEffect } from 'vue'
7
+ import { useRoute } from 'vue-router'
8
+ import { useRest } from '../../composables/rest'
9
+ import { useSeo } from '../../composables/seo'
10
+ import DefaultBreadcrumb from '../ui/DefaultBreadcrumb.vue'
10
11
 
11
12
  const props = withDefaults(
12
13
  defineProps<{
13
- baseUrl: string;
14
- cmsAlias: string;
15
- notFound: Component;
16
- baseBreadcrumb?: BreadcrumbLink[];
17
- showImage?: boolean;
18
- showPreview?: boolean;
19
- showTitle?: boolean;
20
- postValue?: any;
21
- passData?: boolean;
22
- imageDomain?: string;
23
- multLanguage?: boolean;
24
- urlSlug?: string;
14
+ baseUrl: string
15
+ cmsAlias: string
16
+ notFound: Component
17
+ baseBreadcrumb?: BreadcrumbLink[]
18
+ showImage?: boolean
19
+ showPreview?: boolean
20
+ showTitle?: boolean
21
+ postValue?: any
22
+ passData?: boolean
23
+ imageDomain?: string
24
+ multLanguage?: boolean
25
+ urlSlug?: string
25
26
  }>(),
26
27
  {
27
28
  baseBreadcrumb: () => [],
@@ -30,66 +31,71 @@ const props = withDefaults(
30
31
  showTitle: true,
31
32
  postValue: () => undefined,
32
33
  passData: false,
33
- imageDomain: "https://s.nocachenocry.com",
34
+ imageDomain: 'https://s.nocachenocry.com',
34
35
  multLanguage: true,
35
- urlSlug: "blog",
36
+ urlSlug: 'blog',
36
37
  },
37
- );
38
+ )
38
39
 
39
- const rest = useRest();
40
- const post = ref<any>([]);
41
- const route = useRoute();
42
- const seo = ref<LazyHead>({});
43
- const is404 = ref(false);
44
- const getBlogPost = async () => {
45
- let data: any = undefined;
40
+ const rest = useRest()
41
+ const post = ref<any>([])
42
+ const route = useRoute()
43
+ const seo = ref<LazyHead>({})
44
+ const is404 = ref(false)
45
+ async function getBlogPost() {
46
+ let data: any
46
47
  if (!props.passData) {
47
- data = await rest(`Cms/${props.cmsAlias}/Post/${route.params.slug}`, "GET");
48
- } else {
49
- data = props.postValue;
48
+ data = await rest(`Cms/${props.cmsAlias}/Post/${route.params.slug}`, 'GET')
50
49
  }
51
- if (data && data.result == "success") {
52
- post.value = data.data;
53
- seo.value.title = post.value.Title;
54
- seo.value.description = post.value.Overview;
50
+ else {
51
+ data = props.postValue
52
+ }
53
+ if (data && data.result === 'success') {
54
+ post.value = data.data
55
+ seo.value.title = post.value.Title
56
+ seo.value.description = post.value.Overview
55
57
 
56
58
  if (post.value.CoverUUID) {
57
- seo.value.image = `${props.imageDomain}/${post.value.CoverUUID}?vars=format=png:resize=512x512`;
58
- seo.value.imageWidth = "512";
59
- seo.value.imageHeight = "512";
60
- seo.value.imageType = "image/png";
59
+ seo.value.image = `${props.imageDomain}/${post.value.CoverUUID}?vars=format=png:resize=512x512`
60
+ seo.value.imageWidth = '512'
61
+ seo.value.imageHeight = '512'
62
+ seo.value.imageType = 'image/png'
63
+ }
64
+ if (post.value.Locale !== '') {
65
+ seo.value.locale = post.value.Locale
61
66
  }
62
- if (post.value.Locale != "") {
63
- seo.value.locale = post.value.Locale;
64
- } else {
65
- seo.value.locale = "en-US";
67
+ else {
68
+ seo.value.locale = 'en-US'
66
69
  }
67
70
  if (props.multLanguage) {
68
- seo.value.url = `https://${props.baseUrl}/l/${seo.value.locale}/${props.urlSlug}/${post.value.Slug}`;
69
- } else {
70
- seo.value.url = `https://${props.baseUrl}/${props.urlSlug}/${post.value.Slug}`;
71
+ seo.value.url = `https://${props.baseUrl}/l/${seo.value.locale}/${props.urlSlug}/${post.value.Slug}`
72
+ }
73
+ else {
74
+ seo.value.url = `https://${props.baseUrl}/${props.urlSlug}/${post.value.Slug}`
71
75
  }
72
76
  if (post.value.Locales && post.value.Locales.length > 1) {
73
- seo.value.alternateLocales = post.value.Locales;
77
+ seo.value.alternateLocales = post.value.Locales
74
78
  }
75
- } else {
79
+ }
80
+ else {
76
81
  if (!props.passData) {
77
- is404.value = true;
82
+ is404.value = true
78
83
  }
79
84
  }
80
- };
81
- await getBlogPost();
85
+ }
86
+ await getBlogPost()
82
87
  watchEffect(() => {
83
- getBlogPost();
84
- });
85
- useSeo(seo);
88
+ getBlogPost()
89
+ })
90
+ useSeo(seo)
86
91
  useSchemaOrg([
87
92
  defineWebPage({
88
93
  datePublished: post.value.CreatedAt.iso,
89
94
  dateModified: post.value.UpdatedAt.iso,
90
95
  }),
91
- ]);
96
+ ])
92
97
  </script>
98
+
93
99
  <template>
94
100
  <div>
95
101
  <div v-if="!is404 && post">
@@ -102,25 +108,25 @@ useSchemaOrg([
102
108
  />
103
109
  </div>
104
110
  <article itemscope itemtype="https://schema.org/Article">
105
- <meta itemprop="wordCount" :content="post.WordCount" />
106
- <meta itemprop="datePublished" :content="post.CreatedAt.iso" />
107
- <meta itemprop="dateModified" :content="post.UpdatedAt.iso" />
108
- <meta itemprop="inLanguage" :content="post.Locale" />
109
- <meta itemprop="headline" :content="post.Title" />
111
+ <meta itemprop="wordCount" :content="post.WordCount">
112
+ <meta itemprop="datePublished" :content="post.CreatedAt.iso">
113
+ <meta itemprop="dateModified" :content="post.UpdatedAt.iso">
114
+ <meta itemprop="inLanguage" :content="post.Locale">
115
+ <meta itemprop="headline" :content="post.Title">
110
116
  <meta
111
- itemprop="thumbnailUrl"
112
117
  v-if="post.CoverUUID"
118
+ itemprop="thumbnailUrl"
113
119
  :content="`${props.imageDomain}/${post.CoverUUID}?vars=format=webp:resize=512x512`"
114
- />
115
- <div class="py-4 px-4 !max-w-full mx-auto w-full" v-if="showTitle">
120
+ >
121
+ <div v-if="showTitle" class="py-4 px-4 !max-w-full mx-auto w-full">
116
122
  <h1
117
123
  class="mb-4 text-4xl tracking-tight font-extrabold text-center text-fv-neutral-900 dark:text-white"
118
124
  >
119
125
  {{ post.Title }}
120
126
  </h1>
121
127
  <p
122
- class="font-light text-center text-fv-neutral-500 dark:text-fv-neutral-400 sm:text-xl"
123
128
  v-if="showPreview"
129
+ class="font-light text-center text-fv-neutral-500 dark:text-fv-neutral-400 sm:text-xl"
124
130
  >
125
131
  {{ post.Overview }}
126
132
  </p>
@@ -130,12 +136,12 @@ useSchemaOrg([
130
136
  :src="`${props.imageDomain}/${post.CoverUUID}?vars=format=webp:resize=768x768`"
131
137
  :alt="post.Title"
132
138
  class="h-auto rounded-xl shadow max-w-[768px] max-h-[280px] mx-auto mb-6"
133
- />
139
+ >
134
140
  <section
135
141
  itemprop="articleBody"
136
142
  class="prose dark:prose-invert !max-w-full mx-auto w-full mb-6"
137
143
  v-html="post.Body"
138
- ></section>
144
+ />
139
145
  </article>
140
146
  </div>
141
147
  <component :is="notFound" v-if="is404" />