@finema/core 1.4.88 → 1.4.89
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 +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/FlexDeck/Base.vue +14 -1
- package/dist/runtime/components/FlexDeck/index.vue +8 -1
- package/dist/runtime/components/Table/Base.vue +1 -1
- package/dist/runtime/components/Table/Simple.vue +5 -0
- package/dist/runtime/components/Table/index.vue +5 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<slot v-if="status.isLoading" name="loading-state">
|
|
3
|
+
<div class="flex h-60 items-center justify-center">
|
|
4
|
+
<Icon name="i-svg-spinners:180-ring-with-bg" class="text-primary size-8" />
|
|
5
|
+
</div>
|
|
6
|
+
</slot>
|
|
7
|
+
<slot v-if="!status.isLoading && rawData.length === 0" name="empty-state">
|
|
8
|
+
<div class="min-h-60">
|
|
9
|
+
<p class="text-center text-sm italic">ไม่พบข้อมูล!</p>
|
|
10
|
+
</div>
|
|
11
|
+
</slot>
|
|
12
|
+
<div v-if="status.isSuccess" :class="containerClass">
|
|
13
|
+
<slot v-for="(row, index) in rawData" :key="index" :row="row" />
|
|
14
|
+
</div>
|
|
3
15
|
<div v-if="pageOptions" class="mt-4 flex justify-between px-3">
|
|
4
16
|
<p class="text-xs text-gray-500">
|
|
5
17
|
ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
|
|
@@ -48,6 +60,7 @@ const props = defineProps({
|
|
|
48
60
|
type: Boolean as PropType<IFlexDeckOptions['isHideBottomPagination']>,
|
|
49
61
|
default: false,
|
|
50
62
|
},
|
|
63
|
+
containerClass: { type: [String, Array, Object] },
|
|
51
64
|
})
|
|
52
65
|
|
|
53
66
|
const page = ref(props.pageOptions?.currentPage || 1)
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
/>
|
|
9
9
|
</div>
|
|
10
10
|
<Base
|
|
11
|
-
v-bind="$attrs"
|
|
12
11
|
:raw-data="options.rawData"
|
|
13
12
|
:status="options.status"
|
|
14
13
|
:page-options="options.pageOptions"
|
|
15
14
|
:is-simple-pagination="isShowSimplePagination"
|
|
16
15
|
:is-hide-bottom-pagination="options.isHideBottomPagination"
|
|
16
|
+
:container-class="containerClass"
|
|
17
17
|
@page-change="onPageChange"
|
|
18
18
|
>
|
|
19
19
|
<template v-for="(_, slot) of $slots" #[slot]="slotProps">
|
|
@@ -29,6 +29,12 @@ import { useCoreConfig } from '#core/composables/useConfig'
|
|
|
29
29
|
import Base from '#core/components/FlexDeck/Base.vue'
|
|
30
30
|
import type { IFlexDeckOptions } from '#core/components/FlexDeck/types'
|
|
31
31
|
|
|
32
|
+
defineSlots<{
|
|
33
|
+
default: (props: { row: any }) => any
|
|
34
|
+
'empty-state': () => any
|
|
35
|
+
'loading-state': () => any
|
|
36
|
+
}>()
|
|
37
|
+
|
|
32
38
|
const emits = defineEmits<{
|
|
33
39
|
(event: 'pageChange', page: number): void
|
|
34
40
|
(event: 'search', q: string): void
|
|
@@ -36,6 +42,7 @@ const emits = defineEmits<{
|
|
|
36
42
|
|
|
37
43
|
const props = defineProps({
|
|
38
44
|
options: { type: Object as PropType<IFlexDeckOptions>, required: true },
|
|
45
|
+
containerClass: { type: [String, Array, Object], default: '' },
|
|
39
46
|
})
|
|
40
47
|
|
|
41
48
|
const coreConfig = useCoreConfig()
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<UTable :loading="status.isLoading" :columns="columns" :rows="rawData" v-bind="$attrs">
|
|
3
3
|
<template #loading-state>
|
|
4
4
|
<div class="flex h-60 items-center justify-center">
|
|
5
|
-
<Icon name="i-svg-spinners:180-ring-with-bg" class="text-primary
|
|
5
|
+
<Icon name="i-svg-spinners:180-ring-with-bg" class="text-primary size-8" />
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
<template #empty-state>
|
|
@@ -21,6 +21,11 @@ import Base from '#core/components/Table/Base.vue'
|
|
|
21
21
|
import { initPageOptions } from '#core/composables/loaderPage'
|
|
22
22
|
import { useCoreConfig } from '#core/composables/useConfig'
|
|
23
23
|
|
|
24
|
+
defineSlots<{
|
|
25
|
+
'empty-state': () => any
|
|
26
|
+
'loading-state': () => any
|
|
27
|
+
}>()
|
|
28
|
+
|
|
24
29
|
const props = defineProps({
|
|
25
30
|
options: { type: Object as PropType<ISimpleTableOptions>, required: true },
|
|
26
31
|
})
|
|
@@ -30,6 +30,11 @@ import { _debounce, computed, ref, watch } from '#imports'
|
|
|
30
30
|
import { useCoreConfig } from '#core/composables/useConfig'
|
|
31
31
|
import Base from '#core/components/Table/Base.vue'
|
|
32
32
|
|
|
33
|
+
defineSlots<{
|
|
34
|
+
'empty-state': () => any
|
|
35
|
+
'loading-state': () => any
|
|
36
|
+
}>()
|
|
37
|
+
|
|
33
38
|
const emits = defineEmits<{
|
|
34
39
|
(event: 'pageChange', page: number): void
|
|
35
40
|
(event: 'search', q: string): void
|