@finema/core 1.3.40 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.40",
3
+ "version": "1.4.1",
4
4
  "configKey": "core",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.7.4"
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.3.40";
5
+ const version = "1.4.1";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -171,6 +171,17 @@ const alert = {
171
171
  }
172
172
  };
173
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
+
174
185
  const module = defineNuxtModule({
175
186
  meta: {
176
187
  name,
@@ -203,12 +214,14 @@ const module = defineNuxtModule({
203
214
  };
204
215
  });
205
216
  await installModule("@nuxt/ui", {
206
- safelistColors: ["success", "secondary", "info", "danger", "warning"]
217
+ safelistColors: ["secondary", "success", "info", "danger", "warning"]
207
218
  });
208
219
  nuxt.options.appConfig.ui = _merge(nuxt.options.appConfig.ui || {}, {
209
220
  table,
210
221
  pagination,
211
- alert
222
+ alert,
223
+ button,
224
+ buttonGroup
212
225
  });
213
226
  nuxt.options.appConfig.ui.strategy = "override";
214
227
  nuxt.options.runtimeConfig = _deepMerge(
@@ -1,61 +1,49 @@
1
- <template>
2
- <UAlert v-bind="$props">
3
- <template #title><slot name="title" /></template>
4
- <template #description><slot name="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 { alert } from '#ui/ui.config'
12
- // @ts-expect-error
13
- import appConfig from '#build/app.config'
14
-
15
- defineProps({
16
- title: {
17
- type: String,
18
- required: true,
19
- },
20
- description: {
21
- type: String,
22
- default: null,
23
- },
24
- icon: {
25
- type: String,
26
- },
27
- avatar: {
28
- type: Object as PropType<Avatar>,
29
- default: null,
30
- },
31
- closeButton: {
32
- type: Object as PropType<Button>,
33
- },
34
- actions: {
35
- // eslint-disable-next-line @typescript-eslint/ban-types
36
- type: Array as PropType<Array<Button & { click?: Function }>>,
37
- },
38
- color: {
39
- type: String as PropType<AlertColor>,
40
- validator(value: string) {
41
- return [...appConfig.ui.colors, ...Object.keys(alert.color)].includes(value)
42
- },
43
- },
44
- variant: {
45
- type: String as PropType<AlertVariant>,
46
- validator(value: string) {
47
- return [
48
- ...Object.keys(alert.variant),
49
- ...Object.values(alert.color).flatMap((value) => Object.keys(value)),
50
- ].includes(value)
51
- },
52
- },
53
- class: {
54
- type: [String, Object, Array] as PropType<any>,
55
- },
56
- ui: {
57
- type: Object as PropType<Partial<typeof alert> & { strategy?: Strategy }>,
58
- default: () => ({}),
59
- },
60
- })
61
- </script>
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, useUiConfig, useUI, toRef } from '#imports'
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
- const config = useUiConfig<typeof buttonGroup>(buttonGroup, 'buttonGroup')
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 config> & { strategy?: Strategy }>,
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
- v-bind="attrs"
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 { useUiConfig, toRef, type PropType, useUI } from '#imports'
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
- const config = useUiConfig<typeof button>(button, 'button')
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 config & { strategy?: Strategy }>>,
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>
@@ -1 +1,3 @@
1
- export declare const button: any;
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const button: DeepPartial<(typeof config)['button']>;
@@ -1,6 +1,4 @@
1
- import { button as inheritButton } from "#ui/ui.config";
2
1
  export const button = {
3
- ...inheritButton,
4
2
  default: {
5
3
  size: "md",
6
4
  variant: "solid",
@@ -1 +1,3 @@
1
- export declare const buttonGroup: any;
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const buttonGroup: DeepPartial<(typeof config)['buttonGroup']>;
@@ -1,8 +1 @@
1
- import { buttonGroup as inheritButtonGroup } from "#ui/ui.config";
2
- export const buttonGroup = {
3
- ...inheritButtonGroup,
4
- default: {
5
- size: "md",
6
- orientation: "horizontal"
7
- }
8
- };
1
+ export const buttonGroup = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.40",
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.5.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.7.4",
66
+ "nuxt": "^3.8.2",
67
67
  "prettier": "^3.1.1",
68
68
  "release-it": "^17.0.1",
69
69
  "sass": "^1.69.5",