@finema/core 1.4.122 → 1.4.124

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.122",
3
+ "version": "1.4.124",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineNuxtModule, createResolver, installModule, addPlugin, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const name = "@finema/core";
4
- const version = "1.4.122";
4
+ const version = "1.4.124";
5
5
 
6
6
  const colors = {
7
7
  black: "#20243E",
@@ -2,12 +2,36 @@
2
2
  <NuxtLoadingIndicator :color="color" />
3
3
  <Dialog />
4
4
  <UNotifications />
5
+ <div v-if="isDevEnv" class="fixed bottom-4 right-4 z-50">
6
+ <div class="flex flex-col items-end justify-end">
7
+ <div
8
+ v-show="isShowDevTools"
9
+ class="max-w-screen mb-4 h-[800px] max-h-screen w-[600px] overflow-auto rounded-lg border opacity-80 shadow-2xl"
10
+ >
11
+ <p class="p-3 text-lg font-semibold">Debug Tools</p>
12
+ <hr />
13
+ <div id="dev-logs" class="flex flex-col space-y-3 p-3" />
14
+ </div>
15
+ <Button
16
+ :icon="isShowDevTools ? 'heroicons:x-mark' : 'heroicons:information-circle'"
17
+ color="info"
18
+ square
19
+ :ui="{ rounded: 'rounded-full' }"
20
+ @click="isShowDevTools = !isShowDevTools"
21
+ />
22
+ </div>
23
+ </div>
5
24
  </template>
6
25
  <script lang="ts" setup>
26
+ import { defineProps, ref } from 'vue'
27
+
7
28
  defineProps({
8
29
  color: {
9
30
  type: String,
10
31
  default: '#3675FB',
11
32
  },
12
33
  })
34
+
35
+ const isShowDevTools = ref(false)
36
+ const isDevEnv = process.env.NODE_ENV === 'development'
13
37
  </script>
@@ -119,7 +119,13 @@ const totalInnerRawData = computed((): number => {
119
119
  useWatchTrue(
120
120
  () => props.status.isSuccess,
121
121
  () => {
122
- innerRawData.value = [...(innerRawData.value || []), ...props.rawData]
122
+ if (props.isEnableInfiniteScroll) {
123
+ innerRawData.value = [...(innerRawData.value || []), ...props.rawData]
124
+
125
+ return
126
+ }
127
+
128
+ innerRawData.value = props.rawData
123
129
  }
124
130
  )
125
131
 
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <TeleportSafe v-if="isDevEnv" to="#dev-logs">
3
+ <VCodeBlock
4
+ v-if="data"
5
+ :code="JSON.stringify(data)"
6
+ max-height="500"
7
+ :browser-window="true"
8
+ :indent="2"
9
+ lang="json"
10
+ highlightjs
11
+ >
12
+ <template #label>
13
+ <span v-if="title" class="font-semibold">{{ title }}</span>
14
+ </template>
15
+ </VCodeBlock>
16
+
17
+ <VCodeBlock
18
+ v-for="(item, index) in dataItems"
19
+ :key="index"
20
+ :code="JSON.stringify(item)"
21
+ max-height="500"
22
+ :browser-window="true"
23
+ :indent="2"
24
+ lang="json"
25
+ highlightjs
26
+ >
27
+ <template #label>
28
+ <span v-if="title" class="font-semibold">{{ title }} #{{ index + 1 }} </span>
29
+ </template>
30
+ </VCodeBlock>
31
+ </TeleportSafe>
32
+ </template>
33
+ <script lang="ts" setup>
34
+ import { defineProps } from 'vue'
35
+ import { VCodeBlock } from '@wdns/vue-code-block'
36
+
37
+ defineProps<{
38
+ data?: any
39
+ dataItems?: any[]
40
+ title?: string
41
+ }>()
42
+
43
+ const isDevEnv = process.env.NODE_ENV === 'development'
44
+ </script>
45
+ <style>
46
+ .hljs-string{white-space:break-spaces}
47
+ </style>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <Teleport v-if="isShow" :to="target" :disabled="!target || disabled">
3
+ <slot />
4
+ </Teleport>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { onBeforeUnmount, onMounted, ref } from 'vue'
9
+
10
+ const props = defineProps<{ to: string; disabled?: boolean }>()
11
+
12
+ const target = ref<Element | null>(null)
13
+ const isShow = ref(false)
14
+
15
+ onBeforeUnmount(() => {
16
+ isShow.value = false
17
+ })
18
+
19
+ onMounted(() => {
20
+ isShow.value = true
21
+
22
+ const observer = new MutationObserver((mutationList, observer) => {
23
+ for (const mutation of mutationList) {
24
+ if (mutation.type !== 'childList') continue
25
+ const el = document.querySelector(props.to)
26
+ if (!el) continue
27
+ target.value = el
28
+ observer.disconnect()
29
+
30
+ break
31
+ }
32
+ })
33
+
34
+ observer.observe(document, { childList: true, subtree: true })
35
+
36
+ return () => {
37
+ observer.disconnect()
38
+ }
39
+ })
40
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.122",
3
+ "version": "1.4.124",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",
@@ -42,6 +42,7 @@
42
42
  "@vee-validate/zod": "^4.12.6",
43
43
  "@vuepic/vue-datepicker": "^8.2.0",
44
44
  "@vueup/vue-quill": "^1.2.0",
45
+ "@wdns/vue-code-block": "^2.3.2",
45
46
  "axios": "^1.6.8",
46
47
  "date-fns": "^3.3.1",
47
48
  "i18next": "^23.10.1",
@@ -49,6 +50,7 @@
49
50
  "nuxt-lodash": "^2.5.3",
50
51
  "nuxt-security": "^1.2.2",
51
52
  "pinia": "^2.1.7",
53
+ "prismjs": "^1.29.0",
52
54
  "qrcode.vue": "^3.4.1",
53
55
  "url-join": "^5.0.0",
54
56
  "zod": "^3.22.4",
@@ -63,6 +65,7 @@
63
65
  "@nuxt/test-utils": "^3.12.0",
64
66
  "@release-it/conventional-changelog": "^8.0.1",
65
67
  "@types/node": "^20.10.17",
68
+ "@types/prismjs": "^1",
66
69
  "@types/quill": "^2",
67
70
  "@vue/test-utils": "^2.4.3",
68
71
  "changelogen": "^0.5.5",