@finema/core 2.35.2 → 2.36.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.35.2",
3
+ "version": "2.36.1",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import * as lodash from 'lodash-es';
4
4
  import * as theme from '../dist/runtime/theme/index.js';
5
5
 
6
6
  const name = "@finema/core";
7
- const version = "2.35.2";
7
+ const version = "2.36.1";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -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]: void 0
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
@@ -13,6 +13,7 @@ export interface IDateTimeFieldProps extends IFieldProps {
13
13
  minTime?: ITimeOption;
14
14
  maxTime?: ITimeOption;
15
15
  isReturnISO?: boolean;
16
+ teleport?: boolean | string | HTMLElement;
16
17
  }
17
18
  export type IDateTimeField = IFormFieldBase<INPUT_TYPES.DATE_TIME | INPUT_TYPES.DATE, IDateTimeFieldProps, {
18
19
  change: (value: string) => void;
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <FieldWrapper v-bind="wrapperProps">
3
3
  <Datepicker
4
- :teleport="true"
5
4
  :model-value="innerValue"
6
5
  :disabled="wrapperProps.disabled"
7
6
  :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
@@ -15,6 +14,7 @@
15
14
  :min-time="minTime"
16
15
  :max-time="maxTime"
17
16
  :start-time="startTime"
17
+ :teleport="teleport"
18
18
  :required="required"
19
19
  :flow="['calendar', 'time']"
20
20
  @update:model-value="onInput"
@@ -73,6 +73,7 @@ const props = defineProps({
73
73
  minTime: { type: Object, required: false },
74
74
  maxTime: { type: Object, required: false },
75
75
  isReturnISO: { type: Boolean, required: false },
76
+ teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
76
77
  form: { type: Object, required: false },
77
78
  name: { type: String, required: true },
78
79
  errorMessage: { type: String, required: false },
@@ -2,5 +2,6 @@ import '@vuepic/vue-datepicker/dist/main.css';
2
2
  import type { IDateTimeFieldProps } from '#core/components/Form/InputDateTime/date_time_field.types';
3
3
  declare const _default: import("vue").DefineComponent<IDateTimeFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IDateTimeFieldProps> & Readonly<{}>, {
4
4
  clearIcon: string;
5
+ teleport: boolean | string | HTMLElement;
5
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
7
  export default _default;
@@ -11,6 +11,7 @@ export interface IDateTimeRangeResponse {
11
11
  }
12
12
  export interface IDateTimeRangeFieldProps extends IDateTimeFieldProps {
13
13
  isDisabledMultiCalendar?: boolean;
14
+ teleport?: boolean | string | HTMLElement;
14
15
  }
15
16
  export type IDateTimeRangeField = IFormFieldBase<INPUT_TYPES.DATE_RANGE | INPUT_TYPES.DATE_TIME_RANGE, IDateTimeRangeFieldProps, {
16
17
  change: (value: IDateTimeRangeResponse) => void;
@@ -3,7 +3,7 @@
3
3
  <Datepicker
4
4
  ref="datepicker"
5
5
  v-model="innerValueRef"
6
- :teleport="true"
6
+ :teleport="teleport"
7
7
  :disabled="wrapperProps.disabled"
8
8
  :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
9
9
  :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
@@ -69,6 +69,7 @@ import "@vuepic/vue-datepicker/dist/main.css";
69
69
  import { dateTimeTheme } from "#core/theme/dateTime";
70
70
  const props = defineProps({
71
71
  isDisabledMultiCalendar: { type: Boolean, required: false },
72
+ teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
72
73
  clearIcon: { type: String, required: false, default: "ph:x-circle-fill" },
73
74
  disabledTime: { type: Boolean, required: false },
74
75
  minDate: { type: [Date, String], required: false },
@@ -2,5 +2,6 @@ import '@vuepic/vue-datepicker/dist/main.css';
2
2
  import type { IDateTimeRangeFieldProps } from './date_range_time_field.types.js';
3
3
  declare const _default: import("vue").DefineComponent<IDateTimeRangeFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IDateTimeRangeFieldProps> & Readonly<{}>, {
4
4
  clearIcon: string;
5
+ teleport: boolean | string | HTMLElement;
5
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
7
  export default _default;
@@ -2,7 +2,7 @@
2
2
  <FieldWrapper v-bind="wrapperProps">
3
3
  <Datepicker
4
4
  v-model="value"
5
- :teleport="true"
5
+ :teleport="teleport"
6
6
  :disabled="wrapperProps.disabled"
7
7
  :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
8
8
  :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
@@ -69,6 +69,7 @@ const props = defineProps({
69
69
  clearIcon: { type: String, required: false, default: "ph:x-circle-fill" },
70
70
  minDate: { type: [Date, String], required: false },
71
71
  maxDate: { type: [Date, String], required: false },
72
+ teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
72
73
  form: { type: Object, required: false },
73
74
  name: { type: String, required: true },
74
75
  errorMessage: { type: String, required: false },
@@ -2,5 +2,6 @@ import '@vuepic/vue-datepicker/dist/main.css';
2
2
  import type { IMonthFieldProps } from '#core/components/Form/InputMonth/types';
3
3
  declare const _default: import("vue").DefineComponent<IMonthFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IMonthFieldProps> & Readonly<{}>, {
4
4
  clearIcon: string;
5
+ teleport: boolean | string | HTMLElement;
5
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
7
  export default _default;
@@ -3,6 +3,7 @@ export interface IMonthFieldProps extends IFieldProps {
3
3
  clearIcon?: string;
4
4
  minDate?: Date | string;
5
5
  maxDate?: Date | string;
6
+ teleport?: boolean | string | HTMLElement;
6
7
  }
7
8
  export type IMonthField = IFormFieldBase<INPUT_TYPES.MONTH, IMonthFieldProps, {
8
9
  change: (value: string) => void;
@@ -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
+ }>;
@@ -2,10 +2,11 @@
2
2
  <FieldWrapper v-bind="wrapperProps">
3
3
  <Datepicker
4
4
  v-model="innerValue"
5
+ :teleport="teleport"
5
6
  :disabled="wrapperProps.disabled"
6
- cancel-text="ยกเลิก"
7
- select-text="เลือก"
8
- locale="th"
7
+ :cancel-text="appConfig.core?.locale === 'th' ? '\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01' : 'Cancel'"
8
+ :select-text="appConfig.core?.locale === 'th' ? '\u0E15\u0E01\u0E25\u0E07' : 'Select'"
9
+ :locale="appConfig.core?.locale"
9
10
  time-picker
10
11
  :placeholder="wrapperProps.placeholder"
11
12
  :format="format"
@@ -46,7 +47,7 @@
46
47
  <script setup>
47
48
  import Datepicker from "@vuepic/vue-datepicker";
48
49
  import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
49
- import { computed, ref, useFieldHOC, useUiConfig, watch } from "#imports";
50
+ import { computed, ref, useFieldHOC, useUiConfig, watch, useAppConfig } from "#imports";
50
51
  import "@vuepic/vue-datepicker/dist/main.css";
51
52
  import { dateTimeTheme } from "#core/theme/dateTime";
52
53
  const emits = defineEmits(["change"]);
@@ -57,6 +58,7 @@ const props = defineProps({
57
58
  startTime: { type: Object, required: false },
58
59
  format: { type: String, required: false },
59
60
  enableSeconds: { type: Boolean, required: false, default: false },
61
+ teleport: { type: [Boolean, String], required: false, skipCheck: true, default: false },
60
62
  form: { type: Object, required: false },
61
63
  name: { type: String, required: true },
62
64
  errorMessage: { type: String, required: false },
@@ -72,6 +74,7 @@ const props = defineProps({
72
74
  help: { type: String, required: false },
73
75
  ui: { type: null, required: false }
74
76
  });
77
+ const appConfig = useAppConfig();
75
78
  const innerValue = ref(void 0);
76
79
  const theme = computed(() => useUiConfig(dateTimeTheme, "dateTime")());
77
80
  const {
@@ -6,6 +6,7 @@ declare const _default: import("vue").DefineComponent<ITimeFieldProps, void, {},
6
6
  onChange?: ((...args: any[]) => any) | undefined;
7
7
  }>, {
8
8
  clearIcon: string;
9
+ teleport: boolean | string | HTMLElement;
9
10
  enableSeconds: boolean;
10
11
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
12
  export default _default;
@@ -11,6 +11,7 @@ export interface ITimeFieldProps extends IFieldProps {
11
11
  startTime?: ITimeOption;
12
12
  format?: string;
13
13
  enableSeconds?: boolean;
14
+ teleport?: boolean | string | HTMLElement;
14
15
  }
15
16
  export type ITimeField = IFormFieldBase<INPUT_TYPES.TIME, ITimeFieldProps, {
16
17
  change: (value: string) => void;
@@ -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 || {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.35.2",
3
+ "version": "2.36.1",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",