@finema/core 3.23.2 → 3.24.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 +22 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -14
- package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
- package/dist/runtime/components/Dialog/index.vue +11 -10
- package/dist/runtime/components/Empty.d.vue.ts +1 -1
- package/dist/runtime/components/Empty.vue +16 -12
- package/dist/runtime/components/Empty.vue.d.ts +1 -1
- package/dist/runtime/components/FlexDeck/index.vue +85 -92
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
- package/dist/runtime/components/Form/Fields.vue +17 -11
- package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputCheckbox/index.vue +19 -23
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +1 -5
- package/dist/runtime/components/Form/InputCurrency/index.vue +56 -57
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +2 -0
- package/dist/runtime/components/Form/InputDateTime/index.vue +70 -80
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +78 -75
- package/dist/runtime/components/Form/InputMonth/index.vue +7 -10
- package/dist/runtime/components/Form/InputNumber/index.vue +21 -25
- package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
- package/dist/runtime/components/Form/InputRadio/index.vue +1 -5
- package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputRating/index.vue +1 -5
- package/dist/runtime/components/Form/InputSearch/index.vue +2 -8
- package/dist/runtime/components/Form/InputSelect/index.vue +112 -122
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +121 -133
- package/dist/runtime/components/Form/InputTags/index.vue +55 -59
- package/dist/runtime/components/Form/InputText/index.vue +122 -133
- package/dist/runtime/components/Form/InputTextarea/index.vue +19 -23
- package/dist/runtime/components/Form/InputTime/index.vue +63 -63
- package/dist/runtime/components/Form/InputToggle/index.vue +18 -21
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +46 -49
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +57 -64
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +21 -19
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +85 -87
- package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +178 -157
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +34 -36
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +74 -78
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/fileState/SuccessState.vue +3 -12
- package/dist/runtime/components/Form/fileState/useFileState.js +2 -10
- package/dist/runtime/components/Form/fileState/useUploadImageState.js +1 -3
- package/dist/runtime/components/Form/fileState/useUploadState.js +8 -19
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +25 -30
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +22 -28
- package/dist/runtime/components/Loader.d.vue.ts +1 -1
- package/dist/runtime/components/Loader.vue +10 -7
- package/dist/runtime/components/Loader.vue.d.ts +1 -1
- package/dist/runtime/components/Log/LogItem.vue +1 -3
- package/dist/runtime/components/Log/index.vue +1 -3
- package/dist/runtime/components/Table/Base.vue +117 -137
- 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/ColumnText.vue +10 -10
- package/dist/runtime/components/Table/Pagination.vue +71 -77
- package/dist/runtime/components/Table/Simple.vue +19 -19
- package/dist/runtime/components/Table/index.vue +36 -42
- package/dist/runtime/composables/loaderList.js +1 -3
- package/dist/runtime/composables/loaderPage.js +156 -133
- package/dist/runtime/composables/useConfig.js +1 -1
- package/dist/runtime/composables/useDialog.js +1 -3
- package/dist/runtime/composables/useForm.d.ts +1 -1
- package/dist/runtime/composables/useForm.js +1 -3
- package/dist/runtime/composables/useTable.js +2 -14
- package/dist/runtime/helpers/apiBaseHelper.js +6 -24
- package/dist/runtime/helpers/apiListHelper.js +2 -5
- package/dist/runtime/helpers/apiObjectHelper.js +2 -5
- package/dist/runtime/helpers/apiPageHelper.js +19 -38
- package/dist/runtime/helpers/componentHelper.js +2 -6
- package/dist/runtime/helpers/uploadCore.js +1 -4
- package/dist/runtime/locale/index.js +1 -4
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/styles/main.css +1 -1
- package/package.json +39 -26
package/README.md
CHANGED
|
@@ -7,6 +7,23 @@
|
|
|
7
7
|
|
|
8
8
|
> Enterprise-grade Vue.js UI component library for Nuxt applications
|
|
9
9
|
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 🚀 Starting a new project? Use the starter template
|
|
13
|
+
|
|
14
|
+
> [!TIP]
|
|
15
|
+
> **Don't set it up by hand: start from the template.** It's a Nuxt 3 project with `@finema/core` already installed and configured.
|
|
16
|
+
>
|
|
17
|
+
> ### 👉 [gitlab.finema.co/finema/shared/nuxt3-template-with-uikit](https://gitlab.finema.co/finema/shared/nuxt3-template-with-uikit)
|
|
18
|
+
>
|
|
19
|
+
> ```bash
|
|
20
|
+
> git clone https://gitlab.finema.co/finema/shared/nuxt3-template-with-uikit.git my-app
|
|
21
|
+
> ```
|
|
22
|
+
|
|
23
|
+
Adding the kit to an **existing** project instead? See [Installation](#-installation) below.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
10
27
|
A comprehensive, production-ready UI kit that provides 20+ auto-registered components, composables, and utilities for building consistent and beautiful user interfaces. Designed specifically for Nuxt 3 with TypeScript support, automatic validation, and seamless theming.
|
|
11
28
|
|
|
12
29
|
## ✨ Features
|
|
@@ -24,6 +41,7 @@ A comprehensive, production-ready UI kit that provides 20+ auto-registered compo
|
|
|
24
41
|
## 📋 Quick Links
|
|
25
42
|
|
|
26
43
|
- [📖 Getting Started Guide](./docs/getting-started.md) - Complete setup and usage guide
|
|
44
|
+
- [🚀 **Starter Template**](https://gitlab.finema.co/finema/shared/nuxt3-template-with-uikit) - Nuxt 3 project template with the kit pre-configured
|
|
27
45
|
- [🎮 Playground Examples](./playground/) - Live examples and demos
|
|
28
46
|
- [📚 Component Documentation](./docs/components/) - Detailed component API
|
|
29
47
|
- [🔧 Composables Guide](./docs/composables/) - Available utilities and helpers
|
|
@@ -362,14 +380,16 @@ bun run dev:build # Build playground
|
|
|
362
380
|
bun run dev:prepare # Prepare development environment
|
|
363
381
|
|
|
364
382
|
# Quality
|
|
365
|
-
bun run
|
|
383
|
+
bun run check # oxfmt --check + oxlint + nuxt-oxclint check-vue (rules from @finema/nuxt-oxclint)
|
|
384
|
+
bun run lint # oxlint only
|
|
366
385
|
bun run lint:fix # Fix linting issues
|
|
386
|
+
bun run format # oxfmt, writes in place
|
|
367
387
|
bun run test # Run tests
|
|
368
388
|
bun run test:watch # Run tests in watch mode
|
|
369
389
|
bun run test:types # Type checking
|
|
370
390
|
|
|
371
391
|
# Release
|
|
372
|
-
bun run release # Create new release (
|
|
392
|
+
bun run release # Create new release (check, test, build, publish)
|
|
373
393
|
```
|
|
374
394
|
|
|
375
395
|
## 📚 Documentation
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import * as lodash from 'lodash-es';
|
|
|
4
4
|
import * as theme from '../dist/runtime/theme/index.js';
|
|
5
5
|
|
|
6
6
|
const name = "@finema/core";
|
|
7
|
-
const version = "3.
|
|
7
|
+
const version = "3.24.0";
|
|
8
8
|
|
|
9
9
|
const nuxtAppOptions = {
|
|
10
10
|
head: {
|
|
@@ -81,16 +81,7 @@ const module$1 = defineNuxtModule({
|
|
|
81
81
|
defaults: {
|
|
82
82
|
prefix: "",
|
|
83
83
|
theme: {
|
|
84
|
-
colors: [
|
|
85
|
-
"primary",
|
|
86
|
-
"secondary",
|
|
87
|
-
"tertiary",
|
|
88
|
-
"info",
|
|
89
|
-
"success",
|
|
90
|
-
"warning",
|
|
91
|
-
"error",
|
|
92
|
-
"white"
|
|
93
|
-
]
|
|
84
|
+
colors: ["primary", "secondary", "tertiary", "info", "success", "warning", "error", "white"]
|
|
94
85
|
}
|
|
95
86
|
}
|
|
96
87
|
},
|
|
@@ -103,9 +94,7 @@ const module$1 = defineNuxtModule({
|
|
|
103
94
|
},
|
|
104
95
|
defaults: {},
|
|
105
96
|
async setup(_options, _nuxt) {
|
|
106
|
-
const {
|
|
107
|
-
resolve
|
|
108
|
-
} = createResolver(import.meta.url);
|
|
97
|
+
const { resolve } = createResolver(import.meta.url);
|
|
109
98
|
const runtimeDir = resolve("./runtime");
|
|
110
99
|
_nuxt.options.build.transpile.push(runtimeDir);
|
|
111
100
|
_nuxt.options.alias["#core"] = runtimeDir;
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
v-show="isShowDevTools"
|
|
4
4
|
ref="devToolsRef"
|
|
5
|
-
class="
|
|
6
|
-
fixed z-50 overflow-hidden rounded-lg border border-neutral-300 bg-white
|
|
7
|
-
opacity-80 shadow-2xl
|
|
8
|
-
"
|
|
5
|
+
class="fixed z-50 overflow-hidden rounded-lg border border-neutral-300 bg-white opacity-80 shadow-2xl"
|
|
9
6
|
:style="devToolsDynamicStyles"
|
|
10
7
|
>
|
|
11
8
|
<!-- Draggable Title Bar -->
|
|
@@ -85,9 +82,7 @@
|
|
|
85
82
|
</div>
|
|
86
83
|
|
|
87
84
|
<!-- Toggle button for this DevToolsWindow -->
|
|
88
|
-
<div
|
|
89
|
-
class="fixed right-1 bottom-1 z-[99999]"
|
|
90
|
-
>
|
|
85
|
+
<div class="fixed right-1 bottom-1 z-[99999]">
|
|
91
86
|
<Button
|
|
92
87
|
:icon="isShowDevTools ? 'heroicons:x-mark' : 'heroicons:information-circle'"
|
|
93
88
|
color="info"
|
|
@@ -214,14 +209,7 @@ const handleResizeStart = (handle, event) => {
|
|
|
214
209
|
};
|
|
215
210
|
const handleResizeMove = (event) => {
|
|
216
211
|
if (!isResizing.value || !devToolsRef.value || !activeResizeHandle.value) return;
|
|
217
|
-
const {
|
|
218
|
-
width,
|
|
219
|
-
height,
|
|
220
|
-
top,
|
|
221
|
-
left,
|
|
222
|
-
mouseX,
|
|
223
|
-
mouseY
|
|
224
|
-
} = initialResizeState.value;
|
|
212
|
+
const { width, height, top, left, mouseX, mouseY } = initialResizeState.value;
|
|
225
213
|
const deltaX = event.clientX - mouseX;
|
|
226
214
|
const deltaY = event.clientY - mouseY;
|
|
227
215
|
let newWidth = width;
|
|
@@ -278,33 +266,43 @@ const resetDevToolsState = () => {
|
|
|
278
266
|
...DEFAULT_POSITION
|
|
279
267
|
};
|
|
280
268
|
Object.keys(newStyles).forEach((key) => {
|
|
269
|
+
;
|
|
281
270
|
devToolsRef.value.style[key] = newStyles[key];
|
|
282
271
|
});
|
|
283
272
|
if (newStyles.top === "auto") {
|
|
273
|
+
;
|
|
284
274
|
devToolsRef.value.style.bottom = newStyles.bottom;
|
|
285
275
|
} else {
|
|
276
|
+
;
|
|
286
277
|
devToolsRef.value.style.bottom = "auto";
|
|
287
278
|
}
|
|
288
279
|
if (newStyles.left === "auto") {
|
|
280
|
+
;
|
|
289
281
|
devToolsRef.value.style.right = newStyles.right;
|
|
290
282
|
} else {
|
|
283
|
+
;
|
|
291
284
|
devToolsRef.value.style.right = "auto";
|
|
292
285
|
}
|
|
293
286
|
}
|
|
294
287
|
};
|
|
295
288
|
onMounted(() => {
|
|
296
|
-
watch(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
289
|
+
watch(
|
|
290
|
+
isShowDevTools,
|
|
291
|
+
(newValue) => {
|
|
292
|
+
if (newValue && devToolsRef.value) {
|
|
293
|
+
const currentStyle = devToolsDynamicStyles.value;
|
|
294
|
+
Object.keys(currentStyle).forEach((key) => {
|
|
295
|
+
if (devToolsRef.value) {
|
|
296
|
+
;
|
|
297
|
+
devToolsRef.value.style[key] = currentStyle[key] ?? "";
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
immediate: true
|
|
304
304
|
}
|
|
305
|
-
|
|
306
|
-
immediate: true
|
|
307
|
-
});
|
|
305
|
+
);
|
|
308
306
|
});
|
|
309
307
|
onUnmounted(() => {
|
|
310
308
|
if (isDragging.value) handleDragEnd();
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
<AlertDialogRoot :open="true">
|
|
3
3
|
<AlertDialogPortal>
|
|
4
4
|
<AlertDialogOverlay :class="theme.overlay()" />
|
|
5
|
-
<AlertDialogContent
|
|
6
|
-
:class="theme.base()"
|
|
7
|
-
>
|
|
5
|
+
<AlertDialogContent :class="theme.base()">
|
|
8
6
|
<div :class="theme.iconWrapper()">
|
|
9
7
|
<Icon
|
|
10
8
|
v-if="!propsSafe.isHideIcon"
|
|
@@ -68,9 +66,7 @@ import { useCoreMessages } from "#core/composables/useMessages";
|
|
|
68
66
|
const emits = defineEmits();
|
|
69
67
|
const props = defineProps();
|
|
70
68
|
const attrs = useAttrs();
|
|
71
|
-
const {
|
|
72
|
-
messages
|
|
73
|
-
} = useCoreMessages();
|
|
69
|
+
const { messages } = useCoreMessages();
|
|
74
70
|
const icons = useUiIconConfig("dialog");
|
|
75
71
|
const propsSafe = computed(() => {
|
|
76
72
|
const source = props.title ? props : attrs;
|
|
@@ -99,8 +95,13 @@ const getIcon = computed(() => {
|
|
|
99
95
|
return icons.iconInfo;
|
|
100
96
|
}
|
|
101
97
|
});
|
|
102
|
-
const theme = computed(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
const theme = computed(
|
|
99
|
+
() => useUiConfig(
|
|
100
|
+
dialogTheme,
|
|
101
|
+
"dialog"
|
|
102
|
+
)({
|
|
103
|
+
color: propsSafe.value.type,
|
|
104
|
+
confirm: propsSafe.value.isConfirm
|
|
105
|
+
})
|
|
106
|
+
);
|
|
106
107
|
</script>
|
|
@@ -2,7 +2,7 @@ import { emptyTheme } from '#core/theme/empty';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
message?: any;
|
|
4
4
|
icon?: string;
|
|
5
|
-
ui?: typeof emptyTheme['slots'];
|
|
5
|
+
ui?: (typeof emptyTheme)['slots'];
|
|
6
6
|
class?: any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
:class="
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
:class="
|
|
4
|
+
theme.base({
|
|
5
|
+
class: [ui?.base, props.class]
|
|
6
|
+
})
|
|
7
|
+
"
|
|
6
8
|
>
|
|
7
9
|
<Icon
|
|
8
10
|
:name="icon"
|
|
9
|
-
:class="
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
:class="
|
|
12
|
+
theme.iconSize({
|
|
13
|
+
class: [ui?.iconSize]
|
|
14
|
+
})
|
|
15
|
+
"
|
|
12
16
|
/>
|
|
13
17
|
<p
|
|
14
|
-
:class="
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
:class="
|
|
19
|
+
theme.message({
|
|
20
|
+
class: [ui?.message]
|
|
21
|
+
})
|
|
22
|
+
"
|
|
17
23
|
v-html="message ?? messages.common.empty"
|
|
18
24
|
/>
|
|
19
25
|
</div>
|
|
@@ -31,7 +37,5 @@ const props = defineProps({
|
|
|
31
37
|
class: { type: null, required: false }
|
|
32
38
|
});
|
|
33
39
|
const theme = computed(() => useUiConfig(emptyTheme, "empty")());
|
|
34
|
-
const {
|
|
35
|
-
messages
|
|
36
|
-
} = useCoreMessages();
|
|
40
|
+
const { messages } = useCoreMessages();
|
|
37
41
|
</script>
|
|
@@ -2,7 +2,7 @@ import { emptyTheme } from '#core/theme/empty';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
message?: any;
|
|
4
4
|
icon?: string;
|
|
5
|
-
ui?: typeof emptyTheme['slots'];
|
|
5
|
+
ui?: (typeof emptyTheme)['slots'];
|
|
6
6
|
class?: any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
@@ -1,84 +1,78 @@
|
|
|
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 || messages.common.search"
|
|
11
|
-
/>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<div
|
|
15
|
-
v-if="options.pageOptions && options.isEnableInfiniteScroll"
|
|
16
|
-
class="mb-4 flex items-center justify-end"
|
|
17
|
-
>
|
|
18
|
-
<p class="text-xs text-gray-500">
|
|
19
|
-
{{ totalInnerRawData }} {{ messages.pagination.itemsOfTotal }}
|
|
20
|
-
{{
|
|
21
|
-
</p>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<slot
|
|
25
|
-
v-if="options.status.isSuccess && options.rawData.length === 0"
|
|
26
|
-
name="empty-state"
|
|
27
|
-
>
|
|
28
|
-
<Empty />
|
|
29
|
-
</slot>
|
|
30
|
-
|
|
31
|
-
<slot
|
|
32
|
-
v-else-if="options.status.isLoading"
|
|
33
|
-
name="loading-state"
|
|
34
|
-
>
|
|
35
|
-
<Loader
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
:items-per-page="options.pageOptions.limit"
|
|
77
|
-
:total="options.pageOptions.totalCount"
|
|
78
|
-
@update:page="onPageChange"
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
</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 || messages.common.search"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
v-if="options.pageOptions && options.isEnableInfiniteScroll"
|
|
16
|
+
class="mb-4 flex items-center justify-end"
|
|
17
|
+
>
|
|
18
|
+
<p class="text-xs text-gray-500">
|
|
19
|
+
{{ totalInnerRawData }} {{ messages.pagination.itemsOfTotal }} {{ totalCountWithComma }}
|
|
20
|
+
{{ messages.pagination.items }}
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<slot
|
|
25
|
+
v-if="options.status.isSuccess && options.rawData.length === 0"
|
|
26
|
+
name="empty-state"
|
|
27
|
+
>
|
|
28
|
+
<Empty />
|
|
29
|
+
</slot>
|
|
30
|
+
|
|
31
|
+
<slot
|
|
32
|
+
v-else-if="options.status.isLoading"
|
|
33
|
+
name="loading-state"
|
|
34
|
+
>
|
|
35
|
+
<Loader :loading="true" />
|
|
36
|
+
</slot>
|
|
37
|
+
<slot
|
|
38
|
+
v-else-if="options.status.isError"
|
|
39
|
+
name="error-state"
|
|
40
|
+
>
|
|
41
|
+
<div class="flex h-[200px] items-center justify-center text-2xl text-error-400">
|
|
42
|
+
{{ StringHelper.getError(options.status.errorData) }}
|
|
43
|
+
</div>
|
|
44
|
+
</slot>
|
|
45
|
+
|
|
46
|
+
<div
|
|
47
|
+
v-else
|
|
48
|
+
:class="containerClass"
|
|
49
|
+
>
|
|
50
|
+
<slot
|
|
51
|
+
v-for="(row, index) in displayData"
|
|
52
|
+
:key="index"
|
|
53
|
+
:row="row"
|
|
54
|
+
/>
|
|
55
|
+
<div ref="bottomEdgeElement" />
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div
|
|
59
|
+
v-if="options.pageOptions && !options.isEnableInfiniteScroll && !options.isHidePagination"
|
|
60
|
+
class="mt-4 flex justify-between px-3"
|
|
61
|
+
>
|
|
62
|
+
<p class="text-xs text-gray-500">
|
|
63
|
+
{{ pageBetween }} {{ messages.pagination.itemsOfTotal }} {{ totalCountWithComma }}
|
|
64
|
+
{{ messages.pagination.items }}
|
|
65
|
+
</p>
|
|
66
|
+
<Pagination
|
|
67
|
+
v-if="options.pageOptions.totalPage > 1"
|
|
68
|
+
:to="options.isRouteChange ? to : void 0"
|
|
69
|
+
:default-page="options.pageOptions?.currentPage || 1"
|
|
70
|
+
:items-per-page="options.pageOptions.limit"
|
|
71
|
+
:total="options.pageOptions.totalCount"
|
|
72
|
+
@update:page="onPageChange"
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
82
76
|
</template>
|
|
83
77
|
|
|
84
78
|
<script setup>
|
|
@@ -115,9 +109,7 @@ const displayData = computed(() => {
|
|
|
115
109
|
const to = (page2) => {
|
|
116
110
|
const params = props.options?.pageOptions?.request?.params || {};
|
|
117
111
|
const cleanParams = Object.fromEntries(
|
|
118
|
-
Object.entries(params).filter(
|
|
119
|
-
([key, value]) => value !== null && value !== void 0 && value !== ""
|
|
120
|
-
)
|
|
112
|
+
Object.entries(params).filter(([key, value]) => value !== null && value !== void 0 && value !== "")
|
|
121
113
|
);
|
|
122
114
|
return {
|
|
123
115
|
query: {
|
|
@@ -126,12 +118,15 @@ const to = (page2) => {
|
|
|
126
118
|
}
|
|
127
119
|
};
|
|
128
120
|
};
|
|
129
|
-
useWatchChange(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
121
|
+
useWatchChange(
|
|
122
|
+
() => props.options?.pageOptions?.request?.params,
|
|
123
|
+
() => {
|
|
124
|
+
if (props.options?.isRouteChange) return;
|
|
125
|
+
router.replace({
|
|
126
|
+
query: props.options?.pageOptions?.request?.params || {}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
);
|
|
135
130
|
const pageBetween = computed(() => {
|
|
136
131
|
const length = props.options.rawData?.length;
|
|
137
132
|
if (length === 0) {
|
|
@@ -178,7 +173,5 @@ watch(targetElement, (value) => {
|
|
|
178
173
|
const onPageChange = (page2) => {
|
|
179
174
|
emits("pageChange", page2);
|
|
180
175
|
};
|
|
181
|
-
const {
|
|
182
|
-
messages
|
|
183
|
-
} = useCoreMessages();
|
|
176
|
+
const { messages } = useCoreMessages();
|
|
184
177
|
</script>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FormField
|
|
3
|
-
:label="label"
|
|
4
|
-
:name="name"
|
|
5
|
-
:description="description"
|
|
6
|
-
:hint="hint"
|
|
7
|
-
:data-testid="name"
|
|
8
|
-
:help="help"
|
|
9
|
-
:error="errorMessage"
|
|
10
|
-
:required="!!required"
|
|
11
|
-
:ui="containerUi"
|
|
12
|
-
>
|
|
13
|
-
<slot />
|
|
14
|
-
</FormField>
|
|
2
|
+
<FormField
|
|
3
|
+
:label="label"
|
|
4
|
+
:name="name"
|
|
5
|
+
:description="description"
|
|
6
|
+
:hint="hint"
|
|
7
|
+
:data-testid="name"
|
|
8
|
+
:help="help"
|
|
9
|
+
:error="errorMessage"
|
|
10
|
+
:required="!!required"
|
|
11
|
+
:ui="containerUi"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</FormField>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script setup>
|
|
@@ -6,7 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
options: IFormField[];
|
|
7
7
|
orientation?: 'horizontal' | 'vertical';
|
|
8
8
|
class?: any;
|
|
9
|
-
ui?: typeof formTheme['slots'];
|
|
9
|
+
ui?: (typeof formTheme)['slots'];
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
12
|
orientation: "horizontal" | "vertical";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
:class="[
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
:class="[
|
|
4
|
+
theme.base({
|
|
5
|
+
class: [$props.class, ui?.base]
|
|
6
|
+
})
|
|
7
|
+
]"
|
|
6
8
|
>
|
|
7
9
|
<component
|
|
8
10
|
:is="componentMap[option.type]?.component"
|
|
@@ -50,7 +52,9 @@ const FormInputTime = defineAsyncComponent(() => import("./InputTime/index.vue")
|
|
|
50
52
|
const FormInputMonth = defineAsyncComponent(() => import("./InputMonth/index.vue"));
|
|
51
53
|
const FormInputDateTimeRange = defineAsyncComponent(() => import("./InputDateTimeRange/index.vue"));
|
|
52
54
|
const FormInputUploadDropzoneAuto = defineAsyncComponent(() => import("./InputUploadDropzoneAuto/index.vue"));
|
|
53
|
-
const FormInputUploadDropzoneAutoMultiple = defineAsyncComponent(
|
|
55
|
+
const FormInputUploadDropzoneAutoMultiple = defineAsyncComponent(
|
|
56
|
+
() => import("./InputUploadDropzoneAutoMultiple/index.vue")
|
|
57
|
+
);
|
|
54
58
|
const FormInputUploadDropzone = defineAsyncComponent(() => import("./InputUploadDropzone/index.vue"));
|
|
55
59
|
const FormInputUploadImageAuto = defineAsyncComponent(() => import("./InputUploadImageAuto/index.vue"));
|
|
56
60
|
const FormInputWYSIWYG = defineAsyncComponent(() => import("./InputWYSIWYG/index.vue"));
|
|
@@ -179,14 +183,16 @@ const componentMap = {
|
|
|
179
183
|
props: {}
|
|
180
184
|
}
|
|
181
185
|
};
|
|
182
|
-
const theme = computed(
|
|
183
|
-
|
|
184
|
-
|
|
186
|
+
const theme = computed(
|
|
187
|
+
() => useUiConfig(
|
|
188
|
+
formTheme,
|
|
189
|
+
"form"
|
|
190
|
+
)({
|
|
191
|
+
orientation: props.orientation
|
|
192
|
+
})
|
|
193
|
+
);
|
|
185
194
|
const getFieldBinding = (field) => {
|
|
186
|
-
const {
|
|
187
|
-
props: fieldProps,
|
|
188
|
-
ui: fieldUi
|
|
189
|
-
} = field;
|
|
195
|
+
const { props: fieldProps, ui: fieldUi } = field;
|
|
190
196
|
const allProps = {
|
|
191
197
|
...fieldProps,
|
|
192
198
|
containerUi: {
|
|
@@ -6,7 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
options: IFormField[];
|
|
7
7
|
orientation?: 'horizontal' | 'vertical';
|
|
8
8
|
class?: any;
|
|
9
|
-
ui?: typeof formTheme['slots'];
|
|
9
|
+
ui?: (typeof formTheme)['slots'];
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
12
|
orientation: "horizontal" | "vertical";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FieldWrapper
|
|
3
|
-
v-bind="wrapperProps"
|
|
4
|
-
label=""
|
|
5
|
-
description=""
|
|
6
|
-
>
|
|
7
|
-
<Checkbox
|
|
8
|
-
:model-value="value"
|
|
9
|
-
:disabled="wrapperProps.disabled"
|
|
10
|
-
:name="name"
|
|
11
|
-
:label="label"
|
|
12
|
-
:description="description"
|
|
13
|
-
:required="required"
|
|
14
|
-
:variant="variant"
|
|
15
|
-
:indicator="indicator"
|
|
16
|
-
:ui="ui"
|
|
17
|
-
@update:modelValue="onChange"
|
|
18
|
-
/>
|
|
19
|
-
</FieldWrapper>
|
|
2
|
+
<FieldWrapper
|
|
3
|
+
v-bind="wrapperProps"
|
|
4
|
+
label=""
|
|
5
|
+
description=""
|
|
6
|
+
>
|
|
7
|
+
<Checkbox
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:disabled="wrapperProps.disabled"
|
|
10
|
+
:name="name"
|
|
11
|
+
:label="label"
|
|
12
|
+
:description="description"
|
|
13
|
+
:required="required"
|
|
14
|
+
:variant="variant"
|
|
15
|
+
:indicator="indicator"
|
|
16
|
+
:ui="ui"
|
|
17
|
+
@update:modelValue="onChange"
|
|
18
|
+
/>
|
|
19
|
+
</FieldWrapper>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
@@ -42,11 +42,7 @@ const props = defineProps({
|
|
|
42
42
|
ui: { type: null, required: false },
|
|
43
43
|
containerUi: { type: null, required: false }
|
|
44
44
|
});
|
|
45
|
-
const {
|
|
46
|
-
value,
|
|
47
|
-
wrapperProps,
|
|
48
|
-
handleChange
|
|
49
|
-
} = useFieldHOC(props);
|
|
45
|
+
const { value, wrapperProps, handleChange } = useFieldHOC(props);
|
|
50
46
|
const onChange = (value2) => {
|
|
51
47
|
handleChange(value2);
|
|
52
48
|
emits("change", value2);
|
|
@@ -48,11 +48,7 @@ const props = defineProps({
|
|
|
48
48
|
ui: { type: null, required: false },
|
|
49
49
|
containerUi: { type: null, required: false }
|
|
50
50
|
});
|
|
51
|
-
const {
|
|
52
|
-
value,
|
|
53
|
-
wrapperProps,
|
|
54
|
-
handleChange
|
|
55
|
-
} = useFieldHOC(props);
|
|
51
|
+
const { value, wrapperProps, handleChange } = useFieldHOC(props);
|
|
56
52
|
const onChange = (value2) => {
|
|
57
53
|
handleChange(value2);
|
|
58
54
|
emits("change", value2);
|