@qsxy/element-plus-react 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Affix/Affix.d.ts +4 -0
- package/dist/Affix/Affix.js +301 -0
- package/dist/Affix/index.d.ts +2 -0
- package/dist/Affix/index.js +1 -0
- package/dist/Affix/typings.d.ts +50 -0
- package/dist/Affix/typings.js +1 -0
- package/dist/Alert/Alert.d.ts +7 -0
- package/dist/Alert/Alert.js +98 -0
- package/dist/Alert/index.d.ts +2 -0
- package/dist/Alert/index.js +1 -0
- package/dist/Alert/typings.d.ts +45 -0
- package/dist/Alert/typings.js +1 -0
- package/dist/Anchor/Anchor.d.ts +6 -0
- package/dist/Anchor/Anchor.js +258 -0
- package/dist/Anchor/AnchorLink.d.ts +4 -0
- package/dist/Anchor/AnchorLink.js +77 -0
- package/dist/Anchor/element.d.ts +4 -0
- package/dist/Anchor/element.js +17 -0
- package/dist/Anchor/index.d.ts +3 -0
- package/dist/Anchor/index.js +2 -0
- package/dist/Anchor/typings.d.ts +101 -0
- package/dist/Anchor/typings.js +1 -0
- package/dist/Backtop/Backtop.d.ts +7 -0
- package/dist/Backtop/Backtop.js +153 -0
- package/dist/Backtop/index.d.ts +2 -0
- package/dist/Backtop/index.js +1 -0
- package/dist/Backtop/typings.d.ts +31 -0
- package/dist/Backtop/typings.js +1 -0
- package/dist/Button/Button.d.ts +2 -11
- package/dist/Button/Button.js +2 -6
- package/dist/Button/index.d.ts +1 -1
- package/dist/Calendar/Calendar.js +12 -8
- package/dist/Calendar/YearRangePanel.js +1 -1
- package/dist/Card/Card.js +5 -3
- package/dist/Carousel/typings.d.ts +1 -1
- package/dist/Cascader/Cascader.d.ts +3 -3
- package/dist/Cascader/Cascader.js +238 -166
- package/dist/Cascader/CascaderContext.d.ts +9 -3
- package/dist/Cascader/CascaderContext.js +3 -1
- package/dist/Cascader/CascaderDropdown.d.ts +4 -3
- package/dist/Cascader/CascaderDropdown.js +21 -10
- package/dist/Cascader/CascaderMenu.d.ts +2 -2
- package/dist/Cascader/CascaderMenu.js +56 -14
- package/dist/Cascader/CascaderPanel.d.ts +4 -0
- package/dist/Cascader/CascaderPanel.js +11 -0
- package/dist/Cascader/index.d.ts +4 -1
- package/dist/Cascader/index.js +2 -1
- package/dist/Cascader/typings.d.ts +45 -31
- package/dist/Cascader/useCascader.d.ts +14 -27
- package/dist/Cascader/useCascader.js +153 -59
- package/dist/Checkbox/Checkbox.js +3 -2
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +11 -1
- package/dist/CheckboxGroup/CheckboxGroup.js +78 -19
- package/dist/Collapse/Collapse.d.ts +3 -3
- package/dist/Collapse/Collapse.js +71 -16
- package/dist/Collapse/CollapseContext.d.ts +3 -6
- package/dist/Collapse/CollapseContext.js +2 -4
- package/dist/Collapse/CollapseItem.d.ts +3 -3
- package/dist/Collapse/CollapseItem.js +93 -51
- package/dist/Collapse/CollapseTransition.js +11 -7
- package/dist/Collapse/index.d.ts +1 -1
- package/dist/Collapse/typings.d.ts +20 -5
- package/dist/ColorPicker/typings.d.ts +1 -1
- package/dist/ConfigProvider/ConfigProvider.js +2 -24
- package/dist/ConfigProvider/ConfigProviderContext.js +1 -1
- package/dist/ConfigProvider/typings.d.ts +1 -1
- package/dist/Container/Main.d.ts +1 -1
- package/dist/Container/typings.d.ts +1 -1
- package/dist/Countdown/Countdown.d.ts +4 -0
- package/dist/Countdown/Countdown.js +121 -0
- package/dist/Countdown/index.d.ts +2 -0
- package/dist/Countdown/index.js +1 -0
- package/dist/Countdown/typings.d.ts +52 -0
- package/dist/Countdown/typings.js +1 -0
- package/dist/Countdown/util.d.ts +14 -0
- package/dist/Countdown/util.js +58 -0
- package/dist/DatePicker/DatePicker.js +9 -6
- package/dist/DatePicker/DateRangePicker.js +7 -6
- package/dist/DatePicker/typings.d.ts +0 -13
- package/dist/DateTimePicker/DateTimePicker.js +29 -19
- package/dist/Dialog/Dialog.d.ts +2 -13
- package/dist/Dialog/Dialog.js +143 -160
- package/dist/Dialog/DialogBody.js +3 -38
- package/dist/Dialog/DialogContext.d.ts +0 -7
- package/dist/Dialog/DialogContext.js +1 -5
- package/dist/Dialog/DialogHeader.js +2 -2
- package/dist/Dialog/typings.d.ts +43 -28
- package/dist/Dialog/useDraggable.d.ts +2 -1
- package/dist/Dialog/useDraggable.js +34 -9
- package/dist/Drawer/Drawer.d.ts +2 -13
- package/dist/Drawer/Drawer.js +115 -137
- package/dist/Drawer/DrawerBody.js +7 -8
- package/dist/Drawer/DrawerFooter.js +7 -7
- package/dist/Drawer/DrawerHeader.js +11 -8
- package/dist/Drawer/typings.d.ts +22 -6
- package/dist/Dropdown/Dropdown.js +5 -3
- package/dist/Dropdown/typings.d.ts +2 -1
- package/dist/Empty/Empty.js +16 -4
- package/dist/Form/Form.d.ts +4 -21
- package/dist/Form/Form.js +53 -25
- package/dist/Form/FormItem.d.ts +4 -52
- package/dist/Form/FormItem.js +633 -650
- package/dist/Form/FormItemContext.d.ts +10 -1
- package/dist/Form/FormItemContext.js +9 -1
- package/dist/Form/FormLabelWrap.d.ts +8 -0
- package/dist/Form/FormLabelWrap.js +103 -0
- package/dist/Form/{FieldContext.d.ts → InternalFormContext.d.ts} +2 -2
- package/dist/Form/{FieldContext.js → InternalFormContext.js} +5 -2
- package/dist/Form/List.d.ts +3 -3
- package/dist/Form/List.js +4 -4
- package/dist/Form/index.d.ts +4 -2
- package/dist/Form/index.js +4 -1
- package/dist/Form/typings.d.ts +61 -9
- package/dist/Form/typings.js +15 -1
- package/dist/Form/useForm.js +3 -3
- package/dist/Form/useWatch.js +1 -1
- package/dist/Input/Input.d.ts +2 -14
- package/dist/Input/Input.js +187 -140
- package/dist/Input/InputGroup.js +1 -1
- package/dist/Input/InputRange.js +7 -11
- package/dist/Input/TextArea.d.ts +1 -1
- package/dist/Input/TextArea.js +85 -30
- package/dist/Input/index.d.ts +1 -0
- package/dist/Input/index.js +2 -1
- package/dist/Input/typings.d.ts +38 -19
- package/dist/Input/utils.d.ts +1 -0
- package/dist/Input/utils.js +5 -1
- package/dist/InputNumber/InputNumber.js +408 -147
- package/dist/InputNumber/typings.d.ts +15 -5
- package/dist/Loading/Loading.js +5 -2
- package/dist/Menu/Menu.js +26 -2
- package/dist/Menu/MenuItem.js +4 -2
- package/dist/Menu/SubMenu.js +2 -2
- package/dist/Menu/SubMenuCollapseTransition.js +14 -9
- package/dist/Menu/typings.d.ts +5 -14
- package/dist/Message/Message.js +51 -23
- package/dist/Message/index.js +13 -13
- package/dist/Message/typings.d.ts +8 -5
- package/dist/MessageBox/MessageBox.js +75 -57
- package/dist/MessageBox/index.d.ts +2 -1
- package/dist/MessageBox/index.js +4 -2
- package/dist/MessageBox/typings.d.ts +3 -1
- package/dist/Notification/Notification.js +26 -19
- package/dist/Notification/typings.d.ts +1 -1
- package/dist/PageHeader/PageHeader.d.ts +8 -0
- package/dist/PageHeader/PageHeader.js +91 -0
- package/dist/PageHeader/index.d.ts +2 -0
- package/dist/PageHeader/index.js +1 -0
- package/dist/PageHeader/typings.d.ts +34 -0
- package/dist/PageHeader/typings.js +1 -0
- package/dist/Pagination/typings.d.ts +1 -1
- package/dist/Popover/Popover.js +7 -7
- package/dist/Popover/typings.d.ts +3 -3
- package/dist/Popper/Popper.js +49 -28
- package/dist/Popper/popperOptions.js +1 -0
- package/dist/Popper/typings.d.ts +2 -0
- package/dist/Radio/Radio.d.ts +2 -12
- package/dist/Radio/Radio.js +2 -6
- package/dist/Radio/RadioButton.d.ts +1 -1
- package/dist/Radio/RadioButton.js +4 -4
- package/dist/Radio/index.d.ts +1 -0
- package/dist/Radio/index.js +2 -1
- package/dist/Radio/typings.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.js +44 -16
- package/dist/RadioGroup/typings.d.ts +10 -0
- package/dist/Segmented/Segmented.d.ts +4 -0
- package/dist/Segmented/Segmented.js +208 -0
- package/dist/Segmented/index.d.ts +2 -0
- package/dist/Segmented/index.js +1 -0
- package/dist/Segmented/typings.d.ts +20 -0
- package/dist/Segmented/typings.js +5 -0
- package/dist/Select/SelectContext.d.ts +2 -1
- package/dist/Select/SelectContext.js +2 -1
- package/dist/Select/SelectCore.js +64 -15
- package/dist/Select/SelectDropdown.js +23 -15
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/typings.d.ts +26 -17
- package/dist/Select/useSelect.d.ts +35 -18
- package/dist/Select/useSelect.js +88 -33
- package/dist/Skeleton/typings.d.ts +1 -1
- package/dist/Slider/Button.d.ts +4 -0
- package/dist/Slider/Button.js +96 -0
- package/dist/Slider/Marker.d.ts +4 -0
- package/dist/Slider/Marker.js +31 -0
- package/dist/Slider/Slider.d.ts +4 -0
- package/dist/Slider/Slider.js +263 -0
- package/dist/Slider/SliderContext.d.ts +3 -0
- package/dist/Slider/SliderContext.js +2 -0
- package/dist/Slider/hooks/index.d.ts +5 -0
- package/dist/Slider/hooks/index.js +5 -0
- package/dist/Slider/hooks/useLifecycle.d.ts +5 -0
- package/dist/Slider/hooks/useLifecycle.js +50 -0
- package/dist/Slider/hooks/useMarks.d.ts +2 -0
- package/dist/Slider/hooks/useMarks.js +49 -0
- package/dist/Slider/hooks/useSlider.d.ts +38 -0
- package/dist/Slider/hooks/useSlider.js +227 -0
- package/dist/Slider/hooks/useSliderButton.d.ts +28 -0
- package/dist/Slider/hooks/useSliderButton.js +454 -0
- package/dist/Slider/hooks/useStops.d.ts +6 -0
- package/dist/Slider/hooks/useStops.js +47 -0
- package/dist/Slider/hooks/useWatch.d.ts +3 -0
- package/dist/Slider/hooks/useWatch.js +119 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/index.js +1 -0
- package/dist/Slider/style/css.d.ts +1 -0
- package/dist/Slider/style/css.js +1 -0
- package/dist/Slider/style/index.d.ts +1 -0
- package/dist/Slider/style/index.js +1 -0
- package/dist/Slider/typings.d.ts +122 -0
- package/dist/Slider/typings.js +1 -0
- package/dist/Space/Space.d.ts +4 -0
- package/dist/Space/Space.js +125 -0
- package/dist/Space/SpaceItem.d.ts +7 -0
- package/dist/Space/SpaceItem.js +14 -0
- package/dist/Space/index.d.ts +3 -0
- package/dist/Space/index.js +2 -0
- package/dist/Space/typings.d.ts +26 -0
- package/dist/Space/typings.js +1 -0
- package/dist/Space/useSpace.d.ts +7 -0
- package/dist/Space/useSpace.js +105 -0
- package/dist/Statistic/Statistic.d.ts +4 -0
- package/dist/Statistic/Statistic.js +91 -0
- package/dist/Statistic/index.d.ts +2 -0
- package/dist/Statistic/index.js +1 -0
- package/dist/Statistic/typings.d.ts +28 -0
- package/dist/Statistic/typings.js +1 -0
- package/dist/Steps/Step.d.ts +4 -0
- package/dist/Steps/Step.js +247 -0
- package/dist/Steps/Steps.d.ts +5 -0
- package/dist/Steps/Steps.js +116 -0
- package/dist/Steps/index.d.ts +3 -0
- package/dist/Steps/index.js +2 -0
- package/dist/Steps/typings.d.ts +119 -0
- package/dist/Steps/typings.js +1 -0
- package/dist/Switch/Switch.js +2 -2
- package/dist/Switch/typings.d.ts +0 -1
- package/dist/Table/Table.js +17 -14
- package/dist/Table/TableBody.js +4 -4
- package/dist/Table/TableCell.js +53 -28
- package/dist/Table/TableColumn.d.ts +2 -2
- package/dist/Table/TableHeader.js +2 -2
- package/dist/Table/TableHeaderCell.js +2 -2
- package/dist/Table/hooks/useResize.js +0 -2
- package/dist/Table/hooks/useTable.d.ts +1 -1
- package/dist/Table/hooks/useTable.js +15 -10
- package/dist/Table/typings.d.ts +28 -12
- package/dist/Table/util.d.ts +1 -1
- package/dist/Table/util.js +8 -65
- package/dist/TableV2/index.d.ts +10 -0
- package/dist/TableV2/index.js +7 -0
- package/dist/TableV2/src/auto-resizer.d.ts +14 -0
- package/dist/TableV2/src/auto-resizer.js +1 -0
- package/dist/TableV2/src/cell.d.ts +21 -0
- package/dist/TableV2/src/cell.js +1 -0
- package/dist/TableV2/src/components/auto-resizer.d.ts +4 -0
- package/dist/TableV2/src/components/auto-resizer.js +32 -0
- package/dist/TableV2/src/components/cell.d.ts +4 -0
- package/dist/TableV2/src/components/cell.js +22 -0
- package/dist/TableV2/src/components/expand-icon.d.ts +12 -0
- package/dist/TableV2/src/components/expand-icon.js +29 -0
- package/dist/TableV2/src/components/header-cell.d.ts +4 -0
- package/dist/TableV2/src/components/header-cell.js +23 -0
- package/dist/TableV2/src/components/header-row.d.ts +17 -0
- package/dist/TableV2/src/components/header-row.js +41 -0
- package/dist/TableV2/src/components/header.d.ts +20 -0
- package/dist/TableV2/src/components/header.js +103 -0
- package/dist/TableV2/src/components/index.d.ts +10 -0
- package/dist/TableV2/src/components/index.js +7 -0
- package/dist/TableV2/src/components/row.d.ts +19 -0
- package/dist/TableV2/src/components/row.js +206 -0
- package/dist/TableV2/src/components/sort-icon.d.ts +9 -0
- package/dist/TableV2/src/components/sort-icon.js +14 -0
- package/dist/TableV2/src/composables/index.d.ts +6 -0
- package/dist/TableV2/src/composables/index.js +6 -0
- package/dist/TableV2/src/composables/use-auto-resize.d.ts +7 -0
- package/dist/TableV2/src/composables/use-auto-resize.js +55 -0
- package/dist/TableV2/src/composables/use-columns.d.ts +21 -0
- package/dist/TableV2/src/composables/use-columns.js +119 -0
- package/dist/TableV2/src/composables/use-data.d.ts +15 -0
- package/dist/TableV2/src/composables/use-data.js +62 -0
- package/dist/TableV2/src/composables/use-row.d.ts +34 -0
- package/dist/TableV2/src/composables/use-row.js +191 -0
- package/dist/TableV2/src/composables/use-scrollbar.d.ts +25 -0
- package/dist/TableV2/src/composables/use-scrollbar.js +117 -0
- package/dist/TableV2/src/composables/use-styles.d.ts +23 -0
- package/dist/TableV2/src/composables/use-styles.js +90 -0
- package/dist/TableV2/src/composables/utils.d.ts +3 -0
- package/dist/TableV2/src/composables/utils.js +29 -0
- package/dist/TableV2/src/constants.d.ts +18 -0
- package/dist/{Tree/Indent.js → TableV2/src/constants.js} +18 -21
- package/dist/TableV2/src/grid.d.ts +52 -0
- package/dist/TableV2/src/grid.js +1 -0
- package/dist/TableV2/src/header-cell.d.ts +13 -0
- package/dist/TableV2/src/header-cell.js +1 -0
- package/dist/TableV2/src/header-row.d.ts +10 -0
- package/dist/TableV2/src/header-row.js +1 -0
- package/dist/TableV2/src/header.d.ts +15 -0
- package/dist/TableV2/src/header.js +1 -0
- package/dist/TableV2/src/private.d.ts +1 -0
- package/dist/TableV2/src/private.js +1 -0
- package/dist/TableV2/src/renderers/cell.d.ts +14 -0
- package/dist/TableV2/src/renderers/cell.js +120 -0
- package/dist/TableV2/src/renderers/empty.d.ts +7 -0
- package/dist/TableV2/src/renderers/empty.js +11 -0
- package/dist/TableV2/src/renderers/footer.d.ts +7 -0
- package/dist/TableV2/src/renderers/footer.js +9 -0
- package/dist/TableV2/src/renderers/header-cell.d.ts +13 -0
- package/dist/TableV2/src/renderers/header-cell.js +92 -0
- package/dist/TableV2/src/renderers/header.d.ts +9 -0
- package/dist/TableV2/src/renderers/header.js +39 -0
- package/dist/TableV2/src/renderers/left-table.d.ts +32 -0
- package/dist/TableV2/src/renderers/left-table.js +15 -0
- package/dist/TableV2/src/renderers/main-table.d.ts +31 -0
- package/dist/TableV2/src/renderers/main-table.js +12 -0
- package/dist/TableV2/src/renderers/overlay.d.ts +3 -0
- package/dist/TableV2/src/renderers/overlay.js +9 -0
- package/dist/TableV2/src/renderers/right-table.d.ts +31 -0
- package/dist/TableV2/src/renderers/right-table.js +15 -0
- package/dist/TableV2/src/renderers/row.d.ts +11 -0
- package/dist/TableV2/src/renderers/row.js +96 -0
- package/dist/TableV2/src/row.d.ts +51 -0
- package/dist/TableV2/src/row.js +1 -0
- package/dist/TableV2/src/table-grid.d.ts +43 -0
- package/dist/TableV2/src/table-grid.js +283 -0
- package/dist/TableV2/src/table-v2.d.ts +31 -0
- package/dist/TableV2/src/table-v2.js +311 -0
- package/dist/TableV2/src/table.d.ts +196 -0
- package/dist/TableV2/src/table.js +1 -0
- package/dist/TableV2/src/tokens.d.ts +11 -0
- package/dist/TableV2/src/tokens.js +6 -0
- package/dist/TableV2/src/types.d.ts +94 -0
- package/dist/TableV2/src/types.js +1 -0
- package/dist/TableV2/src/use-table.d.ts +48 -0
- package/dist/TableV2/src/use-table.js +197 -0
- package/dist/TableV2/src/utils.d.ts +5 -0
- package/dist/TableV2/src/utils.js +47 -0
- package/dist/Tabs/Tabs.js +1 -1
- package/dist/Tabs/typings.d.ts +1 -3
- package/dist/Tag/Tag.js +1 -1
- package/dist/Tag/typings.d.ts +1 -1
- package/dist/Text/Text.d.ts +4 -0
- package/dist/Text/Text.js +84 -0
- package/dist/Text/index.d.ts +2 -0
- package/dist/Text/index.js +1 -0
- package/dist/Text/typings.d.ts +15 -0
- package/dist/Text/typings.js +1 -0
- package/dist/TimePicker/TimePicker.js +6 -7
- package/dist/TimePicker/TimePickerPanel.js +12 -2
- package/dist/TimePicker/TimePickerRange.js +19 -8
- package/dist/Tooltip/Tooltip.js +31 -8
- package/dist/Tooltip/typings.d.ts +4 -0
- package/dist/Tour/Content.d.ts +9 -0
- package/dist/Tour/Content.js +81 -0
- package/dist/Tour/Mask.d.ts +12 -0
- package/dist/Tour/Mask.js +100 -0
- package/dist/Tour/Step.d.ts +7 -0
- package/dist/Tour/Step.js +119 -0
- package/dist/Tour/Tour.d.ts +6 -0
- package/dist/Tour/Tour.js +237 -0
- package/dist/Tour/context.d.ts +4 -0
- package/dist/Tour/context.js +9 -0
- package/dist/Tour/helper.d.ts +39 -0
- package/dist/Tour/helper.js +286 -0
- package/dist/Tour/index.d.ts +3 -0
- package/dist/Tour/index.js +2 -0
- package/dist/Tour/typings.d.ts +318 -0
- package/dist/Tour/typings.js +38 -0
- package/dist/Transfer/List.js +58 -59
- package/dist/Transfer/ListItem.d.ts +2 -2
- package/dist/Transfer/Transfer.d.ts +2 -2
- package/dist/Transfer/Transfer.js +84 -70
- package/dist/Transfer/index.d.ts +1 -1
- package/dist/Transfer/operation.js +8 -10
- package/dist/Transfer/typings/index.d.ts +49 -38
- package/dist/Transfer/typings/list.d.ts +11 -11
- package/dist/Transfer/typings/listBody.d.ts +2 -2
- package/dist/Transition/Transition.d.ts +1 -0
- package/dist/Transition/Transition.js +8 -7
- package/dist/Tree/CollapseTransition.d.ts +7 -0
- package/dist/Tree/CollapseTransition.js +60 -0
- package/dist/Tree/Tree.d.ts +3 -140
- package/dist/Tree/Tree.js +351 -77
- package/dist/Tree/TreeContext.d.ts +9 -0
- package/dist/Tree/TreeContext.js +14 -0
- package/dist/Tree/TreeNode.d.ts +5 -3
- package/dist/Tree/TreeNode.js +321 -331
- package/dist/Tree/TreeNodeContent.d.ts +9 -0
- package/dist/Tree/TreeNodeContent.js +22 -0
- package/dist/Tree/index.d.ts +3 -8
- package/dist/Tree/index.js +1 -4
- package/dist/Tree/model/node.d.ts +62 -0
- package/dist/Tree/model/node.js +601 -0
- package/dist/Tree/model/tree-store.d.ts +52 -0
- package/dist/Tree/model/tree-store.js +510 -0
- package/dist/Tree/model/useDragNode.d.ts +30 -0
- package/dist/Tree/model/useDragNode.js +293 -0
- package/dist/Tree/model/useKeydown.d.ts +0 -0
- package/dist/Tree/model/useKeydown.js +104 -0
- package/dist/Tree/model/useNodeExpandEventBroadcast.d.ts +15 -0
- package/dist/Tree/model/useNodeExpandEventBroadcast.js +54 -0
- package/dist/Tree/model/util.d.ts +7 -0
- package/dist/Tree/model/util.js +24 -0
- package/dist/Tree/typings.d.ts +227 -114
- package/dist/TreeSelect/TreeSelect.d.ts +2 -10
- package/dist/TreeSelect/TreeSelect.js +90 -566
- package/dist/TreeSelect/TreeSelectOption.d.ts +6 -0
- package/dist/TreeSelect/TreeSelectOption.js +62 -0
- package/dist/TreeSelect/Utils.d.ts +10 -3
- package/dist/TreeSelect/Utils.js +37 -19
- package/dist/TreeSelect/cacheOptions.d.ts +9 -0
- package/dist/TreeSelect/cacheOptions.js +22 -0
- package/dist/TreeSelect/index.d.ts +0 -1
- package/dist/TreeSelect/typings.d.ts +11 -63
- package/dist/TreeSelect/useSelect.d.ts +78 -0
- package/dist/TreeSelect/useSelect.js +104 -0
- package/dist/TreeSelect/useTree.d.ts +125 -0
- package/dist/TreeSelect/useTree.js +285 -0
- package/dist/Upload/UploadContent.js +3 -1
- package/dist/Upload/ajax.js +3 -0
- package/dist/Upload/typings.d.ts +5 -1
- package/dist/Util/PopupManager.js +1 -1
- package/dist/Util/aria.d.ts +1 -1
- package/dist/Util/aria.js +12 -12
- package/dist/Util/base.d.ts +36 -6
- package/dist/Util/base.js +180 -13
- package/dist/Util/easings.d.ts +1 -0
- package/dist/Util/easings.js +8 -0
- package/dist/Util/error.d.ts +3 -0
- package/dist/Util/error.js +39 -0
- package/dist/Util/icons.d.ts +2 -0
- package/dist/Util/icons.js +15 -0
- package/dist/Util/index.d.ts +6 -2
- package/dist/Util/index.js +6 -2
- package/dist/Util/position.d.ts +9 -0
- package/dist/Util/position.js +53 -0
- package/dist/Util/raf.d.ts +4 -0
- package/dist/Util/raf.js +10 -0
- package/dist/Util/scroll.d.ts +9 -0
- package/dist/Util/scroll.js +72 -0
- package/dist/Util/throttleByRaf.d.ts +4 -0
- package/dist/Util/throttleByRaf.js +21 -0
- package/dist/VirtualList/builders/build-grid.d.ts +5 -0
- package/dist/VirtualList/builders/build-grid.js +561 -0
- package/dist/VirtualList/builders/build-list.d.ts +7 -0
- package/dist/VirtualList/builders/build-list.js +408 -0
- package/dist/VirtualList/components/dynamic-size-grid.d.ts +15 -0
- package/dist/VirtualList/components/dynamic-size-grid.js +242 -0
- package/dist/VirtualList/components/dynamic-size-list.d.ts +7 -0
- package/dist/VirtualList/components/dynamic-size-list.js +186 -0
- package/dist/VirtualList/components/fixed-size-grid.d.ts +4 -0
- package/dist/VirtualList/components/fixed-size-grid.js +161 -0
- package/dist/VirtualList/components/fixed-size-list.d.ts +7 -0
- package/dist/VirtualList/components/fixed-size-list.js +103 -0
- package/dist/VirtualList/components/scrollbar.d.ts +5 -0
- package/dist/VirtualList/components/scrollbar.js +272 -0
- package/dist/VirtualList/defaults.d.ts +26 -0
- package/dist/VirtualList/defaults.js +24 -0
- package/dist/VirtualList/hooks/use-cache.d.ts +1 -0
- package/dist/VirtualList/hooks/use-cache.js +16 -0
- package/dist/VirtualList/hooks/use-grid-touch.d.ts +8 -0
- package/dist/VirtualList/hooks/use-grid-touch.js +58 -0
- package/dist/VirtualList/hooks/use-grid-wheel.d.ts +12 -0
- package/dist/VirtualList/hooks/use-grid-wheel.js +48 -0
- package/dist/VirtualList/hooks/use-wheel.d.ts +12 -0
- package/dist/VirtualList/hooks/use-wheel.js +41 -0
- package/dist/VirtualList/index.d.ts +9 -0
- package/dist/VirtualList/index.js +6 -0
- package/dist/VirtualList/props.d.ts +95 -0
- package/dist/VirtualList/props.js +42 -0
- package/dist/VirtualList/types.d.ts +151 -0
- package/dist/VirtualList/types.js +1 -0
- package/dist/VirtualList/utils.d.ts +11 -0
- package/dist/VirtualList/utils.js +56 -0
- package/dist/Watermark/Watermark.d.ts +4 -0
- package/dist/Watermark/Watermark.js +257 -0
- package/dist/Watermark/helper.d.ts +50 -0
- package/dist/Watermark/helper.js +253 -0
- package/dist/Watermark/index.d.ts +2 -0
- package/dist/Watermark/index.js +1 -0
- package/dist/Watermark/typings.d.ts +93 -0
- package/dist/Watermark/typings.js +1 -0
- package/dist/config/Constants.d.ts +3 -0
- package/dist/config/Constants.js +8 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/popperPropsUtils.js +1 -1
- package/dist/hooks/treePropsUtils.d.ts +3 -3
- package/dist/hooks/treePropsUtils.js +2 -2
- package/dist/hooks/useClassNames.d.ts +1 -0
- package/dist/hooks/useClickOutside.js +25 -9
- package/dist/hooks/useCommonProps.d.ts +4 -0
- package/dist/hooks/useCommonProps.js +12 -3
- package/dist/hooks/useConfigProvider.d.ts +27 -0
- package/dist/hooks/useConfigProvider.js +78 -0
- package/dist/hooks/useLockscreen.d.ts +6 -0
- package/dist/hooks/useLockscreen.js +45 -0
- package/dist/hooks/useResizeObserver.d.ts +1 -1
- package/dist/hooks/useResizeObserver.js +7 -7
- package/dist/index.css +1 -1
- package/dist/index.d.ts +50 -22
- package/dist/index.js +27 -10
- package/dist/locale/en.d.ts +4 -1
- package/dist/locale/en.js +4 -1
- package/dist/locale/zhCn.d.ts +4 -1
- package/dist/locale/zhCn.js +4 -1
- package/package.json +5 -3
- package/theme-chalk/affix.scss +7 -0
- package/theme-chalk/alert.scss +115 -0
- package/theme-chalk/anchor-link.scss +45 -0
- package/theme-chalk/anchor.scss +93 -0
- package/theme-chalk/aside.scss +8 -8
- package/theme-chalk/backtop.scss +29 -0
- package/theme-chalk/breadcrumb-item.scss +58 -0
- package/theme-chalk/breadcrumb.scss +5 -61
- package/theme-chalk/button-group.scss +80 -80
- package/theme-chalk/button.scss +304 -304
- package/theme-chalk/calendar/date-table.scss +164 -164
- package/theme-chalk/cascader-panel.scss +57 -82
- package/theme-chalk/cascader.scss +206 -160
- package/theme-chalk/checkbox.scss +38 -0
- package/theme-chalk/collapse-item.scss +72 -0
- package/theme-chalk/collapse.scss +21 -76
- package/theme-chalk/color/index.scss +20 -20
- package/theme-chalk/common/popup.scss +47 -0
- package/theme-chalk/common/transition.scss +142 -142
- package/theme-chalk/common/var.scss +62 -6
- package/theme-chalk/container.scss +14 -14
- package/theme-chalk/dark/css-vars.scss +39 -39
- package/theme-chalk/dark/var.scss +225 -225
- package/theme-chalk/date-picker.scss +12 -12
- package/theme-chalk/dialog.scss +145 -137
- package/theme-chalk/drawer.scss +252 -246
- package/theme-chalk/footer.scss +12 -12
- package/theme-chalk/form-item.scss +437 -0
- package/theme-chalk/form.scss +23 -361
- package/theme-chalk/header.scss +12 -12
- package/theme-chalk/index.scss +21 -1
- package/theme-chalk/input/input-range.scss +2 -1
- package/theme-chalk/input/input.scss +458 -424
- package/theme-chalk/input-number.scss +82 -75
- package/theme-chalk/link.scss +87 -87
- package/theme-chalk/main.scss +14 -14
- package/theme-chalk/menu.scss +353 -353
- package/theme-chalk/message-box.scss +160 -133
- package/theme-chalk/message.scss +54 -128
- package/theme-chalk/mixins/_button.scss +224 -224
- package/theme-chalk/mixins/_col.scss +33 -33
- package/theme-chalk/mixins/_var.scss +67 -67
- package/theme-chalk/mixins/config.scss +5 -5
- package/theme-chalk/mixins/function.scss +99 -99
- package/theme-chalk/mixins/mixins.scss +237 -240
- package/theme-chalk/mixins/utils.scss +39 -39
- package/theme-chalk/notification.scss +96 -143
- package/theme-chalk/overlay.scss +17 -0
- package/theme-chalk/page-header.scss +60 -0
- package/theme-chalk/popper.scss +104 -104
- package/theme-chalk/radio-button.scss +169 -169
- package/theme-chalk/radio.scss +3 -3
- package/theme-chalk/segmented.scss +186 -0
- package/theme-chalk/select/index.scss +278 -272
- package/theme-chalk/slider.scss +212 -0
- package/theme-chalk/space.scss +20 -0
- package/theme-chalk/statistic.scss +35 -0
- package/theme-chalk/step.scss +320 -0
- package/theme-chalk/steps.scss +22 -0
- package/theme-chalk/switch.scss +300 -300
- package/theme-chalk/table-v2.scss +237 -0
- package/theme-chalk/table.scss +461 -482
- package/theme-chalk/tag.scss +181 -181
- package/theme-chalk/text.scss +48 -0
- package/theme-chalk/time-range-picker.scss +1 -1
- package/theme-chalk/tooltip.scss +2 -2
- package/theme-chalk/tour.scss +170 -0
- package/theme-chalk/transfer.scss +38 -12
- package/theme-chalk/transition.scss +34 -4
- package/theme-chalk/tree-select.scss +35 -19
- package/theme-chalk/tree.scss +136 -0
- package/theme-chalk/var.scss +83 -83
- package/theme-chalk/virtual-list.scss +40 -0
- package/dist/Input/Input.1.d.ts +0 -16
- package/dist/Input/Input.1.js +0 -376
- package/dist/Tree/DirectoryTree.d.ts +0 -15
- package/dist/Tree/DirectoryTree.js +0 -183
- package/dist/Tree/DropIndicator.d.ts +0 -8
- package/dist/Tree/DropIndicator.js +0 -34
- package/dist/Tree/Indent.d.ts +0 -9
- package/dist/Tree/MotionTreeNode.d.ts +0 -14
- package/dist/Tree/MotionTreeNode.js +0 -125
- package/dist/Tree/NodeList.d.ts +0 -50
- package/dist/Tree/NodeList.js +0 -301
- package/dist/Tree/RCTree.d.ts +0 -248
- package/dist/Tree/RCTree.js +0 -1216
- package/dist/Tree/contextTypes.d.ts +0 -69
- package/dist/Tree/contextTypes.js +0 -9
- package/dist/Tree/typings.tsx--bak +0 -245
- package/dist/Tree/useUnmount.d.ts +0 -5
- package/dist/Tree/useUnmount.js +0 -34
- package/dist/Tree/util.d.ts +0 -51
- package/dist/Tree/util.js +0 -303
- package/dist/Tree/utils/conductUtil.d.ts +0 -17
- package/dist/Tree/utils/conductUtil.js +0 -209
- package/dist/Tree/utils/dictUtil.d.ts +0 -13
- package/dist/Tree/utils/dictUtil.js +0 -75
- package/dist/Tree/utils/diffUtil.d.ts +0 -7
- package/dist/Tree/utils/diffUtil.js +0 -48
- package/dist/Tree/utils/dropIndicator.d.ts +0 -11
- package/dist/Tree/utils/dropIndicator.js +0 -36
- package/dist/Tree/utils/iconUtil.d.ts +0 -5
- package/dist/Tree/utils/iconUtil.js +0 -62
- package/dist/Tree/utils/keyUtil.d.ts +0 -2
- package/dist/Tree/utils/keyUtil.js +0 -3
- package/dist/Tree/utils/motion.d.ts +0 -10
- package/dist/Tree/utils/motion.js +0 -54
- package/dist/Tree/utils/pickAttrs.d.ts +0 -11
- package/dist/Tree/utils/pickAttrs.js +0 -51
- package/dist/Tree/utils/treeUtil.d.ts +0 -86
- package/dist/Tree/utils/treeUtil.js +0 -364
- package/theme-chalk/button/_mixins.scss +0 -317
- package/theme-chalk/button/button-group.scss +0 -83
- package/theme-chalk/button/button.scss +0 -382
- package/theme-chalk/button/index.scss +0 -2
- package/theme-chalk/button--bak/_mixins.scss +0 -317
- package/theme-chalk/button--bak/button-group.scss +0 -83
- package/theme-chalk/button--bak/button.scss +0 -382
- package/theme-chalk/button--bak/index.scss +0 -2
- package/theme-chalk/calendar/date-table.scss--bak +0 -156
- package/theme-chalk/input/input.scss--bak +0 -578
- package/theme-chalk/link.scss--bak +0 -99
- package/theme-chalk/popper.scss--bak +0 -86
- package/theme-chalk/radio-button.scss--bak +0 -128
- package/theme-chalk/select/index.scss--bak +0 -247
- package/theme-chalk/switch.scss--bak +0 -273
- package/theme-chalk/tag.scss--bak +0 -203
- package/theme-chalk/tree/_directory.scss +0 -73
- package/theme-chalk/tree/_tree.scss +0 -401
- package/theme-chalk/tree/index.scss +0 -2
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Placement } from '@popperjs/core';
|
|
2
|
+
import React, { CSSProperties } from 'react';
|
|
3
|
+
import { BaseProps, FormControlBaseProps, NativeProps, TypeAttributes } from '../types/common';
|
|
4
|
+
export type SliderValue = number | number[];
|
|
5
|
+
export interface SliderMarkerItem {
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
label: any;
|
|
8
|
+
}
|
|
9
|
+
export type SliderMarks = Record<number, string | SliderMarkerItem>;
|
|
10
|
+
export interface Mark {
|
|
11
|
+
point: number;
|
|
12
|
+
position: number;
|
|
13
|
+
mark: string | SliderMarkerItem;
|
|
14
|
+
}
|
|
15
|
+
export interface SliderProps extends BaseProps, NativeProps<'--el-slider-main-bg-color' | '--el-slider-runway-bg-color' | '--el-slider-stop-bg-color' | '--el-slider-disabled-color' | '--el-slider-border-radius' | '--el-slider-height' | '--el-slider-button-size' | '--el-slider-button-wrapper-size' | '--el-slider-button-wrapper-offset'>, FormControlBaseProps<SliderValue> {
|
|
16
|
+
/** 最小值 */
|
|
17
|
+
min?: number;
|
|
18
|
+
/** 最大值 */
|
|
19
|
+
max?: number;
|
|
20
|
+
/** 步长,可以是数字或 'mark' 用于将值限制为刻度。 当设置为 'mark' 时,必须设置 marks 属性。 */
|
|
21
|
+
step?: number | 'mark';
|
|
22
|
+
/** 是否显示输入框,仅在 range 为 false 且 step 不为 'mark' 时生效。 */
|
|
23
|
+
showInput?: boolean;
|
|
24
|
+
/** 在显示输入框的情况下,是否显示输入框的控制按钮 */
|
|
25
|
+
showInputControls?: boolean;
|
|
26
|
+
/** 输入框的大小,如果设置了 size 属性,默认值自动取 size */
|
|
27
|
+
inputSize?: TypeAttributes.Size;
|
|
28
|
+
/** 是否显示间断点 */
|
|
29
|
+
showStops?: boolean;
|
|
30
|
+
/** 是否显示提示信息 */
|
|
31
|
+
showTooltip?: boolean;
|
|
32
|
+
/** 格式化提示信息 */
|
|
33
|
+
formatTooltip?: (val: number) => number | string;
|
|
34
|
+
/** 是否开启选择范围 */
|
|
35
|
+
range?: boolean;
|
|
36
|
+
/** 是否垂直方向 */
|
|
37
|
+
vertical?: boolean;
|
|
38
|
+
/** 滑块高度,垂直模式必填 */
|
|
39
|
+
height?: string;
|
|
40
|
+
/** 原生 aria-label属性 */
|
|
41
|
+
ariaLabel?: string;
|
|
42
|
+
/** 当 range 为true时,屏幕阅读器标签开始的标记 */
|
|
43
|
+
rangeStartLabel?: string;
|
|
44
|
+
/** 当 range 为true时,屏幕阅读器标签结束的标记 */
|
|
45
|
+
rangeEndLabel?: string;
|
|
46
|
+
/** 显示屏幕阅读器的 aria-valuenow 属性的格式 */
|
|
47
|
+
formatValueText?: (val: number) => string;
|
|
48
|
+
/** tooltip 的自定义类名 */
|
|
49
|
+
tooltipClass?: string;
|
|
50
|
+
/** Tooltip 出现的位置 */
|
|
51
|
+
placement?: Placement;
|
|
52
|
+
/** 标记, key 的类型必须为 number 且取值在闭区间 [min, max] 内,每个标记可以单独设置样式 */
|
|
53
|
+
marks?: SliderMarks;
|
|
54
|
+
/** 当 slider 的 tooltip 处于非活动状态且 persistent 为 false 时,tooltip 将被销毁。 当 show-tooltip 为 false 时,persistent 将始终为 false。 */
|
|
55
|
+
persistent?: boolean;
|
|
56
|
+
/** 值改变时触发(使用鼠标拖曳时,只在松开鼠标后触发) */
|
|
57
|
+
onChange?: (val: SliderValue) => void;
|
|
58
|
+
/** 数据改变时触发(使用鼠标拖曳时,活动过程实时触发) */
|
|
59
|
+
onInput?: (val: SliderValue) => void;
|
|
60
|
+
}
|
|
61
|
+
export interface SliderButtonProps {
|
|
62
|
+
value: number;
|
|
63
|
+
vertical: boolean;
|
|
64
|
+
tooltipClass?: string;
|
|
65
|
+
placement?: Placement;
|
|
66
|
+
role?: string;
|
|
67
|
+
id?: string;
|
|
68
|
+
'aria-label'?: string;
|
|
69
|
+
'aria-labelledby'?: string;
|
|
70
|
+
'aria-valuemin'?: number;
|
|
71
|
+
'aria-valuemax'?: number;
|
|
72
|
+
'aria-valuenow'?: number;
|
|
73
|
+
'aria-valuetext'?: string;
|
|
74
|
+
'aria-orientation'?: 'horizontal' | 'vertical';
|
|
75
|
+
'aria-disabled'?: boolean;
|
|
76
|
+
tabindex?: number;
|
|
77
|
+
onChange?: (val: number) => void;
|
|
78
|
+
}
|
|
79
|
+
export interface SliderMarkerProps {
|
|
80
|
+
mark: string | SliderMarkerItem;
|
|
81
|
+
style?: CSSProperties;
|
|
82
|
+
onMousedown?: (e: React.MouseEvent) => void;
|
|
83
|
+
}
|
|
84
|
+
export interface SliderInitData {
|
|
85
|
+
firstValue: number;
|
|
86
|
+
secondValue: number;
|
|
87
|
+
oldValue: SliderValue;
|
|
88
|
+
dragging: boolean;
|
|
89
|
+
sliderSize: number;
|
|
90
|
+
}
|
|
91
|
+
export interface SliderButtonInitData {
|
|
92
|
+
hovering: boolean;
|
|
93
|
+
dragging: boolean;
|
|
94
|
+
isClick: boolean;
|
|
95
|
+
startX: number;
|
|
96
|
+
currentX: number;
|
|
97
|
+
startY: number;
|
|
98
|
+
currentY: number;
|
|
99
|
+
startPosition: number;
|
|
100
|
+
newPosition: number;
|
|
101
|
+
oldValue: SliderValue;
|
|
102
|
+
}
|
|
103
|
+
export interface SliderContextValue extends SliderProps {
|
|
104
|
+
disabled: boolean;
|
|
105
|
+
precision: number;
|
|
106
|
+
sliderSize: number;
|
|
107
|
+
markList: Mark[];
|
|
108
|
+
formatTooltip: SliderProps['formatTooltip'];
|
|
109
|
+
emitChange: () => void;
|
|
110
|
+
resetSize: () => void;
|
|
111
|
+
updateDragging: (val: boolean) => void;
|
|
112
|
+
}
|
|
113
|
+
export type SliderRef = {
|
|
114
|
+
onSliderClick: (event: React.MouseEvent | React.TouchEvent) => void;
|
|
115
|
+
};
|
|
116
|
+
export type SliderButtonRef = {
|
|
117
|
+
onButtonDown: (event: React.MouseEvent | React.TouchEvent) => void;
|
|
118
|
+
onKeyDown: (event: React.KeyboardEvent) => void;
|
|
119
|
+
setPosition: (newPosition: number) => void;
|
|
120
|
+
hovering: boolean;
|
|
121
|
+
dragging: boolean;
|
|
122
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
import isArray from 'lodash/isArray';
|
|
14
|
+
import React, { forwardRef, memo, useCallback, useMemo } from 'react';
|
|
15
|
+
import { mergeDefaultProps } from "../Util";
|
|
16
|
+
import SpaceItem from "./SpaceItem";
|
|
17
|
+
import { useSpace } from "./useSpace";
|
|
18
|
+
var Space = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
19
|
+
props = mergeDefaultProps({
|
|
20
|
+
direction: 'horizontal',
|
|
21
|
+
prefixCls: 'el-space',
|
|
22
|
+
alignment: 'center',
|
|
23
|
+
justify: '',
|
|
24
|
+
size: 'small',
|
|
25
|
+
fillRatio: 100
|
|
26
|
+
}, props);
|
|
27
|
+
var _props = props,
|
|
28
|
+
direction = _props.direction,
|
|
29
|
+
style = _props.style,
|
|
30
|
+
prefixCls = _props.prefixCls,
|
|
31
|
+
spacer = _props.spacer,
|
|
32
|
+
children = _props.children;
|
|
33
|
+
var _useSpace = useSpace(props),
|
|
34
|
+
classes = _useSpace.classes,
|
|
35
|
+
containerStyle = _useSpace.containerStyle,
|
|
36
|
+
itemStyle = _useSpace.itemStyle;
|
|
37
|
+
|
|
38
|
+
// Extract children and handle fragments
|
|
39
|
+
var extractChildren = useCallback(function (childrenArray) {
|
|
40
|
+
var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
41
|
+
var extractedChildren = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
42
|
+
childrenArray.forEach(function (child, loopKey) {
|
|
43
|
+
if ( /*#__PURE__*/React.isValidElement(child) && child.type === React.Fragment) {
|
|
44
|
+
var _props2;
|
|
45
|
+
// Handle React Fragment
|
|
46
|
+
var fragmentChildren = (_props2 = child.props) === null || _props2 === void 0 ? void 0 : _props2.children;
|
|
47
|
+
if (isArray(fragmentChildren)) {
|
|
48
|
+
fragmentChildren.forEach(function (nested, key) {
|
|
49
|
+
if ( /*#__PURE__*/React.isValidElement(nested) && nested.type === React.Fragment) {
|
|
50
|
+
var _props3;
|
|
51
|
+
var nestedChildren = (_props3 = nested.props) === null || _props3 === void 0 ? void 0 : _props3.children;
|
|
52
|
+
if (isArray(nestedChildren)) {
|
|
53
|
+
extractChildren(nestedChildren, "".concat(parentKey).concat(key, "-"), extractedChildren);
|
|
54
|
+
} else {
|
|
55
|
+
if ( /*#__PURE__*/React.isValidElement(nested) && nested.type === React.Fragment) {
|
|
56
|
+
extractedChildren.push(nested);
|
|
57
|
+
} else {
|
|
58
|
+
extractedChildren.push( /*#__PURE__*/React.createElement(SpaceItem, {
|
|
59
|
+
key: "nested-".concat(parentKey).concat(key),
|
|
60
|
+
style: itemStyle,
|
|
61
|
+
prefixCls: prefixCls
|
|
62
|
+
}, nested));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
extractedChildren.push( /*#__PURE__*/React.createElement(SpaceItem, {
|
|
67
|
+
key: "nested-".concat(parentKey).concat(key),
|
|
68
|
+
style: itemStyle,
|
|
69
|
+
prefixCls: prefixCls
|
|
70
|
+
}, nested));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
} else if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
75
|
+
// Handle valid React elements
|
|
76
|
+
extractedChildren.push( /*#__PURE__*/React.createElement(SpaceItem, {
|
|
77
|
+
key: "LoopKey".concat(parentKey).concat(loopKey),
|
|
78
|
+
style: itemStyle,
|
|
79
|
+
prefixCls: prefixCls
|
|
80
|
+
}, child));
|
|
81
|
+
} else if (child !== null && child !== undefined && child !== false) {
|
|
82
|
+
// Handle text nodes and other valid content
|
|
83
|
+
extractedChildren.push( /*#__PURE__*/React.createElement(SpaceItem, {
|
|
84
|
+
key: "LoopKey".concat(parentKey).concat(loopKey),
|
|
85
|
+
style: itemStyle,
|
|
86
|
+
prefixCls: prefixCls
|
|
87
|
+
}, child));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return extractedChildren;
|
|
91
|
+
}, [itemStyle, prefixCls]);
|
|
92
|
+
var childrenArray = React.Children.toArray(children);
|
|
93
|
+
var extractedChildren = useMemo(function () {
|
|
94
|
+
return extractChildren(childrenArray);
|
|
95
|
+
}, [childrenArray, extractChildren]);
|
|
96
|
+
|
|
97
|
+
// Process children
|
|
98
|
+
if (childrenArray.length === 0) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Add spacers if provided
|
|
103
|
+
if (spacer) {
|
|
104
|
+
var len = extractedChildren.length - 1;
|
|
105
|
+
extractedChildren = extractedChildren.reduce(function (acc, child, idx) {
|
|
106
|
+
var childrenNodes = [].concat(_toConsumableArray(acc), [child]);
|
|
107
|
+
if (idx !== len) {
|
|
108
|
+
childrenNodes.push( /*#__PURE__*/React.createElement("span", {
|
|
109
|
+
key: "spacer-".concat(idx),
|
|
110
|
+
style: _objectSpread(_objectSpread({}, itemStyle), direction === 'vertical' ? {
|
|
111
|
+
width: '100%'
|
|
112
|
+
} : {})
|
|
113
|
+
}, /*#__PURE__*/React.isValidElement(spacer) ? spacer : String(spacer)));
|
|
114
|
+
}
|
|
115
|
+
return childrenNodes;
|
|
116
|
+
}, []);
|
|
117
|
+
}
|
|
118
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
ref: ref,
|
|
120
|
+
className: classes,
|
|
121
|
+
style: _objectSpread(_objectSpread({}, containerStyle), style)
|
|
122
|
+
}, extractedChildren);
|
|
123
|
+
}));
|
|
124
|
+
Space.displayName = 'ElSpace';
|
|
125
|
+
export default Space;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useClassNames } from "../hooks";
|
|
3
|
+
var SpaceItem = function SpaceItem(props) {
|
|
4
|
+
var ns = useClassNames('space');
|
|
5
|
+
var classes = useMemo(function () {
|
|
6
|
+
return "".concat(props.prefixCls || ns.b(), "__item");
|
|
7
|
+
}, [props.prefixCls, ns]);
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: classes,
|
|
10
|
+
style: props.style
|
|
11
|
+
}, props.children);
|
|
12
|
+
};
|
|
13
|
+
SpaceItem.displayName = 'ElSpaceItem';
|
|
14
|
+
export default SpaceItem;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { BaseProps, NativeProps } from '../types/common';
|
|
3
|
+
export interface SpaceProps extends BaseProps, NativeProps {
|
|
4
|
+
/** 排列的方向 */
|
|
5
|
+
direction?: 'horizontal' | 'vertical';
|
|
6
|
+
/** 纵轴对齐方式 */
|
|
7
|
+
alignment?: CSSProperties['alignItems'];
|
|
8
|
+
/** 横轴对齐方式 */
|
|
9
|
+
justify?: CSSProperties['justifyContent'];
|
|
10
|
+
/** 间隔大小 */
|
|
11
|
+
size?: 'small' | 'medium' | 'large' | number | [number, number];
|
|
12
|
+
/** 是否自动折行 */
|
|
13
|
+
wrap?: boolean;
|
|
14
|
+
/** 子元素是否填充父容器 */
|
|
15
|
+
fill?: boolean;
|
|
16
|
+
/** 填充父容器的比例 */
|
|
17
|
+
fillRatio?: number;
|
|
18
|
+
/** 间隔符 */
|
|
19
|
+
spacer?: string | number | React.ReactNode;
|
|
20
|
+
/** 给 space-items 的类名前缀 */
|
|
21
|
+
prefixCls?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SpaceItemProps extends BaseProps, NativeProps {
|
|
24
|
+
/** 给 space-item 的类名前缀 */
|
|
25
|
+
prefixCls?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import isArray from 'lodash/isArray';
|
|
15
|
+
import isNumber from 'lodash/isNumber';
|
|
16
|
+
import React, { useMemo } from 'react';
|
|
17
|
+
import { useClassNames } from "../hooks";
|
|
18
|
+
var SIZE_MAP = {
|
|
19
|
+
small: 8,
|
|
20
|
+
default: 12,
|
|
21
|
+
large: 16
|
|
22
|
+
};
|
|
23
|
+
export var useSpace = function useSpace(props) {
|
|
24
|
+
var ns = useClassNames('space');
|
|
25
|
+
var direction = props.direction,
|
|
26
|
+
alignment = props.alignment,
|
|
27
|
+
justify = props.justify,
|
|
28
|
+
wrap = props.wrap,
|
|
29
|
+
fill = props.fill,
|
|
30
|
+
fillRatio = props.fillRatio,
|
|
31
|
+
size = props.size;
|
|
32
|
+
var _React$useState = React.useState(0),
|
|
33
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
34
|
+
horizontalSize = _React$useState2[0],
|
|
35
|
+
setHorizontalSize = _React$useState2[1];
|
|
36
|
+
var _React$useState3 = React.useState(0),
|
|
37
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
38
|
+
verticalSize = _React$useState4[0],
|
|
39
|
+
setVerticalSize = _React$useState4[1];
|
|
40
|
+
|
|
41
|
+
// Container styles
|
|
42
|
+
var containerStyle = useMemo(function () {
|
|
43
|
+
var wrapKls = wrap || fill ? {
|
|
44
|
+
flexWrap: 'wrap'
|
|
45
|
+
} : {};
|
|
46
|
+
var alignmentKls = {
|
|
47
|
+
alignItems: alignment,
|
|
48
|
+
justifyContent: justify
|
|
49
|
+
};
|
|
50
|
+
var gap = {
|
|
51
|
+
rowGap: "".concat(verticalSize, "px"),
|
|
52
|
+
columnGap: "".concat(horizontalSize, "px")
|
|
53
|
+
};
|
|
54
|
+
return _objectSpread(_objectSpread(_objectSpread({}, wrapKls), alignmentKls), gap);
|
|
55
|
+
}, [wrap, fill, alignment, justify, verticalSize, horizontalSize]);
|
|
56
|
+
|
|
57
|
+
// Item styles
|
|
58
|
+
var itemStyle = useMemo(function () {
|
|
59
|
+
return fill ? {
|
|
60
|
+
flexGrow: 1,
|
|
61
|
+
minWidth: "".concat(fillRatio, "%")
|
|
62
|
+
} : {};
|
|
63
|
+
}, [fill, fillRatio]);
|
|
64
|
+
|
|
65
|
+
// Classes
|
|
66
|
+
var classes = useMemo(function () {
|
|
67
|
+
return classNames(ns.b(), ns.m(props.direction), props.className);
|
|
68
|
+
}, [ns, props.direction, props.className]);
|
|
69
|
+
React.useEffect(function () {
|
|
70
|
+
// when the specified size have been given
|
|
71
|
+
if (isArray(size)) {
|
|
72
|
+
var _size = _slicedToArray(size, 2),
|
|
73
|
+
_size$ = _size[0],
|
|
74
|
+
h = _size$ === void 0 ? 0 : _size$,
|
|
75
|
+
_size$2 = _size[1],
|
|
76
|
+
v = _size$2 === void 0 ? 0 : _size$2;
|
|
77
|
+
setHorizontalSize(h);
|
|
78
|
+
setVerticalSize(v);
|
|
79
|
+
} else {
|
|
80
|
+
var val;
|
|
81
|
+
if (isNumber(size)) {
|
|
82
|
+
val = size;
|
|
83
|
+
} else {
|
|
84
|
+
val = SIZE_MAP[size || 'small'] || SIZE_MAP.small;
|
|
85
|
+
}
|
|
86
|
+
if ((wrap || fill) && direction === 'horizontal') {
|
|
87
|
+
setHorizontalSize(val);
|
|
88
|
+
setVerticalSize(val);
|
|
89
|
+
} else {
|
|
90
|
+
if (direction === 'horizontal') {
|
|
91
|
+
setHorizontalSize(val);
|
|
92
|
+
setVerticalSize(0);
|
|
93
|
+
} else {
|
|
94
|
+
setVerticalSize(val);
|
|
95
|
+
setHorizontalSize(0);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, [direction, fill, props, size, wrap]);
|
|
100
|
+
return {
|
|
101
|
+
classes: classes,
|
|
102
|
+
containerStyle: containerStyle,
|
|
103
|
+
itemStyle: itemStyle
|
|
104
|
+
};
|
|
105
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
2
|
+
var _excluded = ["title", "prefix", "suffix", "value", "formatter", "precision", "decimalSeparator", "groupSeparator", "valueStyle", "className", "style"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import React, { forwardRef, memo, useMemo, useRef } from 'react';
|
|
15
|
+
import { isFunction, isNumber, mergeDefaultProps } from "../Util";
|
|
16
|
+
import { useClassNames } from "../hooks";
|
|
17
|
+
var Statistic = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
18
|
+
props = mergeDefaultProps({
|
|
19
|
+
value: 0,
|
|
20
|
+
decimalSeparator: '.',
|
|
21
|
+
groupSeparator: ',',
|
|
22
|
+
precision: 0
|
|
23
|
+
}, props);
|
|
24
|
+
var _props = props,
|
|
25
|
+
title = _props.title,
|
|
26
|
+
prefix = _props.prefix,
|
|
27
|
+
suffix = _props.suffix,
|
|
28
|
+
value = _props.value,
|
|
29
|
+
formatter = _props.formatter,
|
|
30
|
+
precision = _props.precision,
|
|
31
|
+
decimalSeparator = _props.decimalSeparator,
|
|
32
|
+
groupSeparator = _props.groupSeparator,
|
|
33
|
+
valueStyle = _props.valueStyle,
|
|
34
|
+
className = _props.className,
|
|
35
|
+
style = _props.style,
|
|
36
|
+
rest = _objectWithoutProperties(_props, _excluded);
|
|
37
|
+
var _useClassNames = useClassNames('statistic'),
|
|
38
|
+
b = _useClassNames.b,
|
|
39
|
+
e = _useClassNames.e;
|
|
40
|
+
var containerRef = useRef(null);
|
|
41
|
+
var displayValue = useMemo(function () {
|
|
42
|
+
if (isFunction(formatter)) {
|
|
43
|
+
return formatter(value);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Handle non-numeric values
|
|
47
|
+
if (!isNumber(value) || Number.isNaN(value)) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Format numeric value
|
|
52
|
+
var _String$split = String(value).split('.'),
|
|
53
|
+
_String$split2 = _slicedToArray(_String$split, 2),
|
|
54
|
+
integer = _String$split2[0],
|
|
55
|
+
_String$split2$ = _String$split2[1],
|
|
56
|
+
decimal = _String$split2$ === void 0 ? '' : _String$split2$;
|
|
57
|
+
|
|
58
|
+
// Handle decimal precision
|
|
59
|
+
decimal = decimal.padEnd(precision, '0').slice(0, precision > 0 ? precision : 0);
|
|
60
|
+
|
|
61
|
+
// Add group separators
|
|
62
|
+
integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
63
|
+
|
|
64
|
+
// Join with decimal separator if needed
|
|
65
|
+
return [integer, decimal].join(decimal ? decimalSeparator : '');
|
|
66
|
+
}, [value, formatter, precision, decimalSeparator, groupSeparator]);
|
|
67
|
+
React.useImperativeHandle(ref, function () {
|
|
68
|
+
return {
|
|
69
|
+
ref: containerRef,
|
|
70
|
+
displayValue: displayValue
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
74
|
+
ref: containerRef,
|
|
75
|
+
className: classNames(b(), className),
|
|
76
|
+
style: style
|
|
77
|
+
}, rest), title && /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: e(_templateObject || (_templateObject = _taggedTemplateLiteral(["head"])))
|
|
79
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
className: e(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["content"])))
|
|
81
|
+
}, prefix && /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: e(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["prefix"])))
|
|
83
|
+
}, /*#__PURE__*/React.createElement("span", null, prefix)), /*#__PURE__*/React.createElement("span", {
|
|
84
|
+
className: e(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["number"]))),
|
|
85
|
+
style: valueStyle
|
|
86
|
+
}, displayValue), suffix && /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
className: e(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["suffix"])))
|
|
88
|
+
}, /*#__PURE__*/React.createElement("span", null, suffix))));
|
|
89
|
+
}));
|
|
90
|
+
Statistic.displayName = 'ElStatistic';
|
|
91
|
+
export default Statistic;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Statistic } from "./Statistic";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { BaseProps, NativeProps } from '../types/common';
|
|
3
|
+
export interface StatisticProps extends NativeProps<'--el-statistic-title-font-weight' | '--el-statistic-title-font-size' | '--el-statistic-title-color' | '--el-statistic-content-font-weight' | '--el-statistic-content-font-size' | '--el-statistic-content-color'>, BaseProps {
|
|
4
|
+
/** 数字内容 */
|
|
5
|
+
value?: number | string;
|
|
6
|
+
/** 小数点符号 */
|
|
7
|
+
decimalSeparator?: string;
|
|
8
|
+
/** 自定义数字格式化 */
|
|
9
|
+
formatter?: (value: number | string) => ReactNode;
|
|
10
|
+
/** 千分位标识符 */
|
|
11
|
+
groupSeparator?: string;
|
|
12
|
+
/** 数字精度 */
|
|
13
|
+
precision?: number;
|
|
14
|
+
/** 前缀内容 */
|
|
15
|
+
prefix?: string | ReactNode;
|
|
16
|
+
/** 后缀内容 */
|
|
17
|
+
suffix?: string | ReactNode;
|
|
18
|
+
/** 数字标题 */
|
|
19
|
+
title?: string | ReactNode;
|
|
20
|
+
/** 数字样式 */
|
|
21
|
+
valueStyle?: CSSProperties;
|
|
22
|
+
}
|
|
23
|
+
export interface StatisticRef {
|
|
24
|
+
/** 数字统计 html 元素 */
|
|
25
|
+
ref: RefObject<HTMLDivElement>;
|
|
26
|
+
/** 当前显示值 */
|
|
27
|
+
displayValue: ReactNode;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|