@finema/core 2.52.1 → 2.52.3
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/Table/Base.vue +33 -38
- package/dist/runtime/components/Table/Base.vue.d.ts +1 -1
- package/dist/runtime/components/Table/Simple.vue.d.ts +3 -3
- package/dist/runtime/components/Table/index.vue +8 -11
- package/dist/runtime/components/Table/index.vue.d.ts +4 -4
- package/dist/runtime/theme/table.d.ts +1 -0
- package/dist/runtime/theme/table.js +2 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
:class="
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
:class="
|
|
4
|
+
theme.rootWrapper({
|
|
5
|
+
class: [ui?.rootWrapper]
|
|
6
|
+
})
|
|
7
|
+
"
|
|
6
8
|
>
|
|
7
9
|
<Pagination
|
|
8
10
|
v-if="!options.isHidePagination && !options.isHidePaginationTop"
|
|
@@ -20,38 +22,24 @@
|
|
|
20
22
|
:columns="uTableCompatibleColumns"
|
|
21
23
|
:data="options.rawData"
|
|
22
24
|
v-bind="$attrs"
|
|
25
|
+
:ui="ui"
|
|
23
26
|
>
|
|
24
|
-
<template #loading
|
|
25
|
-
<Loader
|
|
26
|
-
:loading="true"
|
|
27
|
-
/>
|
|
27
|
+
<template #loading>
|
|
28
|
+
<Loader :loading="true" />
|
|
28
29
|
</template>
|
|
29
30
|
<template #empty>
|
|
30
|
-
<slot
|
|
31
|
-
|
|
32
|
-
name="loading"
|
|
33
|
-
>
|
|
34
|
-
<Loader
|
|
35
|
-
:loading="true"
|
|
36
|
-
/>
|
|
31
|
+
<slot v-if="options.status.isLoading" name="loading">
|
|
32
|
+
<Loader :loading="true" />
|
|
37
33
|
</slot>
|
|
38
|
-
<slot
|
|
39
|
-
v-else-if="options.status.isError"
|
|
40
|
-
name="error"
|
|
41
|
-
>
|
|
34
|
+
<slot v-else-if="options.status.isError" name="error">
|
|
42
35
|
<div
|
|
43
|
-
class="
|
|
44
|
-
text-error-400 flex h-[200px] items-center justify-center text-2xl
|
|
45
|
-
"
|
|
36
|
+
class="text-error-400 flex h-[200px] items-center justify-center text-2xl"
|
|
46
37
|
>
|
|
47
38
|
{{ StringHelper.getError(options.status.errorData) }}
|
|
48
39
|
</div>
|
|
49
40
|
</slot>
|
|
50
41
|
|
|
51
|
-
<slot
|
|
52
|
-
v-else
|
|
53
|
-
name="error"
|
|
54
|
-
>
|
|
42
|
+
<slot v-else name="error">
|
|
55
43
|
<Empty />
|
|
56
44
|
</slot>
|
|
57
45
|
</template>
|
|
@@ -61,21 +49,19 @@
|
|
|
61
49
|
:key="column.accessorKey"
|
|
62
50
|
>
|
|
63
51
|
<component
|
|
64
|
-
:is="
|
|
65
|
-
|
|
52
|
+
:is="
|
|
53
|
+
column.type === COLUMN_TYPES.COMPONENT ? column.component : columnTypeComponents[column.type]
|
|
54
|
+
"
|
|
55
|
+
v-if="
|
|
56
|
+
column.type === COLUMN_TYPES.COMPONENT || columnTypeComponents[column.type]
|
|
57
|
+
"
|
|
66
58
|
:value="transformValue(column, row)"
|
|
67
59
|
:column="column"
|
|
68
60
|
:row="row"
|
|
69
61
|
/>
|
|
70
62
|
</template>
|
|
71
|
-
<template
|
|
72
|
-
v-
|
|
73
|
-
#[slotName]="slotProps"
|
|
74
|
-
>
|
|
75
|
-
<slot
|
|
76
|
-
:name="slotName"
|
|
77
|
-
v-bind="slotProps || {}"
|
|
78
|
-
/>
|
|
63
|
+
<template v-for="(_, slotName) of $slots" #[slotName]="slotProps">
|
|
64
|
+
<slot :name="slotName" v-bind="slotProps || {}" />
|
|
79
65
|
</template>
|
|
80
66
|
</UTable>
|
|
81
67
|
<Pagination
|
|
@@ -94,10 +80,17 @@
|
|
|
94
80
|
|
|
95
81
|
<script setup>
|
|
96
82
|
import { computed, ref } from "vue";
|
|
97
|
-
import {
|
|
83
|
+
import {
|
|
84
|
+
COLUMN_TYPES
|
|
85
|
+
} from "#core/components/Table/types";
|
|
98
86
|
import ColumnNumber from "#core/components/Table/ColumnNumber.vue";
|
|
99
87
|
import ColumnImage from "#core/components/Table/ColumnImage.vue";
|
|
100
|
-
import {
|
|
88
|
+
import {
|
|
89
|
+
updateAppConfig,
|
|
90
|
+
useAppConfig,
|
|
91
|
+
useUiConfig,
|
|
92
|
+
useWatchChange
|
|
93
|
+
} from "#imports";
|
|
101
94
|
import ColumnDateTime from "#core/components/Table/ColumnDateTime.vue";
|
|
102
95
|
import Empty from "#core/components/Empty.vue";
|
|
103
96
|
import ColumnDate from "#core/components/Table/ColumnDate.vue";
|
|
@@ -120,7 +113,9 @@ const columnTypeComponents = {
|
|
|
120
113
|
const theme = computed(() => useUiConfig(tableTheme, "table")());
|
|
121
114
|
const config = useAppConfig();
|
|
122
115
|
const page = ref(props.options.pageOptions?.currentPage || 1);
|
|
123
|
-
const pageLimit = ref(
|
|
116
|
+
const pageLimit = ref(
|
|
117
|
+
props.options.pageOptions?.limit || config.core.limit_per_page
|
|
118
|
+
);
|
|
124
119
|
const uTableCompatibleColumns = computed(
|
|
125
120
|
() => props.options.columns.map((col) => ({
|
|
126
121
|
...col,
|
|
@@ -2,7 +2,7 @@ import { type ISimpleTableOptions, type ITableOptions } from '#core/components/T
|
|
|
2
2
|
import { tableTheme } from '#core/theme/table';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
options: ITableOptions<any> & ISimpleTableOptions<any>;
|
|
5
|
-
ui?: typeof tableTheme['slots'];
|
|
5
|
+
ui?: (typeof tableTheme)['slots'];
|
|
6
6
|
};
|
|
7
7
|
declare var __VLS_22: {}, __VLS_29: {}, __VLS_31: {}, __VLS_45: string | number, __VLS_46: any;
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { ISimpleTableOptions } from '#core/components/Table/types';
|
|
2
2
|
import type { tableTheme } from '../../theme/table.js';
|
|
3
3
|
import type { TableSlots } from '@nuxt/ui';
|
|
4
|
+
type Slot = TableSlots<any> & {
|
|
5
|
+
error: (props?: Record<string, any>) => any;
|
|
6
|
+
};
|
|
4
7
|
type __VLS_Props = {
|
|
5
8
|
options: ISimpleTableOptions<any>;
|
|
6
9
|
ui?: typeof tableTheme['slots'];
|
|
7
10
|
};
|
|
8
11
|
type __VLS_Slots = Slot;
|
|
9
|
-
type Slot = TableSlots<any> & {
|
|
10
|
-
error: (props?: Record<string, any>) => any;
|
|
11
|
-
};
|
|
12
12
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
14
|
export default _default;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
<div ref="tableContainer">
|
|
3
3
|
<div
|
|
4
4
|
v-if="options.isEnabledSearch"
|
|
5
|
-
:class="
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
:class="
|
|
6
|
+
theme.searchContainer({
|
|
7
|
+
class: [ui?.searchContainer]
|
|
8
|
+
})
|
|
9
|
+
"
|
|
8
10
|
>
|
|
9
11
|
<Input
|
|
10
12
|
v-model="q"
|
|
@@ -17,15 +19,10 @@
|
|
|
17
19
|
:options="options"
|
|
18
20
|
@page-change="onPageChange"
|
|
19
21
|
@search="emits('search', q)"
|
|
22
|
+
:ui="ui"
|
|
20
23
|
>
|
|
21
|
-
<template
|
|
22
|
-
v-
|
|
23
|
-
#[slot]="slotProps"
|
|
24
|
-
>
|
|
25
|
-
<slot
|
|
26
|
-
:name="slot"
|
|
27
|
-
v-bind="slotProps || {}"
|
|
28
|
-
/>
|
|
24
|
+
<template v-for="(_, slot) of $slots" #[slot]="slotProps">
|
|
25
|
+
<slot :name="slot" v-bind="slotProps || {}" />
|
|
29
26
|
</template>
|
|
30
27
|
</Base>
|
|
31
28
|
</div>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { TableSlots } from '@nuxt/ui';
|
|
2
2
|
import type { ITableOptions } from '#core/components/Table/types';
|
|
3
3
|
import { tableTheme } from '#core/theme/table';
|
|
4
|
+
type Slot = TableSlots<any> & {
|
|
5
|
+
error: (props?: Record<string, any>) => any;
|
|
6
|
+
};
|
|
4
7
|
type __VLS_Props = {
|
|
5
8
|
options: ITableOptions<any>;
|
|
6
|
-
ui?: typeof tableTheme['slots'];
|
|
9
|
+
ui?: (typeof tableTheme)['slots'];
|
|
7
10
|
};
|
|
8
11
|
type __VLS_Slots = Slot;
|
|
9
|
-
type Slot = TableSlots<any> & {
|
|
10
|
-
error: (props?: Record<string, any>) => any;
|
|
11
|
-
};
|
|
12
12
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
13
|
search: (q: string) => any;
|
|
14
14
|
pageChange: (page: number) => any;
|