@finema/core 2.58.0 → 2.59.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 +1 -1
- package/dist/runtime/components/Form/Fields.vue +5 -0
- package/dist/runtime/components/Form/InputCheckboxGroup/index.d.vue.ts +8 -0
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +60 -0
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue.d.ts +8 -0
- package/dist/runtime/components/Form/InputCheckboxGroup/types.d.ts +21 -0
- package/dist/runtime/components/Form/InputCheckboxGroup/types.js +0 -0
- package/dist/runtime/components/Form/types.d.ts +3 -1
- package/dist/runtime/components/Form/types.js +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -27,6 +27,7 @@ import FormInputSearch from "./InputSearch/index.vue";
|
|
|
27
27
|
import FormInputNumber from "./InputNumber/index.vue";
|
|
28
28
|
import FormInputToggle from "./InputToggle/index.vue";
|
|
29
29
|
import FormInputCheckbox from "./InputCheckbox/index.vue";
|
|
30
|
+
import FormInputCheckboxGroup from "./InputCheckboxGroup/index.vue";
|
|
30
31
|
import FormInputSelect from "./InputSelect/index.vue";
|
|
31
32
|
import FormInputSelectMultiple from "./InputSelectMultiple/index.vue";
|
|
32
33
|
import FormInputComponent from "./InputComponent/index.vue";
|
|
@@ -70,6 +71,10 @@ const componentMap = {
|
|
|
70
71
|
component: FormInputCheckbox,
|
|
71
72
|
props: {}
|
|
72
73
|
},
|
|
74
|
+
[INPUT_TYPES.CHECKBOX_GROUP]: {
|
|
75
|
+
component: FormInputCheckboxGroup,
|
|
76
|
+
props: {}
|
|
77
|
+
},
|
|
73
78
|
[INPUT_TYPES.SELECT]: {
|
|
74
79
|
component: FormInputSelect,
|
|
75
80
|
props: {}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ICheckboxGroupFieldProps } from '#core/components/Form/InputCheckboxGroup/types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<ICheckboxGroupFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
change: (...args: any[]) => void;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<ICheckboxGroupFieldProps> & Readonly<{
|
|
5
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
6
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FieldWrapper
|
|
3
|
+
v-bind="wrapperProps"
|
|
4
|
+
label=""
|
|
5
|
+
description=""
|
|
6
|
+
>
|
|
7
|
+
<CheckboxGroup
|
|
8
|
+
:model-value="value"
|
|
9
|
+
:disabled="wrapperProps.disabled"
|
|
10
|
+
:name="name"
|
|
11
|
+
:label="label"
|
|
12
|
+
:items="options"
|
|
13
|
+
:description="description"
|
|
14
|
+
:required="required"
|
|
15
|
+
:variant="variant"
|
|
16
|
+
:indicator="indicator"
|
|
17
|
+
:value-key="valueKey"
|
|
18
|
+
:orientation="orientation"
|
|
19
|
+
:ui="ui"
|
|
20
|
+
@update:modelValue="onChange"
|
|
21
|
+
/>
|
|
22
|
+
</FieldWrapper>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
import { useFieldHOC } from "#core/composables/useForm";
|
|
27
|
+
import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
28
|
+
const emits = defineEmits(["change"]);
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
label: { type: String, required: false },
|
|
31
|
+
description: { type: String, required: false },
|
|
32
|
+
variant: { type: String, required: false },
|
|
33
|
+
orientation: { type: String, required: false },
|
|
34
|
+
indicator: { type: String, required: false },
|
|
35
|
+
options: { type: Array, required: true },
|
|
36
|
+
valueKey: { type: String, required: false },
|
|
37
|
+
form: { type: Object, required: false },
|
|
38
|
+
name: { type: String, required: true },
|
|
39
|
+
errorMessage: { type: String, required: false },
|
|
40
|
+
hint: { type: String, required: false },
|
|
41
|
+
rules: { type: null, required: false },
|
|
42
|
+
autoFocus: { type: Boolean, required: false },
|
|
43
|
+
placeholder: { type: String, required: false },
|
|
44
|
+
disabled: { type: Boolean, required: false },
|
|
45
|
+
readonly: { type: Boolean, required: false },
|
|
46
|
+
required: { type: Boolean, required: false },
|
|
47
|
+
help: { type: String, required: false },
|
|
48
|
+
ui: { type: null, required: false }
|
|
49
|
+
});
|
|
50
|
+
const {
|
|
51
|
+
value,
|
|
52
|
+
wrapperProps,
|
|
53
|
+
handleChange
|
|
54
|
+
} = useFieldHOC(props);
|
|
55
|
+
const onChange = (value2) => {
|
|
56
|
+
console.log("CheckboxGroup value changed:", value2);
|
|
57
|
+
handleChange(value2);
|
|
58
|
+
emits("change", value2);
|
|
59
|
+
};
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ICheckboxGroupFieldProps } from '#core/components/Form/InputCheckboxGroup/types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<ICheckboxGroupFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
change: (...args: any[]) => void;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<ICheckboxGroupFieldProps> & Readonly<{
|
|
5
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
6
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IFieldProps, IFormFieldBase, INPUT_TYPES } from '#core/components/Form/types';
|
|
2
|
+
import type { IOption } from '#core/types/common';
|
|
3
|
+
export type CheckboxOption = IOption & {
|
|
4
|
+
label?: string;
|
|
5
|
+
value?: any;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
class?: any;
|
|
9
|
+
};
|
|
10
|
+
export interface ICheckboxGroupFieldProps extends IFieldProps {
|
|
11
|
+
label?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
variant?: 'list' | 'card' | 'table';
|
|
14
|
+
orientation?: 'horizontal' | 'vertical';
|
|
15
|
+
indicator?: 'start' | 'end' | 'hidden';
|
|
16
|
+
options: CheckboxOption[];
|
|
17
|
+
valueKey?: string;
|
|
18
|
+
}
|
|
19
|
+
export type ICheckboxGroupField = IFormFieldBase<INPUT_TYPES.CHECKBOX_GROUP, ICheckboxGroupFieldProps, {
|
|
20
|
+
change?: (value: any) => void;
|
|
21
|
+
}>;
|
|
File without changes
|
|
@@ -18,6 +18,7 @@ import type { IRadioField } from '#core/components/Form/InputRadio/types';
|
|
|
18
18
|
import type { IWYSIWYGField } from '#core/components/Form/InputWYSIWYG/types';
|
|
19
19
|
import type { IComponentField } from '#core/components/Form/InputComponent/types';
|
|
20
20
|
import type { ITagsField } from '#core/components/Form/InputTags/types';
|
|
21
|
+
import type { ICheckboxGroupField } from './InputCheckboxGroup/types.js';
|
|
21
22
|
export declare enum INPUT_TYPES {
|
|
22
23
|
TEXT = "TEXT",
|
|
23
24
|
SEARCH = "SEARCH",
|
|
@@ -32,6 +33,7 @@ export declare enum INPUT_TYPES {
|
|
|
32
33
|
SELECT_MULTIPLE = "SELECT_MULTIPLE",
|
|
33
34
|
RADIO = "RADIO",
|
|
34
35
|
CHECKBOX = "CHECKBOX",
|
|
36
|
+
CHECKBOX_GROUP = "CHECKBOX_GROUP",
|
|
35
37
|
DATE_TIME = "DATE_TIME",
|
|
36
38
|
TIME = "TIME",
|
|
37
39
|
DATE = "DATE",
|
|
@@ -73,7 +75,7 @@ export interface IFormFieldBase<I extends INPUT_TYPES, P extends IFieldProps, O>
|
|
|
73
75
|
props: P;
|
|
74
76
|
on?: O;
|
|
75
77
|
}
|
|
76
|
-
export type IFormField = ITextField | ISearchField | INumberField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ISelectMultipleField | IRadioField | IDateTimeField | ITimeField | IMonthField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IWYSIWYGField | IComponentField | ITagsField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
|
|
78
|
+
export type IFormField = ITextField | ISearchField | INumberField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ICheckboxGroupField | ISelectMultipleField | IRadioField | IDateTimeField | ITimeField | IMonthField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IWYSIWYGField | IComponentField | ITagsField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
|
|
77
79
|
export interface IFileValue {
|
|
78
80
|
url: string;
|
|
79
81
|
path?: string;
|
|
@@ -12,6 +12,7 @@ export var INPUT_TYPES = /* @__PURE__ */ ((INPUT_TYPES2) => {
|
|
|
12
12
|
INPUT_TYPES2["SELECT_MULTIPLE"] = "SELECT_MULTIPLE";
|
|
13
13
|
INPUT_TYPES2["RADIO"] = "RADIO";
|
|
14
14
|
INPUT_TYPES2["CHECKBOX"] = "CHECKBOX";
|
|
15
|
+
INPUT_TYPES2["CHECKBOX_GROUP"] = "CHECKBOX_GROUP";
|
|
15
16
|
INPUT_TYPES2["DATE_TIME"] = "DATE_TIME";
|
|
16
17
|
INPUT_TYPES2["TIME"] = "TIME";
|
|
17
18
|
INPUT_TYPES2["DATE"] = "DATE";
|