@moneyforward/mfui-components 3.29.1 → 3.31.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/src/Button/Button.d.ts +4 -4
- package/dist/src/CheckboxCard/CheckboxCard.d.ts +2 -2
- package/dist/src/CheckboxCard/CheckboxCard.js +1 -1
- package/dist/src/DataTable/DataTable.js +2 -2
- package/dist/src/DataTable/DataTable.types.d.ts +9 -0
- package/dist/src/DataTable/DataTableCell/DataTableCell.js +3 -2
- package/dist/src/DataTable/DataTableHeaderCell/DataTableHeaderCell.js +2 -1
- package/dist/src/DataTable/DataTableProvider.d.ts +2 -2
- package/dist/src/DataTable/DataTableProvider.js +4 -1
- package/dist/src/DataTable/DataTableRow/DataTableRow.js +34 -3
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerProvider/DateRangePickerProvider.d.ts +2 -2
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerTrigger/constants.d.ts +4 -4
- package/dist/src/DateTimeSelection/DateRangePicker/DateRangePickerTrigger/hooks/useDateRangeTriggerInputClick.d.ts +1 -1
- package/dist/src/DateTimeSelection/DateRangePicker/utilities/createDateRangePickerTestUtility.d.ts +1 -1
- package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/constants.d.ts +5 -5
- package/dist/src/DateTimeSelection/TimePicker/TimePicker.d.ts +9 -9
- package/dist/src/DateTimeSelection/shared/BasePicker/basePickerUtilities/useBasePickerValueController.d.ts +1 -1
- package/dist/src/DateTimeSelection/shared/BasePicker/constants.d.ts +1 -1
- package/dist/src/DateTimeSelection/shared/BasePicker/constants.js +2 -0
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerPopover/BaseRangePickerCalendar/constants.d.ts +6 -6
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerProvider/BaseRangePickerProvider.d.ts +2 -2
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerTrigger/BaseRangePickerTrigger.js +1 -1
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/BaseRangePickerTrigger/hooks/useDateRangeTriggerInputClick.d.ts +1 -1
- package/dist/src/DateTimeSelection/shared/BaseRangePicker/utilities/createBaseRangePickerTestUtility.d.ts +1 -1
- package/dist/src/DateTimeSelection/shared/YearSelector/YearSelector.js +7 -1
- package/dist/src/DateTimeSelection/shared/accessibility/constants.d.ts +6 -6
- package/dist/src/Dialog/Dialog.d.ts +4 -4
- package/dist/src/Disclosure/Disclosure.d.ts +21 -10
- package/dist/src/DropdownMenu/DropdownMenu.d.ts +3 -3
- package/dist/src/DropdownMenu/DropdownMenu.js +26 -2
- package/dist/src/DropdownMenu/DropdownMenuButtonTrigger.d.ts +2 -2
- package/dist/src/DropdownMenu/DropdownMenuContainer/DropdownMenuContainer.js +28 -3
- package/dist/src/DropdownMenu/DropdownMenuContainer/DropdownMenuContainer.types.d.ts +5 -2
- package/dist/src/DropdownMenu/DropdownMenuItem/DropdownMenuItem.d.ts +1 -1
- package/dist/src/DropdownMenu/DropdownMenuItem/DropdownMenuItem.js +29 -6
- package/dist/src/DropdownMenu/DropdownMenuItem/DropdownMenuItem.types.d.ts +6 -0
- package/dist/src/EmbeddedSidePane/EmbeddedSidePane.d.ts +1 -1
- package/dist/src/FileBox/FileBox.d.ts +4 -4
- package/dist/src/FileBox/FileBox.js +1 -1
- package/dist/src/FileDropZone/FileDropZone.d.ts +4 -4
- package/dist/src/FileDropZone/utils/fileHelpers.d.ts +3 -3
- package/dist/src/FilterTrigger/FilterTrigger.d.ts +2 -2
- package/dist/src/Heading/Heading.d.ts +2 -2
- package/dist/src/HelpMessage/HelpMessage.d.ts +3 -3
- package/dist/src/IconButton/IconButton.d.ts +6 -6
- package/dist/src/KeyValue/KeyValue.d.ts +2 -2
- package/dist/src/MainNavigation/BaseMainNavigation.d.ts +1 -1
- package/dist/src/MainNavigation/BaseMainNavigation.js +4 -2
- package/dist/src/MainNavigation/MainNavigation.js +3 -3
- package/dist/src/MainNavigation/MainNavigation.types.d.ts +18 -0
- package/dist/src/MultipleSelectBox/MultipleSelectBox.js +1 -1
- package/dist/src/MultipleSelectBox/hooks/useApplyControls.d.ts +1 -1
- package/dist/src/MultipleSelectBox/hooks/useSelectedValues.d.ts +1 -1
- package/dist/src/NumberBox/NumberBox.d.ts +1 -1
- package/dist/src/NumberBox/NumberBox.js +68 -21
- package/dist/src/Pagination/ItemsCount/ItemsCount.js +1 -1
- package/dist/src/Popover/Popover.js +1 -1
- package/dist/src/RadioButton/RadioButton.d.ts +1 -1
- package/dist/src/RadioButtonCard/RadioButtonCard.d.ts +2 -2
- package/dist/src/RadioButtonCard/RadioButtonCard.js +1 -1
- package/dist/src/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/src/SearchBox/SearchBox.js +18 -4
- package/dist/src/SectionMessage/SectionMessage.d.ts +5 -5
- package/dist/src/SectionMessage/SectionMessage.js +11 -4
- package/dist/src/SectionMessage/SectionMessage.types.d.ts +4 -4
- package/dist/src/SelectBox/SelectBox.js +1 -1
- package/dist/src/SelectBox/SelectBoxOption.js +1 -1
- package/dist/src/SelectBox/SelectBoxOptionGroup.js +1 -1
- package/dist/src/SidePane/SidePane.d.ts +9 -7
- package/dist/src/SidePane/SidePane.js +8 -4
- package/dist/src/SidePane/hooks/useSidePaneStateController.d.ts +7 -2
- package/dist/src/SidePane/hooks/useSidePaneStateController.js +11 -5
- package/dist/src/Sidebar/Sidebar.d.ts +10 -1
- package/dist/src/Sidebar/Sidebar.js +40 -10
- package/dist/src/Sidebar/Sidebar.types.d.ts +39 -2
- package/dist/src/Sidebar/SidebarContext.d.ts +3 -0
- package/dist/src/Sidebar/SidebarContext.js +2 -0
- package/dist/src/Sidebar/SidebarMenuHeading/SidebarMenuHeading.d.ts +49 -0
- package/dist/src/Sidebar/SidebarMenuHeading/SidebarMenuHeading.js +113 -0
- package/dist/src/Sidebar/SidebarMenuHeading/SidebarMenuHeading.types.d.ts +36 -0
- package/dist/src/Sidebar/SidebarMenuHeading/SidebarMenuHeading.types.js +1 -0
- package/dist/src/Sidebar/SidebarMenuHeading/index.d.ts +2 -0
- package/dist/src/Sidebar/SidebarMenuHeading/index.js +1 -0
- package/dist/src/Sidebar/SidebarNavigationItem.js +6 -3
- package/dist/src/Sidebar/hooks/useSidebarResize.d.ts +2 -1
- package/dist/src/Sidebar/hooks/useSidebarResize.js +31 -3
- package/dist/src/Sidebar/index.d.ts +2 -1
- package/dist/src/Stack/Stack.d.ts +5 -5
- package/dist/src/StatusLabel/StatusLabel.d.ts +2 -2
- package/dist/src/Stepper/Step/Step.js +1 -1
- package/dist/src/SubNavigation/SubNavigation.js +1 -1
- package/dist/src/Tag/Tag.d.ts +1 -1
- package/dist/src/Tag/Tag.js +2 -2
- package/dist/src/Tag/Tag.types.d.ts +7 -0
- package/dist/src/TextBox/TextBox.d.ts +6 -6
- package/dist/src/TextLink/TextLink.d.ts +2 -2
- package/dist/src/Textarea/Textarea.d.ts +4 -4
- package/dist/src/Toast/Toast.d.ts +3 -3
- package/dist/src/Toast/Toast.js +9 -5
- package/dist/src/Toast/Toast.types.d.ts +3 -5
- package/dist/src/Toast/api/toast.d.ts +18 -2
- package/dist/src/Tooltip/Tooltip.d.ts +3 -3
- package/dist/src/Tooltip/Tooltip.js +1 -1
- package/dist/src/Tooltip/Tooltip.types.d.ts +2 -0
- package/dist/src/Tooltip/hooks/useTooltipDisplayController.js +14 -2
- package/dist/src/utilities/dom/dispatchNativeInputValueWithEvent.d.ts +1 -1
- package/dist/src/utilities/dom/useFocusTrap.d.ts +1 -1
- package/dist/src/utilities/react/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/styled-system/css/conditions.d.ts +3 -3
- package/dist/styled-system/helpers.d.ts +36 -35
- package/dist/styled-system/jsx/factory-helper.d.ts +4 -4
- package/dist/styled-system/recipes/create-recipe.d.ts +2 -2
- package/dist/styled-system/recipes/data-table-cell-slot-recipe.d.ts +1 -0
- package/dist/styled-system/recipes/data-table-cell-slot-recipe.js +4 -0
- package/dist/styled-system/recipes/data-table-header-cell-slot-recipe.d.ts +1 -0
- package/dist/styled-system/recipes/data-table-header-cell-slot-recipe.js +4 -0
- package/dist/styled-system/recipes/dropdown-menu-item-slot-recipe.d.ts +1 -1
- package/dist/styled-system/recipes/dropdown-menu-item-slot-recipe.js +12 -0
- package/dist/styled-system/recipes/index.d.ts +2 -1
- package/dist/styled-system/recipes/index.js +1 -0
- package/dist/styled-system/recipes/section-message-slot-recipe.d.ts +1 -1
- package/dist/styled-system/recipes/section-message-slot-recipe.js +3 -1
- package/dist/styled-system/recipes/sidebar-menu-heading-slot-recipe.d.ts +33 -0
- package/dist/styled-system/recipes/sidebar-menu-heading-slot-recipe.js +44 -0
- package/dist/styled-system/recipes/sidebar-slot-recipe.d.ts +1 -1
- package/dist/styled-system/recipes/sidebar-slot-recipe.js +4 -0
- package/dist/styles.css +158 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -11
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
export declare const Button: import("react").ForwardRefExoticComponent<{
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
-
size?: import("../../styled-system/recipes").ButtonSlotRecipeVariant[
|
|
15
|
-
priority?: import("../../styled-system/recipes").ButtonSlotRecipeVariant[
|
|
16
|
-
destructive?: import("../../styled-system/recipes").ButtonSlotRecipeVariant[
|
|
14
|
+
size?: import("../../styled-system/recipes").ButtonSlotRecipeVariant['size'];
|
|
15
|
+
priority?: import("../../styled-system/recipes").ButtonSlotRecipeVariant['priority'];
|
|
16
|
+
destructive?: import("../../styled-system/recipes").ButtonSlotRecipeVariant['destructive'];
|
|
17
17
|
leftIcon?: React.ReactElement;
|
|
18
18
|
isDropdownTrigger?: boolean;
|
|
19
19
|
loading?: boolean;
|
|
20
20
|
rightIcon?: React.ReactElement;
|
|
21
21
|
href?: string;
|
|
22
22
|
customLinkComponent?: import("react").ElementType;
|
|
23
|
-
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "
|
|
23
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref">, "download" | "hrefLang" | "ping" | "referrerPolicy" | "rel" | "target" | "type"> & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -8,8 +8,8 @@ import { type CheckboxCardResponsiveSlot } from './CheckboxCard.types';
|
|
|
8
8
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
|
|
9
9
|
*/
|
|
10
10
|
export declare const CheckboxCard: import("react").ForwardRefExoticComponent<{
|
|
11
|
-
layout?: import("../../styled-system/recipes").CheckboxCardSlotRecipeVariant[
|
|
11
|
+
layout?: import("../../styled-system/recipes").CheckboxCardSlotRecipeVariant['layout'];
|
|
12
12
|
label: string;
|
|
13
13
|
renderDetailsSlot?: CheckboxCardResponsiveSlot | import("./CheckboxCard.types").CheckboxCardRenderDetailsSlot;
|
|
14
|
-
disableResponsive?: import("../../styled-system/recipes").CheckboxCardSlotRecipeVariant[
|
|
14
|
+
disableResponsive?: import("../../styled-system/recipes").CheckboxCardSlotRecipeVariant['disableResponsive'];
|
|
15
15
|
} & Omit<import("..").CheckboxProps, "label"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { cx } from '../../styled-system/css';
|
|
4
4
|
import { FocusIndicator } from '../FocusIndicator';
|
|
@@ -11,7 +11,7 @@ import { DataTableHeaderRow } from './DataTableHeaderRow';
|
|
|
11
11
|
import { DataTableRow } from './DataTableRow';
|
|
12
12
|
import { cx } from '../../styled-system/css';
|
|
13
13
|
import { isComponentOrWrapped } from '../utilities/react/isComponentOrWrapped';
|
|
14
|
-
const Base = forwardRef(({ className, size = 'medium', enableRowSelection = false, fixedHeader = false, leftFixedColumnIndex, rightFixedColumnIndex, layout = 'default', wrapperProps, loading = false, emptyStateSlot, children, ...props }, ref) => {
|
|
14
|
+
const Base = forwardRef(({ className, size = 'medium', enableRowSelection = false, fixedHeader = false, showVerticalBorder = false, leftFixedColumnIndex, rightFixedColumnIndex, layout = 'default', wrapperProps, loading = false, emptyStateSlot, children, ...props }, ref) => {
|
|
15
15
|
const classes = dataTableSlotRecipe({ layout });
|
|
16
16
|
// Check if DataTable has any rows by looking for DataTable.Body with DataTable.Row children
|
|
17
17
|
const hasRows = useMemo(() => {
|
|
@@ -36,7 +36,7 @@ const Base = forwardRef(({ className, size = 'medium', enableRowSelection = fals
|
|
|
36
36
|
return false;
|
|
37
37
|
}, [children, loading]);
|
|
38
38
|
const shouldShowEmptyState = !hasRows && !!emptyStateSlot && !loading;
|
|
39
|
-
return (_jsx(DataTableProvider, { size: size, enableRowSelection: enableRowSelection, fixedHeader: fixedHeader, leftFixedColumnIndex: leftFixedColumnIndex, rightFixedColumnIndex: rightFixedColumnIndex, loading: loading, layout: layout, children: _jsxs("div", { ...wrapperProps, className: cx(classes.wrapper, 'mfui-DataTable__wrapper',
|
|
39
|
+
return (_jsx(DataTableProvider, { size: size, enableRowSelection: enableRowSelection, fixedHeader: fixedHeader, showVerticalBorder: showVerticalBorder, leftFixedColumnIndex: leftFixedColumnIndex, rightFixedColumnIndex: rightFixedColumnIndex, loading: loading, layout: layout, children: _jsxs("div", { ...wrapperProps, className: cx(classes.wrapper, 'mfui-DataTable__wrapper',
|
|
40
40
|
/* TODO: Remove in v5.0.0 */ 'mfui-DataGrid__wrapper', wrapperProps?.className), children: [_jsx("table", { ref: ref, className: cx(classes.table, 'mfui-DataTable__table',
|
|
41
41
|
/* TODO: Remove in v5.0.0 */ 'mfui-DataGrid__table', className), ...props, children: children }), shouldShowEmptyState ? (_jsx("div", { className: cx(classes.emptyState, 'mfui-DataTable__emptyState',
|
|
42
42
|
/* TODO: Remove in v5.0.0 */ 'mfui-DataGrid__emptyState'), role: "status", "aria-live": "polite", children: emptyStateSlot })) : null] }) }));
|
|
@@ -38,6 +38,15 @@ export type DataTableProps = {
|
|
|
38
38
|
* @default false
|
|
39
39
|
*/
|
|
40
40
|
fixedHeader?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to show vertical borders between columns.
|
|
43
|
+
* If `true`, a vertical border will be drawn between each column of the header and body.
|
|
44
|
+
*
|
|
45
|
+
* Enable this when using `colSpan` / `rowSpan` on cells to clarify the cell boundaries.
|
|
46
|
+
*
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
showVerticalBorder?: boolean;
|
|
41
50
|
/**
|
|
42
51
|
* The layout of the data table.
|
|
43
52
|
* It accepts `default` or `edge-to-edge`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { DisclosureBasicCollapsed, DisclosureBasicExpanded, DisclosureNestedCollapsed, DisclosureNestedExpanded, } from '@moneyforward/mfui-icons-react';
|
|
4
4
|
import { dataTableCellSlotRecipe } from '../../../styled-system/recipes';
|
|
@@ -11,7 +11,7 @@ import { useFixedColumns } from '../../utilities/dom/useFixedColumns';
|
|
|
11
11
|
import { handleCheckboxCellClick } from '../utils/handleCheckbox';
|
|
12
12
|
import { mergeRefs } from '../../utilities/dom/mergeRefs';
|
|
13
13
|
export const DataTableCell = forwardRef(({ onClickCell, children, type = 'text', className, isRowHighlighted, disabled = false, depth = 0, columnIndex, disclosureIconProps: nestingIconProps, style, ...props }, ref) => {
|
|
14
|
-
const { size, leftFixedColumnIndex, rightFixedColumnIndex, loading, enableRowSelection, layout } = useDataTableContext();
|
|
14
|
+
const { size, leftFixedColumnIndex, rightFixedColumnIndex, loading, enableRowSelection, showVerticalBorder, layout, } = useDataTableContext();
|
|
15
15
|
const { cellRef, isFixedColumn, isEdgeFixedColumn, fixedPositionStyles } = useFixedColumns({
|
|
16
16
|
enableRowSelection,
|
|
17
17
|
columnIndex,
|
|
@@ -25,6 +25,7 @@ export const DataTableCell = forwardRef(({ onClickCell, children, type = 'text',
|
|
|
25
25
|
fixedColumn: isFixedColumn,
|
|
26
26
|
edgeFixedColumn: isEdgeFixedColumn,
|
|
27
27
|
isCheckboxCell: enableRowSelection && columnIndex === 0,
|
|
28
|
+
verticalBorder: showVerticalBorder,
|
|
28
29
|
layout,
|
|
29
30
|
});
|
|
30
31
|
const handleClick = (event) => {
|
|
@@ -10,7 +10,7 @@ import { useFixedColumns } from '../../utilities/dom/useFixedColumns';
|
|
|
10
10
|
import { handleCheckboxCellClick } from '../utils/handleCheckbox';
|
|
11
11
|
import { mergeRefs } from '../../utilities/dom/mergeRefs';
|
|
12
12
|
export const DataTableHeaderCell = forwardRef(({ children, type = 'text', sortButtonProps, sortOrder, ascendingIconProps, descendingIconProps, unsortedIconProps, className, columnIndex, disabled = false, ...props }, ref) => {
|
|
13
|
-
const { size, leftFixedColumnIndex, rightFixedColumnIndex, enableRowSelection } = useDataTableContext();
|
|
13
|
+
const { size, leftFixedColumnIndex, rightFixedColumnIndex, enableRowSelection, showVerticalBorder } = useDataTableContext();
|
|
14
14
|
const { cellRef, isFixedColumn, isEdgeFixedColumn, fixedPositionStyles } = useFixedColumns({
|
|
15
15
|
enableRowSelection,
|
|
16
16
|
columnIndex,
|
|
@@ -23,6 +23,7 @@ export const DataTableHeaderCell = forwardRef(({ children, type = 'text', sortBu
|
|
|
23
23
|
fixedColumn: isFixedColumn,
|
|
24
24
|
edgeFixedColumn: isEdgeFixedColumn,
|
|
25
25
|
isCheckboxCell: enableRowSelection && columnIndex === 0,
|
|
26
|
+
verticalBorder: showVerticalBorder,
|
|
26
27
|
});
|
|
27
28
|
const isCheckboxCell = enableRowSelection && columnIndex === 0;
|
|
28
29
|
const isStringChild = typeof children === 'string';
|
|
@@ -4,7 +4,7 @@ export type DataTableSize = 'small' | 'medium';
|
|
|
4
4
|
/**
|
|
5
5
|
* The props for the `DataTableContext` component.
|
|
6
6
|
*/
|
|
7
|
-
export type DataTableContextProps = Pick<DataTableProps, 'size' | 'enableRowSelection' | 'fixedHeader' | 'leftFixedColumnIndex' | 'rightFixedColumnIndex' | 'loading' | 'layout'>;
|
|
7
|
+
export type DataTableContextProps = Pick<DataTableProps, 'size' | 'enableRowSelection' | 'fixedHeader' | 'showVerticalBorder' | 'leftFixedColumnIndex' | 'rightFixedColumnIndex' | 'loading' | 'layout'>;
|
|
8
8
|
export type DataTableProviderValues = {
|
|
9
9
|
numberColumns: number;
|
|
10
10
|
setNumberColumns: (number: number) => void;
|
|
@@ -24,4 +24,4 @@ export declare const useDataTableContext: () => DataTableProviderValues;
|
|
|
24
24
|
*
|
|
25
25
|
* This should only be used in DataTable component.
|
|
26
26
|
*/
|
|
27
|
-
export declare function DataTableProvider({ children, size, enableRowSelection, fixedHeader, leftFixedColumnIndex, rightFixedColumnIndex, loading, layout, }: PropsWithChildren<DataTableContextProps>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function DataTableProvider({ children, size, enableRowSelection, fixedHeader, showVerticalBorder, leftFixedColumnIndex, rightFixedColumnIndex, loading, layout, }: PropsWithChildren<DataTableContextProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,6 +10,7 @@ export const DataTableContext = createContext({
|
|
|
10
10
|
size: 'medium',
|
|
11
11
|
enableRowSelection: false,
|
|
12
12
|
fixedHeader: false,
|
|
13
|
+
showVerticalBorder: false,
|
|
13
14
|
leftFixedColumnIndex: undefined,
|
|
14
15
|
rightFixedColumnIndex: undefined,
|
|
15
16
|
layout: 'default',
|
|
@@ -27,12 +28,13 @@ export const useDataTableContext = () => useContext(DataTableContext);
|
|
|
27
28
|
*
|
|
28
29
|
* This should only be used in DataTable component.
|
|
29
30
|
*/
|
|
30
|
-
export function DataTableProvider({ children, size = 'medium', enableRowSelection = false, fixedHeader = false, leftFixedColumnIndex, rightFixedColumnIndex, loading, layout = 'default', }) {
|
|
31
|
+
export function DataTableProvider({ children, size = 'medium', enableRowSelection = false, fixedHeader = false, showVerticalBorder = false, leftFixedColumnIndex, rightFixedColumnIndex, loading, layout = 'default', }) {
|
|
31
32
|
const [numberColumns, setNumberColumns] = useState(0);
|
|
32
33
|
const contextValue = useMemo(() => ({
|
|
33
34
|
size,
|
|
34
35
|
enableRowSelection,
|
|
35
36
|
fixedHeader,
|
|
37
|
+
showVerticalBorder,
|
|
36
38
|
leftFixedColumnIndex,
|
|
37
39
|
rightFixedColumnIndex,
|
|
38
40
|
loading,
|
|
@@ -43,6 +45,7 @@ export function DataTableProvider({ children, size = 'medium', enableRowSelectio
|
|
|
43
45
|
size,
|
|
44
46
|
enableRowSelection,
|
|
45
47
|
fixedHeader,
|
|
48
|
+
showVerticalBorder,
|
|
46
49
|
leftFixedColumnIndex,
|
|
47
50
|
rightFixedColumnIndex,
|
|
48
51
|
loading,
|
|
@@ -6,6 +6,36 @@ import { Checkbox } from '../../Checkbox';
|
|
|
6
6
|
import { useDataTableContext } from '../DataTableProvider';
|
|
7
7
|
import { cx } from '../../../styled-system/css';
|
|
8
8
|
import { isComponentOrWrapped } from '../../utilities/react/isComponentOrWrapped';
|
|
9
|
+
const INTERACTIVE_ELEMENT_SELECTOR = [
|
|
10
|
+
'a[href]',
|
|
11
|
+
'button',
|
|
12
|
+
'input',
|
|
13
|
+
'select',
|
|
14
|
+
'textarea',
|
|
15
|
+
'label',
|
|
16
|
+
'summary',
|
|
17
|
+
'[role="button"]',
|
|
18
|
+
'[role="link"]',
|
|
19
|
+
'[role="checkbox"]',
|
|
20
|
+
'[role="menuitem"]',
|
|
21
|
+
'[role="menuitemcheckbox"]',
|
|
22
|
+
'[role="menuitemradio"]',
|
|
23
|
+
'[role="option"]',
|
|
24
|
+
'[role="radio"]',
|
|
25
|
+
'[role="switch"]',
|
|
26
|
+
'[role="tab"]',
|
|
27
|
+
'[role="textbox"]',
|
|
28
|
+
'[contenteditable=""]',
|
|
29
|
+
'[contenteditable="true"]',
|
|
30
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
31
|
+
].join(',');
|
|
32
|
+
function isClickFromNestedInteractiveElement(event) {
|
|
33
|
+
if (!(event.target instanceof Element)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
const interactiveElement = event.target.closest(INTERACTIVE_ELEMENT_SELECTOR);
|
|
37
|
+
return interactiveElement !== null && interactiveElement !== event.currentTarget;
|
|
38
|
+
}
|
|
9
39
|
export const DataTableRow = forwardRef(({ children, disabled = false, highlighted, checkboxProps, className, onClickRow, selectable, ...props }, ref) => {
|
|
10
40
|
const { enableRowSelection: contextEnableRowSelection, layout } = useDataTableContext();
|
|
11
41
|
const isSelectable = selectable ?? contextEnableRowSelection;
|
|
@@ -24,12 +54,13 @@ export const DataTableRow = forwardRef(({ children, disabled = false, highlighte
|
|
|
24
54
|
.find((cell) => cell.props.disclosureIconProps && !cell.props.onClickCell)?.props.disclosureIconProps;
|
|
25
55
|
const ariaExpanded = isInteractive && disclosureIconProps ? (disclosureIconProps.isOpen ?? false) : undefined;
|
|
26
56
|
const handleClickRow = (event) => {
|
|
27
|
-
if (
|
|
28
|
-
|
|
57
|
+
if (disabled || isClickFromNestedInteractiveElement(event)) {
|
|
58
|
+
return;
|
|
29
59
|
}
|
|
60
|
+
onClickRow?.(event);
|
|
30
61
|
};
|
|
31
62
|
const handleKeyDownRow = (event) => {
|
|
32
|
-
if (!disabled && (event.key === 'Enter' || event.key === ' ')) {
|
|
63
|
+
if (!disabled && event.target === event.currentTarget && (event.key === 'Enter' || event.key === ' ')) {
|
|
33
64
|
onClickRow?.(event);
|
|
34
65
|
}
|
|
35
66
|
};
|
|
@@ -31,7 +31,7 @@ export declare function useDateRangePickerContext(): {
|
|
|
31
31
|
handleClear: () => void;
|
|
32
32
|
handleApply: () => void;
|
|
33
33
|
handleCancel: () => void;
|
|
34
|
-
selecting: "
|
|
34
|
+
selecting: "end" | "start";
|
|
35
35
|
temporaryStart: Date | undefined;
|
|
36
36
|
temporaryEnd: Date | undefined;
|
|
37
37
|
previewDate: Date | undefined;
|
|
@@ -43,7 +43,7 @@ export declare function useDateRangePickerContext(): {
|
|
|
43
43
|
isRangeEnd: (date: Date) => boolean;
|
|
44
44
|
setTemporaryStart: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
|
|
45
45
|
setTemporaryEnd: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
|
|
46
|
-
setSelecting: import("react").Dispatch<import("react").SetStateAction<"
|
|
46
|
+
setSelecting: import("react").Dispatch<import("react").SetStateAction<"end" | "start">>;
|
|
47
47
|
disableAutoOpen: boolean | undefined;
|
|
48
48
|
pendingFocusDate: string | null;
|
|
49
49
|
setPendingFocusDate: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const SEPARATOR_CONTENT = "\u301C";
|
|
2
2
|
export declare const LOCALE: {
|
|
3
|
-
readonly CLEAR_BUTTON_LABEL:
|
|
4
|
-
readonly CALENDAR_BUTTON_LABEL:
|
|
5
|
-
readonly START_DATE_PLACEHOLDER:
|
|
6
|
-
readonly END_DATE_PLACEHOLDER:
|
|
3
|
+
readonly CLEAR_BUTTON_LABEL: '値をクリアする';
|
|
4
|
+
readonly CALENDAR_BUTTON_LABEL: 'カレンダーを開く';
|
|
5
|
+
readonly START_DATE_PLACEHOLDER: '開始日';
|
|
6
|
+
readonly END_DATE_PLACEHOLDER: '終了日';
|
|
7
7
|
};
|
|
@@ -11,5 +11,5 @@ import { type SyntheticEvent } from 'react';
|
|
|
11
11
|
* handleInputClick: (inputType: 'start' | 'end', userOnClick?: React.MouseEventHandler<HTMLInputElement>) => (event: React.MouseEvent<HTMLInputElement>) => void
|
|
12
12
|
*/
|
|
13
13
|
export declare function useDateRangeTriggerInputClick(disableAutoOpen: boolean, popoverOpenFunction?: (event?: SyntheticEvent) => void): {
|
|
14
|
-
handleInputClick: (inputType:
|
|
14
|
+
handleInputClick: (inputType: 'start' | 'end', userOnClick?: React.MouseEventHandler<HTMLInputElement>) => (event: React.MouseEvent<HTMLInputElement>) => void;
|
|
15
15
|
};
|
package/dist/src/DateTimeSelection/DateRangePicker/utilities/createDateRangePickerTestUtility.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export type DateRangePickerTestUtilityConfig = {
|
|
|
3
3
|
user: UserEvent;
|
|
4
4
|
};
|
|
5
5
|
export declare function createDateRangePickerTestUtility({ user }: DateRangePickerTestUtilityConfig): {
|
|
6
|
-
getPopover: () => Element | null;
|
|
7
6
|
getPreviousMonthButton: () => HTMLElement | undefined;
|
|
8
7
|
getNextMonthButton: () => HTMLElement | undefined;
|
|
9
8
|
getTodayButton: () => HTMLElement;
|
|
@@ -29,4 +28,5 @@ export declare function createDateRangePickerTestUtility({ user }: DateRangePick
|
|
|
29
28
|
setEndDate: (date: string) => Promise<void>;
|
|
30
29
|
clearValues: () => Promise<void>;
|
|
31
30
|
openCalendar: () => Promise<void>;
|
|
31
|
+
getPopover: () => Element | null;
|
|
32
32
|
};
|
package/dist/src/DateTimeSelection/MonthRangePicker/MonthRangePickerMonthCell/constants.d.ts
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const MONTH_RANGE_PICKER_A11Y_LABELS: {
|
|
7
7
|
/** Label for selected months */
|
|
8
|
-
readonly SELECTED:
|
|
8
|
+
readonly SELECTED: '選択済み';
|
|
9
9
|
/** Label for months in the selected range */
|
|
10
|
-
readonly IN_RANGE:
|
|
10
|
+
readonly IN_RANGE: '選択範囲内';
|
|
11
11
|
/** Label for unavailable/disabled months */
|
|
12
|
-
readonly UNAVAILABLE:
|
|
12
|
+
readonly UNAVAILABLE: '無効';
|
|
13
13
|
/** Label for range start months */
|
|
14
|
-
readonly RANGE_START:
|
|
14
|
+
readonly RANGE_START: '範囲開始';
|
|
15
15
|
/** Label for range end months */
|
|
16
|
-
readonly RANGE_END:
|
|
16
|
+
readonly RANGE_END: '範囲終了';
|
|
17
17
|
};
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
* // With seconds
|
|
25
25
|
* <TimePicker format="HH:mm:ss" />
|
|
26
26
|
*/
|
|
27
|
-
export declare const TimePicker: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "
|
|
27
|
+
export declare const TimePicker: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "aria-invalid" | "type" | keyof {
|
|
28
28
|
onChange?: (value: string, event: import("react").SyntheticEvent) => void;
|
|
29
|
-
format?:
|
|
30
|
-
size?:
|
|
29
|
+
format?: 'HH:mm' | 'HH:mm:ss';
|
|
30
|
+
size?: 'small' | 'medium' | 'large';
|
|
31
31
|
invalid?: boolean;
|
|
32
32
|
onClear?: (event: import("react").MouseEvent<HTMLButtonElement>) => void;
|
|
33
33
|
enableClearButton?: boolean;
|
|
34
|
-
clearButtonProps?: Pick<import("../..").IconButtonProps,
|
|
35
|
-
pickerIndicatorIconButtonProps?: Pick<import("../..").IconButtonProps,
|
|
34
|
+
clearButtonProps?: Pick<import("../..").IconButtonProps, 'aria-label'>;
|
|
35
|
+
pickerIndicatorIconButtonProps?: Pick<import("../..").IconButtonProps, 'aria-label'>;
|
|
36
36
|
}> & {
|
|
37
37
|
onChange?: (value: string, event: import("react").SyntheticEvent) => void;
|
|
38
|
-
format?:
|
|
39
|
-
size?:
|
|
38
|
+
format?: 'HH:mm' | 'HH:mm:ss';
|
|
39
|
+
size?: 'small' | 'medium' | 'large';
|
|
40
40
|
invalid?: boolean;
|
|
41
41
|
onClear?: (event: import("react").MouseEvent<HTMLButtonElement>) => void;
|
|
42
42
|
enableClearButton?: boolean;
|
|
43
|
-
clearButtonProps?: Pick<import("../..").IconButtonProps,
|
|
44
|
-
pickerIndicatorIconButtonProps?: Pick<import("../..").IconButtonProps,
|
|
43
|
+
clearButtonProps?: Pick<import("../..").IconButtonProps, 'aria-label'>;
|
|
44
|
+
pickerIndicatorIconButtonProps?: Pick<import("../..").IconButtonProps, 'aria-label'>;
|
|
45
45
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -68,7 +68,7 @@ type UseBasePickerValueControllerOptions = {
|
|
|
68
68
|
export declare function useBasePickerValueController({ value, defaultValue, format, customFormatValue, onChange, onPickerPopoverChange, }: UseBasePickerValueControllerOptions): {
|
|
69
69
|
inputProps: {
|
|
70
70
|
value: string;
|
|
71
|
-
onChange: (event:
|
|
71
|
+
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
72
72
|
onBlur: (event: React.FocusEvent<HTMLInputElement, Element>) => void;
|
|
73
73
|
onClear: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
74
74
|
};
|
|
@@ -8,7 +8,7 @@ export declare const LABEL_SELECT_MONTH = "\u6708\u3092\u9078\u629E";
|
|
|
8
8
|
export declare const LABEL_OPEN_CALENDAR = "\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u958B\u304F";
|
|
9
9
|
export declare const LABEL_CLOSE_CALENDAR = "\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u9589\u3058\u308B";
|
|
10
10
|
export declare const LABEL_TODAY = "\u4ECA\u65E5";
|
|
11
|
-
type LabelKey = 'GO_TO_PREV_MONTH' | 'GO_TO_NEXT_MONTH' | 'GO_TO_PREV_YEAR' | 'GO_TO_NEXT_YEAR' | 'SELECT_MONTH' | 'OPEN_CALENDAR' | 'CLOSE_CALENDAR' | 'TODAY';
|
|
11
|
+
type LabelKey = 'GO_TO_PREV_MONTH' | 'GO_TO_NEXT_MONTH' | 'GO_TO_PREV_YEAR' | 'GO_TO_NEXT_YEAR' | 'SELECT_MONTH' | 'SELECT_YEAR' | 'OPEN_CALENDAR' | 'CLOSE_CALENDAR' | 'TODAY';
|
|
12
12
|
export declare const BASE_PICKER_LABELS: Record<NonNullable<BasePickerProps['calendarLocale']>, Record<LabelKey, string>>;
|
|
13
13
|
export declare const DAY_ABBREVIATIONS: Record<NonNullable<BasePickerProps['calendarLocale']>, string[]>;
|
|
14
14
|
export declare const DAY_FULL_NAMES: Record<NonNullable<BasePickerProps['calendarLocale']>, string[]>;
|
|
@@ -14,6 +14,7 @@ export const BASE_PICKER_LABELS = {
|
|
|
14
14
|
GO_TO_PREV_YEAR: '前の年',
|
|
15
15
|
GO_TO_NEXT_YEAR: '次の年',
|
|
16
16
|
SELECT_MONTH: '月を選択',
|
|
17
|
+
SELECT_YEAR: '年を選択',
|
|
17
18
|
OPEN_CALENDAR: 'カレンダーを開く',
|
|
18
19
|
CLOSE_CALENDAR: 'カレンダーを閉じる',
|
|
19
20
|
TODAY: '今日',
|
|
@@ -24,6 +25,7 @@ export const BASE_PICKER_LABELS = {
|
|
|
24
25
|
GO_TO_PREV_YEAR: 'Previous year',
|
|
25
26
|
GO_TO_NEXT_YEAR: 'Next year',
|
|
26
27
|
SELECT_MONTH: 'Select month',
|
|
28
|
+
SELECT_YEAR: 'Select year',
|
|
27
29
|
OPEN_CALENDAR: 'Open calendar',
|
|
28
30
|
CLOSE_CALENDAR: 'Close calendar',
|
|
29
31
|
TODAY: 'Today',
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const DATE_RANGE_PICKER_A11Y_LABELS: {
|
|
6
6
|
/** Label for today's date */
|
|
7
|
-
readonly TODAY:
|
|
7
|
+
readonly TODAY: '今日';
|
|
8
8
|
/** Label for selected dates */
|
|
9
|
-
readonly SELECTED:
|
|
9
|
+
readonly SELECTED: '選択済み';
|
|
10
10
|
/** Label for dates in the selected range */
|
|
11
|
-
readonly IN_RANGE:
|
|
11
|
+
readonly IN_RANGE: '選択範囲内';
|
|
12
12
|
/** Label for unavailable/disabled dates */
|
|
13
|
-
readonly UNAVAILABLE:
|
|
13
|
+
readonly UNAVAILABLE: '選択不可';
|
|
14
14
|
/** Label for range start dates */
|
|
15
|
-
readonly RANGE_START:
|
|
15
|
+
readonly RANGE_START: '開始日';
|
|
16
16
|
/** Label for range end dates */
|
|
17
|
-
readonly RANGE_END:
|
|
17
|
+
readonly RANGE_END: '終了日';
|
|
18
18
|
};
|
|
@@ -31,7 +31,7 @@ export declare function useBaseRangePickerContext(): {
|
|
|
31
31
|
handleClear: () => void;
|
|
32
32
|
handleApply: () => void;
|
|
33
33
|
handleCancel: () => void;
|
|
34
|
-
selecting: "
|
|
34
|
+
selecting: "end" | "start";
|
|
35
35
|
temporaryStart: Date | undefined;
|
|
36
36
|
temporaryEnd: Date | undefined;
|
|
37
37
|
previewDate: Date | undefined;
|
|
@@ -43,7 +43,7 @@ export declare function useBaseRangePickerContext(): {
|
|
|
43
43
|
isRangeEnd: (date: Date) => boolean;
|
|
44
44
|
setTemporaryStart: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
|
|
45
45
|
setTemporaryEnd: import("react").Dispatch<import("react").SetStateAction<Date | undefined>>;
|
|
46
|
-
setSelecting: import("react").Dispatch<import("react").SetStateAction<"
|
|
46
|
+
setSelecting: import("react").Dispatch<import("react").SetStateAction<"end" | "start">>;
|
|
47
47
|
disableAutoOpen: boolean | undefined;
|
|
48
48
|
pendingFocusDate: string | null;
|
|
49
49
|
setPendingFocusDate: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Calendar } from '@moneyforward/mfui-icons-react';
|
|
4
4
|
import { forwardRef, useCallback } from 'react';
|
|
5
5
|
import { cx } from '../../../../../styled-system/css';
|
|
@@ -11,5 +11,5 @@ import { type SyntheticEvent } from 'react';
|
|
|
11
11
|
* handleInputClick: (inputType: 'start' | 'end', userOnClick?: React.MouseEventHandler<HTMLInputElement>) => (event: React.MouseEvent<HTMLInputElement>) => void
|
|
12
12
|
*/
|
|
13
13
|
export declare function useDateRangeTriggerInputClick(disableAutoOpen: boolean, popoverOpenFunction?: (event?: SyntheticEvent) => void): {
|
|
14
|
-
handleInputClick: (inputType:
|
|
14
|
+
handleInputClick: (inputType: 'start' | 'end', userOnClick?: React.MouseEventHandler<HTMLInputElement>) => (event: React.MouseEvent<HTMLInputElement>) => void;
|
|
15
15
|
};
|
|
@@ -5,7 +5,6 @@ export type BaseRangePickerTestUtilityConfig = {
|
|
|
5
5
|
calendarLocale: BaseRangePickerProps['calendarLocale'];
|
|
6
6
|
};
|
|
7
7
|
export declare function createBaseRangePickerTestUtility({ user, calendarLocale }: BaseRangePickerTestUtilityConfig): {
|
|
8
|
-
getPopover: () => Element | null;
|
|
9
8
|
getPreviousMonthButton: () => HTMLElement;
|
|
10
9
|
getNextMonthButton: () => HTMLElement;
|
|
11
10
|
getApplyButton: () => HTMLElement;
|
|
@@ -29,4 +28,5 @@ export declare function createBaseRangePickerTestUtility({ user, calendarLocale
|
|
|
29
28
|
setEndDate: (date: string) => Promise<void>;
|
|
30
29
|
clearValues: () => Promise<void>;
|
|
31
30
|
openCalendar: () => Promise<void>;
|
|
31
|
+
getPopover: () => Element | null;
|
|
32
32
|
};
|
|
@@ -3,6 +3,7 @@ import { useCallback, useMemo } from 'react';
|
|
|
3
3
|
import { SelectBox } from '../../../SelectBox';
|
|
4
4
|
import { yearSelectorSlotRecipe } from '../../../../styled-system/recipes';
|
|
5
5
|
import { MAXIMUM_VIEWABLE_YEAR, MINIMUM_VIEWABLE_YEAR } from './constants';
|
|
6
|
+
import { getBasePickerLabel } from '../BasePicker/constants';
|
|
6
7
|
import { cx } from '../../../../styled-system/css';
|
|
7
8
|
import { useCalendarLocale } from '../CalendarLocale/CalendarLocaleContext';
|
|
8
9
|
import { useDisplayJapaneseCalendar } from '../CalendarLocale/DisplayJapaneseCalendarContext';
|
|
@@ -34,5 +35,10 @@ export function YearSelector({ value, onChange, filterYear, triggerProps, trigge
|
|
|
34
35
|
}
|
|
35
36
|
}, [onChange]);
|
|
36
37
|
const classes = yearSelectorSlotRecipe();
|
|
37
|
-
return (_jsx(SelectBox, { value: selectedOption, options: options, size: "small", targetDOMNode: targetDOMNode, enableAutoScrollToSelectedOption: { block: 'center', behavior: 'instant' }, popoverContentProps: { className: cx(classes.optionPanel, 'mfui-YearSelector__optionPanel') }, triggerProps:
|
|
38
|
+
return (_jsx(SelectBox, { value: selectedOption, options: options, size: "small", targetDOMNode: targetDOMNode, enableAutoScrollToSelectedOption: { block: 'center', behavior: 'instant' }, popoverContentProps: { className: cx(classes.optionPanel, 'mfui-YearSelector__optionPanel') }, triggerProps: {
|
|
39
|
+
// The trigger has role="combobox", which does not support naming from its
|
|
40
|
+
// content, so an explicit accessible name is required.
|
|
41
|
+
'aria-label': getBasePickerLabel('SELECT_YEAR', calendarLocale),
|
|
42
|
+
...triggerProps,
|
|
43
|
+
}, triggerWrapperProps: triggerWrapperProps, onChange: handleChange }));
|
|
38
44
|
}
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const DATE_PICKER_A11Y_LABELS: {
|
|
6
6
|
/** Label for today's date */
|
|
7
|
-
readonly TODAY:
|
|
7
|
+
readonly TODAY: '今日';
|
|
8
8
|
/** Label for selected dates */
|
|
9
|
-
readonly SELECTED:
|
|
9
|
+
readonly SELECTED: '選択済み';
|
|
10
10
|
/** Label for dates in the selected range */
|
|
11
|
-
readonly IN_RANGE:
|
|
11
|
+
readonly IN_RANGE: '選択範囲内';
|
|
12
12
|
/** Label for unavailable/disabled dates */
|
|
13
|
-
readonly UNAVAILABLE:
|
|
13
|
+
readonly UNAVAILABLE: '選択不可';
|
|
14
14
|
/** Label for range start dates */
|
|
15
|
-
readonly RANGE_START:
|
|
15
|
+
readonly RANGE_START: '開始日';
|
|
16
16
|
/** Label for range end dates */
|
|
17
|
-
readonly RANGE_END:
|
|
17
|
+
readonly RANGE_END: '終了日';
|
|
18
18
|
};
|
|
@@ -12,13 +12,13 @@ export declare const Dialog: import("react").ForwardRefExoticComponent<{
|
|
|
12
12
|
open?: boolean;
|
|
13
13
|
onClose?: () => void;
|
|
14
14
|
actionSlot?: import("react").ReactNode;
|
|
15
|
-
size?: import("../../styled-system/recipes").DialogSlotRecipeVariant[
|
|
15
|
+
size?: import("../../styled-system/recipes").DialogSlotRecipeVariant['size'];
|
|
16
16
|
hideCloseButton?: boolean;
|
|
17
|
-
closeButtonProps?: Pick<import("react").ComponentPropsWithoutRef<
|
|
17
|
+
closeButtonProps?: Pick<import("react").ComponentPropsWithoutRef<'button'>, 'aria-label'>;
|
|
18
18
|
targetDOMNode?: HTMLElement | null;
|
|
19
19
|
enableAutoUnmount?: boolean;
|
|
20
20
|
disableBackdropClose?: boolean;
|
|
21
21
|
customFocusElement?: import("react").RefObject<HTMLElement | null> | HTMLElement | null;
|
|
22
|
-
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "
|
|
23
|
-
ref?: (import("react").
|
|
22
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onClose" | "open"> & {
|
|
23
|
+
ref?: (import("react").RefCallback<HTMLDivElement> | import("react").RefObject<HTMLDivElement | null> | null) | undefined;
|
|
24
24
|
} & import("react").Attributes>;
|
|
@@ -13,14 +13,25 @@ import { type DisclosureProps } from './Disclosure.types';
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function Disclosure({ children, isOpenByDefault, enableAutoUnmount }: DisclosureProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export declare namespace Disclosure {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
className?: string;
|
|
19
|
-
children: string;
|
|
20
|
-
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
21
|
-
var Target: import("react").ForwardRefExoticComponent<{
|
|
22
|
-
id: string;
|
|
23
|
-
className?: string;
|
|
24
|
-
children: import("react").ReactNode;
|
|
25
|
-
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { Trigger };
|
|
17
|
+
export { Target };
|
|
26
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* The trigger button component for the Disclosure.
|
|
21
|
+
* Must be used within a Disclosure component.
|
|
22
|
+
*/
|
|
23
|
+
declare const Trigger: import("react").ForwardRefExoticComponent<{
|
|
24
|
+
targetId: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
children: string;
|
|
27
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* The target component for the Disclosure.
|
|
30
|
+
* Must be used within a Disclosure component.
|
|
31
|
+
*/
|
|
32
|
+
declare const Target: import("react").ForwardRefExoticComponent<{
|
|
33
|
+
id: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
children: import("react").ReactNode;
|
|
36
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export {};
|
|
@@ -21,7 +21,7 @@ import { DropdownMenuHeading } from './DropdownMenuHeading';
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function DropdownMenu({ icon, label, children, triggerProps, tooltipLabel, tooltipPlacement, triggerMiddleTruncate, triggerTypographyVariant, menuPopoverProps, disabled, targetDOMNode, enableAutoUnmount, onOpenStateChanged, onBlur, }: DropdownMenuProps<ReactElement | undefined>): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export declare namespace DropdownMenu {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
export { DropdownMenuDivider as Divider };
|
|
25
|
+
export { DropdownMenuItem as Item };
|
|
26
|
+
export { DropdownMenuHeading as Heading };
|
|
27
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useState } from 'react';
|
|
3
|
+
import { useCallback, useRef, useState, } from 'react';
|
|
4
4
|
import { DropdownMenuButtonTrigger } from './DropdownMenuButtonTrigger';
|
|
5
5
|
import { DropdownMenuContainer } from './DropdownMenuContainer';
|
|
6
6
|
import { DropdownMenuDivider } from './DropdownMenuDivider';
|
|
@@ -29,7 +29,15 @@ import { DropdownMenuHeading } from './DropdownMenuHeading';
|
|
|
29
29
|
*/
|
|
30
30
|
export function DropdownMenu({ icon, label, children, triggerProps, tooltipLabel, tooltipPlacement, triggerMiddleTruncate, triggerTypographyVariant, menuPopoverProps, disabled, targetDOMNode, enableAutoUnmount, onOpenStateChanged, onBlur, }) {
|
|
31
31
|
const [menuDefaultFocusPosition, setMenuDefaultFocusPosition] = useState('first');
|
|
32
|
+
// Tracks keyboard activation (Enter / Space) of the trigger. The resulting click event usually
|
|
33
|
+
// has `detail === 0`, but Safari reports keyboard-triggered clicks with `detail === 1`, so the
|
|
34
|
+
// keydown itself is recorded as the reliable signal.
|
|
35
|
+
const isTriggerActivatedByKeyboardRef = useRef(false);
|
|
32
36
|
const handleTriggerKeyDownLocal = useCallback((event) => {
|
|
37
|
+
// The flag only survives from an Enter / Space keydown to its follow-up click; any other key
|
|
38
|
+
// invalidates the pending keyboard activation so the flag cannot linger when the click never
|
|
39
|
+
// fires.
|
|
40
|
+
isTriggerActivatedByKeyboardRef.current = event.key === 'Enter' || event.key === ' ';
|
|
33
41
|
switch (event.key) {
|
|
34
42
|
case 'ArrowDown':
|
|
35
43
|
event.stopPropagation();
|
|
@@ -49,7 +57,23 @@ export function DropdownMenu({ icon, label, children, triggerProps, tooltipLabel
|
|
|
49
57
|
handleTriggerKeyDownLocal(event);
|
|
50
58
|
handleTriggerKeyDown(event);
|
|
51
59
|
};
|
|
52
|
-
|
|
60
|
+
const handleBlurCommon = (event) => {
|
|
61
|
+
// Focus leaving the trigger invalidates any pending keyboard activation (e.g. a Space
|
|
62
|
+
// keydown whose follow-up click never fired), so a later mouse click cannot be
|
|
63
|
+
// misclassified as keyboard activation.
|
|
64
|
+
isTriggerActivatedByKeyboardRef.current = false;
|
|
65
|
+
handleTriggerBlur(event);
|
|
66
|
+
};
|
|
67
|
+
const handleTriggerClick = (event) => {
|
|
68
|
+
// Opening with the keyboard (Enter / Space) focuses the first item, following the
|
|
69
|
+
// WAI-ARIA menu button pattern. Opening with the mouse focuses no item; the menu
|
|
70
|
+
// container receives focus instead so that arrow keys still work.
|
|
71
|
+
const isKeyboardActivation = isTriggerActivatedByKeyboardRef.current || event.detail === 0;
|
|
72
|
+
isTriggerActivatedByKeyboardRef.current = false;
|
|
73
|
+
setMenuDefaultFocusPosition(isKeyboardActivation ? 'first' : 'none');
|
|
74
|
+
togglePopover(event);
|
|
75
|
+
};
|
|
76
|
+
return icon ? (_jsx(IconButton, { ref: setTriggerRef, "aria-expanded": isPopoverOpen, "aria-haspopup": "menu", disabled: disabled, onKeyDown: handleKeyDownCommon, onBlur: handleBlurCommon, onClick: handleTriggerClick, ...triggerProps, "aria-label": label, children: icon })) : (_jsx(DropdownMenuButtonTrigger, { label: label, tooltipLabel: tooltipLabel, tooltipPlacement: tooltipPlacement, triggerMiddleTruncate: triggerMiddleTruncate, triggerTypographyVariant: triggerTypographyVariant, triggerProps: triggerProps, disabled: disabled, isPopoverOpen: isPopoverOpen, setTriggerRef: setTriggerRef, togglePopover: handleTriggerClick, handleTriggerKeyDown: handleKeyDownCommon, handleTriggerBlur: handleBlurCommon }));
|
|
53
77
|
}, renderContent: ({ closePopover }) => (_jsx(DropdownMenuProvider, { value: { closeMenuPopover: closePopover }, children: _jsx(DropdownMenuContainer, { defaultFocusItem: menuDefaultFocusPosition, onClose: closePopover, children: children }) })), enableAutoFocusOnPopover: false, enableAutoUnmount: enableAutoUnmount, contentProps: {
|
|
54
78
|
className: cx(classes.popover, menuPopoverProps?.className),
|
|
55
79
|
}, onBlur: onBlur, onOpenStateChanged: onOpenStateChanged }));
|