@finema/core 1.3.9 → 1.3.11

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.9",
3
+ "version": "1.3.11",
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.9";
5
+ const version = "1.3.11";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -69,8 +69,8 @@ const colors = {
69
69
 
70
70
  const ui = {
71
71
  safelistColors: ["secondary"],
72
- checkbox: {
73
- inner: "ms-3 flex flex-col cursor-pointer"
72
+ icons: {
73
+ dynamic: true
74
74
  }
75
75
  };
76
76
 
@@ -40,6 +40,12 @@
40
40
  v-bind="option.props"
41
41
  v-on="option.on ?? {}"
42
42
  />
43
+ <FormInputRadio
44
+ v-if="option.type === INPUT_TYPES.RADIO"
45
+ :form="form"
46
+ v-bind="option.props"
47
+ v-on="option.on ?? {}"
48
+ />
43
49
  <FormInputCheckbox
44
50
  v-if="option.type === INPUT_TYPES.CHECKBOX"
45
51
  :form="form"
@@ -2,10 +2,10 @@
2
2
  <FieldWrapper v-bind="wrapperProps" label="">
3
3
  <UCheckbox
4
4
  v-model="value"
5
- class="cursor-pointer"
6
5
  :disabled="disabled"
7
6
  :name="name"
8
7
  :label="props.label"
8
+ :required="isRequired"
9
9
  :color="color"
10
10
  :ui="ui"
11
11
  />
@@ -18,5 +18,5 @@ import { type ICheckboxFieldProps } from '#core/components/Form/InputCheckbox/ty
18
18
 
19
19
  const props = withDefaults(defineProps<ICheckboxFieldProps>(), {})
20
20
 
21
- const { value, wrapperProps, disabled, handleChange } = useFieldHOC<boolean>(props)
21
+ const { value, wrapperProps, disabled, handleChange, isRequired } = useFieldHOC<boolean>(props)
22
22
  </script>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <URadioGroup
4
+ v-model="value"
5
+ :options="options"
6
+ :disabled="disabled"
7
+ :required="isRequired"
8
+ value-attribute="value"
9
+ option-attribute="label"
10
+ :icon="icon"
11
+ :color="color"
12
+ :size="size"
13
+ :ui="ui"
14
+ :ui-menu="uiMenu"
15
+ />
16
+ </FieldWrapper>
17
+ </template>
18
+
19
+ <script lang="ts" setup>
20
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
21
+ import { useFieldHOC } from '#core/composables/useForm'
22
+ import { type ISelectFieldProps } from '#core/components/Form/InputSelect/types'
23
+
24
+ const props = withDefaults(defineProps<ISelectFieldProps>(), {})
25
+
26
+ const { value, wrapperProps, disabled, handleChange, isRequired } = useFieldHOC<any>(props)
27
+ </script>
@@ -0,0 +1,12 @@
1
+ import type { IFieldProps, IFormFieldBase, INPUT_TYPES } from '#core/components/Form/types';
2
+ import { type IOption } from '#core/types/common';
3
+ export interface IRadioFieldProps extends IFieldProps {
4
+ color?: string;
5
+ icon?: string;
6
+ size?: string;
7
+ ui?: object | any;
8
+ options: IOption[];
9
+ }
10
+ export type IRadioField = IFormFieldBase<INPUT_TYPES.RADIO, IRadioFieldProps, {
11
+ change?: (value: string) => void;
12
+ }>;
@@ -1,11 +1,31 @@
1
1
  <template>
2
- <div>
3
- <USelect v-bind="$attrs" />
4
- </div>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <USelectMenu
4
+ v-model="value"
5
+ searchable
6
+ :options="options"
7
+ :placeholder="placeholder || label"
8
+ :disabled="disabled"
9
+ :loading="isLoading"
10
+ :searchable-placeholder="searchablePlaceholder"
11
+ value-attribute="value"
12
+ option-attribute="label"
13
+ :required="isRequired"
14
+ :icon="icon"
15
+ :color="color"
16
+ :size="size"
17
+ :ui="ui"
18
+ :ui-menu="uiMenu"
19
+ />
20
+ </FieldWrapper>
5
21
  </template>
6
22
 
7
23
  <script lang="ts" setup>
8
- defineOptions({
9
- inheritAttrs: true,
10
- })
24
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
25
+ import { useFieldHOC } from '#core/composables/useForm'
26
+ import { type ISelectFieldProps } from '#core/components/Form/InputSelect/types'
27
+
28
+ const props = withDefaults(defineProps<ISelectFieldProps>(), {})
29
+
30
+ const { value, wrapperProps, disabled, handleChange, isRequired } = useFieldHOC<any>(props)
11
31
  </script>
@@ -0,0 +1,15 @@
1
+ import type { IFieldProps, IFormFieldBase, INPUT_TYPES } from '#core/components/Form/types';
2
+ import { type IOption } from '#core/types/common';
3
+ export interface ISelectFieldProps extends IFieldProps {
4
+ color?: string;
5
+ icon?: string;
6
+ size?: string;
7
+ searchablePlaceholder?: string;
8
+ loading?: boolean;
9
+ ui?: object | any;
10
+ uiMenu?: object | any;
11
+ options: IOption[];
12
+ }
13
+ export type ISelectField = IFormFieldBase<INPUT_TYPES.SELECT, ISelectFieldProps, {
14
+ change?: (value: string) => void;
15
+ }>;
@@ -2,6 +2,10 @@ import { type Component } from '@nuxt/schema';
2
2
  import { type FormContext, type RuleExpression } from 'vee-validate';
3
3
  import { type ITextField } from '#core/components/Form/InputText/types';
4
4
  import { type IStaticField } from '#core/components/Form/InputStatic/types';
5
+ import { type ICheckboxField } from '#core/components/Form/InputCheckbox/types';
6
+ import { type IRadioField } from '#core/components/Form/InputRadio/types';
7
+ import { type ISelectField } from '#core/components/Form/InputSelect/types';
8
+ import { type IToggleField } from '#core/components/Form/InputToggle/types';
5
9
  export declare const enum INPUT_TYPES {
6
10
  TEXT = "TEXT",
7
11
  PASSWORD = "PASSWORD",
@@ -9,6 +13,7 @@ export declare const enum INPUT_TYPES {
9
13
  STATIC = "STATIC",
10
14
  TOGGLE = "TOGGLE",
11
15
  SELECT = "SELECT",
16
+ RADIO = "RADIO",
12
17
  CHECKBOX = "CHECKBOX"
13
18
  }
14
19
  export interface IOption {
@@ -46,4 +51,4 @@ export interface IFormFieldBase<I extends INPUT_TYPES, P extends object = never,
46
51
  props: IFieldProps & P;
47
52
  on?: O;
48
53
  }
49
- export type IFormField = ITextField | IStaticField;
54
+ export type IFormField = ITextField | IStaticField | ICheckboxField | IRadioField | ISelectField | IToggleField;
@@ -5,6 +5,7 @@ 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["RADIO"] = "RADIO";
8
9
  INPUT_TYPES2["CHECKBOX"] = "CHECKBOX";
9
10
  return INPUT_TYPES2;
10
11
  })(INPUT_TYPES || {});
@@ -2,7 +2,7 @@ export interface IError {
2
2
  code: string;
3
3
  message: any;
4
4
  }
5
- export interface IOption {
5
+ export interface IOption extends Record<string, any> {
6
6
  value: any;
7
7
  label: string;
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.3.9",
3
+ "version": "1.3.11",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Development Team",
@@ -1,11 +0,0 @@
1
- <template>
2
- <div>
3
- <USelectMenu v-bind="$attrs" />
4
- </div>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- defineOptions({
9
- inheritAttrs: true,
10
- })
11
- </script>