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