-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(range-input): support borderless mode (#3015)
* feat(range-input): support borderless mode * fix: type.ts * chore: update _common * feat(range-input): update usage
- Loading branch information
1 parent
d5da695
commit 8f55816
Showing
22 changed files
with
308 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule _common
updated
15 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* 该脚本为自动生成,如有需要请在 /script/generate-usage.js 中调整 | ||
*/ | ||
|
||
// @ts-nocheck | ||
import React, { useState, useEffect, useMemo } from "react"; | ||
import BaseUsage, { | ||
useConfigChange, | ||
usePanelChange, | ||
} from "@site/src/components/BaseUsage"; | ||
import jsxToString from "react-element-to-jsx-string"; | ||
|
||
import configProps from "./props.json"; | ||
|
||
import { RangeInput } from "tdesign-react"; | ||
|
||
export default function Usage() { | ||
const [configList, setConfigList] = useState(configProps); | ||
|
||
const { changedProps, onConfigChange } = useConfigChange(configList); | ||
|
||
const panelList = [{ label: "rangeInput", value: "rangeInput" }]; | ||
|
||
const { panel, onPanelChange } = usePanelChange(panelList); | ||
|
||
const [renderComp, setRenderComp] = useState(); | ||
|
||
useEffect(() => { | ||
setRenderComp(<RangeInput {...changedProps} />); | ||
}, [changedProps]); | ||
|
||
const jsxStr = useMemo(() => { | ||
if (!renderComp) return ""; | ||
return jsxToString(renderComp); | ||
}, [renderComp]); | ||
|
||
return ( | ||
<BaseUsage | ||
code={jsxStr} | ||
panelList={panelList} | ||
configList={configList} | ||
onPanelChange={onPanelChange} | ||
onConfigChange={onConfigChange} | ||
> | ||
{renderComp} | ||
</BaseUsage> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.