@finema/core 2.35.1 → 2.36.0
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 -1
- package/dist/runtime/components/Form/InputTags/index.vue +71 -0
- package/dist/runtime/components/Form/InputTags/index.vue.d.ts +11 -0
- package/dist/runtime/components/Form/InputTags/types.d.ts +17 -0
- package/dist/runtime/components/Form/InputTags/types.js +0 -0
- package/dist/runtime/components/Form/InputTime/index.vue +4 -1
- package/dist/runtime/components/Form/types.d.ts +3 -2
- package/dist/runtime/components/Form/types.js +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -37,6 +37,7 @@ import FormInputMonth from "./InputMonth/index.vue";
|
|
|
37
37
|
import FormInputDateTimeRange from "./InputDateTimeRange/index.vue";
|
|
38
38
|
import FormInputUploadDropzoneAuto from "./InputUploadDropzoneAuto/index.vue";
|
|
39
39
|
import FormInputUploadDropzone from "./InputUploadDropzone/index.vue";
|
|
40
|
+
import FormInputTag from "./InputTags/index.vue";
|
|
40
41
|
import FormInputWYSIWYG from "./InputWYSIWYG/index.vue";
|
|
41
42
|
import { INPUT_TYPES } from "#core/components/Form/types";
|
|
42
43
|
import { formTheme } from "#core/theme/form";
|
|
@@ -150,7 +151,10 @@ const componentMap = {
|
|
|
150
151
|
component: FormInputWYSIWYG,
|
|
151
152
|
props: {}
|
|
152
153
|
},
|
|
153
|
-
[INPUT_TYPES.TAGS]:
|
|
154
|
+
[INPUT_TYPES.TAGS]: {
|
|
155
|
+
component: FormInputTag,
|
|
156
|
+
props: {}
|
|
157
|
+
}
|
|
154
158
|
};
|
|
155
159
|
const theme = computed(() => useUiConfig(formTheme, "form")({
|
|
156
160
|
orientation: props.orientation
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<InputTags
|
|
4
|
+
:model-value="value"
|
|
5
|
+
:disabled="wrapperProps.disabled"
|
|
6
|
+
:leading-icon="leadingIcon"
|
|
7
|
+
:max-length="maxLength"
|
|
8
|
+
:varant="variant"
|
|
9
|
+
:delete-icon="deleteIcon"
|
|
10
|
+
:size="size"
|
|
11
|
+
:trailing-icon="trailingIcon"
|
|
12
|
+
:loading="loading"
|
|
13
|
+
:loading-icon="loadingIcon"
|
|
14
|
+
:name="name"
|
|
15
|
+
:placeholder="wrapperProps.placeholder"
|
|
16
|
+
:autofocus="!!autoFocus"
|
|
17
|
+
:icon="icon"
|
|
18
|
+
:readonly="readonly"
|
|
19
|
+
:ui="ui"
|
|
20
|
+
@update:model-value="onChange"
|
|
21
|
+
@addTag="onAdd"
|
|
22
|
+
@removeTag="onRemove"
|
|
23
|
+
/>
|
|
24
|
+
</FieldWrapper>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup>
|
|
28
|
+
import { useFieldHOC } from "#core/composables/useForm";
|
|
29
|
+
import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
|
|
30
|
+
const emits = defineEmits(["change", "add", "remove"]);
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
leadingIcon: { type: null, required: false },
|
|
33
|
+
trailingIcon: { type: null, required: false },
|
|
34
|
+
loading: { type: Boolean, required: false },
|
|
35
|
+
loadingIcon: { type: null, required: false },
|
|
36
|
+
icon: { type: String, required: false },
|
|
37
|
+
maxLength: { type: String, required: false },
|
|
38
|
+
variant: { type: String, required: false },
|
|
39
|
+
size: { type: String, required: false },
|
|
40
|
+
deleteIcon: { type: String, required: false },
|
|
41
|
+
form: { type: Object, required: false },
|
|
42
|
+
name: { type: String, required: true },
|
|
43
|
+
errorMessage: { type: String, required: false },
|
|
44
|
+
label: { type: null, required: false },
|
|
45
|
+
description: { type: String, required: false },
|
|
46
|
+
hint: { type: String, required: false },
|
|
47
|
+
rules: { type: null, required: false },
|
|
48
|
+
autoFocus: { type: Boolean, required: false },
|
|
49
|
+
placeholder: { type: String, required: false },
|
|
50
|
+
disabled: { type: Boolean, required: false },
|
|
51
|
+
readonly: { type: Boolean, required: false },
|
|
52
|
+
required: { type: Boolean, required: false },
|
|
53
|
+
help: { type: String, required: false },
|
|
54
|
+
ui: { type: null, required: false }
|
|
55
|
+
});
|
|
56
|
+
const {
|
|
57
|
+
value,
|
|
58
|
+
wrapperProps,
|
|
59
|
+
handleChange
|
|
60
|
+
} = useFieldHOC(props);
|
|
61
|
+
const onChange = (value2) => {
|
|
62
|
+
handleChange(value2);
|
|
63
|
+
emits("change", value2);
|
|
64
|
+
};
|
|
65
|
+
const onAdd = (value2) => {
|
|
66
|
+
emits("add", value2);
|
|
67
|
+
};
|
|
68
|
+
const onRemove = (value2) => {
|
|
69
|
+
emits("remove", value2);
|
|
70
|
+
};
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ITagsFieldProps } from '#core/components/Form/InputTags/types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<ITagsFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
add: (...args: any[]) => void;
|
|
4
|
+
change: (...args: any[]) => void;
|
|
5
|
+
remove: (...args: any[]) => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<ITagsFieldProps> & Readonly<{
|
|
7
|
+
onAdd?: ((...args: any[]) => any) | undefined;
|
|
8
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
9
|
+
onRemove?: ((...args: any[]) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IFieldProps, IFormFieldBase, INPUT_TYPES } from '#core/components/Form/types';
|
|
2
|
+
export interface ITagsFieldProps extends IFieldProps {
|
|
3
|
+
leadingIcon?: any;
|
|
4
|
+
trailingIcon?: any;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
loadingIcon?: any;
|
|
7
|
+
icon?: string;
|
|
8
|
+
maxLength?: string;
|
|
9
|
+
variant?: string;
|
|
10
|
+
size?: string;
|
|
11
|
+
deleteIcon?: string;
|
|
12
|
+
}
|
|
13
|
+
export type ITagsField = IFormFieldBase<INPUT_TYPES.TAGS, ITagsFieldProps, {
|
|
14
|
+
change?: (value: string[]) => void;
|
|
15
|
+
add?: (value: string) => void;
|
|
16
|
+
remove?: (value: string) => void;
|
|
17
|
+
}>;
|
|
File without changes
|
|
@@ -82,7 +82,10 @@ const {
|
|
|
82
82
|
const onChange = (value2) => {
|
|
83
83
|
let timeText = void 0;
|
|
84
84
|
if (value2) {
|
|
85
|
-
|
|
85
|
+
const hours = value2.hours?.toString().padStart(2, "0") ?? "00";
|
|
86
|
+
const minutes = value2.minutes?.toString().padStart(2, "0") ?? "00";
|
|
87
|
+
const seconds = props.enableSeconds ? value2.seconds?.toString().padStart(2, "0") ?? "00" : "";
|
|
88
|
+
timeText = `${hours}:${minutes}${props.enableSeconds ? `:${seconds}` : ""}`;
|
|
86
89
|
}
|
|
87
90
|
handleChange(timeText);
|
|
88
91
|
emits("change", timeText);
|
|
@@ -17,6 +17,7 @@ import type { IMonthField } from '#core/components/Form/InputMonth/types';
|
|
|
17
17
|
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
|
+
import type { ITagsField } from '#core/components/Form/InputTags/types';
|
|
20
21
|
export declare enum INPUT_TYPES {
|
|
21
22
|
TEXT = "TEXT",
|
|
22
23
|
SEARCH = "SEARCH",
|
|
@@ -24,6 +25,7 @@ export declare enum INPUT_TYPES {
|
|
|
24
25
|
TEXTAREA = "TEXTAREA",
|
|
25
26
|
PASSWORD = "PASSWORD",
|
|
26
27
|
EMAIL = "EMAIL",
|
|
28
|
+
TAGS = "TAGS",
|
|
27
29
|
STATIC = "STATIC",
|
|
28
30
|
TOGGLE = "TOGGLE",
|
|
29
31
|
SELECT = "SELECT",
|
|
@@ -44,7 +46,6 @@ export declare enum INPUT_TYPES {
|
|
|
44
46
|
UPLOAD_DROPZONE_AUTO_MULTIPLE = "UPLOAD_DROPZONE_AUTO_MULTIPLE",
|
|
45
47
|
UPLOAD_DROPZONE_IMAGE_AUTO_MULTIPLE = "UPLOAD_DROPZONE_IMAGE_AUTO_MULTIPLE",
|
|
46
48
|
WYSIWYG = "WYSIWYG",
|
|
47
|
-
TAGS = "TAGS",
|
|
48
49
|
COMPONENT = "COMPONENT"
|
|
49
50
|
}
|
|
50
51
|
export interface IFieldProps {
|
|
@@ -72,7 +73,7 @@ export interface IFormFieldBase<I extends INPUT_TYPES, P extends IFieldProps, O>
|
|
|
72
73
|
props: P;
|
|
73
74
|
on?: O;
|
|
74
75
|
}
|
|
75
|
-
export type IFormField = ITextField | ISearchField | INumberField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ISelectMultipleField | IRadioField | IDateTimeField | ITimeField | IMonthField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IWYSIWYGField | IComponentField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
|
|
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>;
|
|
76
77
|
export interface IFileValue {
|
|
77
78
|
url: string;
|
|
78
79
|
path?: string;
|
|
@@ -5,6 +5,7 @@ export var INPUT_TYPES = /* @__PURE__ */ ((INPUT_TYPES2) => {
|
|
|
5
5
|
INPUT_TYPES2["TEXTAREA"] = "TEXTAREA";
|
|
6
6
|
INPUT_TYPES2["PASSWORD"] = "PASSWORD";
|
|
7
7
|
INPUT_TYPES2["EMAIL"] = "EMAIL";
|
|
8
|
+
INPUT_TYPES2["TAGS"] = "TAGS";
|
|
8
9
|
INPUT_TYPES2["STATIC"] = "STATIC";
|
|
9
10
|
INPUT_TYPES2["TOGGLE"] = "TOGGLE";
|
|
10
11
|
INPUT_TYPES2["SELECT"] = "SELECT";
|
|
@@ -25,7 +26,6 @@ export var INPUT_TYPES = /* @__PURE__ */ ((INPUT_TYPES2) => {
|
|
|
25
26
|
INPUT_TYPES2["UPLOAD_DROPZONE_AUTO_MULTIPLE"] = "UPLOAD_DROPZONE_AUTO_MULTIPLE";
|
|
26
27
|
INPUT_TYPES2["UPLOAD_DROPZONE_IMAGE_AUTO_MULTIPLE"] = "UPLOAD_DROPZONE_IMAGE_AUTO_MULTIPLE";
|
|
27
28
|
INPUT_TYPES2["WYSIWYG"] = "WYSIWYG";
|
|
28
|
-
INPUT_TYPES2["TAGS"] = "TAGS";
|
|
29
29
|
INPUT_TYPES2["COMPONENT"] = "COMPONENT";
|
|
30
30
|
return INPUT_TYPES2;
|
|
31
31
|
})(INPUT_TYPES || {});
|