@finema/core 1.3.10 → 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 +1 -1
- package/dist/module.mjs +5 -2
- package/dist/runtime/components/Form/Fields.vue +6 -0
- package/dist/runtime/components/Form/InputCheckbox/index.vue +2 -1
- package/dist/runtime/components/Form/InputRadio/index.vue +27 -0
- package/dist/runtime/components/Form/InputRadio/types.d.ts +12 -0
- package/dist/runtime/components/Form/InputRadio/types.mjs +0 -0
- package/dist/runtime/components/Form/InputSelect/index.vue +26 -6
- package/dist/runtime/components/Form/InputSelect/types.d.ts +15 -0
- package/dist/runtime/components/Form/InputSelect/types.mjs +0 -0
- package/dist/runtime/components/Form/types.d.ts +6 -1
- package/dist/runtime/components/Form/types.mjs +1 -0
- package/dist/runtime/types/common.d.ts +1 -1
- package/package.json +1 -1
- package/dist/runtime/components/Form/InputSelect/SelectMenu.vue +0 -11
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.3.
|
|
5
|
+
const version = "1.3.11";
|
|
6
6
|
|
|
7
7
|
const colors = {
|
|
8
8
|
black: "#20243E",
|
|
@@ -68,7 +68,10 @@ const colors = {
|
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
const ui = {
|
|
71
|
-
safelistColors: ["secondary"]
|
|
71
|
+
safelistColors: ["secondary"],
|
|
72
|
+
icons: {
|
|
73
|
+
dynamic: true
|
|
74
|
+
}
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
const _merge = merge;
|
|
@@ -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"
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:disabled="disabled"
|
|
6
6
|
:name="name"
|
|
7
7
|
:label="props.label"
|
|
8
|
+
:required="isRequired"
|
|
8
9
|
:color="color"
|
|
9
10
|
:ui="ui"
|
|
10
11
|
/>
|
|
@@ -17,5 +18,5 @@ import { type ICheckboxFieldProps } from '#core/components/Form/InputCheckbox/ty
|
|
|
17
18
|
|
|
18
19
|
const props = withDefaults(defineProps<ICheckboxFieldProps>(), {})
|
|
19
20
|
|
|
20
|
-
const { value, wrapperProps, disabled, handleChange } = useFieldHOC<boolean>(props)
|
|
21
|
+
const { value, wrapperProps, disabled, handleChange, isRequired } = useFieldHOC<boolean>(props)
|
|
21
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
|
+
}>;
|
|
File without changes
|
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
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
|
-
|
|
9
|
-
|
|
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
|
+
}>;
|
|
File without changes
|
|
@@ -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 || {});
|
package/package.json
CHANGED