import React from "react"; import styles from "./index.less"; import { Input, Col, Row, Select, InputNumber, ConfigProvider, Cascader, Radio, Switch, Tree, TreeSelect, Modal, Button, Pagination, Steps, Rate, Badge, Divider } from "antd"; import { SearchOutlined as SearchIcon, SmileOutlined, DownloadOutlined, LeftOutlined, RightOutlined, MinusOutlined, PlusOutlined } from "@ant-design/icons"; const InputGroup = Input.Group; const ButtonGroup = Button.Group; const { Option } = Select; const { TreeNode } = Tree; const { Search } = Input; const { Step } = Steps; const cascaderOptions = [ { value: "tehran", label: "تهران", children: [ { value: "tehran-c", label: "تهران", children: [ { value: "saadat-abad", label: "سعادت آیاد" } ] } ] }, { value: "ardabil", label: "اردبیل", children: [ { value: "ardabil-c", label: "اردبیل", children: [ { value: "primadar", label: "پیرمادر" } ] } ] }, { value: "gilan", label: "گیلان", children: [ { value: "rasht", label: "رشت", children: [ { value: "district-3", label: "منطقه ۳" } ] } ] } ]; class Page extends React.Component { state = { currentStep: 0, modalVisible: false, badgeCount: 5, showBadge: true }; selectBefore = ( ); selectAfter = ( ); // ==== Cascader ==== cascaderFilter = (inputValue, path) => { return path.some( option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1 ); }; onCascaderChange = value => { console.log(value); }; // ==== End Cascader ==== // ==== Modal ==== showModal = () => { this.setState({ modalVisible: true }); }; handleOk = e => { console.log(e); this.setState({ modalVisible: false }); }; handleCancel = e => { console.log(e); this.setState({ modalVisible: false }); }; // ==== End Modal ==== onStepsChange = currentStep => { console.log("onChange:", currentStep); this.setState({ currentStep }); }; // ==== Badge ==== increaseBadge = () => { const badgeCount = this.state.badgeCount + 1; this.setState({ badgeCount }); }; declineBadge = () => { let badgeCount = this.state.badgeCount - 1; if (badgeCount < 0) { badgeCount = 0; } this.setState({ badgeCount }); }; onChangeBadge = showBadge => { this.setState({ showBadge }); }; // ==== End Badge ==== render() { const { currentStep } = this.state; return (
Cascader example } options={cascaderOptions} onChange={this.onCascaderChange} placeholder="یک مورد انتخاب کنید" popupPlacement={this.props.popupPlacement} />      With search: } options={cascaderOptions} onChange={this.onCascaderChange} placeholder="Select an item" popupPlacement={this.props.popupPlacement} showSearch={this.cascaderFilter} />
Switch example          Radio Group example تهران اصفهان فارس خوزستان
Button example

Tree example sss} key="0-0-1-0" />

Input (Input Group) example





Select example TreeSelect example
sss} key="random3" />

Modal example

نگاشته‌های خود را اینجا قراردهید

نگاشته‌های خود را اینجا قراردهید

نگاشته‌های خود را اینجا قراردهید


Steps example


Rate example

* Note: Half star not implemented in RTL direction, it will be supported after{" "} rc-rate{" "} implement rtl support.
Badge example


Pagination example
Grid System example

* Note: Every calculation in RTL grid system is from right side (offset, push, etc.)

col-8 col-8 col-6 col-offset-6 col-6 col-offset-6 col-12 col-offset-6 col-18 col-push-6 col-6 col-pull-18
); } } class App extends React.Component { state = { direction: "ltr", popupPlacement: "bottomLeft" }; changeDirection = e => { const directionValue = e.target.value; this.setState({ direction: directionValue }); if (directionValue === "rtl") { this.setState({ popupPlacement: "bottomRight" }); } else { this.setState({ popupPlacement: "bottomLeft" }); } }; render() { const { direction, popupPlacement } = this.state; return ( <>
Change direction of components:{" "} LTR RTL
); } } export default () => (
);