ingred-ui 14.7.1 → 14.8.0

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.
@@ -16,10 +16,18 @@ export type CalendarProps = React.HTMLAttributes<HTMLDivElement> & {
16
16
  * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
17
17
  */
18
18
  weekList?: string[];
19
+ /**
20
+ * デフォルトで選択されているアクション
21
+ */
22
+ defaultClickAction?: string;
19
23
  /**
20
24
  * カレンダーの左に表示するアクション
21
25
  */
22
26
  actions?: Action[];
27
+ /**
28
+ * アクションをクリックしたときの挙動
29
+ */
30
+ onClickAction?: (action: Action) => void;
23
31
  /**
24
32
  * 閉じるボタンを押したときの振る舞い
25
33
  * この関数が渡されてないときは、閉じるボタンが表示されない
@@ -51,10 +59,18 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
51
59
  * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
52
60
  */
53
61
  weekList?: string[] | undefined;
62
+ /**
63
+ * デフォルトで選択されているアクション
64
+ */
65
+ defaultClickAction?: string | undefined;
54
66
  /**
55
67
  * カレンダーの左に表示するアクション
56
68
  */
57
69
  actions?: Action[] | undefined;
70
+ /**
71
+ * アクションをクリックしたときの挙動
72
+ */
73
+ onClickAction?: ((action: Action) => void) | undefined;
58
74
  /**
59
75
  * 閉じるボタンを押したときの振る舞い
60
76
  * この関数が渡されてないときは、閉じるボタンが表示されない
@@ -8,7 +8,9 @@ declare const _default: {
8
8
  date: dayjs.Dayjs;
9
9
  monthFormat?: string | undefined;
10
10
  weekList?: string[] | undefined;
11
+ defaultClickAction?: string | undefined;
11
12
  actions?: import("../internal/Actions").Action[] | undefined;
13
+ onClickAction?: ((action: import("../internal/Actions").Action) => void) | undefined;
12
14
  onClickCloseButton?: (() => void) | undefined;
13
15
  isOutsideRange?: ((date: dayjs.Dayjs) => boolean) | undefined;
14
16
  onDateChange: (value: dayjs.Dayjs) => void;
@@ -23,10 +23,18 @@ export type CalendarRangeProps = React.HTMLAttributes<HTMLDivElement> & {
23
23
  * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
24
24
  */
25
25
  weekList?: string[];
26
+ /**
27
+ * デフォルトで選択されているアクション
28
+ */
29
+ defaultClickAction?: string;
26
30
  /**
27
31
  * カレンダーの左に表示するアクション
28
32
  */
29
33
  actions?: Action[];
34
+ /**
35
+ * アクションをクリックしたときの挙動
36
+ */
37
+ onClickAction?: (action: Action) => void;
30
38
  /**
31
39
  * 親コンポーネントで calendar を任意のタイミングで閉じたい場合に使用する
32
40
  */
@@ -72,10 +80,18 @@ export declare const CalendarRange: React.ForwardRefExoticComponent<React.HTMLAt
72
80
  * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
73
81
  */
74
82
  weekList?: string[] | undefined;
83
+ /**
84
+ * デフォルトで選択されているアクション
85
+ */
86
+ defaultClickAction?: string | undefined;
75
87
  /**
76
88
  * カレンダーの左に表示するアクション
77
89
  */
78
90
  actions?: Action[] | undefined;
91
+ /**
92
+ * アクションをクリックしたときの挙動
93
+ */
94
+ onClickAction?: ((action: Action) => void) | undefined;
79
95
  /**
80
96
  * 親コンポーネントで calendar を任意のタイミングで閉じたい場合に使用する
81
97
  */
@@ -117,10 +133,18 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
117
133
  * @memo dayjs().format("ddd") で対応したいが、階層が深くなったりするので一旦静的な値で対処
118
134
  */
119
135
  weekList?: string[] | undefined;
136
+ /**
137
+ * デフォルトで選択されているアクション
138
+ */
139
+ defaultClickAction?: string | undefined;
120
140
  /**
121
141
  * カレンダーの左に表示するアクション
122
142
  */
123
143
  actions?: Action[] | undefined;
144
+ /**
145
+ * アクションをクリックしたときの挙動
146
+ */
147
+ onClickAction?: ((action: Action) => void) | undefined;
124
148
  /**
125
149
  * 親コンポーネントで calendar を任意のタイミングで閉じたい場合に使用する
126
150
  */
@@ -9,7 +9,9 @@ declare const _default: {
9
9
  endDate: dayjs.Dayjs;
10
10
  monthFormat?: string | undefined;
11
11
  weekList?: string[] | undefined;
12
+ defaultClickAction?: string | undefined;
12
13
  actions?: import("../internal/Actions").Action[] | undefined;
14
+ onClickAction?: ((action: import("../internal/Actions").Action) => void) | undefined;
13
15
  onClose?: ((clickState: import("./constants").ClickStateType) => void) | undefined;
14
16
  onClickCloseButton?: (() => void) | undefined;
15
17
  isOutsideRange?: ((date: dayjs.Dayjs) => boolean) | undefined;
@@ -1,8 +1,11 @@
1
1
  import React from "react";
2
+ import { Action } from "./styled";
2
3
  export type Action = {
3
4
  text: string;
4
5
  onClick: () => void;
5
6
  };
6
7
  export declare const Actions: React.NamedExoticComponent<{
8
+ defaultClickAction?: string | undefined;
7
9
  actions?: Action[] | undefined;
10
+ onClickAction?: ((action: Action) => void) | undefined;
8
11
  }>;
@@ -7,10 +7,18 @@ export type NewDatePickerProps = {
7
7
  * @default dayjs()
8
8
  */
9
9
  date: Dayjs;
10
+ /**
11
+ * デフォルトで選択されているアクション
12
+ */
13
+ defaultClickAction?: string;
10
14
  /**
11
15
  * カレンダーの左に表示するアクション
12
16
  */
13
17
  actions?: Action[];
18
+ /**
19
+ * アクションをクリックしたときの挙動
20
+ */
21
+ onClickAction?: (action: Action) => void;
14
22
  /**
15
23
  * 指定したい format
16
24
  * @default YYYY-MM-DD
@@ -11,6 +11,7 @@ declare const _default: {
11
11
  export default _default;
12
12
  export declare const Example: StoryObj<NewDatePickerProps>;
13
13
  export declare const WithActions: StoryObj<NewDatePickerProps>;
14
+ export declare const WithActionsWithDefaultClickAction: StoryObj<NewDatePickerProps>;
14
15
  export declare const Error: StoryObj<NewDatePickerProps>;
15
16
  export declare const Disabled: StoryObj<NewDatePickerProps>;
16
17
  export declare const IsOutsideRange: StoryObj<NewDatePickerProps>;
@@ -20,10 +20,18 @@ export type NewDateRangePickerProps = {
20
20
  * エラーメッセージのテキスト
21
21
  */
22
22
  errorText?: string;
23
+ /**
24
+ * デフォルトで選択されているアクション
25
+ */
26
+ defaultClickAction?: string;
23
27
  /**
24
28
  * カレンダーの左に表示するアクション
25
29
  */
26
30
  actions?: Action[];
31
+ /**
32
+ * アクションをクリックしたときの挙動
33
+ */
34
+ onClickAction?: (action: Action) => void;
27
35
  /**
28
36
  * 入力を無効にする
29
37
  * @default false
@@ -11,6 +11,7 @@ declare const _default: {
11
11
  export default _default;
12
12
  export declare const Example: StoryObj<NewDateRangePickerProps>;
13
13
  export declare const WithActions: StoryObj<NewDateRangePickerProps>;
14
+ export declare const WithActionsWithDefaultClickAction: StoryObj<NewDateRangePickerProps>;
14
15
  export declare const Error: StoryObj<NewDateRangePickerProps>;
15
16
  export declare const Disabled: StoryObj<NewDateRangePickerProps>;
16
17
  export declare const IsOutsideRange: StoryObj<NewDateRangePickerProps>;