@finema/core 1.3.8 → 1.3.10

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.8",
3
+ "version": "1.3.10",
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.8";
5
+ const version = "1.3.10";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <UButton v-bind="$attrs">
2
+ <UButton v-bind="$props">
3
3
  <template #leading>
4
4
  <slot name="leading" />
5
5
  </template>
@@ -11,7 +11,86 @@
11
11
  </UButton>
12
12
  </template>
13
13
  <script lang="ts" setup>
14
+ import { UButton } from '#components'
15
+ import { type PropType } from 'vue'
16
+
14
17
  defineOptions({
15
18
  inheritAttrs: true,
16
19
  })
20
+
21
+ defineProps({
22
+ type: {
23
+ type: String,
24
+ default: 'button',
25
+ },
26
+ block: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ label: {
31
+ type: String,
32
+ default: null,
33
+ },
34
+ loading: {
35
+ type: Boolean,
36
+ default: false,
37
+ },
38
+ disabled: {
39
+ type: Boolean,
40
+ default: false,
41
+ },
42
+ padded: {
43
+ type: Boolean,
44
+ default: true,
45
+ },
46
+ size: {
47
+ type: String,
48
+ validator(value: unknown): boolean {
49
+ return ['2xs', 'xs', 'sm', 'md', 'lg', 'xl'].includes(value as string)
50
+ },
51
+ },
52
+ color: {
53
+ type: String,
54
+ },
55
+ variant: {
56
+ type: String,
57
+ },
58
+ icon: {
59
+ type: String,
60
+ default: null,
61
+ },
62
+ loadingIcon: {
63
+ type: String,
64
+ },
65
+ leadingIcon: {
66
+ type: String,
67
+ default: null,
68
+ },
69
+ trailingIcon: {
70
+ type: String,
71
+ default: null,
72
+ },
73
+ trailing: {
74
+ type: Boolean,
75
+ default: false,
76
+ },
77
+ leading: {
78
+ type: Boolean,
79
+ default: false,
80
+ },
81
+ square: {
82
+ type: Boolean,
83
+ default: false,
84
+ },
85
+ truncate: {
86
+ type: Boolean,
87
+ default: false,
88
+ },
89
+ class: {
90
+ type: [String, Object, Array] as PropType<any>,
91
+ },
92
+ ui: {
93
+ type: Object,
94
+ },
95
+ })
17
96
  </script>
@@ -40,6 +40,12 @@
40
40
  v-bind="option.props"
41
41
  v-on="option.on ?? {}"
42
42
  />
43
+ <FormInputCheckbox
44
+ v-if="option.type === INPUT_TYPES.CHECKBOX"
45
+ :form="form"
46
+ v-bind="option.props"
47
+ v-on="option.on ?? {}"
48
+ />
43
49
  </div>
44
50
  </template>
45
51
  </div>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps" label="">
3
+ <UCheckbox
4
+ v-model="value"
5
+ :disabled="disabled"
6
+ :name="name"
7
+ :label="props.label"
8
+ :color="color"
9
+ :ui="ui"
10
+ />
11
+ </FieldWrapper>
12
+ </template>
13
+ <script lang="ts" setup>
14
+ import { useFieldHOC } from '#core/composables/useForm'
15
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
16
+ import { type ICheckboxFieldProps } from '#core/components/Form/InputCheckbox/types'
17
+
18
+ const props = withDefaults(defineProps<ICheckboxFieldProps>(), {})
19
+
20
+ const { value, wrapperProps, disabled, handleChange } = useFieldHOC<boolean>(props)
21
+ </script>
@@ -0,0 +1,8 @@
1
+ import { type IFieldProps, type IFormFieldBase, type INPUT_TYPES } from '#core/components/Form/types';
2
+ export interface ICheckboxFieldProps extends IFieldProps {
3
+ color?: string;
4
+ ui?: object | any;
5
+ }
6
+ export type ICheckboxField = IFormFieldBase<INPUT_TYPES.CHECKBOX, ICheckboxFieldProps, {
7
+ change?: (value: string) => void;
8
+ }>;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <FieldWrapper v-bind="wrapperProps">
3
- <UToggle v-model="value" :disabled="disabled" :name="name" />
3
+ <UToggle v-model="value" :disabled="disabled" :name="name" :color="color" :ui="ui" />
4
4
  </FieldWrapper>
5
5
  </template>
6
6
 
@@ -1,5 +1,7 @@
1
1
  import { type IFieldProps, type IFormFieldBase, type INPUT_TYPES } from '#core/components/Form/types';
2
2
  export interface IToggleFieldProps extends IFieldProps {
3
+ color?: string;
4
+ ui?: object | any;
3
5
  }
4
6
  export type IToggleField = IFormFieldBase<INPUT_TYPES.TOGGLE, IToggleFieldProps, {
5
7
  change?: (value: string) => void;
@@ -8,7 +8,8 @@ export declare const enum INPUT_TYPES {
8
8
  EMAIL = "EMAIL",
9
9
  STATIC = "STATIC",
10
10
  TOGGLE = "TOGGLE",
11
- SELECT = "SELECT"
11
+ SELECT = "SELECT",
12
+ CHECKBOX = "CHECKBOX"
12
13
  }
13
14
  export interface IOption {
14
15
  label: string;
@@ -5,5 +5,6 @@ export var INPUT_TYPES = /* @__PURE__ */ ((INPUT_TYPES2) => {
5
5
  INPUT_TYPES2["STATIC"] = "STATIC";
6
6
  INPUT_TYPES2["TOGGLE"] = "TOGGLE";
7
7
  INPUT_TYPES2["SELECT"] = "SELECT";
8
+ INPUT_TYPES2["CHECKBOX"] = "CHECKBOX";
8
9
  return INPUT_TYPES2;
9
10
  })(INPUT_TYPES || {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Development Team",
@@ -29,7 +29,7 @@
29
29
  "lint:fix": "eslint . --fix",
30
30
  "test": "vitest run",
31
31
  "test:watch": "vitest watch",
32
- "release": "release-it",
32
+ "release": "release-it --ci",
33
33
  "prepare": "husky install"
34
34
  },
35
35
  "dependencies": {