ingred-ui 29.0.0 → 29.1.1
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/components/Calendar/Calendar/Calendar.d.ts +5 -5
- package/dist/components/Calendar/Calendar/Calendar.stories.d.ts +1 -1
- package/dist/components/Calendar/CalendarRange/CalendarRange.d.ts +7 -7
- package/dist/components/Calendar/CalendarRange/CalendarRange.stories.d.ts +2 -2
- package/dist/components/DateField/DateField2/DateField2.d.ts +19 -0
- package/dist/components/DateField/DateField2/DateField2.stories.d.ts +23 -0
- package/dist/components/DateField/DateField2/index.d.ts +2 -0
- package/dist/components/DateField/DateField2/styled.d.ts +17 -0
- package/dist/components/DateField/DateField2/useDateField2.d.ts +69 -0
- package/dist/components/DateField/DateRangeField2/DateRangeField2.d.ts +21 -0
- package/dist/components/DateField/DateRangeField2/DateRangeField2.stories.d.ts +23 -0
- package/dist/components/DateField/DateRangeField2/index.d.ts +2 -0
- package/dist/components/DateField/DateRangeField2/styled.d.ts +10 -0
- package/dist/components/DateField/__tests__/useDateField2.test.d.ts +1 -0
- package/dist/components/DateField/index.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.d.ts +3 -3
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/components/TimeField/TimeField2.d.ts +20 -0
- package/dist/components/TimeField/TimeField2.stories.d.ts +12 -0
- package/dist/components/TimeField/__tests__/useTimeField2.test.d.ts +1 -0
- package/dist/components/TimeField/index.d.ts +2 -0
- package/dist/components/TimeField/useTimeField2.d.ts +68 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/index.es.js +702 -600
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +677 -575
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dayjs } from "dayjs";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { PresetButton } from "../internal/Actions";
|
|
4
|
-
import {
|
|
4
|
+
import type { TimeField2Props } from "../../TimeField/TimeField2";
|
|
5
5
|
import type { CalendarWeekConfig } from "../types";
|
|
6
6
|
export type CalendarProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
7
7
|
/**
|
|
@@ -56,9 +56,9 @@ export type CalendarProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
56
56
|
*/
|
|
57
57
|
showTimeFields?: boolean;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* TimeField2のprops
|
|
60
60
|
*/
|
|
61
|
-
timeFieldProps?: Partial<
|
|
61
|
+
timeFieldProps?: Partial<TimeField2Props>;
|
|
62
62
|
};
|
|
63
63
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
64
64
|
/**
|
|
@@ -113,8 +113,8 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
|
113
113
|
*/
|
|
114
114
|
showTimeFields?: boolean | undefined;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
116
|
+
* TimeField2のprops
|
|
117
117
|
*/
|
|
118
|
-
timeFieldProps?: Partial<
|
|
118
|
+
timeFieldProps?: Partial<TimeField2Props> | undefined;
|
|
119
119
|
} & React.RefAttributes<HTMLDivElement>>>;
|
|
120
120
|
export default _default;
|
|
@@ -16,7 +16,7 @@ declare const _default: {
|
|
|
16
16
|
isOutsideRange?: ((date: dayjs.Dayjs) => boolean) | undefined;
|
|
17
17
|
onDateChange: (value: dayjs.Dayjs) => void;
|
|
18
18
|
showTimeFields?: boolean | undefined;
|
|
19
|
-
timeFieldProps?: Partial<import("../..").
|
|
19
|
+
timeFieldProps?: Partial<import("../..").TimeField2Props> | undefined;
|
|
20
20
|
} & React.RefAttributes<HTMLDivElement>>>;
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import dayjs, { Dayjs } from "dayjs";
|
|
|
2
2
|
import { DateRange } from "../..";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { PresetButton } from "../internal/Actions";
|
|
5
|
-
import {
|
|
5
|
+
import type { TimeField2Props } from "../../TimeField/TimeField2";
|
|
6
6
|
import type { CalendarWeekConfig } from "../types";
|
|
7
7
|
export type CalendarRangeProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
8
8
|
/**
|
|
@@ -80,9 +80,9 @@ export type CalendarRangeProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
80
80
|
*/
|
|
81
81
|
showTimeFields?: boolean;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* TimeField2のprops
|
|
84
84
|
*/
|
|
85
|
-
timeFieldProps?: Partial<
|
|
85
|
+
timeFieldProps?: Partial<TimeField2Props>;
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
88
88
|
* CalendarRange
|
|
@@ -165,9 +165,9 @@ export declare const CalendarRange: React.ForwardRefExoticComponent<React.HTMLAt
|
|
|
165
165
|
*/
|
|
166
166
|
showTimeFields?: boolean | undefined;
|
|
167
167
|
/**
|
|
168
|
-
*
|
|
168
|
+
* TimeField2のprops
|
|
169
169
|
*/
|
|
170
|
-
timeFieldProps?: Partial<
|
|
170
|
+
timeFieldProps?: Partial<TimeField2Props> | undefined;
|
|
171
171
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
172
172
|
export type { DateRange };
|
|
173
173
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -246,8 +246,8 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
|
246
246
|
*/
|
|
247
247
|
showTimeFields?: boolean | undefined;
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
249
|
+
* TimeField2のprops
|
|
250
250
|
*/
|
|
251
|
-
timeFieldProps?: Partial<
|
|
251
|
+
timeFieldProps?: Partial<TimeField2Props> | undefined;
|
|
252
252
|
} & React.RefAttributes<HTMLDivElement>>>;
|
|
253
253
|
export default _default;
|
|
@@ -21,7 +21,7 @@ declare const _default: {
|
|
|
21
21
|
isOutsideRange?: ((date: dayjs.Dayjs) => boolean) | undefined;
|
|
22
22
|
onDatesChange?: ((dates: import("./CalendarRange").DateRange) => void) | undefined;
|
|
23
23
|
showTimeFields?: boolean | undefined;
|
|
24
|
-
timeFieldProps?: Partial<import("../..").
|
|
24
|
+
timeFieldProps?: Partial<import("../..").TimeField2Props> | undefined;
|
|
25
25
|
} & React.RefAttributes<HTMLDivElement>>>;
|
|
26
26
|
};
|
|
27
27
|
export default _default;
|
|
@@ -31,5 +31,5 @@ export declare const WithPresetButtons: StoryObj<CalendarRangeProps>;
|
|
|
31
31
|
export declare const WithDateField: StoryObj<CalendarRangeProps>;
|
|
32
32
|
export declare const WithDateFieldAndPresetButtons: StoryObj<CalendarRangeProps>;
|
|
33
33
|
export declare const WithDateFieldsAndTimeFields: StoryObj<CalendarRangeProps>;
|
|
34
|
-
/**
|
|
34
|
+
/** DateField2 + TimeField2 に加え、プリセットボタンを並べた組み合わせ例 */
|
|
35
35
|
export declare const WithDateFieldsTimeFieldsAndPresetButtons: StoryObj<CalendarRangeProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
import { InputSize, InputVariant } from "../types";
|
|
4
|
+
export type DateField2Props = {
|
|
5
|
+
date: Dayjs;
|
|
6
|
+
format?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
error?: boolean;
|
|
9
|
+
errorText?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
size?: InputSize;
|
|
12
|
+
variant?: InputVariant;
|
|
13
|
+
width?: string | number;
|
|
14
|
+
append?: React.ReactNode;
|
|
15
|
+
onAppendClick?: () => void;
|
|
16
|
+
onDateChange?: (date: Dayjs) => void;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<DateField2Props & React.RefAttributes<HTMLDivElement>>>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { DateField2Props } from "./DateField2";
|
|
3
|
+
import React from "react";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.MemoExoticComponent<React.ForwardRefExoticComponent<DateField2Props & React.RefAttributes<HTMLDivElement>>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
16
|
+
export declare const Example: StoryObj<DateField2Props>;
|
|
17
|
+
export declare const Custom: StoryObj<DateField2Props>;
|
|
18
|
+
export declare const Japanese: StoryObj<DateField2Props>;
|
|
19
|
+
export declare const Error: StoryObj<DateField2Props>;
|
|
20
|
+
export declare const Disabled: StoryObj<DateField2Props>;
|
|
21
|
+
export declare const Small: StoryObj<DateField2Props>;
|
|
22
|
+
export declare const Large: StoryObj<DateField2Props>;
|
|
23
|
+
export declare const Dark: StoryObj<DateField2Props>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InputSize, InputVariant } from "../../Input/types";
|
|
2
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
|
+
$size: InputSize;
|
|
4
|
+
$variant: InputVariant;
|
|
5
|
+
$error: boolean;
|
|
6
|
+
$disabled: boolean;
|
|
7
|
+
$focused: boolean;
|
|
8
|
+
$isIOS?: boolean | undefined;
|
|
9
|
+
$width?: string | number | undefined;
|
|
10
|
+
}, never>;
|
|
11
|
+
export declare const SegmentsRow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
+
export declare const Segment: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
|
|
13
|
+
$focused: boolean;
|
|
14
|
+
$editable: boolean;
|
|
15
|
+
}, never>;
|
|
16
|
+
export declare const Separator: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
17
|
+
export declare const AppendContainer: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
type Props = {
|
|
4
|
+
date: Dayjs | null;
|
|
5
|
+
format?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onDateChange?: (date: Dayjs) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* React Aria 方式の DateField2 向けフック。
|
|
11
|
+
* 各セグメント span が contentEditable + tabIndex={0} で直接フォーカス・入力を受ける。
|
|
12
|
+
* setSelectionRange を使わないためモバイル (iOS) でも安定動作する。
|
|
13
|
+
*/
|
|
14
|
+
export declare const useDateField2: ({ date, format, disabled, onDateChange, }: Props) => {
|
|
15
|
+
value: string;
|
|
16
|
+
sections: {
|
|
17
|
+
start: number;
|
|
18
|
+
end: number;
|
|
19
|
+
value: string;
|
|
20
|
+
editable: boolean;
|
|
21
|
+
}[];
|
|
22
|
+
focusedIndex: number | null;
|
|
23
|
+
isFocused: boolean;
|
|
24
|
+
getSegmentProps: (index: number) => {
|
|
25
|
+
ref: (el: HTMLSpanElement | null) => void;
|
|
26
|
+
"aria-hidden": true;
|
|
27
|
+
role?: undefined;
|
|
28
|
+
contentEditable?: undefined;
|
|
29
|
+
suppressContentEditableWarning?: undefined;
|
|
30
|
+
inputMode?: undefined;
|
|
31
|
+
tabIndex?: undefined;
|
|
32
|
+
enterKeyHint?: undefined;
|
|
33
|
+
spellCheck?: undefined;
|
|
34
|
+
autoCorrect?: undefined;
|
|
35
|
+
style?: undefined;
|
|
36
|
+
onFocus?: undefined;
|
|
37
|
+
onBlur?: undefined;
|
|
38
|
+
onKeyDown?: undefined;
|
|
39
|
+
onBeforeInput?: undefined;
|
|
40
|
+
onPointerDown?: undefined;
|
|
41
|
+
onMouseDown?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
ref: (el: HTMLSpanElement | null) => void;
|
|
44
|
+
role: "spinbutton";
|
|
45
|
+
contentEditable: true;
|
|
46
|
+
suppressContentEditableWarning: true;
|
|
47
|
+
inputMode: "numeric";
|
|
48
|
+
tabIndex: number;
|
|
49
|
+
enterKeyHint: "next";
|
|
50
|
+
spellCheck: false;
|
|
51
|
+
autoCorrect: "off";
|
|
52
|
+
style: {
|
|
53
|
+
caretColor: "transparent";
|
|
54
|
+
};
|
|
55
|
+
onFocus: () => void;
|
|
56
|
+
onBlur: (e: React.FocusEvent) => void;
|
|
57
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLSpanElement>) => void;
|
|
58
|
+
onBeforeInput: (e: React.FormEvent<HTMLSpanElement>) => void;
|
|
59
|
+
onPointerDown(e: React.PointerEvent): void;
|
|
60
|
+
onMouseDown(e: React.MouseEvent): void;
|
|
61
|
+
"aria-hidden"?: undefined;
|
|
62
|
+
};
|
|
63
|
+
groupProps: {
|
|
64
|
+
ref: React.MutableRefObject<HTMLDivElement | null>;
|
|
65
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
66
|
+
onPaste: (event: React.ClipboardEvent<HTMLDivElement>) => void;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DateRange } from "../..";
|
|
3
|
+
import { InputSize, InputVariant } from "../types";
|
|
4
|
+
export type DateRangeField2Props = {
|
|
5
|
+
date: DateRange;
|
|
6
|
+
format?: string;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
errorText?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
size?: InputSize;
|
|
11
|
+
variant?: InputVariant;
|
|
12
|
+
startWidth?: string | number;
|
|
13
|
+
endWidth?: string | number;
|
|
14
|
+
startName?: string;
|
|
15
|
+
endName?: string;
|
|
16
|
+
append?: React.ReactNode;
|
|
17
|
+
onAppendClick?: () => void;
|
|
18
|
+
onDatesChange?: (date: DateRange) => void;
|
|
19
|
+
};
|
|
20
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<DateRangeField2Props & React.RefAttributes<HTMLDivElement>>>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { DateRangeField2Props } from "./DateRangeField2";
|
|
3
|
+
import React from "react";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.MemoExoticComponent<React.ForwardRefExoticComponent<DateRangeField2Props & React.RefAttributes<HTMLDivElement>>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
16
|
+
export declare const Example: StoryObj<DateRangeField2Props>;
|
|
17
|
+
export declare const Custom: StoryObj<DateRangeField2Props>;
|
|
18
|
+
export declare const Japanese: StoryObj<DateRangeField2Props>;
|
|
19
|
+
export declare const Error: StoryObj<DateRangeField2Props>;
|
|
20
|
+
export declare const Disabled: StoryObj<DateRangeField2Props>;
|
|
21
|
+
export declare const Small: StoryObj<DateRangeField2Props>;
|
|
22
|
+
export declare const Large: StoryObj<DateRangeField2Props>;
|
|
23
|
+
export declare const Dark: StoryObj<DateRangeField2Props>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputSize, InputVariant } from "../../Input/types";
|
|
2
|
+
export declare const RangeContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
|
+
$size: InputSize;
|
|
4
|
+
$variant: InputVariant;
|
|
5
|
+
$error: boolean;
|
|
6
|
+
$disabled: boolean;
|
|
7
|
+
$focused: boolean;
|
|
8
|
+
$isIOS?: boolean | undefined;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const RangeSeparator: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import DateField from "./DateField";
|
|
2
2
|
import DateRangeField from "./DateRangeField";
|
|
3
3
|
export { DateField, DateRangeField };
|
|
4
|
+
export { DateField2 } from "./DateField2";
|
|
5
|
+
export type { DateField2Props } from "./DateField2";
|
|
6
|
+
export { DateRangeField2 } from "./DateRangeField2";
|
|
7
|
+
export type { DateRangeField2Props } from "./DateRangeField2";
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import type { CalendarWeekConfig } from "../Calendar/types";
|
|
3
3
|
import { PresetButton } from "../Calendar/internal/Actions";
|
|
4
4
|
import { Dayjs } from "dayjs";
|
|
5
|
-
import {
|
|
5
|
+
import type { TimeField2Props } from "../TimeField/TimeField2";
|
|
6
6
|
import { InputSize, InputVariant } from "../Input/types";
|
|
7
7
|
export type DatePickerProps = {
|
|
8
8
|
/**
|
|
@@ -99,9 +99,9 @@ export type DatePickerProps = {
|
|
|
99
99
|
*/
|
|
100
100
|
showTimeFields?: boolean;
|
|
101
101
|
/**
|
|
102
|
-
*
|
|
102
|
+
* TimeField2のprops
|
|
103
103
|
*/
|
|
104
|
-
timeFieldProps?: Partial<
|
|
104
|
+
timeFieldProps?: Partial<TimeField2Props>;
|
|
105
105
|
/**
|
|
106
106
|
* CalendarRangeを使用するかどうか
|
|
107
107
|
* @default false
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { Dayjs } from "dayjs";
|
|
3
3
|
import type { CalendarWeekConfig } from "../Calendar/types";
|
|
4
4
|
import { PresetButton } from "../Calendar/internal/Actions";
|
|
5
|
-
import {
|
|
5
|
+
import type { TimeField2Props } from "../TimeField/TimeField2";
|
|
6
6
|
import { InputSize, InputVariant } from "../Input/types";
|
|
7
7
|
export type DateRange = {
|
|
8
8
|
startDate: Dayjs;
|
|
@@ -88,9 +88,9 @@ export type DateRangePickerProps = {
|
|
|
88
88
|
*/
|
|
89
89
|
showTimeFields?: boolean;
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* TimeField2のprops
|
|
92
92
|
*/
|
|
93
|
-
timeFieldProps?: Partial<
|
|
93
|
+
timeFieldProps?: Partial<TimeField2Props>;
|
|
94
94
|
/**
|
|
95
95
|
* 日付の表示フォーマット
|
|
96
96
|
* @default "YYYY-MM-DD"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
export type TimeField2Props = {
|
|
4
|
+
time?: Dayjs | null;
|
|
5
|
+
name?: string;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
errorText?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onTimeChange?: (time: Dayjs) => void;
|
|
10
|
+
dropdownInterval?: number;
|
|
11
|
+
filterTimeOptions?: Array<(time: string) => boolean>;
|
|
12
|
+
size?: "small" | "medium" | "large";
|
|
13
|
+
variant?: "light" | "dark";
|
|
14
|
+
width?: string;
|
|
15
|
+
maxHeight?: number | string;
|
|
16
|
+
onFocus?: () => void;
|
|
17
|
+
onBlur?: () => void;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: React.NamedExoticComponent<TimeField2Props>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import TimeField2, { TimeField2Props } from "./TimeField2";
|
|
3
|
+
declare const meta: Meta<typeof TimeField2>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<TimeField2Props>;
|
|
6
|
+
export declare const Example: Story;
|
|
7
|
+
export declare const SmallSize: Story;
|
|
8
|
+
export declare const LargeSize: Story;
|
|
9
|
+
export declare const DarkVariant: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
export declare const Error: Story;
|
|
12
|
+
export declare const FilteredTimeOptions: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
type Props = {
|
|
4
|
+
time: Dayjs | null;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onTimeChange?: (time: Dayjs) => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* React Aria 方式の TimeField2 向けフック。
|
|
10
|
+
* 各セグメント span が contentEditable + tabIndex={0} で直接フォーカス・入力を受ける。
|
|
11
|
+
* setSelectionRange を使わないためモバイル (iOS) でも安定動作する。
|
|
12
|
+
*/
|
|
13
|
+
export declare const useTimeField2: ({ time, disabled, onTimeChange, }: Props) => {
|
|
14
|
+
value: string;
|
|
15
|
+
sections: {
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
value: string;
|
|
19
|
+
editable: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
focusedIndex: number | null;
|
|
22
|
+
isFocused: boolean;
|
|
23
|
+
getSegmentProps: (index: number) => {
|
|
24
|
+
ref: (el: HTMLSpanElement | null) => void;
|
|
25
|
+
"aria-hidden": true;
|
|
26
|
+
role?: undefined;
|
|
27
|
+
contentEditable?: undefined;
|
|
28
|
+
suppressContentEditableWarning?: undefined;
|
|
29
|
+
inputMode?: undefined;
|
|
30
|
+
tabIndex?: undefined;
|
|
31
|
+
enterKeyHint?: undefined;
|
|
32
|
+
spellCheck?: undefined;
|
|
33
|
+
autoCorrect?: undefined;
|
|
34
|
+
style?: undefined;
|
|
35
|
+
onFocus?: undefined;
|
|
36
|
+
onBlur?: undefined;
|
|
37
|
+
onKeyDown?: undefined;
|
|
38
|
+
onBeforeInput?: undefined;
|
|
39
|
+
onPointerDown?: undefined;
|
|
40
|
+
onMouseDown?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
ref: (el: HTMLSpanElement | null) => void;
|
|
43
|
+
role: "spinbutton";
|
|
44
|
+
contentEditable: true;
|
|
45
|
+
suppressContentEditableWarning: true;
|
|
46
|
+
inputMode: "numeric";
|
|
47
|
+
tabIndex: number;
|
|
48
|
+
enterKeyHint: "next";
|
|
49
|
+
spellCheck: false;
|
|
50
|
+
autoCorrect: "off";
|
|
51
|
+
style: {
|
|
52
|
+
caretColor: "transparent";
|
|
53
|
+
};
|
|
54
|
+
onFocus: () => void;
|
|
55
|
+
onBlur: (e: React.FocusEvent) => void;
|
|
56
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLSpanElement>) => void;
|
|
57
|
+
onBeforeInput: (e: React.FormEvent<HTMLSpanElement>) => void;
|
|
58
|
+
onPointerDown(e: React.PointerEvent): void;
|
|
59
|
+
onMouseDown(e: React.MouseEvent): void;
|
|
60
|
+
"aria-hidden"?: undefined;
|
|
61
|
+
};
|
|
62
|
+
groupProps: {
|
|
63
|
+
ref: React.MutableRefObject<HTMLDivElement | null>;
|
|
64
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
65
|
+
onPaste: (event: React.ClipboardEvent<HTMLDivElement>) => void;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export {};
|
|
@@ -33,7 +33,7 @@ export * from "./CreatableSelect";
|
|
|
33
33
|
export { default as DataTable } from "./DataTable";
|
|
34
34
|
export * from "./DataTable";
|
|
35
35
|
export * from "./DataTable2";
|
|
36
|
-
export { DateField, DateRangeField } from "./DateField";
|
|
36
|
+
export { DateField, DateRangeField, DateField2, DateRangeField2, } from "./DateField";
|
|
37
37
|
export * from "./DateField";
|
|
38
38
|
export { default as DatePicker } from "./DatePicker";
|
|
39
39
|
export * from "./DatePicker";
|
|
@@ -130,7 +130,7 @@ export * from "./Tabs";
|
|
|
130
130
|
export * from "./Tag";
|
|
131
131
|
export { default as TextField } from "./TextField";
|
|
132
132
|
export * from "./TextField";
|
|
133
|
-
export { TimeField } from "./TimeField";
|
|
133
|
+
export { TimeField, TimeField2 } from "./TimeField";
|
|
134
134
|
export * from "./TimeField";
|
|
135
135
|
export { default as Toast } from "./Toast";
|
|
136
136
|
export * from "./Toast";
|