@finema/core 2.5.5 → 2.6.1
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 +19 -2
- package/dist/runtime/components/App.vue +7 -7
- package/dist/runtime/components/DevToolsWindow/index.vue +95 -95
- package/dist/runtime/components/Empty.vue +12 -12
- package/dist/runtime/components/FlexDeck/Base.vue +67 -67
- package/dist/runtime/components/FlexDeck/index.vue +33 -33
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.vue +14 -14
- package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
- package/dist/runtime/components/Form/InputDateTime/index.vue +44 -44
- package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
- package/dist/runtime/components/Form/InputSelect/index.vue +38 -38
- 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/Base.vue +76 -76
- 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/Simple.vue +21 -21
- package/dist/runtime/components/Table/index.vue +100 -100
- package/dist/runtime/server/tsconfig.json +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Get your module up and running quickly.
|
|
3
|
-
|
|
4
|
-
Find and replace all on all files (CMD+SHIFT+F):
|
|
5
|
-
- Name: Finema UI Kit (Note: package.json has name: @finema/core, consider aligning these)
|
|
6
|
-
- Package name: @finema/core
|
|
7
|
-
- Description: A comprehensive UI kit for Finema projects.
|
|
8
|
-
-->
|
|
9
|
-
|
|
10
|
-
# Finema UI Kit
|
|
11
|
-
|
|
12
|
-
[![npm version][npm-version-src]][npm-version-href]
|
|
13
|
-
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
|
-
[![License][license-src]][license-href]
|
|
15
|
-
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
|
-
|
|
17
|
-
A comprehensive UI kit for building consistent and beautiful user interfaces for Finema projects, designed to integrate seamlessly with Nuxt. This package is named `@finema/core` on npm.
|
|
18
|
-
|
|
19
|
-
- [✨ Release Notes](/CHANGELOG.md)
|
|
20
|
-
- [📖 Storybook](https://your-storybook-url.com) <!-- Add a link to your Storybook -->
|
|
21
|
-
- [🕹️ Playground](#playground)
|
|
22
|
-
|
|
23
|
-
## Features
|
|
24
|
-
|
|
25
|
-
<!-- Highlight some of the features your UI kit provides here -->
|
|
26
|
-
- 🎨 Wide range of customizable components, built for Vue and Nuxt
|
|
27
|
-
- 📱 Responsive design out-of-the-box
|
|
28
|
-
- ♿ Accessibility focused
|
|
29
|
-
- 🛠️ Easy to integrate and use with Nuxt auto-import capabilities
|
|
30
|
-
|
|
31
|
-
## 🚀 Installation
|
|
32
|
-
|
|
33
|
-
Install the UI kit in your project using npm or yarn:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm install @finema/core
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
or
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
yarn add @finema/core
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## 🛠️ Available Scripts
|
|
46
|
-
|
|
47
|
-
In the project directory, you can run the following scripts:
|
|
48
|
-
|
|
49
|
-
- `npm run dev` or `yarn dev`: Runs the playground app in development mode.
|
|
50
|
-
- `npm run dev:build` or `yarn dev:build`: Builds the playground app.
|
|
51
|
-
- `npm run dev:prepare` or `yarn dev:prepare`: Prepares the development environment.
|
|
52
|
-
- `npm run lint` or `yarn lint`: Lints the codebase.
|
|
53
|
-
- `npm run test` or `yarn test`: Runs tests.
|
|
54
|
-
- `npm run release` or `yarn release`: Creates a new release (lints, tests, builds, publishes).
|
|
55
|
-
|
|
56
|
-
## 🕹️ Playground
|
|
57
|
-
|
|
58
|
-
This project includes a `playground` directory that you can use to test and experiment with the UI components.
|
|
59
|
-
|
|
60
|
-
To run the playground:
|
|
61
|
-
1. Navigate to the `playground` directory.
|
|
62
|
-
2. Install dependencies if you haven't already (`npm install` or `yarn install`).
|
|
63
|
-
3. Run `npm run dev` or `yarn dev`.
|
|
64
|
-
|
|
65
|
-
## 🤝 Contributing
|
|
66
|
-
|
|
67
|
-
Contributions are welcome! Please refer to the `CONTRIBUTING.md` file for guidelines. (You'll need to create this file).
|
|
68
|
-
|
|
69
|
-
<!--
|
|
70
|
-
Badge URLs - Keep these at the bottom of the file for better readability
|
|
71
|
-
-->
|
|
72
|
-
[npm-version-src]: https://img.shields.io/npm/v/@finema/core.svg
|
|
73
|
-
[npm-version-href]: https://npmjs.com/package/@finema/core
|
|
74
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/@finema/core.svg
|
|
75
|
-
[npm-downloads-href]: https://npmjs.com/package/@finema/core
|
|
76
|
-
[license-src]: https://img.shields.io/npm/l/@finema/core.svg
|
|
77
|
-
[license-href]: https://npmjs.com/package/@finema/core
|
|
78
|
-
[nuxt-src]: https://img.shields.io/badge/Nuxt-00DC82?logo=nuxt.js
|
|
79
|
-
[nuxt-href]: https://nuxt.com
|
|
1
|
+
<!--
|
|
2
|
+
Get your module up and running quickly.
|
|
3
|
+
|
|
4
|
+
Find and replace all on all files (CMD+SHIFT+F):
|
|
5
|
+
- Name: Finema UI Kit (Note: package.json has name: @finema/core, consider aligning these)
|
|
6
|
+
- Package name: @finema/core
|
|
7
|
+
- Description: A comprehensive UI kit for Finema projects.
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# Finema UI Kit
|
|
11
|
+
|
|
12
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
13
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
|
+
[![License][license-src]][license-href]
|
|
15
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
|
+
|
|
17
|
+
A comprehensive UI kit for building consistent and beautiful user interfaces for Finema projects, designed to integrate seamlessly with Nuxt. This package is named `@finema/core` on npm.
|
|
18
|
+
|
|
19
|
+
- [✨ Release Notes](/CHANGELOG.md)
|
|
20
|
+
- [📖 Storybook](https://your-storybook-url.com) <!-- Add a link to your Storybook -->
|
|
21
|
+
- [🕹️ Playground](#playground)
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
<!-- Highlight some of the features your UI kit provides here -->
|
|
26
|
+
- 🎨 Wide range of customizable components, built for Vue and Nuxt
|
|
27
|
+
- 📱 Responsive design out-of-the-box
|
|
28
|
+
- ♿ Accessibility focused
|
|
29
|
+
- 🛠️ Easy to integrate and use with Nuxt auto-import capabilities
|
|
30
|
+
|
|
31
|
+
## 🚀 Installation
|
|
32
|
+
|
|
33
|
+
Install the UI kit in your project using npm or yarn:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @finema/core
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
or
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yarn add @finema/core
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 🛠️ Available Scripts
|
|
46
|
+
|
|
47
|
+
In the project directory, you can run the following scripts:
|
|
48
|
+
|
|
49
|
+
- `npm run dev` or `yarn dev`: Runs the playground app in development mode.
|
|
50
|
+
- `npm run dev:build` or `yarn dev:build`: Builds the playground app.
|
|
51
|
+
- `npm run dev:prepare` or `yarn dev:prepare`: Prepares the development environment.
|
|
52
|
+
- `npm run lint` or `yarn lint`: Lints the codebase.
|
|
53
|
+
- `npm run test` or `yarn test`: Runs tests.
|
|
54
|
+
- `npm run release` or `yarn release`: Creates a new release (lints, tests, builds, publishes).
|
|
55
|
+
|
|
56
|
+
## 🕹️ Playground
|
|
57
|
+
|
|
58
|
+
This project includes a `playground` directory that you can use to test and experiment with the UI components.
|
|
59
|
+
|
|
60
|
+
To run the playground:
|
|
61
|
+
1. Navigate to the `playground` directory.
|
|
62
|
+
2. Install dependencies if you haven't already (`npm install` or `yarn install`).
|
|
63
|
+
3. Run `npm run dev` or `yarn dev`.
|
|
64
|
+
|
|
65
|
+
## 🤝 Contributing
|
|
66
|
+
|
|
67
|
+
Contributions are welcome! Please refer to the `CONTRIBUTING.md` file for guidelines. (You'll need to create this file).
|
|
68
|
+
|
|
69
|
+
<!--
|
|
70
|
+
Badge URLs - Keep these at the bottom of the file for better readability
|
|
71
|
+
-->
|
|
72
|
+
[npm-version-src]: https://img.shields.io/npm/v/@finema/core.svg
|
|
73
|
+
[npm-version-href]: https://npmjs.com/package/@finema/core
|
|
74
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@finema/core.svg
|
|
75
|
+
[npm-downloads-href]: https://npmjs.com/package/@finema/core
|
|
76
|
+
[license-src]: https://img.shields.io/npm/l/@finema/core.svg
|
|
77
|
+
[license-href]: https://npmjs.com/package/@finema/core
|
|
78
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-00DC82?logo=nuxt.js
|
|
79
|
+
[nuxt-href]: https://nuxt.com
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import defu from 'defu';
|
|
|
3
3
|
import * as theme from '../dist/runtime/theme/index.js';
|
|
4
4
|
|
|
5
5
|
const name = "@finema/core";
|
|
6
|
-
const version = "2.
|
|
6
|
+
const version = "2.6.1";
|
|
7
7
|
|
|
8
8
|
const nuxtAppOptions = {
|
|
9
9
|
head: {
|
|
@@ -96,6 +96,22 @@ const module = defineNuxtModule({
|
|
|
96
96
|
},
|
|
97
97
|
...theme
|
|
98
98
|
};
|
|
99
|
+
_nuxt.options.build = defu(
|
|
100
|
+
{
|
|
101
|
+
transpile: [
|
|
102
|
+
..._nuxt.options.build?.transpile || [],
|
|
103
|
+
"date-fns",
|
|
104
|
+
"date-fns-tz",
|
|
105
|
+
"@vuepic/vue-datepicker",
|
|
106
|
+
"defu"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
_nuxt.options.build
|
|
110
|
+
);
|
|
111
|
+
_nuxt.options.vite = defu(
|
|
112
|
+
{ optimizeDeps: { include: [..._nuxt.options.vite?.optimizeDeps?.include || [], "@wdns/vue-code-block"] } },
|
|
113
|
+
_nuxt.options.vite
|
|
114
|
+
);
|
|
99
115
|
await installModule("@nuxt/ui", {
|
|
100
116
|
prefix: "",
|
|
101
117
|
colorMode: false,
|
|
@@ -131,7 +147,8 @@ const module = defineNuxtModule({
|
|
|
131
147
|
addPlugin(resolve("./runtime/plugin"));
|
|
132
148
|
void addComponentsDir({
|
|
133
149
|
path: resolve(runtimeDir, "components"),
|
|
134
|
-
prefix: _options.prefix
|
|
150
|
+
prefix: _options.prefix,
|
|
151
|
+
priority: 10
|
|
135
152
|
});
|
|
136
153
|
addImportsDir(resolve(runtimeDir, "composables"));
|
|
137
154
|
addImportsDir(resolve(runtimeDir, "utils"));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<NuxtLoadingIndicator :color="coreConfig.color" />
|
|
3
|
-
<UApp :locale="th">
|
|
4
|
-
<slot />
|
|
5
|
-
</UApp>
|
|
6
|
-
<DevOnly>
|
|
7
|
-
<DevToolsWindow />
|
|
8
|
-
</DevOnly>
|
|
2
|
+
<NuxtLoadingIndicator :color="coreConfig.color" />
|
|
3
|
+
<UApp :locale="th">
|
|
4
|
+
<slot />
|
|
5
|
+
</UApp>
|
|
6
|
+
<DevOnly>
|
|
7
|
+
<DevToolsWindow />
|
|
8
|
+
</DevOnly>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup>
|
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-show="isShowDevTools"
|
|
4
|
-
ref="devToolsRef"
|
|
5
|
-
class="fixed z-50 overflow-hidden rounded-lg border border-neutral-300 bg-white opacity-80 shadow-2xl"
|
|
6
|
-
:style="devToolsDynamicStyles"
|
|
7
|
-
>
|
|
8
|
-
<!-- Draggable Title Bar -->
|
|
9
|
-
<div class="flex items-center justify-between px-2 py-1 select-none">
|
|
10
|
-
<p
|
|
11
|
-
class="text-sm font-semibold cursor-move flex-grow"
|
|
12
|
-
@mousedown.prevent="handleDragStart"
|
|
13
|
-
>
|
|
14
|
-
Debug Tools
|
|
15
|
-
</p>
|
|
16
|
-
<div class="flex items-center">
|
|
17
|
-
<Button
|
|
18
|
-
icon="i-heroicons-arrow-path"
|
|
19
|
-
size="xs"
|
|
20
|
-
color="neutral"
|
|
21
|
-
variant="ghost"
|
|
22
|
-
class="mr-1"
|
|
23
|
-
title="Reset Position & Size"
|
|
24
|
-
@click.stop="resetDevToolsState"
|
|
25
|
-
/>
|
|
26
|
-
<Button
|
|
27
|
-
icon="i-heroicons-x-mark"
|
|
28
|
-
size="xs"
|
|
29
|
-
color="neutral"
|
|
30
|
-
variant="ghost"
|
|
31
|
-
title="Close DevTools"
|
|
32
|
-
@click.stop="closeDevTools"
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
<hr class="text-neutral-300" />
|
|
37
|
-
<!-- Content Area Target for Logs -->
|
|
38
|
-
<div
|
|
39
|
-
id="dev-logs"
|
|
40
|
-
class="flex flex-col flex-1 space-y-1 p-2 overflow-auto"
|
|
41
|
-
:style="{ height: `calc(${devToolsHeight} - 40px)` }"
|
|
42
|
-
/>
|
|
43
|
-
|
|
44
|
-
<!-- Resize Handles -->
|
|
45
|
-
<div
|
|
46
|
-
v-if="!isDragging"
|
|
47
|
-
class="resize-handles"
|
|
48
|
-
>
|
|
49
|
-
<div
|
|
50
|
-
class="resize-handle top-left"
|
|
51
|
-
@mousedown.prevent="handleResizeStart('top-left', $event)"
|
|
52
|
-
/>
|
|
53
|
-
<div
|
|
54
|
-
class="resize-handle top-center"
|
|
55
|
-
@mousedown.prevent="handleResizeStart('top', $event)"
|
|
56
|
-
/>
|
|
57
|
-
<div
|
|
58
|
-
class="resize-handle top-right"
|
|
59
|
-
@mousedown.prevent="handleResizeStart('top-right', $event)"
|
|
60
|
-
/>
|
|
61
|
-
<div
|
|
62
|
-
class="resize-handle middle-left"
|
|
63
|
-
@mousedown.prevent="handleResizeStart('left', $event)"
|
|
64
|
-
/>
|
|
65
|
-
<div
|
|
66
|
-
class="resize-handle middle-right"
|
|
67
|
-
@mousedown.prevent="handleResizeStart('right', $event)"
|
|
68
|
-
/>
|
|
69
|
-
<div
|
|
70
|
-
class="resize-handle bottom-left"
|
|
71
|
-
@mousedown.prevent="handleResizeStart('bottom-left', $event)"
|
|
72
|
-
/>
|
|
73
|
-
<div
|
|
74
|
-
class="resize-handle bottom-center"
|
|
75
|
-
@mousedown.prevent="handleResizeStart('bottom', $event)"
|
|
76
|
-
/>
|
|
77
|
-
<div
|
|
78
|
-
class="resize-handle bottom-right"
|
|
79
|
-
@mousedown.prevent="handleResizeStart('bottom-right', $event)"
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
<!-- Toggle button for this DevToolsWindow -->
|
|
85
|
-
<div
|
|
86
|
-
class="fixed bottom-1 right-1 z-[99999]"
|
|
87
|
-
>
|
|
88
|
-
<Button
|
|
89
|
-
:icon="isShowDevTools ? 'heroicons:x-mark' : 'heroicons:information-circle'"
|
|
90
|
-
color="info"
|
|
91
|
-
square
|
|
92
|
-
size="sm"
|
|
93
|
-
:ui="{ base: 'rounded-full' }"
|
|
94
|
-
@click="toggleDevTools"
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
2
|
+
<div
|
|
3
|
+
v-show="isShowDevTools"
|
|
4
|
+
ref="devToolsRef"
|
|
5
|
+
class="fixed z-50 overflow-hidden rounded-lg border border-neutral-300 bg-white opacity-80 shadow-2xl"
|
|
6
|
+
:style="devToolsDynamicStyles"
|
|
7
|
+
>
|
|
8
|
+
<!-- Draggable Title Bar -->
|
|
9
|
+
<div class="flex items-center justify-between px-2 py-1 select-none">
|
|
10
|
+
<p
|
|
11
|
+
class="text-sm font-semibold cursor-move flex-grow"
|
|
12
|
+
@mousedown.prevent="handleDragStart"
|
|
13
|
+
>
|
|
14
|
+
Debug Tools
|
|
15
|
+
</p>
|
|
16
|
+
<div class="flex items-center">
|
|
17
|
+
<Button
|
|
18
|
+
icon="i-heroicons-arrow-path"
|
|
19
|
+
size="xs"
|
|
20
|
+
color="neutral"
|
|
21
|
+
variant="ghost"
|
|
22
|
+
class="mr-1"
|
|
23
|
+
title="Reset Position & Size"
|
|
24
|
+
@click.stop="resetDevToolsState"
|
|
25
|
+
/>
|
|
26
|
+
<Button
|
|
27
|
+
icon="i-heroicons-x-mark"
|
|
28
|
+
size="xs"
|
|
29
|
+
color="neutral"
|
|
30
|
+
variant="ghost"
|
|
31
|
+
title="Close DevTools"
|
|
32
|
+
@click.stop="closeDevTools"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<hr class="text-neutral-300" />
|
|
37
|
+
<!-- Content Area Target for Logs -->
|
|
38
|
+
<div
|
|
39
|
+
id="dev-logs"
|
|
40
|
+
class="flex flex-col flex-1 space-y-1 p-2 overflow-auto"
|
|
41
|
+
:style="{ height: `calc(${devToolsHeight} - 40px)` }"
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<!-- Resize Handles -->
|
|
45
|
+
<div
|
|
46
|
+
v-if="!isDragging"
|
|
47
|
+
class="resize-handles"
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
class="resize-handle top-left"
|
|
51
|
+
@mousedown.prevent="handleResizeStart('top-left', $event)"
|
|
52
|
+
/>
|
|
53
|
+
<div
|
|
54
|
+
class="resize-handle top-center"
|
|
55
|
+
@mousedown.prevent="handleResizeStart('top', $event)"
|
|
56
|
+
/>
|
|
57
|
+
<div
|
|
58
|
+
class="resize-handle top-right"
|
|
59
|
+
@mousedown.prevent="handleResizeStart('top-right', $event)"
|
|
60
|
+
/>
|
|
61
|
+
<div
|
|
62
|
+
class="resize-handle middle-left"
|
|
63
|
+
@mousedown.prevent="handleResizeStart('left', $event)"
|
|
64
|
+
/>
|
|
65
|
+
<div
|
|
66
|
+
class="resize-handle middle-right"
|
|
67
|
+
@mousedown.prevent="handleResizeStart('right', $event)"
|
|
68
|
+
/>
|
|
69
|
+
<div
|
|
70
|
+
class="resize-handle bottom-left"
|
|
71
|
+
@mousedown.prevent="handleResizeStart('bottom-left', $event)"
|
|
72
|
+
/>
|
|
73
|
+
<div
|
|
74
|
+
class="resize-handle bottom-center"
|
|
75
|
+
@mousedown.prevent="handleResizeStart('bottom', $event)"
|
|
76
|
+
/>
|
|
77
|
+
<div
|
|
78
|
+
class="resize-handle bottom-right"
|
|
79
|
+
@mousedown.prevent="handleResizeStart('bottom-right', $event)"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<!-- Toggle button for this DevToolsWindow -->
|
|
85
|
+
<div
|
|
86
|
+
class="fixed bottom-1 right-1 z-[99999]"
|
|
87
|
+
>
|
|
88
|
+
<Button
|
|
89
|
+
:icon="isShowDevTools ? 'heroicons:x-mark' : 'heroicons:information-circle'"
|
|
90
|
+
color="info"
|
|
91
|
+
square
|
|
92
|
+
size="sm"
|
|
93
|
+
:ui="{ base: 'rounded-full' }"
|
|
94
|
+
@click="toggleDevTools"
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
97
|
</template>
|
|
98
98
|
|
|
99
99
|
<script setup>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
:class="theme.base({
|
|
4
4
|
class: [ui?.base, props.class]
|
|
5
|
-
})"
|
|
6
|
-
>
|
|
7
|
-
<Icon
|
|
8
|
-
:name="icon"
|
|
5
|
+
})"
|
|
6
|
+
>
|
|
7
|
+
<Icon
|
|
8
|
+
:name="icon"
|
|
9
9
|
:class="theme.icon({
|
|
10
10
|
class: [ui?.icon]
|
|
11
|
-
})"
|
|
12
|
-
/>
|
|
13
|
-
<p
|
|
11
|
+
})"
|
|
12
|
+
/>
|
|
13
|
+
<p
|
|
14
14
|
:class="theme.message({
|
|
15
15
|
class: [ui?.message]
|
|
16
|
-
})"
|
|
17
|
-
v-html="message"
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
16
|
+
})"
|
|
17
|
+
v-html="message"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="!isHideCaption || !isHideBottomPagination"
|
|
4
|
-
class="mb-4 text-gray-500"
|
|
5
|
-
>
|
|
6
|
-
<span class="font-bold">ผลลัพธ์ทั้งหมด:</span>
|
|
7
|
-
จำนวน
|
|
8
|
-
<span class="font-bold">{{ pageOptions?.totalCount || 0 }}</span>
|
|
9
|
-
รายการ
|
|
10
|
-
</div>
|
|
11
|
-
<slot
|
|
12
|
-
v-if="!status.isLoading && rawData.length === 0"
|
|
13
|
-
name="empty-state"
|
|
14
|
-
>
|
|
15
|
-
<Empty />
|
|
16
|
-
</slot>
|
|
17
|
-
|
|
18
|
-
<div
|
|
19
|
-
v-if="pageOptions && isEnableInfiniteScroll && !isHideTopPagination"
|
|
20
|
-
class="mb-4 flex items-center justify-end"
|
|
21
|
-
>
|
|
22
|
-
<p class="text-xs text-gray-500">
|
|
23
|
-
ผลลัพธ์ {{ totalInnerRawData }} ของ {{ totalCountWithComma }} รายการ
|
|
24
|
-
</p>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<div :class="containerClass">
|
|
28
|
-
<slot
|
|
29
|
-
v-for="(row, index) in innerRawData"
|
|
30
|
-
:key="index"
|
|
31
|
-
:row="row"
|
|
32
|
-
/>
|
|
33
|
-
<div ref="bottomEdgeElement" />
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<slot
|
|
37
|
-
v-if="status.isLoading"
|
|
38
|
-
name="loading-state"
|
|
39
|
-
>
|
|
40
|
-
<div class="flex h-60 items-center justify-center">
|
|
41
|
-
<Icon
|
|
42
|
-
name="i-svg-spinners:180-ring-with-bg"
|
|
43
|
-
class="text-primary size-8"
|
|
44
|
-
/>
|
|
45
|
-
</div>
|
|
46
|
-
</slot>
|
|
47
|
-
|
|
48
|
-
<div
|
|
49
|
-
v-if="pageOptions && !isEnableInfiniteScroll"
|
|
50
|
-
class="mt-4 flex justify-between px-3"
|
|
51
|
-
>
|
|
52
|
-
<p class="text-xs text-gray-500">
|
|
53
|
-
ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
|
|
54
|
-
</p>
|
|
55
|
-
<Pagination
|
|
56
|
-
v-if="pageOptions.totalPage > 1 && !isSimplePagination && !isHideBottomPagination"
|
|
57
|
-
:default-page="pageOptions?.currentPage || 1"
|
|
58
|
-
:items-per-page="pageOptions.limit"
|
|
59
|
-
:total="pageOptions.totalCount"
|
|
60
|
-
@update:page="emits('pageChange', $event)"
|
|
61
|
-
/>
|
|
62
|
-
<SimplePagination
|
|
63
|
-
v-if="pageOptions.totalPage > 1 && isSimplePagination"
|
|
64
|
-
v-model="page"
|
|
65
|
-
:page-count="pageOptions.limit"
|
|
66
|
-
:total="pageOptions.totalCount"
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
2
|
+
<div
|
|
3
|
+
v-if="!isHideCaption || !isHideBottomPagination"
|
|
4
|
+
class="mb-4 text-gray-500"
|
|
5
|
+
>
|
|
6
|
+
<span class="font-bold">ผลลัพธ์ทั้งหมด:</span>
|
|
7
|
+
จำนวน
|
|
8
|
+
<span class="font-bold">{{ pageOptions?.totalCount || 0 }}</span>
|
|
9
|
+
รายการ
|
|
10
|
+
</div>
|
|
11
|
+
<slot
|
|
12
|
+
v-if="!status.isLoading && rawData.length === 0"
|
|
13
|
+
name="empty-state"
|
|
14
|
+
>
|
|
15
|
+
<Empty />
|
|
16
|
+
</slot>
|
|
17
|
+
|
|
18
|
+
<div
|
|
19
|
+
v-if="pageOptions && isEnableInfiniteScroll && !isHideTopPagination"
|
|
20
|
+
class="mb-4 flex items-center justify-end"
|
|
21
|
+
>
|
|
22
|
+
<p class="text-xs text-gray-500">
|
|
23
|
+
ผลลัพธ์ {{ totalInnerRawData }} ของ {{ totalCountWithComma }} รายการ
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div :class="containerClass">
|
|
28
|
+
<slot
|
|
29
|
+
v-for="(row, index) in innerRawData"
|
|
30
|
+
:key="index"
|
|
31
|
+
:row="row"
|
|
32
|
+
/>
|
|
33
|
+
<div ref="bottomEdgeElement" />
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<slot
|
|
37
|
+
v-if="status.isLoading"
|
|
38
|
+
name="loading-state"
|
|
39
|
+
>
|
|
40
|
+
<div class="flex h-60 items-center justify-center">
|
|
41
|
+
<Icon
|
|
42
|
+
name="i-svg-spinners:180-ring-with-bg"
|
|
43
|
+
class="text-primary size-8"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</slot>
|
|
47
|
+
|
|
48
|
+
<div
|
|
49
|
+
v-if="pageOptions && !isEnableInfiniteScroll"
|
|
50
|
+
class="mt-4 flex justify-between px-3"
|
|
51
|
+
>
|
|
52
|
+
<p class="text-xs text-gray-500">
|
|
53
|
+
ผลลัพธ์ {{ pageBetween }} ของ {{ totalCountWithComma }} รายการ
|
|
54
|
+
</p>
|
|
55
|
+
<Pagination
|
|
56
|
+
v-if="pageOptions.totalPage > 1 && !isSimplePagination && !isHideBottomPagination"
|
|
57
|
+
:default-page="pageOptions?.currentPage || 1"
|
|
58
|
+
:items-per-page="pageOptions.limit"
|
|
59
|
+
:total="pageOptions.totalCount"
|
|
60
|
+
@update:page="emits('pageChange', $event)"
|
|
61
|
+
/>
|
|
62
|
+
<SimplePagination
|
|
63
|
+
v-if="pageOptions.totalPage > 1 && isSimplePagination"
|
|
64
|
+
v-model="page"
|
|
65
|
+
:page-count="pageOptions.limit"
|
|
66
|
+
:total="pageOptions.totalCount"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
69
|
</template>
|
|
70
70
|
|
|
71
71
|
<script setup>
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div
|
|
4
|
-
v-if="options.isEnabledSearch"
|
|
5
|
-
class="mb-4 flex justify-end"
|
|
6
|
-
>
|
|
7
|
-
<Input
|
|
8
|
-
v-model="q"
|
|
9
|
-
icon="i-heroicons-magnifying-glass"
|
|
10
|
-
:placeholder="options.searchPlaceholder || '\u0E04\u0E49\u0E19\u0E2B\u0E32...'"
|
|
11
|
-
/>
|
|
12
|
-
</div>
|
|
13
|
-
<Base
|
|
14
|
-
:raw-data="options.rawData"
|
|
15
|
-
:status="options.status"
|
|
16
|
-
:page-options="options.pageOptions"
|
|
17
|
-
:is-simple-pagination="isShowSimplePagination"
|
|
18
|
-
:is-hide-top-pagination="options.isHideTopPagination"
|
|
19
|
-
:is-hide-bottom-pagination="options.isHideBottomPagination"
|
|
20
|
-
:is-enable-infinite-scroll="options.isEnableInfiniteScroll"
|
|
21
|
-
:container-class="containerClass"
|
|
22
|
-
@page-change="onPageChange"
|
|
23
|
-
>
|
|
24
|
-
<template
|
|
25
|
-
v-for="(_, slot) of $slots"
|
|
26
|
-
#[slot]="slotProps"
|
|
27
|
-
>
|
|
28
|
-
<slot
|
|
29
|
-
:name="slot"
|
|
30
|
-
v-bind="slotProps || {}"
|
|
31
|
-
/>
|
|
32
|
-
</template>
|
|
33
|
-
</Base>
|
|
34
|
-
</div>
|
|
2
|
+
<div>
|
|
3
|
+
<div
|
|
4
|
+
v-if="options.isEnabledSearch"
|
|
5
|
+
class="mb-4 flex justify-end"
|
|
6
|
+
>
|
|
7
|
+
<Input
|
|
8
|
+
v-model="q"
|
|
9
|
+
icon="i-heroicons-magnifying-glass"
|
|
10
|
+
:placeholder="options.searchPlaceholder || '\u0E04\u0E49\u0E19\u0E2B\u0E32...'"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
<Base
|
|
14
|
+
:raw-data="options.rawData"
|
|
15
|
+
:status="options.status"
|
|
16
|
+
:page-options="options.pageOptions"
|
|
17
|
+
:is-simple-pagination="isShowSimplePagination"
|
|
18
|
+
:is-hide-top-pagination="options.isHideTopPagination"
|
|
19
|
+
:is-hide-bottom-pagination="options.isHideBottomPagination"
|
|
20
|
+
:is-enable-infinite-scroll="options.isEnableInfiniteScroll"
|
|
21
|
+
:container-class="containerClass"
|
|
22
|
+
@page-change="onPageChange"
|
|
23
|
+
>
|
|
24
|
+
<template
|
|
25
|
+
v-for="(_, slot) of $slots"
|
|
26
|
+
#[slot]="slotProps"
|
|
27
|
+
>
|
|
28
|
+
<slot
|
|
29
|
+
:name="slot"
|
|
30
|
+
v-bind="slotProps || {}"
|
|
31
|
+
/>
|
|
32
|
+
</template>
|
|
33
|
+
</Base>
|
|
34
|
+
</div>
|
|
35
35
|
</template>
|
|
36
36
|
|
|
37
37
|
<script setup>
|