@finema/core 1.4.8 → 1.4.9

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.8",
3
+ "version": "1.4.9",
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.8";
5
+ const version = "1.4.9";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -13,7 +13,26 @@
13
13
  :row="row"
14
14
  />
15
15
  <ColumnImage
16
- v-if="column.type === COLUMN_TYPES.IMAGE"
16
+ v-else-if="column.type === COLUMN_TYPES.IMAGE"
17
+ :value="row[column.key]"
18
+ :column="column"
19
+ :row="row"
20
+ />
21
+ <ColumnDateTime
22
+ v-else-if="column.type === COLUMN_TYPES.DATE_TIME"
23
+ :value="row[column.key]"
24
+ :column="column"
25
+ :row="row"
26
+ />
27
+ <ColumnDate
28
+ v-else-if="column.type === COLUMN_TYPES.DATE"
29
+ :value="row[column.key]"
30
+ :column="column"
31
+ :row="row"
32
+ />
33
+ <component
34
+ :is="column.component"
35
+ v-else-if="column.type === COLUMN_TYPES.COMPONENT"
17
36
  :value="row[column.key]"
18
37
  :column="column"
19
38
  :row="row"
@@ -45,6 +64,8 @@ import ColumnImage from '#core/components/Table/ColumnImage.vue'
45
64
  import { computed, type PropType } from 'vue'
46
65
  import { StringHelper } from '#core/utils/StringHelper'
47
66
  import { ref, watch } from '#imports'
67
+ import ColumnDateTime from '#core/components/Table/ColumnDateTime.vue'
68
+ import ColumnDate from '#core/components/Table/ColumnDate.vue'
48
69
 
49
70
  const emits = defineEmits(['pageChange'])
50
71
 
@@ -0,0 +1,16 @@
1
+ <template>
2
+ {{ getValue }}
3
+ </template>
4
+ <script lang="ts" setup>
5
+ import { computed } from 'vue'
6
+ import { type IColumn } from '#core/components/Table/types'
7
+ import { TimeHelper } from '#core/utils/TimeHelper'
8
+
9
+ const props = defineProps<{
10
+ value: any
11
+ row: any
12
+ column: IColumn
13
+ }>()
14
+
15
+ const getValue = computed<string>(() => TimeHelper.getDateFormTime(props.value))
16
+ </script>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <p :title="`${getValue.date} ${getValue.time}`" class="flex flex-col whitespace-nowrap px-4">
3
+ <span>
4
+ {{ getValue.date }}
5
+ </span>
6
+ <span class="text-gray text-xs">
7
+ {{ getValue.time }}
8
+ </span>
9
+ </p>
10
+ </template>
11
+ <script lang="ts" setup>
12
+ import { computed } from 'vue'
13
+ import { type IColumn } from '#core/components/Table/types'
14
+ import { TimeHelper } from '#core/utils/TimeHelper'
15
+
16
+ const props = defineProps<{
17
+ value: any
18
+ row: any
19
+ column: IColumn
20
+ }>()
21
+
22
+ const getValue = computed<{ date: string; time: string }>(() => {
23
+ return props.value
24
+ ? {
25
+ date: TimeHelper.getDateFormTime(props.value),
26
+ time: TimeHelper.getTimeFormTime(props.value),
27
+ }
28
+ : { date: '-', time: '-' }
29
+ })
30
+ </script>
@@ -1,6 +1,5 @@
1
1
  import { type IPageOptions, type IStatus } from '#core/types/lib';
2
2
  export declare const enum COLUMN_TYPES {
3
- VALUE = "VALUE",
4
3
  COMPONENT = "COMPONENT",
5
4
  DATE = "DATE",
6
5
  DATE_TIME = "DATE_TIME",
@@ -14,6 +13,7 @@ export interface IColumn {
14
13
  sortable?: boolean;
15
14
  direction?: 'asc' | 'desc';
16
15
  class?: string;
16
+ component?: any;
17
17
  type?: COLUMN_TYPES;
18
18
  }
19
19
  export interface IRowItem {
@@ -1,5 +1,4 @@
1
1
  export var COLUMN_TYPES = /* @__PURE__ */ ((COLUMN_TYPES2) => {
2
- COLUMN_TYPES2["VALUE"] = "VALUE";
3
2
  COLUMN_TYPES2["COMPONENT"] = "COMPONENT";
4
3
  COLUMN_TYPES2["DATE"] = "DATE";
5
4
  COLUMN_TYPES2["DATE_TIME"] = "DATE_TIME";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",