nuxt-hs-ui 1.0.1

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.
Files changed (54) hide show
  1. package/README.md +4 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.mts +8 -0
  4. package/dist/module.d.ts +8 -0
  5. package/dist/module.json +9 -0
  6. package/dist/module.mjs +92 -0
  7. package/dist/runtime/components/hs-fc/btn/index.vue +508 -0
  8. package/dist/runtime/components/hs-fc/btn/line-loading.vue +125 -0
  9. package/dist/runtime/components/hs-fc/hoge +0 -0
  10. package/dist/runtime/components/hs-ui/accordion.vue +93 -0
  11. package/dist/runtime/components/hs-ui/aspect-box.vue +78 -0
  12. package/dist/runtime/components/hs-ui/block-loading.vue +210 -0
  13. package/dist/runtime/components/hs-ui/card-item.vue +136 -0
  14. package/dist/runtime/components/hs-ui/card.vue +48 -0
  15. package/dist/runtime/components/hs-ui/container.vue +46 -0
  16. package/dist/runtime/components/hs-ui/dialog/index.type.d.ts +48 -0
  17. package/dist/runtime/components/hs-ui/dialog/index.type.js +57 -0
  18. package/dist/runtime/components/hs-ui/dialog/index.vue +353 -0
  19. package/dist/runtime/components/hs-ui/modal/bg.vue +90 -0
  20. package/dist/runtime/components/hs-ui/modal/index.vue +203 -0
  21. package/dist/runtime/components/hs-ui/modal/use-ui-modal.d.ts +20 -0
  22. package/dist/runtime/components/hs-ui/modal/use-ui-modal.js +74 -0
  23. package/dist/runtime/components/hs-ui/toast/index.type.d.ts +24 -0
  24. package/dist/runtime/components/hs-ui/toast/index.type.js +7 -0
  25. package/dist/runtime/components/hs-ui/toast/index.vue +355 -0
  26. package/dist/runtime/components/hs-ui/window-loader.vue +185 -0
  27. package/dist/runtime/components/v-test.vue +57 -0
  28. package/dist/runtime/composables/use-hs-form-focus.d.ts +10 -0
  29. package/dist/runtime/composables/use-hs-form-focus.js +29 -0
  30. package/dist/runtime/composables/use-hs-multi-lang.d.ts +9 -0
  31. package/dist/runtime/composables/use-hs-multi-lang.js +21 -0
  32. package/dist/runtime/composables/use-hs-ui-dialog.d.ts +22 -0
  33. package/dist/runtime/composables/use-hs-ui-dialog.js +43 -0
  34. package/dist/runtime/composables/use-hs-ui-toast.d.ts +20 -0
  35. package/dist/runtime/composables/use-hs-ui-toast.js +55 -0
  36. package/dist/runtime/composables/use-hs-ui-window-loader.d.ts +11 -0
  37. package/dist/runtime/composables/use-hs-ui-window-loader.js +21 -0
  38. package/dist/runtime/lib/class-style.d.ts +8 -0
  39. package/dist/runtime/lib/class-style.js +59 -0
  40. package/dist/runtime/lib/com.d.ts +14 -0
  41. package/dist/runtime/lib/com.js +25 -0
  42. package/dist/runtime/lib/multi-lang.d.ts +9 -0
  43. package/dist/runtime/lib/multi-lang.js +75 -0
  44. package/dist/runtime/lib/number.d.ts +16 -0
  45. package/dist/runtime/lib/number.js +101 -0
  46. package/dist/runtime/lib/prefix.d.ts +2 -0
  47. package/dist/runtime/lib/prefix.js +19 -0
  48. package/dist/runtime/lib/theme.d.ts +2 -0
  49. package/dist/runtime/lib/theme.js +21 -0
  50. package/dist/runtime/server/tsconfig.json +3 -0
  51. package/dist/runtime/style.css +1 -0
  52. package/dist/types.d.mts +17 -0
  53. package/dist/types.d.ts +17 -0
  54. package/package.json +82 -0
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 数値をカンマを挿入した文字列に変換する
3
+ * @param num 数値
4
+ * @returns カンマが挿入された文字列
5
+ */
6
+ export declare const InsertComma: (num: number | string | null, digits?: number, nullText?: string, comma?: string) => string;
7
+ /**
8
+ * 数値をカンマを挿入した文字列に変換する
9
+ * @param num 数値
10
+ * @returns カンマが挿入された文字列
11
+ */
12
+ export declare const InsertCommaK: (num: number | string | null) => string;
13
+ export declare const Int: (i: any) => number;
14
+ export declare const IntNullable: (i: any) => number | null;
15
+ export declare const Float: (i: any, digits?: number) => number;
16
+ export declare const FloatNullable: (i: any, digits?: number) => number | null;
@@ -0,0 +1,101 @@
1
+ import BigNumber from "bignumber.js";
2
+ export const InsertComma = (num, digits = 0, nullText = "0", comma = ",") => {
3
+ if (num === null || num === "") {
4
+ num = nullText;
5
+ return num;
6
+ }
7
+ const numString = String(num).replace(/,/g, "");
8
+ const delimitExp = /(\d)(?=(\d{3})+$)/g;
9
+ const decimalDelimitExp = /(\d)(?=(\d{3})+(\.\d+))/g;
10
+ let ret = "";
11
+ if (numString.includes(".")) {
12
+ ret = numString.replace(decimalDelimitExp, "$1" + comma);
13
+ } else {
14
+ ret = numString.replace(delimitExp, "$1" + comma);
15
+ }
16
+ if (digits === 0)
17
+ return ret;
18
+ const d = Int(numString) < 0 ? digits + 1 : digits;
19
+ if (numString.includes(".")) {
20
+ const m = ret.replace(/\d+\./g, "");
21
+ if (m.length < d) {
22
+ ret = `${ret}${Array(d + 1 - m.length).join("0")}`;
23
+ }
24
+ } else {
25
+ ret = `${ret}.${Array(digits + 1).join("0")}`;
26
+ }
27
+ return ret;
28
+ };
29
+ export const InsertCommaK = (num) => {
30
+ num = Int(num) * 100;
31
+ num = InsertComma(num);
32
+ return num.replace(/(.*)\d{2}$/, "$1");
33
+ };
34
+ export const Int = (i) => {
35
+ try {
36
+ const str = String(i).replace(/(\\|,|-$)/g, "");
37
+ const num = Number.parseInt(str, 10);
38
+ if (Number.isNaN(num)) {
39
+ return 0;
40
+ } else {
41
+ return num;
42
+ }
43
+ } catch (error) {
44
+ console.error(`Comvert.Int(${i})`, i, error);
45
+ return 0;
46
+ }
47
+ };
48
+ export const IntNullable = (i) => {
49
+ try {
50
+ if (i === null)
51
+ return null;
52
+ if (i === "")
53
+ return null;
54
+ const str = String(i).replace(/(\\|,|-$)/g, "");
55
+ const num = Number.parseInt(str, 10);
56
+ if (Number.isNaN(num)) {
57
+ return null;
58
+ } else {
59
+ return num;
60
+ }
61
+ } catch (error) {
62
+ console.error(`IntNullable(${i})`, { i, error });
63
+ return null;
64
+ }
65
+ };
66
+ export const Float = (i, digits = 0) => {
67
+ try {
68
+ const str = `${String(i).replace(/(\\|,|-$)/g, "")}`;
69
+ const num = new BigNumber(str);
70
+ if (Number.isNaN(num.toNumber())) {
71
+ return 0;
72
+ } else {
73
+ return num.dp(digits).toNumber();
74
+ }
75
+ } catch (error) {
76
+ console.error(`Float(${i})`, { i, digits, error });
77
+ return 0;
78
+ }
79
+ };
80
+ export const FloatNullable = (i, digits = 0) => {
81
+ try {
82
+ if (i === null)
83
+ return null;
84
+ if (i === "")
85
+ return null;
86
+ BigNumber.config({
87
+ ROUNDING_MODE: BigNumber.ROUND_DOWN
88
+ // 切り上げ
89
+ });
90
+ const str = `${String(i).replace(/(\\|,|-$)/g, "")}`;
91
+ const num = new BigNumber(str);
92
+ if (Number.isNaN(num.toNumber())) {
93
+ return null;
94
+ } else {
95
+ return num.dp(digits).toNumber();
96
+ }
97
+ } catch (error) {
98
+ console.error(`FloatNullable(${i})`, { i, digits, error });
99
+ return null;
100
+ }
101
+ };
@@ -0,0 +1,2 @@
1
+ export declare const GetPrefix: () => "" | "tw-";
2
+ export declare const RemovePrefix: (arg: string[]) => string[];
@@ -0,0 +1,19 @@
1
+ import { useRuntimeConfig } from "#imports";
2
+ export const GetPrefix = () => {
3
+ const config = useRuntimeConfig().public.hsui;
4
+ const prefix = config?.prefix || "";
5
+ if (prefix === "tw-")
6
+ return "tw-";
7
+ return "";
8
+ };
9
+ const checkReg = /(?:[ :!]|^|\n)tw-/;
10
+ export const RemovePrefix = (arg) => {
11
+ const prefix = GetPrefix();
12
+ const ret = arg.reduce((ret2, row) => {
13
+ if (prefix === "" && !checkReg.test(row) || prefix !== "" && checkReg.test(row)) {
14
+ ret2.push(row);
15
+ }
16
+ return ret2;
17
+ }, []);
18
+ return ret;
19
+ };
@@ -0,0 +1,2 @@
1
+ export declare const Theme: readonly ["main0", "main1", "main2", "main3", "accent1", "accent2", "info", "link", "download", "success", "warn", "error", "white", "black", "dark", "back"];
2
+ export type Theme = (typeof Theme)[number];
@@ -0,0 +1,21 @@
1
+ export const Theme = [
2
+ //
3
+ "main0",
4
+ "main1",
5
+ "main2",
6
+ "main3",
7
+ "accent1",
8
+ "accent2",
9
+ //
10
+ "info",
11
+ "link",
12
+ "download",
13
+ "success",
14
+ "warn",
15
+ "error",
16
+ //
17
+ "white",
18
+ "black",
19
+ "dark",
20
+ "back"
21
+ ];
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json",
3
+ }
@@ -0,0 +1 @@
1
+ @tailwind base;@tailwind components;@tailwind utilities;*{position:relative}
@@ -0,0 +1,17 @@
1
+
2
+ import type { ModuleOptions } from './module.js'
3
+
4
+
5
+
6
+ declare module '@nuxt/schema' {
7
+ interface NuxtConfig { ['hsui']?: Partial<ModuleOptions> }
8
+ interface NuxtOptions { ['hsui']?: ModuleOptions }
9
+ }
10
+
11
+ declare module 'nuxt/schema' {
12
+ interface NuxtConfig { ['hsui']?: Partial<ModuleOptions> }
13
+ interface NuxtOptions { ['hsui']?: ModuleOptions }
14
+ }
15
+
16
+
17
+ export type { ModuleOptions, default } from './module.js'
@@ -0,0 +1,17 @@
1
+
2
+ import type { ModuleOptions } from './module'
3
+
4
+
5
+
6
+ declare module '@nuxt/schema' {
7
+ interface NuxtConfig { ['hsui']?: Partial<ModuleOptions> }
8
+ interface NuxtOptions { ['hsui']?: ModuleOptions }
9
+ }
10
+
11
+ declare module 'nuxt/schema' {
12
+ interface NuxtConfig { ['hsui']?: Partial<ModuleOptions> }
13
+ interface NuxtOptions { ['hsui']?: ModuleOptions }
14
+ }
15
+
16
+
17
+ export type { ModuleOptions, default } from './module'
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "nuxt-hs-ui",
3
+ "version": "1.0.1",
4
+ "description": "Nuxt UI Pack",
5
+ "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
+ "license": "MIT",
7
+ "author": {
8
+ "name": "Ryo@Hare-Systems",
9
+ "email": "admin@hare-systems.net"
10
+ },
11
+ "type": "module",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/types.d.ts",
15
+ "import": "./dist/module.mjs",
16
+ "require": "./dist/module.cjs"
17
+ },
18
+ "./lib/com": {
19
+ "types": "./dist/runtime/lib/com.d.ts",
20
+ "import": "./dist/runtime/lib/com.js",
21
+ "require": "./dist/runtime/lib/com.js"
22
+ },
23
+ "./lib/number": {
24
+ "types": "./dist/runtime/lib/number.d.ts",
25
+ "import": "./dist/runtime/lib/number.js",
26
+ "require": "./dist/runtime/lib/number.js"
27
+ }
28
+ },
29
+ "main": "./dist/module.cjs",
30
+ "types": "./dist/types.d.ts",
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "volta": {
35
+ "node": "20.13.0",
36
+ "npm": "10.5.2"
37
+ },
38
+ "scripts": {
39
+ "prepack": "nuxt-module-build build",
40
+ "dev": "nuxi dev playground",
41
+ "dev:build": "nuxi build playground",
42
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
43
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
44
+ "lint": "eslint .",
45
+ "lint:fix": "eslint . --fix",
46
+ "test": "vitest run",
47
+ "test:watch": "vitest watch",
48
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
49
+ },
50
+ "dependencies": {
51
+ "@nuxt/kit": "^3.12.1",
52
+ "@nuxtjs/tailwindcss": "^6.12.0",
53
+ "@pinia/nuxt": "^0.5.1",
54
+ "@vueuse/core": "^10.11.0",
55
+ "bignumber.js": "^9.1.2",
56
+ "body-scroll-lock": "^4.0.0-beta.0",
57
+ "dayjs": "^1.11.11",
58
+ "defu": "^6.1.4",
59
+ "focus-trap": "^7.5.4",
60
+ "pinia": "^2.1.7"
61
+ },
62
+ "devDependencies": {
63
+ "@nuxt/devtools": "^1.3.3",
64
+ "@nuxt/eslint-config": "^0.3.13",
65
+ "@nuxt/module-builder": "^0.7.1",
66
+ "@nuxt/schema": "^3.12.1",
67
+ "@nuxt/test-utils": "^3.13.1",
68
+ "@types/body-scroll-lock": "^3.1.2",
69
+ "@types/node": "^20.14.2",
70
+ "changelogen": "^0.5.5",
71
+ "eslint": "^8.57.0",
72
+ "nuxt": "^3.12.1",
73
+ "sass": "^1.77.5",
74
+ "tailwind-merge": "^2.3.0",
75
+ "typescript": "latest",
76
+ "vitest": "^1.6.0",
77
+ "vue-tsc": "^2.0.21"
78
+ },
79
+ "overrides": {
80
+ "vue": "latest"
81
+ }
82
+ }