@finema/core 1.3.39 → 1.4.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/dist/module.json +1 -1
- package/dist/module.mjs +37 -6
- package/dist/runtime/components/Alert.vue +49 -0
- package/dist/runtime/components/Button/Group.vue +5 -15
- package/dist/runtime/components/Button/index.vue +9 -58
- package/dist/runtime/ui.config/alert.d.ts +3 -0
- package/dist/runtime/ui.config/alert.mjs +6 -0
- package/dist/runtime/ui.config/button.d.ts +3 -1
- package/dist/runtime/ui.config/button.mjs +0 -2
- package/dist/runtime/ui.config/buttonGroup.d.ts +3 -1
- package/dist/runtime/ui.config/buttonGroup.mjs +1 -8
- package/package.json +3 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, installModule, addPlugin, addComponen
|
|
|
2
2
|
import { merge } from 'lodash-es';
|
|
3
3
|
|
|
4
4
|
const name = "@finema/core";
|
|
5
|
-
const version = "1.
|
|
5
|
+
const version = "1.4.1";
|
|
6
6
|
|
|
7
7
|
const colors = {
|
|
8
8
|
black: "#20243E",
|
|
@@ -43,7 +43,7 @@ const colors = {
|
|
|
43
43
|
},
|
|
44
44
|
danger: {
|
|
45
45
|
DEFAULT: "#F25555",
|
|
46
|
-
50: "#
|
|
46
|
+
50: "#FF808E",
|
|
47
47
|
100: "#FF808E",
|
|
48
48
|
400: "#FF808E",
|
|
49
49
|
500: "#F25555",
|
|
@@ -51,7 +51,7 @@ const colors = {
|
|
|
51
51
|
},
|
|
52
52
|
success: {
|
|
53
53
|
DEFAULT: "#3FB061",
|
|
54
|
-
50: "#
|
|
54
|
+
50: "#E7F8D7",
|
|
55
55
|
100: "#C6F2D3",
|
|
56
56
|
400: "#C6F2D3",
|
|
57
57
|
500: "#3FB061",
|
|
@@ -59,7 +59,7 @@ const colors = {
|
|
|
59
59
|
},
|
|
60
60
|
warning: {
|
|
61
61
|
DEFAULT: "#FF9A35",
|
|
62
|
-
50: "#
|
|
62
|
+
50: "#FFC061",
|
|
63
63
|
100: "#FFC061",
|
|
64
64
|
400: "#FFC061",
|
|
65
65
|
500: "#FF9A35",
|
|
@@ -164,6 +164,24 @@ const table = {
|
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
+
const alert = {
|
|
168
|
+
default: {
|
|
169
|
+
variant: "soft",
|
|
170
|
+
color: "primary"
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const button = {
|
|
175
|
+
default: {
|
|
176
|
+
size: "md",
|
|
177
|
+
variant: "solid",
|
|
178
|
+
color: "primary",
|
|
179
|
+
loadingIcon: "i-heroicons-arrow-path-20-solid"
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const buttonGroup = {};
|
|
184
|
+
|
|
167
185
|
const module = defineNuxtModule({
|
|
168
186
|
meta: {
|
|
169
187
|
name,
|
|
@@ -195,10 +213,15 @@ const module = defineNuxtModule({
|
|
|
195
213
|
...colors
|
|
196
214
|
};
|
|
197
215
|
});
|
|
198
|
-
await installModule("@nuxt/ui"
|
|
216
|
+
await installModule("@nuxt/ui", {
|
|
217
|
+
safelistColors: ["secondary", "success", "info", "danger", "warning"]
|
|
218
|
+
});
|
|
199
219
|
nuxt.options.appConfig.ui = _merge(nuxt.options.appConfig.ui || {}, {
|
|
200
220
|
table,
|
|
201
|
-
pagination
|
|
221
|
+
pagination,
|
|
222
|
+
alert,
|
|
223
|
+
button,
|
|
224
|
+
buttonGroup
|
|
202
225
|
});
|
|
203
226
|
nuxt.options.appConfig.ui.strategy = "override";
|
|
204
227
|
nuxt.options.runtimeConfig = _deepMerge(
|
|
@@ -265,6 +288,14 @@ const module = defineNuxtModule({
|
|
|
265
288
|
},
|
|
266
289
|
nuxt.options.app
|
|
267
290
|
);
|
|
291
|
+
nuxt.options.colorMode = _deepMerge(
|
|
292
|
+
{},
|
|
293
|
+
{
|
|
294
|
+
preference: "light"
|
|
295
|
+
},
|
|
296
|
+
nuxt.options.colorMode
|
|
297
|
+
);
|
|
298
|
+
nuxt.options.devtools = _deepMerge({}, { enabled: true }, nuxt.options.devtools);
|
|
268
299
|
await installModule("@pinia/nuxt");
|
|
269
300
|
await installModule("@vee-validate/nuxt", {
|
|
270
301
|
// disable or enable auto imports
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UAlert v-bind="$props">
|
|
3
|
+
<template #title><slot name="title" :title="title" /></template>
|
|
4
|
+
<template #description><slot name="description" :description="description" /></template>
|
|
5
|
+
</UAlert>
|
|
6
|
+
</template>
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { type PropType } from 'vue'
|
|
9
|
+
import { type AlertColor, type AlertVariant, type Avatar, type Button } from '#ui/types'
|
|
10
|
+
import type { Strategy } from '#core/types/utils'
|
|
11
|
+
import { type alert } from '#ui/ui.config'
|
|
12
|
+
|
|
13
|
+
defineProps({
|
|
14
|
+
title: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
description: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: null,
|
|
21
|
+
},
|
|
22
|
+
icon: {
|
|
23
|
+
type: String,
|
|
24
|
+
},
|
|
25
|
+
avatar: {
|
|
26
|
+
type: Object as PropType<Avatar>,
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
closeButton: {
|
|
30
|
+
type: Object as PropType<Button>,
|
|
31
|
+
},
|
|
32
|
+
actions: {
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
34
|
+
type: Array as PropType<Array<Button & { click?: Function }>>,
|
|
35
|
+
},
|
|
36
|
+
color: {
|
|
37
|
+
type: String as PropType<AlertColor>,
|
|
38
|
+
},
|
|
39
|
+
variant: {
|
|
40
|
+
type: String as PropType<AlertVariant>,
|
|
41
|
+
},
|
|
42
|
+
class: {
|
|
43
|
+
type: [String, Object, Array] as PropType<any>,
|
|
44
|
+
},
|
|
45
|
+
ui: {
|
|
46
|
+
type: Object as PropType<Partial<typeof alert> & { strategy?: Strategy }>,
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<UButtonGroup
|
|
3
|
-
v-bind="attrs"
|
|
4
|
-
:class="$props.class"
|
|
5
|
-
:size="size"
|
|
6
|
-
:orientation="orientation"
|
|
7
|
-
:ui="ui"
|
|
8
|
-
>
|
|
2
|
+
<UButtonGroup v-bind="$props">
|
|
9
3
|
<slot />
|
|
10
4
|
</UButtonGroup>
|
|
11
5
|
</template>
|
|
12
6
|
|
|
13
7
|
<script lang="ts" setup>
|
|
14
|
-
import { type PropType
|
|
15
|
-
import { button, buttonGroup } from '#core/ui.config'
|
|
8
|
+
import { type PropType } from '#imports'
|
|
16
9
|
import { type ButtonSize } from '#ui/types/button'
|
|
17
10
|
import { type Strategy } from '#core/types/utils'
|
|
11
|
+
import { type buttonGroup, button } from '#ui/ui.config'
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const props = defineProps({
|
|
13
|
+
defineProps({
|
|
22
14
|
size: {
|
|
23
15
|
type: String as PropType<ButtonSize>,
|
|
24
16
|
default: () => button.default.size,
|
|
@@ -38,10 +30,8 @@ const props = defineProps({
|
|
|
38
30
|
default: undefined,
|
|
39
31
|
},
|
|
40
32
|
ui: {
|
|
41
|
-
type: Object as PropType<Partial<typeof
|
|
33
|
+
type: Object as PropType<Partial<typeof buttonGroup> & { strategy?: Strategy }>,
|
|
42
34
|
default: undefined,
|
|
43
35
|
},
|
|
44
36
|
})
|
|
45
|
-
|
|
46
|
-
const { ui, attrs } = useUI('buttonGroup', toRef(props, 'ui'), config, toRef(props, 'class'))
|
|
47
37
|
</script>
|
|
@@ -1,65 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<UButton
|
|
3
|
-
|
|
4
|
-
:class="$props.class"
|
|
5
|
-
:label="label"
|
|
6
|
-
:type="type"
|
|
7
|
-
:block="block"
|
|
8
|
-
:loading="loading"
|
|
9
|
-
:disabled="disabled"
|
|
10
|
-
:padded="padded"
|
|
11
|
-
:size="size"
|
|
12
|
-
:color="color"
|
|
13
|
-
:variant="variant"
|
|
14
|
-
:icon="icon"
|
|
15
|
-
:loading-icon="loadingIcon"
|
|
16
|
-
:leading-icon="leadingIcon"
|
|
17
|
-
:trailing-icon="trailingIcon"
|
|
18
|
-
:trailing="trailing"
|
|
19
|
-
:leading="leading"
|
|
20
|
-
:square="square"
|
|
21
|
-
:truncate="truncate"
|
|
22
|
-
:ui="ui"
|
|
23
|
-
>
|
|
24
|
-
<template #leading><slot name="leading" /></template>
|
|
25
|
-
|
|
2
|
+
<UButton v-bind="$props">
|
|
3
|
+
<template #leading><slot name="leading" :disabled="disabled" :loading="loading" /></template>
|
|
26
4
|
<slot />
|
|
27
|
-
<template #trailing><slot name="trailing" /></template>
|
|
5
|
+
<template #trailing><slot name="trailing" :disabled="disabled" :loading="loading" /></template>
|
|
28
6
|
</UButton>
|
|
29
7
|
</template>
|
|
30
8
|
|
|
31
9
|
<script lang="ts" setup>
|
|
32
|
-
import {
|
|
33
|
-
import { button } from '#core/ui.config'
|
|
10
|
+
import { type PropType } from '#imports'
|
|
34
11
|
import { type ButtonSize, type ButtonColor, type ButtonVariant } from '#ui/types/button'
|
|
35
12
|
import { type Strategy } from '#core/types/utils'
|
|
13
|
+
import { type button } from '#ui/ui.config'
|
|
14
|
+
import { UButton } from '#components'
|
|
36
15
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
defineOptions({
|
|
40
|
-
inheritAttrs: true,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const props = defineProps({
|
|
16
|
+
defineProps({
|
|
17
|
+
...UButton.props,
|
|
44
18
|
label: {
|
|
45
19
|
type: String,
|
|
46
|
-
default: '',
|
|
47
20
|
},
|
|
48
21
|
type: {
|
|
49
22
|
type: String as PropType<'button' | 'submit' | 'reset'>,
|
|
50
|
-
default: 'button',
|
|
51
23
|
},
|
|
52
24
|
block: {
|
|
53
25
|
type: Boolean,
|
|
54
|
-
default: false,
|
|
55
26
|
},
|
|
56
27
|
loading: {
|
|
57
28
|
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
29
|
},
|
|
60
30
|
disabled: {
|
|
61
31
|
type: Boolean,
|
|
62
|
-
default: false,
|
|
63
32
|
},
|
|
64
33
|
padded: {
|
|
65
34
|
type: Boolean,
|
|
@@ -67,60 +36,42 @@ const props = defineProps({
|
|
|
67
36
|
},
|
|
68
37
|
size: {
|
|
69
38
|
type: String as PropType<ButtonSize>,
|
|
70
|
-
default: () => button.default.size,
|
|
71
|
-
validator(value: string) {
|
|
72
|
-
return Object.keys(button.size).includes(value)
|
|
73
|
-
},
|
|
74
39
|
},
|
|
75
40
|
color: {
|
|
76
41
|
type: String as PropType<ButtonColor>,
|
|
77
|
-
default: () => button.default.color,
|
|
78
42
|
},
|
|
79
43
|
variant: {
|
|
80
44
|
type: String as PropType<ButtonVariant>,
|
|
81
|
-
default: () => button.default.variant,
|
|
82
45
|
},
|
|
83
46
|
loadingIcon: {
|
|
84
47
|
type: String,
|
|
85
|
-
default: () => button.default.loadingIcon,
|
|
86
48
|
},
|
|
87
49
|
icon: {
|
|
88
50
|
type: String,
|
|
89
|
-
default: null,
|
|
90
51
|
},
|
|
91
52
|
leadingIcon: {
|
|
92
53
|
type: String,
|
|
93
|
-
default: null,
|
|
94
54
|
},
|
|
95
55
|
trailingIcon: {
|
|
96
56
|
type: String,
|
|
97
|
-
default: null,
|
|
98
57
|
},
|
|
99
58
|
trailing: {
|
|
100
59
|
type: Boolean,
|
|
101
|
-
default: false,
|
|
102
60
|
},
|
|
103
61
|
leading: {
|
|
104
62
|
type: Boolean,
|
|
105
|
-
default: false,
|
|
106
63
|
},
|
|
107
64
|
square: {
|
|
108
65
|
type: Boolean,
|
|
109
|
-
default: false,
|
|
110
66
|
},
|
|
111
67
|
truncate: {
|
|
112
68
|
type: Boolean,
|
|
113
|
-
default: false,
|
|
114
69
|
},
|
|
115
70
|
class: {
|
|
116
71
|
type: [String, Array, Object] as PropType<any>,
|
|
117
|
-
default: undefined,
|
|
118
72
|
},
|
|
119
73
|
ui: {
|
|
120
|
-
type: Object as PropType<Partial<typeof
|
|
121
|
-
default: undefined,
|
|
74
|
+
type: Object as PropType<Partial<typeof button & { strategy?: Strategy }>>,
|
|
122
75
|
},
|
|
123
76
|
})
|
|
124
|
-
|
|
125
|
-
const { ui, attrs } = useUI('button', toRef(props, 'ui'), config, toRef(props, 'class'))
|
|
126
77
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finema/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"repository": "https://gitlab.finema.co/finema/ui-kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Finema Dev Core Team",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@vee-validate/nuxt": "^4.12.3",
|
|
40
40
|
"@vee-validate/zod": "^4.12.3",
|
|
41
41
|
"@vuepic/vue-datepicker": "^7.4.0",
|
|
42
|
-
"axios": "^1.
|
|
42
|
+
"axios": "^1.6.2",
|
|
43
43
|
"date-fns": "^3.0.6",
|
|
44
44
|
"i18next": "^23.7.11",
|
|
45
45
|
"lodash-es": "^4.17.21",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"eslint": "^8.56.0",
|
|
64
64
|
"husky": "^8.0.3",
|
|
65
65
|
"lint-staged": "^15.2.0",
|
|
66
|
-
"nuxt": "^3.
|
|
66
|
+
"nuxt": "^3.8.2",
|
|
67
67
|
"prettier": "^3.1.1",
|
|
68
68
|
"release-it": "^17.0.1",
|
|
69
69
|
"sass": "^1.69.5",
|