nuxt-hs-ui 2.0.17 → 2.0.19
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 +1 -1
- package/dist/runtime/components/layout/container.vue +1 -1
- package/dist/runtime/utils/class-style.d.ts +2 -0
- package/dist/runtime/utils/com.d.ts +2 -1
- package/dist/runtime/utils/dayjs.d.ts +8 -7
- package/dist/runtime/utils/dayjs.js +2 -4
- package/dist/runtime/utils/float.d.ts +2 -0
- package/dist/runtime/utils/multi-lang-object.d.ts +1 -3
- package/dist/runtime/utils/number.d.ts +1 -0
- package/dist/runtime/utils/object.d.ts +5 -3
- package/dist/runtime/utils/select.d.ts +1 -2
- package/dist/runtime/utils/stop-watch.d.ts +7 -0
- package/dist/runtime/utils/stop-watch.js +37 -0
- package/package.json +6 -1
package/dist/module.json
CHANGED
|
@@ -27,7 +27,7 @@ const classStyle = computed(() => {
|
|
|
27
27
|
"mx-auto px-2",
|
|
28
28
|
props.fluid
|
|
29
29
|
? "w-full"
|
|
30
|
-
: "
|
|
30
|
+
: "w-full xs:max-w-[600px] md:max-w-[700px] lg:max-w-[950px] xl:max-w-[1200px] 2xl:max-w-[1450px]",
|
|
31
31
|
ClassTypeToString(props.class)
|
|
32
32
|
);
|
|
33
33
|
});
|
|
@@ -2,5 +2,7 @@ export type ClassTypeObje = {
|
|
|
2
2
|
[key: string]: boolean;
|
|
3
3
|
};
|
|
4
4
|
export type ClassTypeArray = (string | ClassTypeObje | ClassTypeArray)[];
|
|
5
|
+
/** VueSFC の「Prop」に渡されるclassプロパティの型 */
|
|
5
6
|
export type ClassType = string | ClassTypeObje | ClassTypeArray;
|
|
7
|
+
/** VueSFC の「Prop」に渡されるclassプロパティを文字列に変換する */
|
|
6
8
|
export declare const ClassTypeToString: (c: ClassType) => string;
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
export declare const GenerateUniqeKey: (len?: number) => string;
|
|
3
3
|
/** 一定時間処理を待機 */
|
|
4
4
|
export declare const Sleep: (time: number) => Promise<unknown>;
|
|
5
|
-
/**
|
|
5
|
+
/** モバイル系デバイスかどうかの判定
|
|
6
|
+
* - ブラウザ側で実行すること */
|
|
6
7
|
export declare const IsMobile: () => boolean;
|
|
@@ -4,9 +4,10 @@ export type QUnitType = dayjs.QUnitType;
|
|
|
4
4
|
export type OpUnitType = dayjs.OpUnitType;
|
|
5
5
|
export declare const DayjsInit: () => void;
|
|
6
6
|
export declare const defaultTimezone = "Asia/Tokyo";
|
|
7
|
-
/**
|
|
7
|
+
/** dayjsオブジェクト生成 */
|
|
8
8
|
export declare const Dayjs: (arg?: string | number | Dayjs | Date | null | undefined) => Dayjs;
|
|
9
|
-
/**
|
|
9
|
+
/** dayjsオブジェクト生成
|
|
10
|
+
* - 日付返還できない場合 Nullを返す */
|
|
10
11
|
export declare const DayjsNullable: (date?: string | null | Date | undefined) => Dayjs | null;
|
|
11
12
|
/**
|
|
12
13
|
* 日付の差分を計測
|
|
@@ -18,26 +19,26 @@ export declare const DayjsDiff: (date: Dayjs | null, diff: Dayjs | null, unit: Q
|
|
|
18
19
|
* 時差を取得する
|
|
19
20
|
* - str:format()
|
|
20
21
|
*/
|
|
21
|
-
export declare const GetTimeShiftValue: (date: Dayjs | null) => number;
|
|
22
|
+
export declare const GetTimeShiftValue: (date: Dayjs | null, timeZone?: string) => number;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
-
* - date - diff
|
|
24
|
+
* 日付の時間部分を[00:00:00.000]にする
|
|
25
25
|
*/
|
|
26
26
|
export declare const DateOnly: (date: string | null) => string | null;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* 日付文字列をフォーマットされた日付に変換される
|
|
29
29
|
* @param date 文字列、日付オブジェクト
|
|
30
30
|
* @returns 変換OKならDayjsフォーマット文字列、それ以外は空文字
|
|
31
31
|
*/
|
|
32
32
|
export declare const DayjsFormat: (date: string | null | Date, f?: string, nullText?: string) => string;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* 日付文字列をフォーマットされた日付に変換される(変換不可の場合、null)
|
|
35
35
|
* @param date 文字列、日付オブジェクト
|
|
36
36
|
* @returns 変換OKならDayjsフォーマット文字列、それ以外はnull
|
|
37
37
|
*/
|
|
38
38
|
export declare const DayjsFormatNullable: (date: string | null | Date, f?: string) => string | null;
|
|
39
39
|
export declare const DayjsSetLocal: (lang?: "ja" | "en") => void;
|
|
40
40
|
export declare const DayjsSetTimezone: (tz?: string) => void;
|
|
41
|
+
/** Prismaの日付型の条件式を生成する関数 */
|
|
41
42
|
export declare const DayjsBetweenWhereQuery: (arg: {
|
|
42
43
|
from: string | null;
|
|
43
44
|
to: string | null;
|
|
@@ -11,8 +11,6 @@ export const DayjsInit = () => {
|
|
|
11
11
|
dayjs.extend(utc);
|
|
12
12
|
dayjs.extend(timezone);
|
|
13
13
|
dayjs.extend(advancedFormat);
|
|
14
|
-
dayjs.extend(utc);
|
|
15
|
-
dayjs.extend(timezone);
|
|
16
14
|
dayjs.tz.setDefault(defaultTimezone);
|
|
17
15
|
dayjs.locale(ja);
|
|
18
16
|
};
|
|
@@ -49,11 +47,11 @@ export const DayjsDiff = (date, diff, unit) => {
|
|
|
49
47
|
return null;
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
|
-
export const GetTimeShiftValue = (date) => {
|
|
50
|
+
export const GetTimeShiftValue = (date, timeZone = defaultTimezone) => {
|
|
53
51
|
if (date === null) return 0;
|
|
54
52
|
const format = `YYYY-MM-DD HH:mm`;
|
|
55
53
|
const a = date.format(format);
|
|
56
|
-
const b = date.tz(
|
|
54
|
+
const b = date.tz(timeZone).format(format);
|
|
57
55
|
const diff = DayjsDiff(Dayjs(a), Dayjs(b), "m");
|
|
58
56
|
return diff === null ? 0 : diff;
|
|
59
57
|
};
|
|
@@ -10,5 +10,6 @@ export declare const InsertComma: (num: number | string | null, digits?: number,
|
|
|
10
10
|
* 数値をカンマを挿入した文字列に変換する
|
|
11
11
|
* @param num 数値
|
|
12
12
|
* @returns カンマが挿入された文字列
|
|
13
|
+
* - 例 12,000,000 => 12,000
|
|
13
14
|
*/
|
|
14
15
|
export declare const InsertCommaK: (num: number | string | null) => string;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
export declare const GetMapValue: <T>(obj: T, key: keyof T | null) => T[keyof T] | null;
|
|
2
2
|
/**
|
|
3
3
|
* オブジェクトをJSON経由でコピーします
|
|
4
|
+
* - JSON.parse(JSON.stringify(obj));
|
|
4
5
|
*/
|
|
5
6
|
export declare const ObjectCopy: <T>(obj: T) => T;
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Object.keys
|
|
8
9
|
*/
|
|
9
10
|
export declare const ObjectKeys: <T>(obj: T) => (keyof T)[];
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Object.values
|
|
12
13
|
*/
|
|
13
14
|
export declare const ObjectValues: <T>(obj: T) => T[keyof T][];
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* オブジェクトのキーを再利用して
|
|
17
|
+
* Value値をinitDataにした新しいオブジェクトを生成します
|
|
16
18
|
*/
|
|
17
19
|
export declare const ObjectKeyToMap: <T, T2>(obj: T, initData: T2) => { [x in keyof T]: T2; };
|
|
18
20
|
/**
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const convertms = (i) => {
|
|
2
|
+
const a = String(i).split(".");
|
|
3
|
+
if (a.length !== 2) {
|
|
4
|
+
return i + ".000";
|
|
5
|
+
} else {
|
|
6
|
+
let ret = a[0];
|
|
7
|
+
ret += ".";
|
|
8
|
+
if (a[1].length === 1) {
|
|
9
|
+
return ret + a[1] + "00";
|
|
10
|
+
} else if (a[1].length === 2) {
|
|
11
|
+
return ret + a[1] + "0";
|
|
12
|
+
} else if (a[1].length === 3) {
|
|
13
|
+
return ret + a[1];
|
|
14
|
+
} else {
|
|
15
|
+
return ret + a[1].slice(-3);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export class StopWatch {
|
|
20
|
+
hrstart;
|
|
21
|
+
constructor() {
|
|
22
|
+
this.hrstart = process.hrtime();
|
|
23
|
+
}
|
|
24
|
+
GetTime = () => {
|
|
25
|
+
const hrend = process.hrtime(this.hrstart);
|
|
26
|
+
const time = convertms(Math.floor(hrend[1] / 1e6 * 1e3) / 1e3);
|
|
27
|
+
return ("___" + hrend[0] + "s").slice(-4) + "" + ("_________" + time).slice(-8);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export const SetTime = () => {
|
|
31
|
+
return process.hrtime();
|
|
32
|
+
};
|
|
33
|
+
export const GetTime = (start) => {
|
|
34
|
+
const hrend = process.hrtime(start);
|
|
35
|
+
const time = convertms(Math.floor(hrend[1] / 1e6 * 1e3) / 1e3);
|
|
36
|
+
return ("___" + hrend[0] + "s").slice(-4) + "" + ("_________" + time).slice(-8);
|
|
37
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-hs-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19",
|
|
4
4
|
"description": "My new Nuxt module",
|
|
5
5
|
"repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,6 +65,11 @@
|
|
|
65
65
|
"import": "./dist/runtime/utils/select-item.js",
|
|
66
66
|
"require": "./dist/runtime/utils/select-item.js"
|
|
67
67
|
},
|
|
68
|
+
"./utils/stop-watch": {
|
|
69
|
+
"types": "./dist/runtime/utils/stop-watch.d.ts",
|
|
70
|
+
"import": "./dist/runtime/utils/stop-watch.js",
|
|
71
|
+
"require": "./dist/runtime/utils/stop-watch.js"
|
|
72
|
+
},
|
|
68
73
|
"./utils/string": {
|
|
69
74
|
"types": "./dist/runtime/utils/string.d.ts",
|
|
70
75
|
"import": "./dist/runtime/utils/string.js",
|