Skip to content

Commit

Permalink
feat(ui): use component name as useDComponentConfig argument
Browse files Browse the repository at this point in the history
  • Loading branch information
xiejay97 committed Dec 3, 2021
1 parent 2c9b790 commit 4bc6c39
Show file tree
Hide file tree
Showing 25 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/affix/Affix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const DAffix = React.forwardRef<DAffixRef, DAffixProps>((props, ref) => {
style,
children,
...restProps
} = useDComponentConfig('affix', props);
} = useDComponentConfig(DAffix.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/anchor/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function DAnchor(props: DAnchorProps) {
className,
children,
...restProps
} = useDComponentConfig('anchor', props);
} = useDComponentConfig(DAnchor.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/anchor/AnchorLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface DAnchorLinkProps extends React.LiHTMLAttributes<HTMLLIElement>
}

export function DAnchorLink(props: DAnchorLinkProps) {
const { dLevel = 0, href, className, children, onClick, ...restProps } = useDComponentConfig('anchor-link', props);
const { dLevel = 0, href, className, children, onClick, ...restProps } = useDComponentConfig(DAnchorLink.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const DButton = React.forwardRef<DButtonRef, DButtonProps>((props, ref) =
children,
onClick,
...restProps
} = useDComponentConfig('button', props);
} = useDComponentConfig(DButton.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/button/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function DButtonGroup(props: DButtonGroupProps) {
className,
children,
...restProps
} = useDComponentConfig('button-group', props);
} = useDComponentConfig(DButtonGroup.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/drag-drop/Drag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface DDragProps {
}

export function DDrag(props: DDragProps) {
const { dId, dPlaceholder, dZIndex = 1000, children, onDragStart, onDrag, onDragEnd } = useDComponentConfig('drag', props);
const { dId, dPlaceholder, dZIndex = 1000, children, onDragStart, onDrag, onDragEnd } = useDComponentConfig(DDrag.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/drag-drop/DragPlaceholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DDropContext } from './Drop';
export type DDragPlaceholderProps = React.HTMLAttributes<HTMLDivElement>;

export function DDragPlaceholder(props: DDragPlaceholderProps) {
const { className, ...restProps } = useDComponentConfig('drag-placeholder', props);
const { className, ...restProps } = useDComponentConfig(DDragPlaceholder.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/drag-drop/Drop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const DDrop = React.forwardRef<DDropRef, DDropProps>((props, ref) => {
onDragStart,
onDrag,
onDragEnd,
} = useDComponentConfig('drop', props);
} = useDComponentConfig(DDrop.name, props);

const dataRef = useRef<DDropContextData['dropCurrentData']>({
drags: new Map(),
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function DDrawer(props: DDrawerProps) {
style,
children,
...restProps
} = useDComponentConfig('drawer', props);
} = useDComponentConfig(DDrawer.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/drawer/DrawerFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface DDrawerFooterProps extends DFooterProps {

export function DDrawerFooter(props: DDrawerFooterProps) {
const { className, dOkButtonProps, dCancelButtonProps, onOkClick, onCancelClick, ...restProps } = useDComponentConfig(
'drawer-footer',
DDrawerFooter.name,
props
);

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/drawer/DrawerHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DDrawerContext } from './Drawer';
export type DDrawerHeaderProps = Omit<DHeaderProps, 'onClose'>;

export function DDrawerHeader(props: DDrawerHeaderProps) {
const { className, ...restProps } = useDComponentConfig('drawer-header', props);
const { className, ...restProps } = useDComponentConfig(DDrawerHeader.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function DDropdown(props: DDropdownProps) {
className,
children,
...restProps
} = useDComponentConfig('dropdown', props);
} = useDComponentConfig(DDropdown.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/dropdown/DropdownItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function DDropdownItem(props: DDropdownItemProps) {
onFocus,
onBlur,
...restProps
} = useDComponentConfig('dropdown-item', props);
} = useDComponentConfig(DDropdownItem.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/dropdown/DropdownSub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function DDropdownSub(props: DDropdownSubProps) {
onFocus,
onBlur,
...restProps
} = useDComponentConfig('dropdown-sub', props);
} = useDComponentConfig(DDropdownSub.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const DIcon = React.forwardRef<SVGSVGElement, DIconProps>((props, ref) =>
style,
children,
...restProps
} = useDComponentConfig('icon', props);
} = useDComponentConfig(DIcon.name, props);

const paths = useMemo(() => {
if (!children) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function DMenu(props: DMenuProps) {
onBlur,
onClick,
...restProps
} = useDComponentConfig('menu', props);
} = useDComponentConfig(DMenu.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/menu/MenuGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function DMenuGroup(props: DMenuGroupProps) {
onFocus,
onBlur,
...restProps
} = useDComponentConfig('menu-group', props);
} = useDComponentConfig(DMenuGroup.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function DMenuItem(props: DMenuItemProps) {
onFocus,
onBlur,
...restProps
} = useDComponentConfig('menu-item', props);
} = useDComponentConfig(DMenuItem.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/menu/MenuSub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function DMenuSub(props: DMenuSubProps) {
onFocus,
onBlur,
...restProps
} = useDComponentConfig('menu-sub', props);
} = useDComponentConfig(DMenuSub.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const DRadio = React.forwardRef<DRadioRef, DRadioProps>((props, ref) => {
children,
onChange,
...restProps
} = useDComponentConfig('button', props);
} = useDComponentConfig(DRadio.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/radio/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function DRadioGroup(props: DRadioGroupProps) {
className,
children,
...restProps
} = useDComponentConfig('button-group', props);
} = useDComponentConfig(DRadioGroup.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/tabs/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function DTab(props: DTabProps) {
className,
onClick,
...restProps
} = useDComponentConfig('tab', props);
} = useDComponentConfig(DTab.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function DTabs(props: DTabsProps) {
className,
children,
...restProps
} = useDComponentConfig('menu', props);
} = useDComponentConfig(DTabs.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface DTooltipProps extends Omit<DPopupProps, 'dPopupContent'> {
}

export const DTooltip = React.forwardRef<DTooltipRef, DTooltipProps>((props, ref) => {
const { dTitle, id, className, children, ...restProps } = useDComponentConfig('tooltip', props);
const { dTitle, id, className, children, ...restProps } = useDComponentConfig(DTooltip.name, props);

//#region Context
const dPrefix = useDPrefixConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface DVirtualScrollProps<T> {

export function DVirtualScroll<T>(props: DVirtualScrollProps<T>) {
const { dListRender, dWidth, dHeight, dItemWidth, dItemHeight, dList, dItemRender, dCustomSize, onScrollEnd } = useDComponentConfig(
'virtual-scroll',
DVirtualScroll.name,
props
);

Expand Down

0 comments on commit 4bc6c39

Please sign in to comment.