@finema/core 2.29.0 → 2.31.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.
Files changed (37) hide show
  1. package/README.md +410 -79
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
  5. package/dist/runtime/components/Form/Fields.vue +23 -14
  6. package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
  7. package/dist/runtime/components/Form/InputComponent/index.vue +23 -0
  8. package/dist/runtime/components/Form/InputComponent/index.vue.d.ts +3 -0
  9. package/dist/runtime/components/Form/InputComponent/types.d.ts +6 -0
  10. package/dist/runtime/components/Form/InputComponent/types.js +0 -0
  11. package/dist/runtime/components/Form/InputDateTime/index.vue +51 -51
  12. package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
  13. package/dist/runtime/components/Form/InputSelectMultiple/index.vue +43 -43
  14. package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
  15. package/dist/runtime/components/Form/InputTime/index.vue +106 -0
  16. package/dist/runtime/components/Form/InputTime/index.vue.d.ts +11 -0
  17. package/dist/runtime/components/Form/InputTime/types.d.ts +17 -0
  18. package/dist/runtime/components/Form/InputTime/types.js +0 -0
  19. package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
  20. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
  21. package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
  22. package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
  23. package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
  24. package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
  25. package/dist/runtime/components/Form/index.vue +5 -5
  26. package/dist/runtime/components/Form/types.d.ts +4 -1
  27. package/dist/runtime/components/Form/types.js +1 -0
  28. package/dist/runtime/components/Image.vue +28 -28
  29. package/dist/runtime/components/Log/index.vue +17 -17
  30. package/dist/runtime/components/Table/ColumnDate.vue +1 -1
  31. package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
  32. package/dist/runtime/components/Table/ColumnImage.vue +4 -4
  33. package/dist/runtime/components/Table/ColumnText.vue +1 -1
  34. package/dist/runtime/server/tsconfig.json +3 -3
  35. package/dist/runtime/utils/TimeHelper.d.ts +3 -3
  36. package/dist/runtime/utils/TimeHelper.js +6 -6
  37. package/package.json +2 -2
@@ -1,28 +1,28 @@
1
1
  <template>
2
- <div :class="theme.onLoadingWrapper()">
3
- <div :class="theme.onLoadingPlaceholderWrapper()">
4
- <Icon
5
- :name="getFileIcon(selectedFile)"
6
- :class="theme.onLoadingPlaceholderIconClass()"
7
- />
8
- </div>
9
- <div :class="theme.onLoadingTextWrapper()">
10
- <div class="truncate">
11
- <h1 class="truncate font-bold">
12
- {{ selectedFile.name }}
13
- </h1>
14
- <p class="truncate font-light text-gray-400">
15
- {{ getFileSize(selectedFile) }} - {{ percent }}% {{ uploadingLabel }}
16
- </p>
17
- </div>
18
- <div>
19
- <Icon
20
- :name="icons.loadingIcon"
21
- :class="theme.onLoadingLoadingIconClass()"
22
- />
23
- </div>
24
- </div>
25
- </div>
2
+ <div :class="theme.onLoadingWrapper()">
3
+ <div :class="theme.onLoadingPlaceholderWrapper()">
4
+ <Icon
5
+ :name="getFileIcon(selectedFile)"
6
+ :class="theme.onLoadingPlaceholderIconClass()"
7
+ />
8
+ </div>
9
+ <div :class="theme.onLoadingTextWrapper()">
10
+ <div class="truncate">
11
+ <h1 class="truncate font-bold">
12
+ {{ selectedFile.name }}
13
+ </h1>
14
+ <p class="truncate font-light text-gray-400">
15
+ {{ getFileSize(selectedFile) }} - {{ percent }}% {{ uploadingLabel }}
16
+ </p>
17
+ </div>
18
+ <div>
19
+ <Icon
20
+ :name="icons.loadingIcon"
21
+ :class="theme.onLoadingLoadingIconClass()"
22
+ />
23
+ </div>
24
+ </div>
25
+ </div>
26
26
  </template>
27
27
 
28
28
  <script setup>
@@ -1,29 +1,29 @@
1
1
  <template>
2
- <Modal
3
- :close="{ onClick: () => emits('close', false) }"
4
- :dismissible="false"
5
- :title="value?.name"
2
+ <Modal
3
+ :close="{ onClick: () => emits('close', false) }"
4
+ :dismissible="false"
5
+ :title="value?.name"
6
6
  :ui="{
7
7
  content: 'max-w-3xl'
8
- }"
9
- >
10
- <template #body>
11
- <div class="flex justify-center">
12
- <img
13
- v-if="value && isImageFromPath(value.path)"
14
- :src="value.url"
15
- alt="img-preview"
16
- class="max-h-96 max-w-full rounded-lg"
17
- />
18
- <video
19
- v-else-if="value && isVideoFromPath(value.path)"
20
- :src="value.url"
21
- controls
22
- class="max-h-96 max-w-full"
23
- />
24
- </div>
25
- </template>
26
- </Modal>
8
+ }"
9
+ >
10
+ <template #body>
11
+ <div class="flex justify-center">
12
+ <img
13
+ v-if="value && isImageFromPath(value.path)"
14
+ :src="value.url"
15
+ alt="img-preview"
16
+ class="max-h-96 max-w-full rounded-lg"
17
+ />
18
+ <video
19
+ v-else-if="value && isVideoFromPath(value.path)"
20
+ :src="value.url"
21
+ controls
22
+ class="max-h-96 max-w-full"
23
+ />
24
+ </div>
25
+ </template>
26
+ </Modal>
27
27
  </template>
28
28
 
29
29
  <script setup>
@@ -1,5 +1,5 @@
1
- <template>
2
- <form class="form">
3
- <slot />
4
- </form>
5
- </template>
1
+ <template>
2
+ <form class="form">
3
+ <slot />
4
+ </form>
5
+ </template>
@@ -12,8 +12,10 @@ import type { ICheckboxField } from '#core/components/Form/InputCheckbox/types';
12
12
  import type { ISelectMultipleField } from '#core/components/Form/InputSelectMultiple/types';
13
13
  import type { INumberField } from '#core/components/Form/InputNumber/types';
14
14
  import type { IDateTimeField } from '#core/components/Form/InputDateTime/date_time_field.types';
15
+ import type { ITimeField } from '#core/components/Form/InputTime/types';
15
16
  import type { IRadioField } from '#core/components/Form/InputRadio/types';
16
17
  import type { IWYSIWYGField } from '#core/components/Form/InputWYSIWYG/types';
18
+ import type { IComponentField } from '#core/components/Form/InputComponent/types';
17
19
  export declare enum INPUT_TYPES {
18
20
  TEXT = "TEXT",
19
21
  SEARCH = "SEARCH",
@@ -28,6 +30,7 @@ export declare enum INPUT_TYPES {
28
30
  RADIO = "RADIO",
29
31
  CHECKBOX = "CHECKBOX",
30
32
  DATE_TIME = "DATE_TIME",
33
+ TIME = "TIME",
31
34
  DATE = "DATE",
32
35
  DATE_RANGE = "DATE_RANGE",
33
36
  DATE_TIME_RANGE = "DATE_TIME_RANGE",
@@ -67,7 +70,7 @@ export interface IFormFieldBase<I extends INPUT_TYPES, P extends IFieldProps, O>
67
70
  props: P;
68
71
  on?: O;
69
72
  }
70
- export type IFormField = ITextField | ISearchField | INumberField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ISelectMultipleField | IRadioField | IDateTimeField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IWYSIWYGField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
73
+ export type IFormField = ITextField | ISearchField | INumberField | ITextareaField | IToggleField | ISelectField | ICheckboxField | ISelectMultipleField | IRadioField | IDateTimeField | ITimeField | IDateTimeRangeField | IUploadDropzoneField | IUploadDropzoneAutoField | IWYSIWYGField | IComponentField | IFormFieldBase<INPUT_TYPES.COMPONENT, any, any>;
71
74
  export interface IFileValue {
72
75
  url: string;
73
76
  path?: string;
@@ -12,6 +12,7 @@ export var INPUT_TYPES = /* @__PURE__ */ ((INPUT_TYPES2) => {
12
12
  INPUT_TYPES2["RADIO"] = "RADIO";
13
13
  INPUT_TYPES2["CHECKBOX"] = "CHECKBOX";
14
14
  INPUT_TYPES2["DATE_TIME"] = "DATE_TIME";
15
+ INPUT_TYPES2["TIME"] = "TIME";
15
16
  INPUT_TYPES2["DATE"] = "DATE";
16
17
  INPUT_TYPES2["DATE_RANGE"] = "DATE_RANGE";
17
18
  INPUT_TYPES2["DATE_TIME_RANGE"] = "DATE_TIME_RANGE";
@@ -1,32 +1,32 @@
1
1
  <template>
2
- <UseImage v-bind="$props">
3
- <template #loading>
4
- <slot name="loading">
5
- <div
6
- class="flex h-full w-full items-center justify-center"
7
- >
8
- <Loader
9
- :loading="true"
10
- />
11
- </div>
12
- </slot>
13
- </template>
14
-
15
- <template #error>
16
- <slot name="error">
17
- <div
18
- class="flex h-full w-full items-center justify-center"
19
- >
20
- <p class="text-error-400">
21
- <Icon
22
- name="i-heroicons:exclamation-circle-solid"
23
- class="text-error-400 size-8"
24
- />
25
- </p>
26
- </div>
27
- </slot>
28
- </template>
29
- </UseImage>
2
+ <UseImage v-bind="$props">
3
+ <template #loading>
4
+ <slot name="loading">
5
+ <div
6
+ class="flex h-full w-full items-center justify-center"
7
+ >
8
+ <Loader
9
+ :loading="true"
10
+ />
11
+ </div>
12
+ </slot>
13
+ </template>
14
+
15
+ <template #error>
16
+ <slot name="error">
17
+ <div
18
+ class="flex h-full w-full items-center justify-center"
19
+ >
20
+ <p class="text-error-400">
21
+ <Icon
22
+ name="i-heroicons:exclamation-circle-solid"
23
+ class="text-error-400 size-8"
24
+ />
25
+ </p>
26
+ </div>
27
+ </slot>
28
+ </template>
29
+ </UseImage>
30
30
  </template>
31
31
 
32
32
  <script setup>
@@ -1,21 +1,21 @@
1
1
  <template>
2
- <DevOnly>
3
- <TeleportSafe
4
- to="#dev-logs"
5
- >
6
- <LogItem
7
- v-if="typeof data !== 'undefined'"
8
- :data="data"
9
- :title="title"
10
- />
11
- <LogItem
12
- v-for="(item, index) in dataItems"
13
- :key="index"
14
- :data="item"
15
- :title="`${title} #${index + 1}`"
16
- />
17
- </TeleportSafe>
18
- </DevOnly>
2
+ <DevOnly>
3
+ <TeleportSafe
4
+ to="#dev-logs"
5
+ >
6
+ <LogItem
7
+ v-if="typeof data !== 'undefined'"
8
+ :data="data"
9
+ :title="title"
10
+ />
11
+ <LogItem
12
+ v-for="(item, index) in dataItems"
13
+ :key="index"
14
+ :data="item"
15
+ :title="`${title} #${index + 1}`"
16
+ />
17
+ </TeleportSafe>
18
+ </DevOnly>
19
19
  </template>
20
20
 
21
21
  <script setup>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue || "-" }}
2
+ {{ getValue || "-" }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue || "-" }}
2
+ {{ getValue || "-" }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <Image
3
- class="h-12 rounded"
4
- :src="getValue"
5
- />
2
+ <Image
3
+ class="h-12 rounded"
4
+ :src="getValue"
5
+ />
6
6
  </template>
7
7
 
8
8
  <script setup>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- {{ getValue }}
2
+ {{ getValue }}
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -1,3 +1,3 @@
1
- {
2
- "extends": "../../../.nuxt/tsconfig.server.json",
3
- }
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json",
3
+ }
@@ -8,9 +8,9 @@ export declare class TimeHelper {
8
8
  };
9
9
  static toUTC: (time: string | Date) => string;
10
10
  static toLocal: (time: string | Date) => string;
11
- static getCurrentDate: () => string;
12
- static getDateFormTime: (time: string | Date) => string;
13
- static getDateFormTimeWithLocal: (time: string | Date) => string;
11
+ static getCurrentDate: (customFormat?: string) => string;
12
+ static getDateFormTime: (time: string | Date, customFormat?: string) => string;
13
+ static getDateFormTimeWithLocal: (time: string | Date, customFormat?: string) => string;
14
14
  static getISODateTimeFormTime: (time: string | Date) => string;
15
15
  static getDateTimeFormTime: (time: string | Date) => string;
16
16
  static getTimeFormTime: (time: string | Date) => string;
@@ -81,24 +81,24 @@ export class TimeHelper {
81
81
  return time.toString();
82
82
  }
83
83
  };
84
- static getCurrentDate = () => {
85
- return format(/* @__PURE__ */ new Date(), dateFormat);
84
+ static getCurrentDate = (customFormat = dateFormat) => {
85
+ return format(/* @__PURE__ */ new Date(), customFormat);
86
86
  };
87
- static getDateFormTime = (time) => {
87
+ static getDateFormTime = (time, customFormat = dateFormat) => {
88
88
  if (!time) {
89
89
  return time;
90
90
  }
91
91
  const parsedTime = isDate(time) ? time : parse(time, dateTimeFormat, /* @__PURE__ */ new Date());
92
- const newTime = format(parsedTime, dateFormat);
92
+ const newTime = format(parsedTime, customFormat);
93
93
  return isValid(parsedTime) ? newTime : time;
94
94
  };
95
- static getDateFormTimeWithLocal = (time) => {
95
+ static getDateFormTimeWithLocal = (time, customFormat = dateFormat) => {
96
96
  if (!time) {
97
97
  return time;
98
98
  }
99
99
  const localTime = TimeHelper.toLocal(time);
100
100
  const parsedTime = isDate(localTime) ? localTime : parse(localTime, dateTimeFormat, /* @__PURE__ */ new Date());
101
- const newTime = format(parsedTime, dateFormat);
101
+ const newTime = format(parsedTime, customFormat);
102
102
  return isValid(parsedTime) ? newTime : time;
103
103
  };
104
104
  static getISODateTimeFormTime = (time) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.29.0",
3
+ "version": "2.31.0",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",
@@ -44,7 +44,7 @@
44
44
  "@iconify-json/ph": "^1.2.2",
45
45
  "@iconify-json/svg-spinners": "^1.2.2",
46
46
  "@nuxt/kit": "^4.0.2",
47
- "@nuxt/ui": "^3.3.0",
47
+ "@nuxt/ui": "^3.3.2",
48
48
  "@pinia/nuxt": "^0.11.0",
49
49
  "@tailwindcss/typography": "^0.5.0-alpha.3",
50
50
  "@tiptap/extension-image": "^3.0.7",