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.
- package/README.md +4 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +8 -0
- package/dist/module.d.ts +8 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +92 -0
- package/dist/runtime/components/hs-fc/btn/index.vue +508 -0
- package/dist/runtime/components/hs-fc/btn/line-loading.vue +125 -0
- package/dist/runtime/components/hs-fc/hoge +0 -0
- package/dist/runtime/components/hs-ui/accordion.vue +93 -0
- package/dist/runtime/components/hs-ui/aspect-box.vue +78 -0
- package/dist/runtime/components/hs-ui/block-loading.vue +210 -0
- package/dist/runtime/components/hs-ui/card-item.vue +136 -0
- package/dist/runtime/components/hs-ui/card.vue +48 -0
- package/dist/runtime/components/hs-ui/container.vue +46 -0
- package/dist/runtime/components/hs-ui/dialog/index.type.d.ts +48 -0
- package/dist/runtime/components/hs-ui/dialog/index.type.js +57 -0
- package/dist/runtime/components/hs-ui/dialog/index.vue +353 -0
- package/dist/runtime/components/hs-ui/modal/bg.vue +90 -0
- package/dist/runtime/components/hs-ui/modal/index.vue +203 -0
- package/dist/runtime/components/hs-ui/modal/use-ui-modal.d.ts +20 -0
- package/dist/runtime/components/hs-ui/modal/use-ui-modal.js +74 -0
- package/dist/runtime/components/hs-ui/toast/index.type.d.ts +24 -0
- package/dist/runtime/components/hs-ui/toast/index.type.js +7 -0
- package/dist/runtime/components/hs-ui/toast/index.vue +355 -0
- package/dist/runtime/components/hs-ui/window-loader.vue +185 -0
- package/dist/runtime/components/v-test.vue +57 -0
- package/dist/runtime/composables/use-hs-form-focus.d.ts +10 -0
- package/dist/runtime/composables/use-hs-form-focus.js +29 -0
- package/dist/runtime/composables/use-hs-multi-lang.d.ts +9 -0
- package/dist/runtime/composables/use-hs-multi-lang.js +21 -0
- package/dist/runtime/composables/use-hs-ui-dialog.d.ts +22 -0
- package/dist/runtime/composables/use-hs-ui-dialog.js +43 -0
- package/dist/runtime/composables/use-hs-ui-toast.d.ts +20 -0
- package/dist/runtime/composables/use-hs-ui-toast.js +55 -0
- package/dist/runtime/composables/use-hs-ui-window-loader.d.ts +11 -0
- package/dist/runtime/composables/use-hs-ui-window-loader.js +21 -0
- package/dist/runtime/lib/class-style.d.ts +8 -0
- package/dist/runtime/lib/class-style.js +59 -0
- package/dist/runtime/lib/com.d.ts +14 -0
- package/dist/runtime/lib/com.js +25 -0
- package/dist/runtime/lib/multi-lang.d.ts +9 -0
- package/dist/runtime/lib/multi-lang.js +75 -0
- package/dist/runtime/lib/number.d.ts +16 -0
- package/dist/runtime/lib/number.js +101 -0
- package/dist/runtime/lib/prefix.d.ts +2 -0
- package/dist/runtime/lib/prefix.js +19 -0
- package/dist/runtime/lib/theme.d.ts +2 -0
- package/dist/runtime/lib/theme.js +21 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/style.css +1 -0
- package/dist/types.d.mts +17 -0
- package/dist/types.d.ts +17 -0
- 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,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 @@
|
|
|
1
|
+
@tailwind base;@tailwind components;@tailwind utilities;*{position:relative}
|
package/dist/types.d.mts
ADDED
|
@@ -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'
|
package/dist/types.d.ts
ADDED
|
@@ -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
|
+
}
|