@finema/core 2.5.1 → 2.5.2

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.5.1",
3
+ "version": "2.5.2",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import defu from 'defu';
3
3
  import * as theme from '../dist/runtime/theme/index.js';
4
4
 
5
5
  const name = "@finema/core";
6
- const version = "2.5.1";
6
+ const version = "2.5.2";
7
7
 
8
8
  const nuxtAppOptions = {
9
9
  head: {
@@ -1,50 +1,50 @@
1
1
  <template>
2
- <AlertDialogRoot :open="true">
3
- <AlertDialogPortal>
4
- <AlertDialogOverlay :class="ui.overlay()" />
5
- <AlertDialogContent
6
- :class="ui.base()"
7
- >
8
- <Icon
9
- v-if="!propsSafe.isHideIcon"
10
- :name="getIcon"
11
- :class="ui.icon()"
12
- />
13
- <div :class="ui.wrapper()">
14
- <AlertDialogTitle :class="ui.title()">
15
- {{ propsSafe.title }}
16
- </AlertDialogTitle>
17
- <AlertDialogDescription
18
- v-if="propsSafe.description"
19
- :class="ui.description()"
20
- >
21
- {{ propsSafe.description }}
22
- </AlertDialogDescription>
23
-
24
- <div :class="ui.buttonGroup()">
25
- <Button
26
- v-if="propsSafe.isShowCancelBtn"
27
- type="button"
28
- color="neutral"
29
- variant="outline"
30
- :class="ui.cancelButton()"
31
- @click="emits('close', false)"
32
- >
33
- {{ propsSafe.cancelText }}
34
- </Button>
35
- <Button
36
- type="button"
37
- :color="propsSafe.isConfirm ? ui.confirmColor() : propsSafe.type"
38
- :class="ui.confirmButton()"
39
- @click="emits('close', true)"
40
- >
41
- {{ propsSafe.confirmText }}
42
- </Button>
43
- </div>
44
- </div>
45
- </AlertDialogContent>
46
- </AlertDialogPortal>
47
- </AlertDialogRoot>
2
+ <AlertDialogRoot :open="true">
3
+ <AlertDialogPortal>
4
+ <AlertDialogOverlay :class="ui.overlay()" />
5
+ <AlertDialogContent
6
+ :class="ui.base()"
7
+ >
8
+ <Icon
9
+ v-if="!propsSafe.isHideIcon"
10
+ :name="getIcon"
11
+ :class="ui.icon()"
12
+ />
13
+ <div :class="ui.wrapper()">
14
+ <AlertDialogTitle :class="ui.title()">
15
+ {{ propsSafe.title }}
16
+ </AlertDialogTitle>
17
+ <AlertDialogDescription
18
+ v-if="propsSafe.description"
19
+ :class="ui.description()"
20
+ >
21
+ {{ propsSafe.description }}
22
+ </AlertDialogDescription>
23
+
24
+ <div :class="ui.buttonGroup()">
25
+ <Button
26
+ v-if="propsSafe.isShowCancelBtn"
27
+ type="button"
28
+ color="neutral"
29
+ variant="outline"
30
+ :class="ui.cancelButton()"
31
+ @click="emits('close', false)"
32
+ >
33
+ {{ propsSafe.cancelText }}
34
+ </Button>
35
+ <Button
36
+ type="button"
37
+ :color="propsSafe.isConfirm ? ui.confirmColor() : propsSafe.type"
38
+ :class="ui.confirmButton()"
39
+ @click="emits('close', true)"
40
+ >
41
+ {{ propsSafe.confirmText }}
42
+ </Button>
43
+ </div>
44
+ </div>
45
+ </AlertDialogContent>
46
+ </AlertDialogPortal>
47
+ </AlertDialogRoot>
48
48
  </template>
49
49
 
50
50
  <script setup>
@@ -57,7 +57,7 @@ import {
57
57
  AlertDialogTitle
58
58
  } from "reka-ui";
59
59
  import { computed, useAttrs } from "vue";
60
- import { useUiConfig } from "#core/composables/useConfig";
60
+ import { useUiAllConfig, useUiConfig } from "../../composables/useConfig";
61
61
  import { dialogTheme } from "#core/theme/dialog";
62
62
  import { DialogType } from "#core/composables/useDialog";
63
63
  const emits = defineEmits();
@@ -66,6 +66,7 @@ const props = withDefaults(defineProps(), {
66
66
  cancelText: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01"
67
67
  });
68
68
  const attrs = useAttrs();
69
+ const dialogConfig = useUiAllConfig().dialog.slots;
69
70
  const propsSafe = computed(() => {
70
71
  if (props.title) {
71
72
  return props;
@@ -85,15 +86,15 @@ const getIcon = computed(() => {
85
86
  }
86
87
  switch (propsSafe.value.type) {
87
88
  case DialogType.SUCCESS:
88
- return ui.value.iconSuccess();
89
+ return dialogConfig.iconSuccess;
89
90
  case DialogType.ERROR:
90
- return ui.value.iconError();
91
+ return dialogConfig.iconError;
91
92
  case DialogType.INFO:
92
- return ui.value.iconInfo();
93
+ return dialogConfig.iconInfo;
93
94
  case DialogType.WARNING:
94
- return ui.value.iconWarning();
95
+ return dialogConfig.iconWarning;
95
96
  default:
96
- return ui.value.iconInfo();
97
+ return dialogConfig.iconInfo;
97
98
  }
98
99
  });
99
100
  const ui = computed(() => useUiConfig(dialogTheme, "dialog")({
@@ -1,3 +1,4 @@
1
1
  import type { core as Core } from '../../core.config.js';
2
2
  export declare const useCoreConfig: () => typeof Core;
3
3
  export declare const useUiConfig: (config: object, name: string) => any;
4
+ export declare const useUiAllConfig: () => any;
@@ -10,3 +10,6 @@ export const useUiConfig = (config, name) => {
10
10
  ...appConfig.ui[name] || {}
11
11
  });
12
12
  };
13
+ export const useUiAllConfig = () => {
14
+ return useAppConfig().ui;
15
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",