@finema/core 2.15.2 → 2.16.0
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/README.md +79 -79
- package/dist/module.json +1 -1
- package/dist/module.mjs +53 -14
- package/dist/runtime/components/DevToolsWindow/index.vue +95 -95
- package/dist/runtime/components/FlexDeck/index.vue +68 -68
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
- package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -43
- package/dist/runtime/components/Form/InputText/index.vue +48 -48
- package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
- package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +28 -28
- package/dist/runtime/components/Log/index.vue +17 -17
- package/dist/runtime/components/Table/ColumnDate.vue +1 -1
- package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
- package/dist/runtime/components/Table/ColumnImage.vue +4 -4
- package/dist/runtime/components/Table/ColumnNumber.vue +1 -1
- package/dist/runtime/components/Table/ColumnText.vue +1 -1
- package/dist/runtime/components/Table/index.vue +87 -87
- package/dist/runtime/composables/useApp.d.ts +16 -7
- package/dist/runtime/composables/useApp.js +10 -5
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/types/index.d.ts +5 -0
- package/dist/runtime/types/index.js +5 -0
- package/package.json +6 -3
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div ref="tableContainer">
|
|
3
|
-
<div
|
|
4
|
-
v-if="options.isEnabledSearch"
|
|
2
|
+
<div ref="tableContainer">
|
|
3
|
+
<div
|
|
4
|
+
v-if="options.isEnabledSearch"
|
|
5
5
|
:class="theme.searchContainer({
|
|
6
6
|
class: [ui?.searchContainer]
|
|
7
|
-
})"
|
|
8
|
-
>
|
|
9
|
-
<Input
|
|
10
|
-
v-model="q"
|
|
11
|
-
icon="i-heroicons-magnifying-glass"
|
|
12
|
-
:placeholder="options.searchPlaceholder || '\u0E04\u0E49\u0E19\u0E2B\u0E32....'"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
<UTable
|
|
16
|
-
v-bind="$attrs"
|
|
17
|
-
:loading="options.status.isLoading"
|
|
18
|
-
:data="options.rawData"
|
|
19
|
-
:columns="options.columns"
|
|
20
|
-
>
|
|
21
|
-
<template #empty>
|
|
22
|
-
<slot
|
|
23
|
-
v-if="options.status.isLoading"
|
|
24
|
-
name="loading"
|
|
25
|
-
>
|
|
26
|
-
<Loader
|
|
27
|
-
:loading="true"
|
|
28
|
-
/>
|
|
29
|
-
</slot>
|
|
30
|
-
<slot
|
|
31
|
-
v-else-if="options.status.isError"
|
|
32
|
-
name="error"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
class="flex h-[200px] items-center justify-center text-2xl text-error-400"
|
|
36
|
-
>
|
|
37
|
-
{{ StringHelper.getError(options.status.errorData) }}
|
|
38
|
-
</div>
|
|
39
|
-
</slot>
|
|
40
|
-
|
|
41
|
-
<slot
|
|
42
|
-
v-else
|
|
43
|
-
name="error"
|
|
44
|
-
>
|
|
45
|
-
<Empty />
|
|
46
|
-
</slot>
|
|
47
|
-
</template>
|
|
48
|
-
<template
|
|
49
|
-
v-for="column in options.columns.filter((item) => !!item.type)"
|
|
50
|
-
#[`${column.accessorKey}-cell`]="{ row }"
|
|
51
|
-
:key="column.accessorKey"
|
|
52
|
-
>
|
|
53
|
-
<component
|
|
54
|
-
:is="column.type === COLUMN_TYPES.COMPONENT ? column.component : columnTypeComponents[column.type]"
|
|
55
|
-
v-if="column.type === COLUMN_TYPES.COMPONENT || columnTypeComponents[column.type]"
|
|
56
|
-
:value="transformValue(column, row)"
|
|
57
|
-
:column="column"
|
|
58
|
-
:row="row"
|
|
59
|
-
/>
|
|
60
|
-
</template>
|
|
61
|
-
<template
|
|
62
|
-
v-for="(_, slotName) of $slots"
|
|
63
|
-
#[slotName]="slotProps"
|
|
64
|
-
>
|
|
65
|
-
<slot
|
|
66
|
-
:name="slotName"
|
|
67
|
-
v-bind="slotProps || {}"
|
|
68
|
-
/>
|
|
69
|
-
</template>
|
|
70
|
-
</UTable>
|
|
71
|
-
|
|
72
|
-
<div
|
|
73
|
-
v-if="!options.isHidePagination"
|
|
7
|
+
})"
|
|
8
|
+
>
|
|
9
|
+
<Input
|
|
10
|
+
v-model="q"
|
|
11
|
+
icon="i-heroicons-magnifying-glass"
|
|
12
|
+
:placeholder="options.searchPlaceholder || '\u0E04\u0E49\u0E19\u0E2B\u0E32....'"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
<UTable
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
:loading="options.status.isLoading"
|
|
18
|
+
:data="options.rawData"
|
|
19
|
+
:columns="options.columns"
|
|
20
|
+
>
|
|
21
|
+
<template #empty>
|
|
22
|
+
<slot
|
|
23
|
+
v-if="options.status.isLoading"
|
|
24
|
+
name="loading"
|
|
25
|
+
>
|
|
26
|
+
<Loader
|
|
27
|
+
:loading="true"
|
|
28
|
+
/>
|
|
29
|
+
</slot>
|
|
30
|
+
<slot
|
|
31
|
+
v-else-if="options.status.isError"
|
|
32
|
+
name="error"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
class="flex h-[200px] items-center justify-center text-2xl text-error-400"
|
|
36
|
+
>
|
|
37
|
+
{{ StringHelper.getError(options.status.errorData) }}
|
|
38
|
+
</div>
|
|
39
|
+
</slot>
|
|
40
|
+
|
|
41
|
+
<slot
|
|
42
|
+
v-else
|
|
43
|
+
name="error"
|
|
44
|
+
>
|
|
45
|
+
<Empty />
|
|
46
|
+
</slot>
|
|
47
|
+
</template>
|
|
48
|
+
<template
|
|
49
|
+
v-for="column in options.columns.filter((item) => !!item.type)"
|
|
50
|
+
#[`${column.accessorKey}-cell`]="{ row }"
|
|
51
|
+
:key="column.accessorKey"
|
|
52
|
+
>
|
|
53
|
+
<component
|
|
54
|
+
:is="column.type === COLUMN_TYPES.COMPONENT ? column.component : columnTypeComponents[column.type]"
|
|
55
|
+
v-if="column.type === COLUMN_TYPES.COMPONENT || columnTypeComponents[column.type]"
|
|
56
|
+
:value="transformValue(column, row)"
|
|
57
|
+
:column="column"
|
|
58
|
+
:row="row"
|
|
59
|
+
/>
|
|
60
|
+
</template>
|
|
61
|
+
<template
|
|
62
|
+
v-for="(_, slotName) of $slots"
|
|
63
|
+
#[slotName]="slotProps"
|
|
64
|
+
>
|
|
65
|
+
<slot
|
|
66
|
+
:name="slotName"
|
|
67
|
+
v-bind="slotProps || {}"
|
|
68
|
+
/>
|
|
69
|
+
</template>
|
|
70
|
+
</UTable>
|
|
71
|
+
|
|
72
|
+
<div
|
|
73
|
+
v-if="!options.isHidePagination"
|
|
74
74
|
:class="theme.paginationContainer({
|
|
75
75
|
class: [ui?.paginationContainer]
|
|
76
|
-
})"
|
|
77
|
-
>
|
|
78
|
-
<p
|
|
76
|
+
})"
|
|
77
|
+
>
|
|
78
|
+
<p
|
|
79
79
|
:class="theme.paginationInfo({
|
|
80
80
|
class: [ui?.paginationInfo]
|
|
81
|
-
})"
|
|
82
|
-
>
|
|
83
|
-
{{ pageBetween }} รายการ จากทั้งหมด {{ totalCountWithComma }} รายการ
|
|
84
|
-
</p>
|
|
85
|
-
<Pagination
|
|
86
|
-
v-if="options.pageOptions.totalPage > 1"
|
|
87
|
-
v-model:page="page"
|
|
88
|
-
:default-page="options.pageOptions?.currentPage || 1"
|
|
89
|
-
:items-per-page="options.pageOptions.limit"
|
|
90
|
-
:total="options.pageOptions.totalCount"
|
|
91
|
-
@update:page="onPageChange"
|
|
92
|
-
/>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
81
|
+
})"
|
|
82
|
+
>
|
|
83
|
+
{{ pageBetween }} รายการ จากทั้งหมด {{ totalCountWithComma }} รายการ
|
|
84
|
+
</p>
|
|
85
|
+
<Pagination
|
|
86
|
+
v-if="options.pageOptions.totalPage > 1"
|
|
87
|
+
v-model:page="page"
|
|
88
|
+
:default-page="options.pageOptions?.currentPage || 1"
|
|
89
|
+
:items-per-page="options.pageOptions.limit"
|
|
90
|
+
:total="options.pageOptions.totalCount"
|
|
91
|
+
@update:page="onPageChange"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
95
|
</template>
|
|
96
96
|
|
|
97
97
|
<script setup>
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import type { BreadcrumbItem } from '@nuxt/ui';
|
|
2
|
-
export interface
|
|
1
|
+
import type { BreadcrumbItem, NavigationMenuItem } from '@nuxt/ui';
|
|
2
|
+
export interface IAppPageMeta {
|
|
3
3
|
title?: string;
|
|
4
4
|
sub_title?: string;
|
|
5
5
|
isHideBreadcrumbs?: boolean;
|
|
6
6
|
breadcrumbs?: BreadcrumbItem[];
|
|
7
7
|
}
|
|
8
|
-
export
|
|
9
|
-
pageMeta:
|
|
10
|
-
sidebar:
|
|
11
|
-
}
|
|
12
|
-
|
|
8
|
+
export interface IApp {
|
|
9
|
+
pageMeta: IAppPageMeta;
|
|
10
|
+
sidebar: NavigationMenuItem[];
|
|
11
|
+
}
|
|
12
|
+
export declare const useApp: import("pinia").StoreDefinition<"_app", IApp, {}, {
|
|
13
|
+
definePage(pageMeta: IAppPageMeta): void;
|
|
13
14
|
defineSidebar(items: BreadcrumbItem[]): void;
|
|
15
|
+
patchTitle(payload: {
|
|
16
|
+
title?: string;
|
|
17
|
+
sub_title?: string;
|
|
18
|
+
}): void;
|
|
19
|
+
patchBreadcrumbs(payload: {
|
|
20
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
21
|
+
isHideBreadcrumbs?: boolean;
|
|
22
|
+
}): void;
|
|
14
23
|
}>;
|
|
@@ -5,14 +5,19 @@ export const useApp = defineStore("_app", {
|
|
|
5
5
|
sidebar: []
|
|
6
6
|
}),
|
|
7
7
|
actions: {
|
|
8
|
-
definePage(
|
|
9
|
-
this.pageMeta
|
|
10
|
-
this.pageMeta.sub_title = payload.sub_title;
|
|
11
|
-
this.pageMeta.isHideBreadcrumbs = payload.isHideBreadcrumbs;
|
|
12
|
-
this.pageMeta.breadcrumbs = payload.breadcrumbs;
|
|
8
|
+
definePage(pageMeta) {
|
|
9
|
+
this.pageMeta = pageMeta;
|
|
13
10
|
},
|
|
14
11
|
defineSidebar(items) {
|
|
15
12
|
this.sidebar = items;
|
|
13
|
+
},
|
|
14
|
+
patchTitle(payload) {
|
|
15
|
+
this.pageMeta.title = payload.title;
|
|
16
|
+
this.pageMeta.sub_title = payload.sub_title;
|
|
17
|
+
},
|
|
18
|
+
patchBreadcrumbs(payload) {
|
|
19
|
+
this.pageMeta.breadcrumbs = payload.breadcrumbs || [];
|
|
20
|
+
this.pageMeta.isHideBreadcrumbs = payload.isHideBreadcrumbs || false;
|
|
16
21
|
}
|
|
17
22
|
}
|
|
18
23
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../.nuxt/tsconfig.server.json",
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../.nuxt/tsconfig.server.json",
|
|
3
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finema/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"repository": "https://gitlab.finema.co/finema/ui-kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Finema Dev Core Team",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22"
|
|
9
|
+
},
|
|
7
10
|
"type": "module",
|
|
8
11
|
"exports": {
|
|
9
12
|
".": {
|
|
@@ -64,6 +67,7 @@
|
|
|
64
67
|
"@iconify-json/heroicons": "^1.2.2",
|
|
65
68
|
"@iconify-json/ph": "^1.2.2",
|
|
66
69
|
"@iconify-json/svg-spinners": "^1.2.2",
|
|
70
|
+
"@tailwindcss/typography": "^0.5.0-alpha.3",
|
|
67
71
|
"url-join": "^5.0.0"
|
|
68
72
|
},
|
|
69
73
|
"devDependencies": {
|
|
@@ -74,7 +78,6 @@
|
|
|
74
78
|
"@nuxt/module-builder": "^1.0.1",
|
|
75
79
|
"@nuxt/schema": "^3.17.3",
|
|
76
80
|
"@nuxt/test-utils": "^3.19.0",
|
|
77
|
-
"@tailwindcss/typography": "^0.5.0-alpha.3",
|
|
78
81
|
"@types/node": "latest",
|
|
79
82
|
"changelogen": "^0.5.7",
|
|
80
83
|
"eslint": "^9.26.0",
|
|
@@ -94,4 +97,4 @@
|
|
|
94
97
|
"lint-staged": {
|
|
95
98
|
"*": "eslint --fix"
|
|
96
99
|
}
|
|
97
|
-
}
|
|
100
|
+
}
|