Skip to content

Commit

Permalink
feat: dropdown-menu 组件分支整理 (#317)
Browse files Browse the repository at this point in the history
* feat: dropdown-menu 组件分支整理

* feat: 文档修改
  • Loading branch information
yx376642000 authored Nov 23, 2023
1 parent 7b86e20 commit cf80b55
Show file tree
Hide file tree
Showing 16 changed files with 1,763 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example/src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,16 @@
"desc": "动作面板",
"author": "MrZhao"
},
{
"version": "0.0.1",
"name": "DropdownMenu",
"sort": 1,
"cName": "下拉菜单",
"type": "component",
"show": true,
"desc": "下拉菜单",
"author": "yunxia"
},
{
"version": "1.0.29",
"name": "Collapse",
Expand Down
23 changes: 23 additions & 0 deletions packages/quark-react/src/dropdown-item/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { FC } from "react";
import reactify from "@quarkd/reactify";
import "quarkd/lib/dropdownitem";
import {
DropdownItemOption,
DropdownItemProps as Props,
CustomEvent,
} from "quarkd/lib/dropdownitem";
import { componentBaseInterface, ReactifyProps } from "../type";

type DropdownItemProps = componentBaseInterface &
ReactifyProps<Props, CustomEvent>;
type DropdownItemType = FC<DropdownItemProps>;

interface Ref {
setOptions(options: DropdownItemOption[]): void;
toggle(show?: boolean): void;
}

type DropdownItemInstance = Ref & HTMLElement;
const DropdownItem = reactify("quark-dropdown-item") as DropdownItemType;
export { DropdownItemInstance, DropdownItemProps, DropdownItemOption };
export default DropdownItem;
17 changes: 17 additions & 0 deletions packages/quark-react/src/dropdown-menu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { FC } from "react";
import reactify from "@quarkd/reactify";
import "quarkd/lib/dropdownmenu";
import {
IDropdownMenuProps as Props,
DropdownMenuDirection,
} from "quarkd/lib/dropdownmenu";
import { componentBaseInterface, ReactifyProps } from "../type";

type DropdownMenuProps = componentBaseInterface & ReactifyProps<Props, {}>;

type DropdownMenuType = FC<DropdownMenuProps>;

const DropdownMenu = reactify("quark-dropdown-menu") as DropdownMenuType;

export { DropdownMenuDirection, DropdownMenuProps };
export default DropdownMenu;
16 changes: 16 additions & 0 deletions packages/quark-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ import Circle, {
StrokeLinecap,
} from "./circle";
import PickerView, { PickerViewRef } from "./pickerview";
import DropdownMenu, {
DropdownMenuProps,
DropdownMenuDirection,
} from "./dropdown-menu";
import DropdownItem, {
DropdownItemInstance,
DropdownItemOption,
DropdownItemProps,
} from "./dropdown-item";

export {
ActionSheet,
Expand Down Expand Up @@ -159,4 +168,11 @@ export {
CircleType,
PickerView,
PickerViewRef,
DropdownMenu,
DropdownMenuDirection,
DropdownMenuProps,
DropdownItem,
DropdownItemInstance,
DropdownItemOption,
DropdownItemProps,
};
Loading

0 comments on commit cf80b55

Please sign in to comment.