nuxt-hs-ui 2.0.18 → 2.0.20

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.20",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -123,7 +123,13 @@ type Emits = {
123
123
  "value-change": [after: number[], before: number[], id: number];
124
124
  };
125
125
  const emit = defineEmits<Emits>();
126
-
126
+ // ----------------------------------------------------------------------------
127
+ const slots = defineSlots<{
128
+ default(props: { msg: string }): any;
129
+ overlay?(): any;
130
+ "right-icons"?(): any;
131
+ "left-icons"?(): any;
132
+ }>();
127
133
  // ----------------------------------------------------------------------------
128
134
 
129
135
  // [ 選択肢配列 ]
@@ -313,7 +319,13 @@ const itemClass = computed(() => {
313
319
  :warn-time-out="props.warnTimeOut"
314
320
  :size="props.size"
315
321
  >
316
- <template v-if="$slots.overlay" #overlay>
322
+ <template v-if="slots['left-icons']" #left-icons>
323
+ <slot name="left-icons" :disabled="disabled" />
324
+ </template>
325
+ <template v-if="slots['right-icons']" #right-icons>
326
+ <slot name="right-icons" :disabled="disabled" />
327
+ </template>
328
+ <template v-if="slots.overlay" #overlay>
317
329
  <slot name="overlay"></slot>
318
330
  </template>
319
331
  <div class="nac-input-box" @mousedown.stop="" @mouseup.stop="">
@@ -171,6 +171,13 @@ type Emits = {
171
171
  };
172
172
  const emit = defineEmits<Emits>();
173
173
  // ----------------------------------------------------------------------------
174
+ const slots = defineSlots<{
175
+ default(props: { msg: string }): any;
176
+ overlay?(): any;
177
+ "right-icons"?(): any;
178
+ "left-icons"?(): any;
179
+ }>();
180
+ // ----------------------------------------------------------------------------
174
181
  // ----------------------------------------------------------------------------
175
182
  // [ getCurrentInstance ]
176
183
  const uid = useId();
@@ -733,15 +740,19 @@ const computedIsFocusOpenBtn = computed(() => {
733
740
  :warn-time-out="props.warnTimeOut"
734
741
  :size="props.size"
735
742
  >
736
- <template v-if="!props.readonly" #left-icons="{ disabled: iconDisabled }">
743
+ <template v-if="slots.overlay" #overlay>
744
+ <slot name="overlay"></slot>
745
+ </template>
746
+ <template v-if="!props.readonly" #left-icons>
747
+ <slot name="left-icons" :disabled="disabled" />
737
748
  <button
738
749
  ref="openBtn"
739
750
  data-sep="right"
740
751
  data-icon="calendar"
741
752
  :tabindex="tabindex"
742
- :disabled="iconDisabled"
753
+ :disabled="disabled"
743
754
  :class="
744
- !iconDisabled
755
+ !disabled
745
756
  ? 'cursor-pointer hover:bg-accent1/[0.1] active:bg-accent1/[0.2]'
746
757
  : ''
747
758
  "
@@ -821,20 +832,20 @@ const computedIsFocusOpenBtn = computed(() => {
821
832
  {{ props.mode === "month" ? "Now" : "Today" }}
822
833
  </span>
823
834
  </div>
824
- <template
825
- v-if="!props.hideDeleteBtn && !props.readonly"
826
- #right-icons="{ disabled: iconDisabled }"
827
- >
828
- <div
829
- :class="
830
- !iconDisabled
831
- ? 'text-error cursor-pointer hover:bg-error/[0.1] active:bg-error/[0.2]'
832
- : ''
833
- "
834
- @click="iconEventDelete()"
835
- >
836
- <i class="fa-solid fa-delete-left"></i>
837
- </div>
835
+ <template v-if="slots['right-icons']" #right-icons>
836
+ <template v-if="!props.hideDeleteBtn && !props.readonly">
837
+ <div
838
+ :class="
839
+ !disabled
840
+ ? 'text-error cursor-pointer hover:bg-error/[0.1] active:bg-error/[0.2]'
841
+ : ''
842
+ "
843
+ @click="iconEventDelete()"
844
+ >
845
+ <i class="fa-solid fa-delete-left"></i>
846
+ </div>
847
+ </template>
848
+ <slot name="right-icons" :disabled="disabled" />
838
849
  </template>
839
850
  </InputFrame>
840
851
  </template>
@@ -130,6 +130,13 @@ type Emits = {
130
130
  };
131
131
  const emit = defineEmits<Emits>();
132
132
  // ----------------------------------------------------------------------------
133
+ const slots = defineSlots<{
134
+ default(props: { msg: string }): any;
135
+ overlay?(): any;
136
+ "right-icons"?(): any;
137
+ "left-icons"?(): any;
138
+ }>();
139
+ // ----------------------------------------------------------------------------
133
140
  // [ getCurrentInstance ]
134
141
  const uid = useId();
135
142
  // ----------------------------------------------------------------------------
@@ -380,6 +387,15 @@ const inputClass = computed(() => {
380
387
  :warn-time-out="props.warnTimeOut"
381
388
  :size="props.size"
382
389
  >
390
+ <template v-if="slots['left-icons']" #left-icons>
391
+ <slot name="left-icons" :disabled="disabled" />
392
+ </template>
393
+ <template v-if="slots['right-icons']" #right-icons>
394
+ <slot name="right-icons" :disabled="disabled" />
395
+ </template>
396
+ <template v-if="slots.overlay" #overlay>
397
+ <slot name="overlay"></slot>
398
+ </template>
383
399
  <div class="nac-input">
384
400
  <div
385
401
  class="radio-row"
@@ -479,10 +495,14 @@ const inputClass = computed(() => {
479
495
  />
480
496
  <div class="radio-text truncate">
481
497
  {{ tx(row.text) }}
482
- <span v-if="row.deleted" class="text-error text-[0.7em] leading-[1em]"
498
+ <span
499
+ v-if="row.deleted"
500
+ class="text-error text-[0.7em] leading-[1em]"
483
501
  >※削除済み</span
484
502
  >
485
- <span v-if="row.hidden" class="text-error text-[0.7em] leading-[1em]"
503
+ <span
504
+ v-if="row.hidden"
505
+ class="text-error text-[0.7em] leading-[1em]"
486
506
  >※非表示</span
487
507
  >
488
508
  </div>
@@ -129,6 +129,13 @@ type Emits = {
129
129
  };
130
130
  const emit = defineEmits<Emits>();
131
131
  // ----------------------------------------------------------------------------
132
+ const slots = defineSlots<{
133
+ default(props: { msg: string }): any;
134
+ overlay?(): any;
135
+ "right-icons"?(): any;
136
+ "left-icons"?(): any;
137
+ }>();
138
+ // ----------------------------------------------------------------------------
132
139
  // [ getCurrentInstance ]
133
140
  const uid = useId();
134
141
  // ----------------------------------------------------------------------------
@@ -280,6 +287,15 @@ const selectClose = () => {
280
287
  :warn-time-out="props.warnTimeOut"
281
288
  :size="props.size"
282
289
  >
290
+ <template v-if="slots['left-icons']" #left-icons>
291
+ <slot name="left-icons" :disabled="disabled" />
292
+ </template>
293
+ <template v-if="slots['right-icons']" #right-icons>
294
+ <slot name="right-icons" :disabled="disabled" />
295
+ </template>
296
+ <template v-if="slots.overlay" #overlay>
297
+ <slot name="overlay"></slot>
298
+ </template>
283
299
  <div
284
300
  v-if="displayData === null"
285
301
  class="absolute inset-0 flex items-center px-1 pointer-events-none text-[0.9em]"
@@ -130,8 +130,9 @@ const emit = defineEmits<Emits>();
130
130
  // ----------------------------------------------------------------------------
131
131
  const slots = defineSlots<{
132
132
  default(props: { msg: string }): any;
133
- "right-icons"(): any;
134
- "left-icons"(): any;
133
+ overlay?(): any;
134
+ "right-icons"?(): any;
135
+ "left-icons"?(): any;
135
136
  }>();
136
137
  // ----------------------------------------------------------------------------
137
138
  // [ getCurrentInstance ]
@@ -307,10 +308,13 @@ const dataListId = ref(`textbox-list-${uid}`);
307
308
  @click="elmFocus"
308
309
  >
309
310
  <template v-if="slots['left-icons']" #left-icons>
310
- <slot name="left-icons" />
311
+ <slot name="left-icons" :disabled="disabled" />
311
312
  </template>
312
313
  <template v-if="slots['right-icons']" #right-icons>
313
- <slot name="left-icons" />
314
+ <slot name="right-icons" :disabled="disabled" />
315
+ </template>
316
+ <template v-if="slots.overlay" #overlay>
317
+ <slot name="overlay"></slot>
314
318
  </template>
315
319
  <template v-if="props.maxLen > 0" #header-right="{ defaultClass }">
316
320
  <div :class="[defaultClass, lenLabelClass]">
@@ -160,6 +160,13 @@ type Emits = {
160
160
  };
161
161
  const emit = defineEmits<Emits>();
162
162
  // ----------------------------------------------------------------------------
163
+ const slots = defineSlots<{
164
+ default(props: { msg: string }): any;
165
+ overlay?(): any;
166
+ "right-icons"?(): any;
167
+ "left-icons"?(): any;
168
+ }>();
169
+ // ----------------------------------------------------------------------------
163
170
  // [ getCurrentInstance ]
164
171
  const uid = useId();
165
172
 
@@ -544,6 +551,12 @@ watch(
544
551
  :size="props.size"
545
552
  @click="elmFocus"
546
553
  >
554
+ <template v-if="slots['left-icons']" #left-icons>
555
+ <slot name="left-icons" :disabled="disabled" />
556
+ </template>
557
+ <template v-if="slots.overlay" #overlay>
558
+ <slot name="overlay"></slot>
559
+ </template>
547
560
  <div class="flex items-end justify-end">
548
561
  <div class="flex-1">
549
562
  <input
@@ -601,6 +614,7 @@ watch(
601
614
  <i class="fas fa-caret-down"></i>
602
615
  </div>
603
616
  </div>
617
+ <slot name="right-icons" :disabled="disabled" />
604
618
  </template>
605
619
  </InputFrame>
606
620
  </template>
@@ -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.20",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",