Skip to content

Commit

Permalink
Merge pull request #1295 from yaklang/luoluo/style/yakit-collapse
Browse files Browse the repository at this point in the history
ghost,omit
  • Loading branch information
b1rdfree authored Dec 19, 2023
2 parents a3e495a + 1bdc7c7 commit d4569b3
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { CollapsePanelProps, CollapseProps } from "antd";
import {CollapsePanelProps, CollapseProps} from "antd"
/**
* @description: YakitSelectProps
* @augments YakitCollapseProps 继承antd的 CollapseProps 默认属性
*/
export interface YakitCollapseProps extends CollapseProps{
}
export interface YakitCollapseProps extends Omit<CollapseProps, "ghost"> {}
/**
* @description: YakitPanelProps
* @augments YakitPanelProps 继承antd的 CollapsePanelProps 默认属性
*/
export interface YakitPanelProps extends CollapsePanelProps{

}
export interface YakitPanelProps extends CollapsePanelProps {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {DraggerProps} from "antd/lib/upload"
import type {YakitSizeType} from "../YakitInputNumber/YakitInputNumberType"
import {InternalTextAreaProps} from "../YakitInput/YakitInputType"

export interface YakitFormDraggerProps extends DraggerProps {
export interface YakitFormDraggerProps extends Omit<DraggerProps,'beforeUpload'> {
size?: YakitSizeType
formItemClassName?: string
formItemProps?: FormItemProps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const InternalInput: React.FC<YakitInputProps> = (props) => {
style={{...(wrapperStyle || {})}}
>
<Input
spellCheck={false}
{...restProps}
size='middle'
spellCheck={false}
className={classNames(
styles["yakit-input-middle"],
{
Expand Down Expand Up @@ -86,12 +86,12 @@ const InternalSearch: React.FC<YakitInputSearchProps> = (props) => {
>
<Input.Search
allowClear
enterButton
spellCheck={false}
{...restProps}
onFocus={onFocus}
onBlur={onBlur}
size='middle'
enterButton
spellCheck={false}
className={classNames(styles["yakit-search-middle"], {
[styles["yakit-search-large"]]: size === "large",
[styles["yakit-search-small"]]: size === "small",
Expand All @@ -117,7 +117,7 @@ const InternalTextArea: React.FC<InternalTextAreaProps> = (props) => {
)}
style={{...(wrapperStyle || {})}}
>
<Input.TextArea {...restProps} spellCheck={false} />
<Input.TextArea spellCheck={false} {...restProps} />
{isShowResize && <ResizerIcon className={styles["resizer-icon"]} />}
</div>
)
Expand All @@ -139,7 +139,7 @@ const InternalInputPassword: React.FC<InternalInputPasswordProps> = (props) => {
)}
style={{...(wrapperStyle || {})}}
>
<Input.Password {...restProps} spellCheck={false} />
<Input.Password spellCheck={false} {...restProps} />
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ import {ChevronLeftIcon, ChevronRightIcon} from "@/assets/newIcon"
import {useMemoizedFn, useMutationObserver} from "ahooks"
import { getReleaseEditionName } from "@/utils/envfile"

/**
* 更新说明
* 1.增加环境变量加载主题色
* 2.修复横向输入时,value为0无法加减问题
* 3.antd form 校验错误状态做兼容处理
* 4.增加颜色变量
*/

/**
* @description: 两种方式的数字输入
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export declare type ValueType = string | number
export interface YakitInputNumberProps extends Omit<InputNumberProps, "size"> {
type?: "horizontal" | "vertical"
size?: YakitSizeType
ref?:any
ref?: any
wrapperClassName?: string
}

/**
* @description: 两种方式的数字输入
* @augments InputNumberProps 继承antd的InputNumber默认属性
*/
export interface YakitInputNumberHorizontalProps extends Omit<InputNumberProps, "size"> {
export interface YakitInputNumberHorizontalProps extends Omit<InputNumberProps, "size" | "bordered"> {
size?: YakitSizeType
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import classNames from "classnames"

/**
* @description: 按钮单选框Props
* @param optionType 弃用
* @deprecated optionType 弃用
* @param {"small" | "middle" | "large" | "maxLarge"} size 默认middle
* @augments RadioGroupProps 继承antd的 RadioGroupProps 默认属性
* @params {string} className RadioGroup className
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {YakitSizeType} from "../YakitInputNumber/YakitInputNumberType"
* @property {string} className
* @property {string} wrapClassName
*/
export interface YakitRadioButtonsProps extends Omit<RadioGroupProps, "size" | "optionType"> {
export interface YakitRadioButtonsProps extends Omit<RadioGroupProps, "size" | "optionType" | "optionType"> {
size?: YakitSizeType
className?: string
wrapClassName?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import classNames from "classnames"
* @augments YakitSegmentedProps
*/
export const YakitSegmented = React.forwardRef<HTMLDivElement, YakitSegmentedProps>((props, ref) => {
const {wrapClassName, size = "middle", ...resProps} = props
const {wrapClassName, size = "middle", className = "", ...resProps} = props
return (
<div
className={classNames(
Expand All @@ -26,7 +26,12 @@ export const YakitSegmented = React.forwardRef<HTMLDivElement, YakitSegmentedPro
wrapClassName
)}
>
<Segmented {...resProps} size='small' ref={ref} className={classNames(styles["yakit-segmented"])} />
<Segmented
{...resProps}
size='small'
ref={ref}
className={classNames(styles["yakit-segmented"], className)}
/>
</div>
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ const {Option} = Select
* @param {CSSProperties} wrapperStyle Switch装饰div的style
*/
export const YakitSelectCustom = <ValueType, OptionType>(
{className, size='middle', wrapperClassName, wrapperStyle, dropdownRender, ...props}: YakitSelectProps<OptionType>,
{
className,
size = "middle",
wrapperClassName,
wrapperStyle,
dropdownRender,
...props
}: YakitSelectProps<OptionType>,
ref: React.Ref<BaseSelectRef>
) => {
const [show, setShow] = useState<boolean>(false)
Expand All @@ -47,6 +54,22 @@ export const YakitSelectCustom = <ValueType, OptionType>(
style={wrapperStyle}
>
<Select
suffixIcon={
show ? (
<ChevronUpIcon className={styles["yakit-select-icon"]} />
) : (
<ChevronDownIcon className={styles["yakit-select-icon"]} />
)
}
tagRender={(props) => {
return (
<YakitTag size={size} {...props}>
<span className='content-ellipsis' style={{width: "100%"}}>
{props.label}
</span>
</YakitTag>
)
}}
{...props}
size='middle'
dropdownClassName={classNames(
Expand All @@ -61,20 +84,6 @@ export const YakitSelectCustom = <ValueType, OptionType>(
setShow(open)
if (props.onDropdownVisibleChange) props.onDropdownVisibleChange(open)
}}
tagRender={(props) => {
return (
<YakitTag size={size} {...props}>
<span className='content-ellipsis' style={{width:'100%'}}>{props.label}</span>
</YakitTag>
)
}}
suffixIcon={
show ? (
<ChevronUpIcon className={styles["yakit-select-icon"]} />
) : (
<ChevronDownIcon className={styles["yakit-select-icon"]} />
)
}
>
{props.children}
</Select>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import {SizeType} from "antd/lib/config-provider/SizeContext"
* @description YakitAutoCompleteProps 的属性
* @augments YakitSpinProps 继承antd的 SpinProps 默认属性
*/
export interface YakitSpinProps extends SpinProps {
ref?:any
export interface YakitSpinProps extends Omit<SpinProps, "className"> {
ref?: any
}

0 comments on commit d4569b3

Please sign in to comment.