ingred-ui 14.4.0 → 14.5.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.
- package/LICENSE +21 -0
- package/dist/components/Calendar/Calendar/Calendar.d.ts +56 -0
- package/dist/components/Calendar/Calendar/Calendar.stories.d.ts +18 -0
- package/dist/components/Calendar/Calendar/index.d.ts +1 -0
- package/dist/components/Calendar/Calendar/internal/Day/Day.d.ts +11 -0
- package/dist/components/Calendar/Calendar/internal/Day/index.d.ts +1 -0
- package/dist/components/Calendar/Calendar/internal/Day/styled.d.ts +6 -0
- package/dist/components/Calendar/CalendarRange/CalendarRange.d.ts +117 -0
- package/dist/components/Calendar/CalendarRange/CalendarRange.stories.d.ts +20 -0
- package/dist/components/Calendar/CalendarRange/constants.d.ts +12 -0
- package/dist/components/Calendar/CalendarRange/index.d.ts +2 -0
- package/dist/components/Calendar/CalendarRange/internal/Day/Day.d.ts +12 -0
- package/dist/components/Calendar/CalendarRange/internal/Day/index.d.ts +1 -0
- package/dist/components/Calendar/CalendarRange/internal/Day/styled.d.ts +5 -0
- package/dist/components/Calendar/CalendarRange/utils.d.ts +2 -0
- package/dist/components/Calendar/constants.d.ts +9 -0
- package/dist/components/Calendar/hooks/__tests__/useScroll.test.d.ts +1 -0
- package/dist/components/Calendar/hooks/constants.d.ts +1 -0
- package/dist/components/Calendar/hooks/useScroll.d.ts +13 -0
- package/dist/components/Calendar/index.d.ts +3 -0
- package/dist/components/Calendar/internal/Actions/Actions.d.ts +9 -0
- package/dist/components/Calendar/internal/Actions/index.d.ts +2 -0
- package/dist/components/Calendar/internal/Actions/styled.d.ts +4 -0
- package/dist/components/Calendar/styled.d.ts +7 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +10 -10
- package/dist/components/DateField/DateField/DateField.d.ts +33 -0
- package/dist/components/DateField/DateField/DateField.stories.d.ts +13 -0
- package/dist/components/DateField/DateField/index.d.ts +1 -0
- package/dist/components/DateField/DateField/styled.d.ts +5 -0
- package/dist/components/DateField/DateRangeField/DateRangeField.d.ts +33 -0
- package/dist/components/DateField/DateRangeField/DateRangeField.stories.d.ts +13 -0
- package/dist/components/DateField/DateRangeField/index.d.ts +1 -0
- package/dist/components/DateField/DateRangeField/styled.d.ts +5 -0
- package/dist/components/DateField/__tests__/useDateField.test.d.ts +1 -0
- package/dist/components/DateField/__tests__/utils.test.d.ts +1 -0
- package/dist/components/DateField/constants.d.ts +22 -0
- package/dist/components/DateField/index.d.ts +3 -0
- package/dist/components/DateField/plugin/index.d.ts +3 -0
- package/dist/components/DateField/types.d.ts +9 -0
- package/dist/components/DateField/useDateField.d.ts +23 -0
- package/dist/components/DateField/utils.d.ts +26 -0
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.stories.d.ts +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.stories.d.ts +1 -1
- package/dist/components/MultipleFilter/MultipleFilterStatus.d.ts +1 -1
- package/dist/components/NewDatePicker/NewDatePicker.d.ts +44 -0
- package/dist/components/NewDatePicker/NewDatePicker.stories.d.ts +16 -0
- package/dist/components/NewDatePicker/index.d.ts +2 -0
- package/dist/components/NewDatePicker/styled.d.ts +1 -0
- package/dist/components/NewDateRangePicker/NewDateRangePicker.d.ts +48 -0
- package/dist/components/NewDateRangePicker/NewDateRangePicker.stories.d.ts +16 -0
- package/dist/components/NewDateRangePicker/index.d.ts +2 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/hooks/usePlacement.d.ts +1 -1
- package/dist/index.es.js +4 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +15 -12
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-present, CARTA HOLDINGS, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import dayjs, { Dayjs } from "dayjs";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Action } from "../internal/Actions";
|
|
4
|
+
export type CalendarProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
/**
|
|
6
|
+
* 日付
|
|
7
|
+
* @default dayjs()
|
|
8
|
+
*/
|
|
9
|
+
date: Dayjs;
|
|
10
|
+
/**
|
|
11
|
+
* カレンダーの左に表示するアクション
|
|
12
|
+
*/
|
|
13
|
+
actions?: Action[];
|
|
14
|
+
/**
|
|
15
|
+
* 閉じるボタンを押したときの振る舞い
|
|
16
|
+
* この関数が渡されてないときは、閉じるボタンが表示されない
|
|
17
|
+
*/
|
|
18
|
+
onClickCloseButton?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* 選択可能なカレンダーの領域を制限する
|
|
21
|
+
* true が返る場合は、選択不可となる
|
|
22
|
+
* @default () => false
|
|
23
|
+
*/
|
|
24
|
+
isOutsideRange?: (date: Dayjs) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 日付が変更されたときに呼ばれる関数
|
|
27
|
+
*/
|
|
28
|
+
onDateChange: (value: Dayjs) => void;
|
|
29
|
+
};
|
|
30
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
31
|
+
/**
|
|
32
|
+
* 日付
|
|
33
|
+
* @default dayjs()
|
|
34
|
+
*/
|
|
35
|
+
date: dayjs.Dayjs;
|
|
36
|
+
/**
|
|
37
|
+
* カレンダーの左に表示するアクション
|
|
38
|
+
*/
|
|
39
|
+
actions?: Action[] | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* 閉じるボタンを押したときの振る舞い
|
|
42
|
+
* この関数が渡されてないときは、閉じるボタンが表示されない
|
|
43
|
+
*/
|
|
44
|
+
onClickCloseButton?: (() => void) | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* 選択可能なカレンダーの領域を制限する
|
|
47
|
+
* true が返る場合は、選択不可となる
|
|
48
|
+
* @default () => false
|
|
49
|
+
*/
|
|
50
|
+
isOutsideRange?: ((date: dayjs.Dayjs) => boolean) | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* 日付が変更されたときに呼ばれる関数
|
|
53
|
+
*/
|
|
54
|
+
onDateChange: (value: dayjs.Dayjs) => void;
|
|
55
|
+
} & React.RefAttributes<HTMLDivElement>>>;
|
|
56
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryObj } from "@storybook/react";
|
|
3
|
+
import { CalendarProps } from "./Calendar";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
declare const _default: {
|
|
6
|
+
title: string;
|
|
7
|
+
components: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
date: dayjs.Dayjs;
|
|
9
|
+
actions?: import("../internal/Actions").Action[] | undefined;
|
|
10
|
+
onClickCloseButton?: (() => void) | undefined;
|
|
11
|
+
isOutsideRange?: ((date: dayjs.Dayjs) => boolean) | undefined;
|
|
12
|
+
onDateChange: (value: dayjs.Dayjs) => void;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
16
|
+
export declare const Default: StoryObj<CalendarProps>;
|
|
17
|
+
export declare const WithActions: StoryObj<CalendarProps>;
|
|
18
|
+
export declare const IsOutsideRange: StoryObj<CalendarProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Calendar";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Dayjs } from "dayjs";
|
|
2
|
+
import { FC, ReactNode } from "react";
|
|
3
|
+
type Props = {
|
|
4
|
+
selected: boolean;
|
|
5
|
+
selectable: boolean;
|
|
6
|
+
value: Dayjs;
|
|
7
|
+
onClickDate?: (newDate: Dayjs) => void;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const Day: FC<Props>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Day } from "./Day";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DayContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
2
|
+
selected?: boolean | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const DisableDayContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
5
|
+
selected?: boolean | undefined;
|
|
6
|
+
}, never>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import dayjs, { Dayjs } from "dayjs";
|
|
2
|
+
import { DateRange } from "../..";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Action } from "../internal/Actions";
|
|
5
|
+
import { ClickStateType } from "./constants";
|
|
6
|
+
export type CalendarRangeProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
/**
|
|
8
|
+
* 開始日
|
|
9
|
+
* @default dayjs()
|
|
10
|
+
*/
|
|
11
|
+
startDate: Dayjs;
|
|
12
|
+
/**
|
|
13
|
+
* 終了日
|
|
14
|
+
* @default dayjs()
|
|
15
|
+
*/
|
|
16
|
+
endDate: Dayjs;
|
|
17
|
+
/**
|
|
18
|
+
* カレンダーの左に表示するアクション
|
|
19
|
+
*/
|
|
20
|
+
actions?: Action[];
|
|
21
|
+
/**
|
|
22
|
+
* 親コンポーネントで calendar を任意のタイミングで閉じたい場合に使用する
|
|
23
|
+
*/
|
|
24
|
+
onClose?: (clickState: ClickStateType) => void;
|
|
25
|
+
/**
|
|
26
|
+
* 閉じるボタンを押したときの振る舞い
|
|
27
|
+
* この関数が渡されてないときは、閉じるボタンが表示されない
|
|
28
|
+
*/
|
|
29
|
+
onClickCloseButton?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* 選択可能なカレンダーの領域を制限する
|
|
32
|
+
* true が返る場合は、選択不可となる
|
|
33
|
+
* @default () => false
|
|
34
|
+
*/
|
|
35
|
+
isOutsideRange?: (date: Dayjs) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 日付が変更されたときに呼ばれる関数
|
|
38
|
+
*/
|
|
39
|
+
onDatesChange: (dates: DateRange) => void;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* CalendarRange
|
|
43
|
+
* Scrollable calendar UI.
|
|
44
|
+
* Currently, one year from the currently selected date is displayed.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CalendarRange: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
47
|
+
/**
|
|
48
|
+
* 開始日
|
|
49
|
+
* @default dayjs()
|
|
50
|
+
*/
|
|
51
|
+
startDate: Dayjs;
|
|
52
|
+
/**
|
|
53
|
+
* 終了日
|
|
54
|
+
* @default dayjs()
|
|
55
|
+
*/
|
|
56
|
+
endDate: Dayjs;
|
|
57
|
+
/**
|
|
58
|
+
* カレンダーの左に表示するアクション
|
|
59
|
+
*/
|
|
60
|
+
actions?: Action[] | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* 親コンポーネントで calendar を任意のタイミングで閉じたい場合に使用する
|
|
63
|
+
*/
|
|
64
|
+
onClose?: ((clickState: ClickStateType) => void) | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* 閉じるボタンを押したときの振る舞い
|
|
67
|
+
* この関数が渡されてないときは、閉じるボタンが表示されない
|
|
68
|
+
*/
|
|
69
|
+
onClickCloseButton?: (() => void) | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* 選択可能なカレンダーの領域を制限する
|
|
72
|
+
* true が返る場合は、選択不可となる
|
|
73
|
+
* @default () => false
|
|
74
|
+
*/
|
|
75
|
+
isOutsideRange?: ((date: Dayjs) => boolean) | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* 日付が変更されたときに呼ばれる関数
|
|
78
|
+
*/
|
|
79
|
+
onDatesChange: (dates: DateRange) => void;
|
|
80
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
81
|
+
export type { DateRange };
|
|
82
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
83
|
+
/**
|
|
84
|
+
* 開始日
|
|
85
|
+
* @default dayjs()
|
|
86
|
+
*/
|
|
87
|
+
startDate: dayjs.Dayjs;
|
|
88
|
+
/**
|
|
89
|
+
* 終了日
|
|
90
|
+
* @default dayjs()
|
|
91
|
+
*/
|
|
92
|
+
endDate: dayjs.Dayjs;
|
|
93
|
+
/**
|
|
94
|
+
* カレンダーの左に表示するアクション
|
|
95
|
+
*/
|
|
96
|
+
actions?: Action[] | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* 親コンポーネントで calendar を任意のタイミングで閉じたい場合に使用する
|
|
99
|
+
*/
|
|
100
|
+
onClose?: ((clickState: ClickStateType) => void) | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* 閉じるボタンを押したときの振る舞い
|
|
103
|
+
* この関数が渡されてないときは、閉じるボタンが表示されない
|
|
104
|
+
*/
|
|
105
|
+
onClickCloseButton?: (() => void) | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* 選択可能なカレンダーの領域を制限する
|
|
108
|
+
* true が返る場合は、選択不可となる
|
|
109
|
+
* @default () => false
|
|
110
|
+
*/
|
|
111
|
+
isOutsideRange?: ((date: dayjs.Dayjs) => boolean) | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* 日付が変更されたときに呼ばれる関数
|
|
114
|
+
*/
|
|
115
|
+
onDatesChange: (dates: DateRange) => void;
|
|
116
|
+
} & React.RefAttributes<HTMLDivElement>>>;
|
|
117
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StoryObj } from "@storybook/react";
|
|
3
|
+
import { CalendarRangeProps } from "./CalendarRange";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
declare const _default: {
|
|
6
|
+
title: string;
|
|
7
|
+
components: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
startDate: dayjs.Dayjs;
|
|
9
|
+
endDate: dayjs.Dayjs;
|
|
10
|
+
actions?: import("../internal/Actions").Action[] | undefined;
|
|
11
|
+
onClose?: ((clickState: import("./constants").ClickStateType) => void) | undefined;
|
|
12
|
+
onClickCloseButton?: (() => void) | undefined;
|
|
13
|
+
isOutsideRange?: ((date: dayjs.Dayjs) => boolean) | undefined;
|
|
14
|
+
onDatesChange: (dates: import("./CalendarRange").DateRange) => void;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>>;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const Default: StoryObj<CalendarRangeProps>;
|
|
19
|
+
export declare const WithActions: StoryObj<CalendarRangeProps>;
|
|
20
|
+
export declare const IsOutsideRange: StoryObj<CalendarRangeProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const DayState: {
|
|
2
|
+
readonly NONE: "none";
|
|
3
|
+
readonly START: "start";
|
|
4
|
+
readonly END: "end";
|
|
5
|
+
readonly BETWEEN: "between";
|
|
6
|
+
};
|
|
7
|
+
export type DayStateType = (typeof DayState)[keyof typeof DayState];
|
|
8
|
+
export declare const ClickState: {
|
|
9
|
+
readonly START: "start";
|
|
10
|
+
readonly END: "end";
|
|
11
|
+
};
|
|
12
|
+
export type ClickStateType = (typeof ClickState)[keyof typeof ClickState];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dayjs } from "dayjs";
|
|
2
|
+
import { FC, ReactNode } from "react";
|
|
3
|
+
import { DayStateType } from "../../constants";
|
|
4
|
+
type Props = {
|
|
5
|
+
state: DayStateType;
|
|
6
|
+
value: Dayjs;
|
|
7
|
+
selectable: boolean;
|
|
8
|
+
onClickDate?: (value: Dayjs) => void;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const Day: FC<Props>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Day } from "./Day";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DayStyle: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const DayStart: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const DayEnd: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const DayBetween: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const DisableDayContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MONTH_SIZE = 4;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Dayjs } from "dayjs";
|
|
2
|
+
export declare const getNextMonthList: (date: Dayjs) => Dayjs[];
|
|
3
|
+
export declare const getPrevMonthList: (date: Dayjs) => Dayjs[];
|
|
4
|
+
/**
|
|
5
|
+
* @memo カレンダーを選択中の月にするときに、アニメーション等があるといいかもしれない
|
|
6
|
+
*
|
|
7
|
+
* @param date 選択中の日付
|
|
8
|
+
* @param ref カレンダーの親要素のref、IntersectionObserverのrootに使う
|
|
9
|
+
* @return monthList 表示する月のリスト
|
|
10
|
+
*/
|
|
11
|
+
export declare const useScroll: (date: Dayjs, ref: React.RefObject<HTMLDivElement>) => {
|
|
12
|
+
monthList: Dayjs[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Action } from "./styled";
|
|
3
|
+
export type Action = {
|
|
4
|
+
text: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const Actions: React.MemoExoticComponent<({ actions }: {
|
|
8
|
+
actions?: Action[] | undefined;
|
|
9
|
+
}) => JSX.Element | null>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const Action: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
2
|
+
clicked: boolean;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const ActionsContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const ScrollContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const DatePickerContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").FlexProps, never>;
|
|
4
|
+
export declare const CalendarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").FlexProps, never>;
|
|
5
|
+
export declare const DayStyle: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const CalendarMonth: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
+
export declare const IconContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -34,13 +34,13 @@ declare const _default: {
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
export default _default;
|
|
37
|
-
export declare const Overview: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
38
|
-
export declare const WithVerticalLine: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
39
|
-
export declare const WithPagination: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
40
|
-
export declare const WithStickyHeader: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
41
|
-
export declare const WithTabs: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
42
|
-
export declare const WithSearch: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
43
|
-
export declare const SelectableRows: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
44
|
-
export declare const SelectableRow: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
45
|
-
export declare const CustomCell: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
46
|
-
export declare const WithEmptyTable: StoryObj<DataTableProps<typeof data[number], "id">>;
|
|
37
|
+
export declare const Overview: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
38
|
+
export declare const WithVerticalLine: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
39
|
+
export declare const WithPagination: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
40
|
+
export declare const WithStickyHeader: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
41
|
+
export declare const WithTabs: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
42
|
+
export declare const WithSearch: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
43
|
+
export declare const SelectableRows: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
44
|
+
export declare const SelectableRow: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
45
|
+
export declare const CustomCell: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
46
|
+
export declare const WithEmptyTable: StoryObj<DataTableProps<(typeof data)[number], "id">>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
export type DateFieldProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 日付
|
|
6
|
+
* @default dayjs()
|
|
7
|
+
*/
|
|
8
|
+
date: Dayjs;
|
|
9
|
+
/**
|
|
10
|
+
* 指定したい format
|
|
11
|
+
* @default YYYY-MM-DD
|
|
12
|
+
*/
|
|
13
|
+
format?: string;
|
|
14
|
+
/**
|
|
15
|
+
* エラーメッセージのテキスト
|
|
16
|
+
*/
|
|
17
|
+
errorText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 入力を無効にする
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 日付が変更されたときに呼ばれる関数
|
|
25
|
+
*/
|
|
26
|
+
onDateChange?: (date: Dayjs) => void;
|
|
27
|
+
/**
|
|
28
|
+
* カレンダーアイコンをクリックした時に呼ばれる関数
|
|
29
|
+
*/
|
|
30
|
+
onClick: () => void;
|
|
31
|
+
};
|
|
32
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<DateFieldProps & React.RefAttributes<HTMLInputElement>>>;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
|
2
|
+
import { DateFieldProps } from "./DateField";
|
|
3
|
+
import React from "react";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.MemoExoticComponent<React.ForwardRefExoticComponent<DateFieldProps & React.RefAttributes<HTMLInputElement>>>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Example: StoryObj<DateFieldProps>;
|
|
10
|
+
export declare const Custom: StoryObj<DateFieldProps>;
|
|
11
|
+
export declare const Japanese: StoryObj<DateFieldProps>;
|
|
12
|
+
export declare const Error: StoryObj<DateFieldProps>;
|
|
13
|
+
export declare const Disable: StoryObj<DateFieldProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./DateField";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const InputContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
2
|
+
disabled: boolean;
|
|
3
|
+
error?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const CalendarIcon: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DateRange } from "../..";
|
|
3
|
+
export type DateRangeFieldProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 日付
|
|
6
|
+
* @default { startDate: dayjs(), endDate: dayjs() }
|
|
7
|
+
*/
|
|
8
|
+
date: DateRange;
|
|
9
|
+
/**
|
|
10
|
+
* 指定したい format
|
|
11
|
+
* @default YYYY-MM-DD
|
|
12
|
+
*/
|
|
13
|
+
format?: string;
|
|
14
|
+
/**
|
|
15
|
+
* エラーメッセージのテキスト
|
|
16
|
+
*/
|
|
17
|
+
errorText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 入力を無効にする
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* カレンダーアイコンをクリックした時に呼ばれる関数
|
|
25
|
+
*/
|
|
26
|
+
onClickCalendarIcon?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* 日付が変更されたときに呼ばれる関数
|
|
29
|
+
*/
|
|
30
|
+
onDatesChange?: (date: DateRange) => void;
|
|
31
|
+
};
|
|
32
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<DateRangeFieldProps & React.RefAttributes<HTMLInputElement>>>;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
|
2
|
+
import { DateRangeFieldProps } from "./DateRangeField";
|
|
3
|
+
import React from "react";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.MemoExoticComponent<React.ForwardRefExoticComponent<DateRangeFieldProps & React.RefAttributes<HTMLInputElement>>>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Example: StoryObj<DateRangeFieldProps>;
|
|
10
|
+
export declare const Custom: StoryObj<DateRangeFieldProps>;
|
|
11
|
+
export declare const Japanese: StoryObj<DateRangeFieldProps>;
|
|
12
|
+
export declare const Error: StoryObj<DateRangeFieldProps>;
|
|
13
|
+
export declare const Disable: StoryObj<DateRangeFieldProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./DateRangeField";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const InputContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
2
|
+
disabled: boolean;
|
|
3
|
+
error?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const CalendarIcon: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const AllowedKeys: {
|
|
2
|
+
readonly Backspace: "Backspace";
|
|
3
|
+
readonly Delete: "Delete";
|
|
4
|
+
readonly ArrowLeft: "ArrowLeft";
|
|
5
|
+
readonly ArrowRight: "ArrowRight";
|
|
6
|
+
readonly ArrowUp: "ArrowUp";
|
|
7
|
+
readonly ArrowDown: "ArrowDown";
|
|
8
|
+
readonly Tab: "Tab";
|
|
9
|
+
readonly "0": "0";
|
|
10
|
+
readonly "1": "1";
|
|
11
|
+
readonly "2": "2";
|
|
12
|
+
readonly "3": "3";
|
|
13
|
+
readonly "4": "4";
|
|
14
|
+
readonly "5": "5";
|
|
15
|
+
readonly "6": "6";
|
|
16
|
+
readonly "7": "7";
|
|
17
|
+
readonly "8": "8";
|
|
18
|
+
readonly "9": "9";
|
|
19
|
+
};
|
|
20
|
+
export declare const numberKeys: string[];
|
|
21
|
+
export declare const allowedKeys: ("0" | "1" | "4" | "2" | "3" | "5" | "7" | "6" | "Backspace" | "Delete" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "ArrowDown" | "Tab" | "8" | "9")[];
|
|
22
|
+
export type AllowedKeys = (typeof AllowedKeys)[keyof typeof AllowedKeys];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
type Props = {
|
|
4
|
+
date: Dayjs | null;
|
|
5
|
+
format?: string;
|
|
6
|
+
onDateChange?: (date: Dayjs) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* 指定された format で日付を表示・操作するための hooks
|
|
10
|
+
* 左右キーでセクション移動、上下キーで選択中のセクションの値を増減する
|
|
11
|
+
* 直接キーボード入力することもできる
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export declare const useDateField: ({ date, format, onDateChange, }: Props) => {
|
|
15
|
+
ref: import("react").RefObject<HTMLInputElement>;
|
|
16
|
+
value: string | undefined;
|
|
17
|
+
onFocus: () => void;
|
|
18
|
+
onBlur: () => void;
|
|
19
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
20
|
+
onMouseDown: () => void;
|
|
21
|
+
onPaste: (event: React.ClipboardEvent<HTMLInputElement>) => void;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type Sections = {
|
|
2
|
+
start: number;
|
|
3
|
+
end: number;
|
|
4
|
+
value: string;
|
|
5
|
+
editable: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* 何らかのフォーマットで入ってくる日付を開始位置と終了位置と値を持つセクションに分割する
|
|
9
|
+
* useDateField で format された日付操作を汎用的に行うために必要なプロパティを返す
|
|
10
|
+
* 例) 2023-01-02 -> [
|
|
11
|
+
* { start: 0, end: 3, value: "2023", editable: true },
|
|
12
|
+
* { start: 4, end: 4, value: "-", editable: false },
|
|
13
|
+
* { start: 5, end: 6, value: "01", editable: true },
|
|
14
|
+
* { start: 7, end: 7, value: "-", editable: false },
|
|
15
|
+
* { start: 8, end: 9, value: "02", editable: true }
|
|
16
|
+
* ]
|
|
17
|
+
*
|
|
18
|
+
* @param formattedDate 何らかのフォーマットで入ってくる日付
|
|
19
|
+
* @returns 開始位置と終了位置と値を持つセクション
|
|
20
|
+
*/
|
|
21
|
+
export declare const getSections: (formattedDate?: string | null) => Sections[];
|
|
22
|
+
/**
|
|
23
|
+
* 開始位置と終了位置と値を持つセクションをフォーマットされた日付に変換する
|
|
24
|
+
*/
|
|
25
|
+
export declare const formatString: (sectionsWithCharacter: Sections[]) => string;
|
|
26
|
+
export {};
|
|
@@ -10,7 +10,7 @@ export type DatePickerProps = Partial<Omit<SingleDatePickerShape, "date" | "onFo
|
|
|
10
10
|
localeData?: InstanceLocaleDataReturn;
|
|
11
11
|
error?: boolean;
|
|
12
12
|
};
|
|
13
|
-
declare const DatePicker: React.ForwardRefExoticComponent<Partial<Omit<SingleDatePickerShape, "date" | "
|
|
13
|
+
declare const DatePicker: React.ForwardRefExoticComponent<Partial<Omit<SingleDatePickerShape, "date" | "onDateChange" | "onFocusChange" | "renderMonthText">> & Omit<RenderMonthProps, "renderMonthText"> & {
|
|
14
14
|
date: dayjs.Dayjs | null;
|
|
15
15
|
onDateChange: (date: dayjs.Dayjs | null) => void;
|
|
16
16
|
renderMonthText?: ((month: dayjs.Dayjs) => React.ReactNode) | null | undefined;
|