x-ui-design 0.7.68 → 0.7.70

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.
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { ItemType } from "../../../types/menu";
3
+ declare const MenuItem: FC<ItemType>;
4
+ export default MenuItem;
@@ -0,0 +1,26 @@
1
+ import React, { FC, ReactNode, MouseEvent } from "react";
2
+ import { MenuMode, MenuProps } from "../../types/menu";
3
+ import MenuItem from "./Item/Item";
4
+ import SubMenu from "./SubMenu/SubMenu";
5
+ import "./index.css";
6
+ export declare const MenuContext: React.Context<{
7
+ mode: MenuMode;
8
+ inlineIndent: number;
9
+ inlineCollapsed: boolean;
10
+ selectedKeys: string[];
11
+ openKeys: string[];
12
+ toggleOpen: (key: string) => void;
13
+ onItemClick: (key: string, domEvent?: MouseEvent) => void;
14
+ triggerSubMenuAction?: "hover" | "click";
15
+ prefixCls: string;
16
+ } | null>;
17
+ declare const ItemGroup: FC<{
18
+ title?: ReactNode;
19
+ children?: ReactNode;
20
+ }>;
21
+ declare const Menu: FC<MenuProps> & {
22
+ Item: typeof MenuItem;
23
+ SubMenu: typeof SubMenu;
24
+ ItemGroup: typeof ItemGroup;
25
+ };
26
+ export default Menu;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { SubMenuItem } from "../../../types/menu";
3
+ declare const SubMenu: FC<SubMenuItem>;
4
+ export default SubMenu;
@@ -0,0 +1 @@
1
+ export { default as Menu } from './Menu';
@@ -0,0 +1,59 @@
1
+ import { CSSProperties, MouseEvent, ReactNode } from "react";
2
+ export type MenuMode = "vertical" | "horizontal" | "inline";
3
+ export type ItemType = {
4
+ danger?: boolean;
5
+ disabled?: boolean;
6
+ extra?: ReactNode;
7
+ icon?: ReactNode;
8
+ key: string;
9
+ label?: ReactNode;
10
+ title?: ReactNode;
11
+ children?: ItemType[];
12
+ type?: string;
13
+ selected?: boolean;
14
+ itemKey?: string;
15
+ };
16
+ export type SubMenuItem = {
17
+ key: string;
18
+ title?: ReactNode;
19
+ icon?: ReactNode;
20
+ children?: ReactNode;
21
+ itemKey: string;
22
+ };
23
+ export interface MenuProps {
24
+ prefixCls?: string;
25
+ className?: string;
26
+ style?: CSSProperties;
27
+ defaultOpenKeys?: string[];
28
+ defaultSelectedKeys?: string[];
29
+ expandIcon?: ReactNode;
30
+ forceSubMenuRender?: boolean;
31
+ inlineCollapsed?: boolean;
32
+ inlineIndent?: number;
33
+ items?: ItemType[];
34
+ mode?: MenuMode;
35
+ multiple?: boolean;
36
+ openKeys?: string[];
37
+ overflowedIndicator?: ReactNode;
38
+ selectable?: boolean;
39
+ selectedKeys?: string[];
40
+ subMenuCloseDelay?: number;
41
+ subMenuOpenDelay?: number;
42
+ triggerSubMenuAction?: "hover" | "click";
43
+ onClick?: (info: {
44
+ key: string;
45
+ keyPath: string[];
46
+ domEvent?: MouseEvent;
47
+ }) => void;
48
+ onDeselect?: (info: {
49
+ key: string;
50
+ keyPath: string[];
51
+ }) => void;
52
+ onOpenChange?: (openKeys: string[]) => void;
53
+ onSelect?: (info: {
54
+ key: string;
55
+ keyPath: string[];
56
+ selectedKeys: string[];
57
+ }) => void;
58
+ children?: ReactNode;
59
+ }
package/dist/index.esm.js CHANGED
@@ -2128,7 +2128,7 @@ const DatePicker = ({
2128
2128
  }
2129
2129
  if (typeof format === 'string') {
2130
2130
  date = new Date(date);
2131
- return format.replace(/YYYY/, date.getFullYear().toString()).replace(/MMM/, monthNames[date.getMonth() + 1]).replace(/MM/, (date.getMonth() + 1).toString().padStart(2, '0')).replace(/DD/, date.getDate().toString().padStart(2, '0'));
2131
+ return format.replace(/YYYY/, date.getFullYear().toString()).replace(/MMM/, monthNames[date.getMonth()]).replace(/MM/, (date.getMonth() + 1).toString().padStart(2, '0')).replace(/DD/, date.getDate().toString().padStart(2, '0'));
2132
2132
  }
2133
2133
  return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
2134
2134
  }