@finema/core 1.4.24 → 1.4.25

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.d.mts CHANGED
@@ -7,6 +7,7 @@ declare const core: {
7
7
  date_time_format: string;
8
8
  time_format: string;
9
9
  is_thai_year: boolean;
10
+ site_name: string;
10
11
  };
11
12
 
12
13
  declare const config_core: typeof core;
package/dist/module.d.ts CHANGED
@@ -7,6 +7,7 @@ declare const core: {
7
7
  date_time_format: string;
8
8
  time_format: string;
9
9
  is_thai_year: boolean;
10
+ site_name: string;
10
11
  };
11
12
 
12
13
  declare const config_core: typeof core;
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.24",
3
+ "version": "1.4.25",
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.24";
5
+ const version = "1.4.25";
6
6
 
7
7
  const colors = {
8
8
  black: "#20243E",
@@ -24,16 +24,19 @@
24
24
  :color="getColor"
25
25
  close-button=""
26
26
  />
27
- <div :class="['mt-5 flex justify-end']">
27
+ <div :class="[uiConfig.actionGroup.wrapper]">
28
28
  <Button
29
29
  v-if="dialog.meta?.isShowCancelBtn"
30
- class="text-gray mr-4"
30
+ :color="uiConfig.actionGroup.cancelColor"
31
+ :variant="uiConfig.actionGroup.cancelVariant"
31
32
  type="button"
32
33
  @click="dialog.closeDialogCancel"
33
34
  >
34
35
  {{ dialog.meta?.cancelText || 'ยกเลิก' }}
35
36
  </Button>
36
37
  <Button
38
+ :color="uiConfig.actionGroup.confirmColor"
39
+ :variant="uiConfig.actionGroup.confirmVariant"
37
40
  :class="[
38
41
  {
39
42
  'btn-success': dialog.meta?.type === DialogType.SUCCESS,
@@ -53,8 +56,11 @@
53
56
  <script lang="tsx" setup>
54
57
  import { DialogType, useDialog } from '#core/composables/useDialog'
55
58
  import { computed } from 'vue'
59
+ import { useUiConfig } from '#core/composables/useConfig'
60
+ import { notification } from '#core/ui.config/notification'
56
61
 
57
62
  const dialog = useDialog()
63
+ const uiConfig = useUiConfig<typeof notification>(notification, 'notification')
58
64
 
59
65
  const getColor = computed(() => {
60
66
  if (dialog.meta?.type === DialogType.SUCCESS) {
@@ -77,6 +83,10 @@ const getColor = computed(() => {
77
83
  })
78
84
 
79
85
  const getIcon = computed(() => {
86
+ if (dialog.meta?.isHideIcon) {
87
+ return ''
88
+ }
89
+
80
90
  if (dialog.meta?.type === DialogType.SUCCESS) {
81
91
  return 'i-heroicons-check-circle'
82
92
  }
@@ -90,7 +100,7 @@ const getIcon = computed(() => {
90
100
  }
91
101
 
92
102
  if (dialog.meta?.type === DialogType.WARNING) {
93
- return 'i-heroicons-sexclamation-circle'
103
+ return 'i-heroicons-exclamation-circle'
94
104
  }
95
105
 
96
106
  return ''
@@ -1,4 +1,4 @@
1
- import { useSeoMeta } from "#imports";
1
+ import { useCoreConfig, useSeoMeta } from "#imports";
2
2
  import { defineStore } from "pinia";
3
3
  export const useApp = defineStore("_app", {
4
4
  state: () => ({
@@ -16,8 +16,10 @@ export const useApp = defineStore("_app", {
16
16
  this.sidebar = items;
17
17
  },
18
18
  defineSEO(payload) {
19
+ const coreConfig = useCoreConfig();
19
20
  useSeoMeta({
20
21
  title: payload.title,
22
+ titleTemplate: (title) => title ? `${title} | ${coreConfig.site_name}` : coreConfig.site_name,
21
23
  ogTitle: payload.title,
22
24
  description: payload.description,
23
25
  ogDescription: payload.description,
@@ -11,6 +11,7 @@ export interface IDialogMetaItem {
11
11
  confirmText?: string;
12
12
  cancelText?: string;
13
13
  isShowCancelBtn?: boolean;
14
+ isHideIcon?: boolean;
14
15
  }
15
16
  export interface IDialog {
16
17
  isShow: boolean;
@@ -5,4 +5,5 @@ export declare const core: {
5
5
  date_time_format: string;
6
6
  time_format: string;
7
7
  is_thai_year: boolean;
8
+ site_name: string;
8
9
  };
@@ -4,5 +4,6 @@ export const core = {
4
4
  date_format: "dd-MM-yyyy",
5
5
  date_time_format: "dd-MM-yyyy HH:mm",
6
6
  time_format: "HH:mm",
7
- is_thai_year: false
7
+ is_thai_year: false,
8
+ site_name: ""
8
9
  };
@@ -1 +1 @@
1
- export type UIComponentList = 'modal' | 'slideover' | 'dropdown' | 'icon' | 'button' | 'buttonGroup' | 'tabs' | 'card' | 'breadcrumb' | 'badge' | 'input' | 'pagination';
1
+ export type UIComponentList = 'modal' | 'slideover' | 'dropdown' | 'icon' | 'button' | 'buttonGroup' | 'tabs' | 'card' | 'breadcrumb' | 'badge' | 'input' | 'pagination' | 'notification';
@@ -0,0 +1,11 @@
1
+ import type { DeepPartial } from '#ui/types';
2
+ import type * as config from '#ui/ui.config';
3
+ export declare const notification: DeepPartial<(typeof config)['notification'] & {
4
+ actionGroup: {
5
+ wrapper: string;
6
+ cancelColor: string;
7
+ cancelVariant: string;
8
+ confirmColor: string;
9
+ confirmVariant: string;
10
+ };
11
+ }>;
@@ -0,0 +1,9 @@
1
+ export const notification = {
2
+ actionGroup: {
3
+ wrapper: "mt-5 flex justify-end space-x-4",
4
+ cancelColor: "primary",
5
+ cancelVariant: "outline",
6
+ confirmColor: "primary",
7
+ confirmVariant: "solid"
8
+ }
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "1.4.24",
3
+ "version": "1.4.25",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",