nuxt-hs-ui 2.0.18 → 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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.15.0"
6
6
  },
7
- "version": "2.0.18",
7
+ "version": "2.0.19",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -27,7 +27,7 @@ const classStyle = computed(() => {
27
27
  "mx-auto px-2",
28
28
  props.fluid
29
29
  ? "w-full"
30
- : "max-w-full xs:max-w-[600px] md:max-w-[700px] lg:max-w-[950px] xl:max-w-[1200px] 2xl:max-w-[1450px]",
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
- /** Dayjsオブジェクトを生成 */
7
+ /** dayjsオブジェクト生成 */
8
8
  export declare const Dayjs: (arg?: string | number | Dayjs | Date | null | undefined) => Dayjs;
9
- /** 日付オブジェクト(Null許容) */
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(defaultTimezone).format(format);
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
  };
@@ -1,2 +1,4 @@
1
+ /** 小数点含む数値文字列の数値変換 変換失敗=0 */
1
2
  export declare const Float: (i: any, digits?: number) => number;
3
+ /** 小数点含む数値文字列の数値変換 変換失敗=null */
2
4
  export declare const FloatNullable: (i: any, digits?: number) => number | null;
@@ -1,7 +1,5 @@
1
1
  import type { SelectItem } from "./select-item.js";
2
- export type MultiLang = string | {
3
- [key: string]: string;
4
- };
2
+ import { type MultiLang } from "./multi-lang.js";
5
3
  export type KeyNumber = {
6
4
  [key: string]: number;
7
5
  };
@@ -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
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.0.18",
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",