@finema/core 1.4.13 → 1.4.14

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.4.13",
3
+ "version": "1.4.14",
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 'lodash-es';
3
3
 
4
4
  const name = "@finema/core";
5
- const version = "1.4.13";
5
+ const version = "1.4.14";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -71,6 +71,12 @@
71
71
  :disabled-time="true"
72
72
  v-on="option.on ?? {}"
73
73
  />
74
+ <FormInputUploadFileClassic
75
+ v-else-if="option.type === INPUT_TYPES.UPLOAD_FILE_CLASSIC"
76
+ :form="form"
77
+ v-bind="option.props"
78
+ v-on="option.on ?? {}"
79
+ />
74
80
  </div>
75
81
  </template>
76
82
  </div>
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <UInput
4
+ type="file"
5
+ trailing
6
+ :loading-icon="loadingIcon"
7
+ :icon="icon"
8
+ :leading-icon="leadingIcon"
9
+ :trailing-icon="trailingIcon"
10
+ :disabled="wrapperProps.isDisabled"
11
+ :name="name"
12
+ :placeholder="wrapperProps.placeholder"
13
+ :autofocus="!!autoFocus"
14
+ :readonly="isReadonly"
15
+ :accept="accept"
16
+ :ui="ui"
17
+ @change="handleChange"
18
+ />
19
+ </FieldWrapper>
20
+ </template>
21
+ <script lang="ts" setup>
22
+ import { useFieldHOC } from '#core/composables/useForm'
23
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
24
+ import { type IUploadFileClassicFieldProps } from '#core/components/Form/InputUploadFileClassic/types'
25
+
26
+ const props = withDefaults(defineProps<IUploadFileClassicFieldProps>(), {})
27
+
28
+ const { value, wrapperProps } = useFieldHOC<File | undefined>(props)
29
+
30
+ const emits = defineEmits(['change'])
31
+
32
+ const handleChange = (e: Event) => {
33
+ value.value = (e.target as HTMLInputElement).files?.[0]
34
+ emits('change', e)
35
+ }
36
+ </script>
@@ -0,0 +1,13 @@
1
+ import { type IFieldProps, type IFormFieldBase, type INPUT_TYPES } from '#core/components/Form/types';
2
+ export interface IUploadFileClassicFieldProps extends IFieldProps {
3
+ selectFileLabel?: string;
4
+ accept?: string[] | string;
5
+ maxSize?: number;
6
+ leadingIcon?: string;
7
+ trailingIcon?: string;
8
+ icon?: string;
9
+ loadingIcon?: string;
10
+ }
11
+ export type IUploadFileClassicField = IFormFieldBase<INPUT_TYPES.UPLOAD_FILE_CLASSIC, IUploadFileClassicFieldProps, {
12
+ change?: (value: Event) => void;
13
+ }>;
@@ -8,6 +8,7 @@ import { type ISelectField } from '#core/components/Form/InputSelect/types';
8
8
  import { type IToggleField } from '#core/components/Form/InputToggle/types';
9
9
  import { type ITextareaField } from '#core/components/Form/InputTextarea/types';
10
10
  import { type IDateTimeField } from '#core/components/Form/InputDateTime/date_time_field.types';
11
+ import { type IUploadFileClassicField } from '#core/components/Form/InputUploadFileClassic/types';
11
12
  export declare const enum INPUT_TYPES {
12
13
  TEXT = "TEXT",
13
14
  TEXTAREA = "TEXTAREA",
@@ -19,7 +20,8 @@ export declare const enum INPUT_TYPES {
19
20
  RADIO = "RADIO",
20
21
  CHECKBOX = "CHECKBOX",
21
22
  DATE_TIME = "DATE_TIME",
22
- DATE = "DATE"
23
+ DATE = "DATE",
24
+ UPLOAD_FILE_CLASSIC = "UPLOAD_FILE_CLASSIC"
23
25
  }
24
26
  export interface IFieldProps {
25
27
  form?: FormContext;
@@ -48,4 +50,4 @@ export interface IFormFieldBase<I extends INPUT_TYPES, P extends IFieldProps, O>
48
50
  props: P;
49
51
  on?: O;
50
52
  }
51
- export type IFormField = ITextField | IStaticField | ICheckboxField | IRadioField | ISelectField | IToggleField | ITextareaField | IDateTimeField;
53
+ export type IFormField = ITextField | IStaticField | ICheckboxField | IRadioField | ISelectField | IToggleField | ITextareaField | IDateTimeField | IUploadFileClassicField;
@@ -10,5 +10,6 @@ export var INPUT_TYPES = /* @__PURE__ */ ((INPUT_TYPES2) => {
10
10
  INPUT_TYPES2["CHECKBOX"] = "CHECKBOX";
11
11
  INPUT_TYPES2["DATE_TIME"] = "DATE_TIME";
12
12
  INPUT_TYPES2["DATE"] = "DATE";
13
+ INPUT_TYPES2["UPLOAD_FILE_CLASSIC"] = "UPLOAD_FILE_CLASSIC";
13
14
  return INPUT_TYPES2;
14
15
  })(INPUT_TYPES || {});
@@ -49,7 +49,10 @@ const props = defineProps({
49
49
  inputClass: {
50
50
  type: String,
51
51
  default:
52
- 'h-12 w-12 relative flex flex-col items-center justify-center text-center disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none border-0 form-input rounded-md placeholder-gray-400 text-sm px-3.5 py-2.5 shadow-sm bg-white text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-primary-500',
52
+ 'h-12 w-12 relative flex flex-col items-center justify-center text-center ' +
53
+ 'disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none border-0 form-input ' +
54
+ 'rounded-md placeholder-gray-400 text-sm px-3.5 py-2.5 shadow-sm bg-white text-gray-900 ' +
55
+ 'ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-primary-500',
53
56
  },
54
57
  })
55
58
 
@@ -1,19 +1,5 @@
1
1
  :root {
2
- --color-primary-50: 248 248 255;
3
- --color-primary-100: 232 239 253;
4
- --color-primary-200: 190 227 248;
5
- --color-primary-300: 144 205 244;
6
- --color-primary-400: 99 179 237;
7
- --color-primary-500: 54 117 251;
8
- --color-primary-600: 0 104 254;
9
- --color-primary-700: 43 108 176;
10
- --color-primary-800: 44 82 130;
11
- --color-primary-900: 32 36 62;
12
- --color-primary-950: 32 36 62;
13
- --color-primary-DEFAULT: 54 117 251;
14
-
15
2
  --dp-font-family: inherit !important;
16
-
17
3
  }
18
4
 
19
5
  .dp__theme_light {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.13",
3
+ "version": "1.4.14",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",