nuxt-hs-ui 2.0.11 → 2.0.13

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
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.15.0"
6
6
  },
7
- "version": "2.0.11",
7
+ "version": "2.0.13",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -244,7 +244,7 @@ const buttonTv = tv({
244
244
  // [ vueuse ]
245
245
  import { useElementHover } from "@vueuse/core";
246
246
  // [ NUXT ]
247
- import { ref, computed, useId, useRuntimeConfig } from "#imports";
247
+ import { ref, computed, useId } from "#imports";
248
248
  // [ utils ]
249
249
  import { Dayjs } from "../../utils/dayjs";
250
250
  import { type ClassType, ClassTypeToString } from "../../utils/class-style";
@@ -254,7 +254,6 @@ import { Sleep } from "../../utils/com";
254
254
  import { useHsFocus } from "../../composables/use-hs-focus";
255
255
 
256
256
  import BtnLineLoading from "./btn-line-loading.vue";
257
- const { public: config } = useRuntimeConfig();
258
257
  // ----------------------------------------------------------------------------
259
258
  // ----------------------------------------------------------------------------
260
259
  interface Props {
@@ -313,9 +312,9 @@ emit("id", uid);
313
312
  const styleMain = computed(() => {
314
313
  return [
315
314
  //
316
- `--main-color:${GetGolorCode(props.theme, config)};`,
317
- `--main-color-opacity-50:${GetGolorCode(props.theme, config)}88;`,
318
- `--sub-color:${GetGolorCode(props.theme, config)};`,
315
+ `--main-color:${GetGolorCode(props.theme)};`,
316
+ `--main-color-opacity-50:${GetGolorCode(props.theme)}88;`,
317
+ `--sub-color:${GetGolorCode(props.theme)};`,
319
318
  ];
320
319
  });
321
320
 
@@ -53,13 +53,11 @@ const alertTv = tv({
53
53
 
54
54
  // ----------------------------------------------------------------------------
55
55
  // [ NUXT ]
56
- import { computed, useRuntimeConfig } from "#imports";
56
+ import { computed } from "#imports";
57
57
  // [ utils ]
58
58
  import { type ClassType, ClassTypeToString } from "../../utils/class-style";
59
59
  import { GetGolorCode } from "../../utils/theme";
60
60
 
61
- // ----------------------------------------------------------------------------
62
- const { public: config } = useRuntimeConfig();
63
61
  // ----------------------------------------------------------------------------
64
62
 
65
63
  interface Props {
@@ -79,7 +77,7 @@ const props = withDefaults(defineProps<Props>(), {
79
77
  const styleMain = computed(() => {
80
78
  return [
81
79
  //
82
- `--main-color:${GetGolorCode(props.theme, config)};`,
80
+ `--main-color:${GetGolorCode(props.theme)};`,
83
81
  ];
84
82
  });
85
83
  const classTv = computed(() => {
@@ -80,14 +80,13 @@ const cardItemTv = tv({
80
80
  ----------------------------------------------------------------------------- */
81
81
 
82
82
  // [ NUXT ]
83
- import { computed, useRuntimeConfig } from "#imports";
83
+ import { computed } from "#imports";
84
84
  // [ utils ]
85
85
  import { type ClassType, ClassTypeToString } from "../../utils/class-style";
86
86
  import { GetGolorCode } from "../../utils/theme";
87
87
  // [ Components ]
88
88
  import Btn from "../form/btn.vue";
89
89
  import Accordion from "./accordion.vue";
90
- const { public: config } = useRuntimeConfig();
91
90
  // ----------------------------------------------------------------------------
92
91
  // ----------------------------------------------------------------------------
93
92
  interface Props {
@@ -130,7 +129,7 @@ const bgTheme = computed(() => {
130
129
  const styleMain = computed(() => {
131
130
  return [
132
131
  //
133
- `--main-color:${GetGolorCode(bgTheme.value, config)};`,
132
+ `--main-color:${GetGolorCode(bgTheme.value)};`,
134
133
  ];
135
134
  });
136
135
  const classTv = computed(() => {
@@ -1,4 +1,3 @@
1
- import { useRuntimeConfig } from "#imports";
2
1
  import { Int } from "./number.js";
3
2
  import { ObjectCopy } from "./object.js";
4
3
  import { useHsMultiLang } from "../composables/use-hs-multi-lang.js";
@@ -218,12 +217,11 @@ export const GetListTableBtnSetting = (arg) => {
218
217
  title: ``,
219
218
  formatter: (cell) => {
220
219
  const row = cell.getRow().getData();
221
- const { public: config } = useRuntimeConfig();
222
220
  const baseUrl = detailUrl;
223
221
  const herf = mode === "detail" ? `href="${baseUrl.replace(/new/, "")}${row.pId}"` : "";
224
222
  const style = [
225
- `border:solid 2px ${GetGolorCode(actionBtnTheme, config)}`,
226
- `color:${GetGolorCode(actionBtnTheme, config)}`,
223
+ `border:solid 2px ${GetGolorCode(actionBtnTheme)}`,
224
+ `color:${GetGolorCode(actionBtnTheme)}`,
227
225
  `width:100%`
228
226
  ].join(";");
229
227
  const overlayBg = `bg-${actionBtnTheme}`;
@@ -18,4 +18,4 @@ export declare const Theme: {
18
18
  };
19
19
  export type Theme = (typeof Theme)[keyof typeof Theme];
20
20
  export declare const ThemeKyes: [keyof typeof Theme];
21
- export declare const GetGolorCode: (code: string, config: any) => any;
21
+ export declare const GetGolorCode: (code: string) => any;
@@ -1,3 +1,4 @@
1
+ import _appConfig from "#build/app.config";
1
2
  export const Theme = {
2
3
  main0: "main0",
3
4
  main1: "main1",
@@ -20,8 +21,8 @@ export const Theme = {
20
21
  back: "back"
21
22
  };
22
23
  export const ThemeKyes = Object.keys(Theme);
23
- export const GetGolorCode = (code, config) => {
24
- const colors = config.hsui.colors || {};
24
+ export const GetGolorCode = (code) => {
25
+ const colors = _appConfig.tv.twMergeConfig.theme.extend.colors || {};
25
26
  if (code in colors) {
26
27
  return colors[code] || "#000000";
27
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",