@qsxy/element-plus-react 1.0.3 → 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/typings.d.ts +1 -1
- 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/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 -13
- package/dist/Cascader/useCascader.js +120 -27
- 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/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 +139 -149
- 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 +122 -100
- 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 +84 -29
- package/dist/Input/index.d.ts +1 -0
- package/dist/Input/index.js +2 -1
- package/dist/Input/typings.d.ts +3 -25
- package/dist/InputNumber/InputNumber.js +74 -23
- package/dist/InputNumber/typings.d.ts +0 -4
- package/dist/Menu/Menu.js +1 -1
- package/dist/Menu/typings.d.ts +3 -13
- package/dist/Message/index.js +5 -3
- package/dist/MessageBox/MessageBox.js +29 -33
- package/dist/MessageBox/typings.d.ts +0 -1
- 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/SelectCore.js +52 -9
- package/dist/Select/typings.d.ts +13 -8
- package/dist/Select/useSelect.d.ts +23 -9
- package/dist/Select/useSelect.js +55 -8
- 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.js +9 -12
- package/dist/Space/useSpace.js +2 -1
- package/dist/Statistic/Statistic.js +1 -2
- 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/typings.d.ts +0 -1
- package/dist/Table/Table.js +14 -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 +26 -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/TableV2/src/constants.js +22 -0
- 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/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/Tree.js +1 -0
- package/dist/Tree/model/tree-store.js +4 -4
- package/dist/Tree/typings.d.ts +3 -1
- package/dist/TreeSelect/typings.d.ts +1 -1
- package/dist/TreeSelect/useSelect.d.ts +38 -85
- package/dist/TreeSelect/useSelect.js +1 -1
- package/dist/TreeSelect/useTree.d.ts +47 -52
- package/dist/TreeSelect/useTree.js +2 -2
- package/dist/Upload/UploadContent.js +1 -1
- package/dist/Upload/typings.d.ts +1 -1
- package/dist/Util/PopupManager.js +1 -1
- package/dist/Util/aria.d.ts +1 -1
- package/dist/Util/base.d.ts +33 -8
- package/dist/Util/base.js +44 -16
- 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/hooks/index.d.ts +1 -0
- 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/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 +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +33 -12
- package/dist/index.js +17 -6
- 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 -115
- package/theme-chalk/anchor-link.scss +45 -0
- package/theme-chalk/anchor.scss +93 -0
- 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/cascader-panel.scss +57 -82
- package/theme-chalk/cascader.scss +206 -160
- package/theme-chalk/checkbox.scss +4 -0
- package/theme-chalk/collapse-item.scss +72 -0
- package/theme-chalk/collapse.scss +21 -76
- package/theme-chalk/common/popup.scss +47 -0
- package/theme-chalk/common/var.scss +62 -6
- package/theme-chalk/dialog.scss +145 -137
- package/theme-chalk/drawer.scss +252 -247
- package/theme-chalk/form-item.scss +437 -0
- package/theme-chalk/form.scss +23 -361
- package/theme-chalk/index.scss +17 -1
- package/theme-chalk/input/input.scss +19 -0
- package/theme-chalk/input-number.scss +179 -192
- package/theme-chalk/message-box.scss +160 -133
- package/theme-chalk/message.scss +104 -104
- package/theme-chalk/mixins/mixins.scss +148 -151
- package/theme-chalk/notification.scss +109 -109
- package/theme-chalk/overlay.scss +17 -0
- package/theme-chalk/page-header.scss +60 -0
- package/theme-chalk/popper.scss +1 -1
- package/theme-chalk/radio.scss +3 -3
- package/theme-chalk/segmented.scss +186 -0
- package/theme-chalk/slider.scss +212 -0
- package/theme-chalk/space.scss +20 -20
- package/theme-chalk/statistic.scss +35 -35
- package/theme-chalk/step.scss +320 -0
- package/theme-chalk/steps.scss +22 -0
- package/theme-chalk/table-v2.scss +237 -0
- package/theme-chalk/table.scss +461 -482
- 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/tree-select.scss +41 -41
- package/theme-chalk/virtual-list.scss +40 -0
- 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/input-number.bak +0 -172
- package/theme-chalk/link.scss--bak +0 -99
- package/theme-chalk/notification.bak +0 -156
- 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
- /package/dist/TreeSelect/{utils.d.ts → Utils.d.ts} +0 -0
- /package/dist/TreeSelect/{utils.js → Utils.js} +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
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
|
+
var _templateObject;
|
|
2
3
|
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
4
|
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
5
|
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
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
7
|
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); }
|
|
8
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
7
9
|
import classNames from 'classnames';
|
|
8
10
|
import React from 'react';
|
|
9
11
|
import { useClassNames } from "../hooks";
|
|
10
12
|
var DrawerFooter = function DrawerFooter(props) {
|
|
11
13
|
var _props$classPrefix = props.classPrefix,
|
|
12
|
-
classPrefix = _props$classPrefix === void 0 ? 'drawer
|
|
14
|
+
classPrefix = _props$classPrefix === void 0 ? 'drawer' : _props$classPrefix;
|
|
13
15
|
var _useClassNames = useClassNames(classPrefix),
|
|
14
|
-
|
|
16
|
+
e = _useClassNames.e;
|
|
15
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className: classNames(
|
|
17
|
-
style: _objectSpread(
|
|
18
|
-
maxHeight: 260
|
|
19
|
-
})
|
|
18
|
+
className: classNames(e(_templateObject || (_templateObject = _taggedTemplateLiteral(["footer"]))), props.className),
|
|
19
|
+
style: _objectSpread({}, props.style)
|
|
20
20
|
}, props.children);
|
|
21
21
|
};
|
|
22
|
-
DrawerFooter.displayName = '
|
|
22
|
+
DrawerFooter.displayName = 'ElDrawerFooter';
|
|
23
23
|
export default DrawerFooter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import React, { useContext } from 'react';
|
|
@@ -7,27 +7,30 @@ import { useClassNames } from "../hooks";
|
|
|
7
7
|
import { DrawerContext } from "./DrawerContext";
|
|
8
8
|
var DrawerHeader = function DrawerHeader(props) {
|
|
9
9
|
var _props$showClose = props.showClose,
|
|
10
|
-
|
|
10
|
+
showClose = _props$showClose === void 0 ? true : _props$showClose,
|
|
11
11
|
_props$classPrefix = props.classPrefix,
|
|
12
12
|
classPrefix = _props$classPrefix === void 0 ? 'drawer' : _props$classPrefix,
|
|
13
13
|
border = props.border;
|
|
14
14
|
var _useClassNames = useClassNames(classPrefix),
|
|
15
15
|
b = _useClassNames.b,
|
|
16
|
+
e = _useClassNames.e,
|
|
16
17
|
is = _useClassNames.is;
|
|
17
18
|
var _useContext = useContext(DrawerContext),
|
|
18
19
|
doClose = _useContext.doClose;
|
|
19
|
-
return /*#__PURE__*/React.createElement("
|
|
20
|
-
className: classNames(
|
|
20
|
+
return /*#__PURE__*/React.createElement("header", {
|
|
21
|
+
className: classNames(e(_templateObject || (_templateObject = _taggedTemplateLiteral(["header"]))), props.className, is({
|
|
21
22
|
border: border
|
|
22
23
|
})),
|
|
23
24
|
style: props.style
|
|
24
|
-
}, /*#__PURE__*/React.createElement("
|
|
25
|
-
className:
|
|
25
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
26
|
+
className: e(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["title"]))),
|
|
26
27
|
style: props.titleStyle
|
|
27
|
-
}, props.children),
|
|
28
|
-
className:
|
|
28
|
+
}, props.children), showClose && /*#__PURE__*/React.createElement("button", {
|
|
29
|
+
className: e(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["close-btn"]))),
|
|
30
|
+
type: "button",
|
|
29
31
|
onClick: doClose
|
|
30
32
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
33
|
+
className: e(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["close"]))),
|
|
31
34
|
name: 'xmark'
|
|
32
35
|
})));
|
|
33
36
|
};
|
package/dist/Drawer/typings.d.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnimationEventProps, BaseProps, NativeProps } from '../types/common';
|
|
3
|
-
export interface DrawerProps extends AnimationEventProps, BaseProps, NativeProps<'--el-drawer-
|
|
3
|
+
export interface DrawerProps extends AnimationEventProps, BaseProps, NativeProps<'--el-drawer-margin-top' | '--el-drawer-bg-color' | '--el-drawer-box-shadow' | '--el-drawer-title-font-size' | '--el-drawer-content-font-size' | '--el-drawer-font-line-height' | '--el-drawer-padding-primary' | '--el-drawer-border-radius'> {
|
|
4
4
|
/** 是否显示抽屉(可控) */
|
|
5
5
|
visible?: boolean;
|
|
6
|
-
/** 默认是否显示抽屉 */
|
|
7
|
-
defaultVisible?: boolean;
|
|
8
6
|
/** 当设置为 true,Drawer 打开时会显示背景,点击背景会关闭 Drawer,如果不想关闭 Drawer,可以设置为 'static' */
|
|
9
7
|
modal?: boolean;
|
|
8
|
+
/** 是否允许穿透遮罩层。 modal 属性必须为 false */
|
|
9
|
+
modalPenetrable?: boolean;
|
|
10
10
|
/** 是否可以通过点击 modal 关闭 Drawer */
|
|
11
11
|
closeOnClickModal?: boolean;
|
|
12
12
|
/** 是否在 Drawer 出现时将 body 滚动锁定 */
|
|
13
13
|
lockScroll?: boolean;
|
|
14
14
|
/** 应用于 backdrop DOM 节点的 css class */
|
|
15
|
-
|
|
15
|
+
modalClass?: string;
|
|
16
|
+
/** header 部分的自定义 class 名 */
|
|
17
|
+
headerClass?: string;
|
|
18
|
+
/** body 部分的自定义 class 名 */
|
|
19
|
+
bodyClass?: string;
|
|
20
|
+
/** footer 部分的自定义 class 名 */
|
|
21
|
+
footerClass?: string;
|
|
16
22
|
/** Drawer 对话框 Drawer 的标题 */
|
|
17
23
|
title?: string | React.ReactElement;
|
|
24
|
+
/** Drawer 对话框 Drawer 的底部操作按钮 */
|
|
25
|
+
footer?: React.ReactNode;
|
|
18
26
|
/** 控制是否显示 header 栏, 默认为 true, 当此项为 false 时, title 属性不生效 */
|
|
19
27
|
withHeader?: boolean;
|
|
20
28
|
/** 当设置为 true, 显示关闭按钮 */
|
|
@@ -24,7 +32,15 @@ export interface DrawerProps extends AnimationEventProps, BaseProps, NativeProps
|
|
|
24
32
|
/** 设置 Drawer 尺寸 */
|
|
25
33
|
size?: number | string;
|
|
26
34
|
/** 设置 Drawer 显示的位置 */
|
|
27
|
-
direction?: '
|
|
35
|
+
direction?: 'rtl' | 'ltr' | 'ttb' | 'btt';
|
|
36
|
+
/** 和原生的 CSS 的 z-index 相同,改变 z 轴的顺序 */
|
|
37
|
+
zIndex?: number;
|
|
38
|
+
/** dialog 打开的延时时间,单位毫秒 */
|
|
39
|
+
openDelay?: number;
|
|
40
|
+
/** dialog 关闭的延时时间,单位毫秒 */
|
|
41
|
+
closeDelay?: number;
|
|
42
|
+
/** 控制是否在关闭 Drawer 之后将子元素全部销毁 */
|
|
43
|
+
destroyOnClose?: boolean;
|
|
28
44
|
/** Drawer 打开的回调 */
|
|
29
45
|
onOpen?: () => void;
|
|
30
46
|
/** Drawer 打开动画结束时的回调 */
|
|
@@ -34,7 +50,7 @@ export interface DrawerProps extends AnimationEventProps, BaseProps, NativeProps
|
|
|
34
50
|
/** Drawer 关闭动画结束时的回调 */
|
|
35
51
|
onClosed?: () => void;
|
|
36
52
|
/** 关闭弹窗函数 */
|
|
37
|
-
|
|
53
|
+
onCloseDrawer?: () => void;
|
|
38
54
|
/** 关闭前的回调,会暂停 Drawer 的关闭. 回调函数内执行 done 参数方法的时候才是真正关闭对话框的时候. */
|
|
39
55
|
beforeClose?: DrawerBeforeCloseFn;
|
|
40
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _templateObject;
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
2
2
|
var _excluded = ["menu", "classPrefix", "showTimeout", "hideTimeout", "offset", "trigger", "hideOnClick", "onClick", "onVisiblechange", "onEnter", "onMouseEnter", "onMouseLeave", "disabled"];
|
|
3
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
4
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
@@ -53,7 +53,8 @@ var Dropdown = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
53
53
|
tooltipEvents = _partitionHTMLProps2[0];
|
|
54
54
|
var _useClassNames = useClassNames(classPrefix),
|
|
55
55
|
b = _useClassNames.b,
|
|
56
|
-
e = _useClassNames.e
|
|
56
|
+
e = _useClassNames.e,
|
|
57
|
+
is = _useClassNames.is;
|
|
57
58
|
var containerRef = useRef(null);
|
|
58
59
|
|
|
59
60
|
/** 显示 */
|
|
@@ -81,9 +82,10 @@ var Dropdown = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
81
82
|
}, tooltipEvents), /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
82
83
|
classPrefix: classPrefix,
|
|
83
84
|
triggerRef: props.children,
|
|
84
|
-
popperClass: e(_templateObject || (_templateObject = _taggedTemplateLiteral(["popper"]))),
|
|
85
|
+
popperClass: classNames(e(_templateObject || (_templateObject = _taggedTemplateLiteral(["popper"]))), is(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["pure"])))),
|
|
85
86
|
disabled: disabled,
|
|
86
87
|
enterable: true,
|
|
88
|
+
hideOnClick: hideOnClick,
|
|
87
89
|
effect: "light",
|
|
88
90
|
offset: offset,
|
|
89
91
|
showAfter: showTimeout,
|
|
@@ -3,7 +3,7 @@ import { PopperOptions } from '../Popper';
|
|
|
3
3
|
import { TransitionProps } from '../Transition';
|
|
4
4
|
import { AnimationEventProps, BaseProps, NativeProps } from '../types/common';
|
|
5
5
|
/** Dropdown 属性 */
|
|
6
|
-
export interface DropdownProps extends BaseProps<React.ReactElement>, NativeProps
|
|
6
|
+
export interface DropdownProps extends BaseProps<React.ReactElement>, NativeProps<'--el-dropdown-menu-box-shadow-light' | '--el-dropdown-menuItem-hover-fill' | '--el-dropdown-menuItem-hover-color'>, PopperOptions, AnimationEventProps, Omit<TransitionProps, 'children'> {
|
|
7
7
|
menu: React.ReactElement<DropdownMenuProps>;
|
|
8
8
|
/** 触发下拉的行为 */
|
|
9
9
|
trigger?: 'hover' | 'click' | 'contextmenu';
|
|
@@ -19,6 +19,7 @@ export interface DropdownProps extends BaseProps<React.ReactElement>, NativeProp
|
|
|
19
19
|
defaultVisible?: boolean;
|
|
20
20
|
/** 是否禁用 */
|
|
21
21
|
disabled?: boolean;
|
|
22
|
+
/** [popper.js](https://popper.js.org/docs/v2/) 参数 */
|
|
22
23
|
onMouseEnter?: (e?: React.MouseEvent<any>) => void;
|
|
23
24
|
onMouseLeave?: (e?: React.MouseEvent<any>) => void;
|
|
24
25
|
/** 点击菜单项触发的事件回调 */
|
package/dist/Empty/Empty.js
CHANGED
|
@@ -2,13 +2,25 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { useConfigProvider } from "../ConfigProvider/ConfigProviderContext";
|
|
5
7
|
import { useClassNames } from "../hooks";
|
|
8
|
+
import { mergeDefaultProps } from "../Util";
|
|
6
9
|
import ImgEmpty from "./ImgEmpty";
|
|
7
10
|
var Empty = function Empty(props) {
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
var _useConfigProvider = useConfigProvider(),
|
|
12
|
+
locale = _useConfigProvider.locale;
|
|
13
|
+
var _useTranslation = useTranslation(),
|
|
14
|
+
t = _useTranslation.t;
|
|
15
|
+
props = mergeDefaultProps({
|
|
16
|
+
description: t('el.tree.emptyText', {
|
|
17
|
+
lng: locale
|
|
18
|
+
})
|
|
19
|
+
}, props);
|
|
20
|
+
var _props = props,
|
|
21
|
+
image = _props.image,
|
|
22
|
+
imageSize = _props.imageSize,
|
|
23
|
+
description = _props.description;
|
|
12
24
|
var _useClassNames = useClassNames('empty'),
|
|
13
25
|
b = _useClassNames.b,
|
|
14
26
|
e = _useClassNames.e;
|
package/dist/Form/Form.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { FormInstance, FormProps, Store } from './typings';
|
|
6
|
-
import useForm from './useForm';
|
|
7
|
-
import useWatch from './useWatch';
|
|
8
|
-
declare const ForwardForm: <RecordType = Store>(props: FormProps<RecordType> & {
|
|
9
|
-
ref?: ForwardedRef<FormInstance<RecordType>>;
|
|
10
|
-
}) => React.ReactElement;
|
|
11
|
-
type InternalFormType = typeof ForwardForm;
|
|
12
|
-
interface FormInterface extends InternalFormType {
|
|
13
|
-
displayName?: string;
|
|
14
|
-
FormProvider: typeof FormProvider;
|
|
15
|
-
Item: typeof Field;
|
|
16
|
-
List: typeof List;
|
|
17
|
-
useForm: typeof useForm;
|
|
18
|
-
useWatch: typeof useWatch;
|
|
19
|
-
}
|
|
20
|
-
declare const Form: FormInterface;
|
|
21
|
-
export default Form;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormInstance, FormProps } from './typings';
|
|
3
|
+
declare const ForwardForm: React.MemoExoticComponent<React.ForwardRefExoticComponent<FormProps<unknown> & React.RefAttributes<FormInstance<unknown>>>>;
|
|
4
|
+
export default ForwardForm;
|
package/dist/Form/Form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
var _templateObject;
|
|
3
|
-
var _excluded = ["colon", "inline", "labelPosition", "cols", "flat", "formStyle", "name", "initialValues", "fields", "component", "preserve", "children", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed", "className", "disabled", "labelWidth", "size", "rules", "hideRequiredAsterisk", "requireAsteriskPosition", "showMessage", "scrollToError"];
|
|
3
|
+
var _excluded = ["colon", "inline", "labelPosition", "cols", "flat", "formStyle", "name", "initialValues", "fields", "component", "preserve", "children", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed", "className", "disabled", "labelWidth", "size", "rules", "hideRequiredAsterisk", "requireAsteriskPosition", "showMessage", "scrollToError", "statusIcon"];
|
|
4
4
|
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); }
|
|
5
5
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
6
6
|
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; }
|
|
@@ -8,6 +8,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
8
8
|
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; }
|
|
9
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
10
10
|
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); }
|
|
11
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
|
+
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."); }
|
|
13
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
16
|
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."); }
|
|
13
17
|
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); }
|
|
@@ -18,26 +22,24 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
18
22
|
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; }
|
|
19
23
|
import classNames from 'classnames';
|
|
20
24
|
import omit from 'lodash/omit';
|
|
21
|
-
import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
25
|
+
import React, { forwardRef, memo, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
22
26
|
import { mergeDefaultProps } from "../Util";
|
|
23
27
|
import { useClassNames } from "../hooks";
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import Field from "./FormItem";
|
|
27
|
-
import List from "./List";
|
|
28
|
+
import FormContext from "./FormContext";
|
|
29
|
+
import InternalFormContext, { HOOK_MARK } from "./InternalFormContext";
|
|
28
30
|
import useForm from "./useForm";
|
|
29
|
-
import useWatch from "./useWatch";
|
|
30
31
|
import { isSimilar } from "./utils/valueUtil";
|
|
31
32
|
function InternalForm(props, ref) {
|
|
32
33
|
var _this = this;
|
|
33
34
|
props = mergeDefaultProps({
|
|
34
35
|
inline: false,
|
|
35
36
|
cols: 0,
|
|
36
|
-
labelWidth:
|
|
37
|
+
labelWidth: 'auto',
|
|
37
38
|
labelPosition: 'right',
|
|
38
39
|
validateTrigger: 'onChange',
|
|
39
40
|
showMessage: true,
|
|
40
|
-
requireAsteriskPosition: 'left'
|
|
41
|
+
requireAsteriskPosition: 'left',
|
|
42
|
+
rules: {}
|
|
41
43
|
}, props);
|
|
42
44
|
var _props = props,
|
|
43
45
|
colon = _props.colon,
|
|
@@ -61,15 +63,14 @@ function InternalForm(props, ref) {
|
|
|
61
63
|
onFinishFailed = _props.onFinishFailed,
|
|
62
64
|
className = _props.className,
|
|
63
65
|
disabled = _props.disabled,
|
|
64
|
-
|
|
65
|
-
labelWidth = _props$labelWidth === void 0 ? 120 : _props$labelWidth,
|
|
66
|
+
labelWidth = _props.labelWidth,
|
|
66
67
|
size = _props.size,
|
|
67
|
-
|
|
68
|
-
rules = _props$rules === void 0 ? {} : _props$rules,
|
|
68
|
+
rules = _props.rules,
|
|
69
69
|
hideRequiredAsterisk = _props.hideRequiredAsterisk,
|
|
70
70
|
requireAsteriskPosition = _props.requireAsteriskPosition,
|
|
71
71
|
showMessage = _props.showMessage,
|
|
72
72
|
scrollToError = _props.scrollToError,
|
|
73
|
+
statusIcon = _props.statusIcon,
|
|
73
74
|
restProps = _objectWithoutProperties(_props, _excluded);
|
|
74
75
|
var formContext = useContext(FormContext);
|
|
75
76
|
var _useForm = useForm(props.form),
|
|
@@ -83,8 +84,37 @@ function InternalForm(props, ref) {
|
|
|
83
84
|
setPreserve = _getInternalHooks.setPreserve,
|
|
84
85
|
destroyForm = _getInternalHooks.destroyForm;
|
|
85
86
|
var _useClassNames = useClassNames('form'),
|
|
87
|
+
b = _useClassNames.b,
|
|
86
88
|
m = _useClassNames.m,
|
|
87
89
|
is = _useClassNames.is;
|
|
90
|
+
var _useState = useState(''),
|
|
91
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
92
|
+
autoLabelWidth = _useState2[0],
|
|
93
|
+
setAutoLabelWidth = _useState2[1];
|
|
94
|
+
var labelWidthListRef = useRef([]);
|
|
95
|
+
var registerLabelWidth = useCallback(function (width, oldWidth) {
|
|
96
|
+
var labelWidthList = labelWidthListRef.current;
|
|
97
|
+
if (oldWidth) {
|
|
98
|
+
var index = labelWidthList.indexOf(oldWidth);
|
|
99
|
+
if (index !== -1) {
|
|
100
|
+
labelWidthList.splice(index, 1);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (width) {
|
|
104
|
+
labelWidthList.push(width);
|
|
105
|
+
}
|
|
106
|
+
var maxWidth = Math.max.apply(Math, _toConsumableArray(labelWidthList));
|
|
107
|
+
setAutoLabelWidth(maxWidth ? "".concat(maxWidth, "px") : '');
|
|
108
|
+
}, []);
|
|
109
|
+
var deregisterLabelWidth = useCallback(function (width) {
|
|
110
|
+
var labelWidthList = labelWidthListRef.current;
|
|
111
|
+
var index = labelWidthList.indexOf(width);
|
|
112
|
+
if (index !== -1) {
|
|
113
|
+
labelWidthList.splice(index, 1);
|
|
114
|
+
}
|
|
115
|
+
var maxWidth = Math.max.apply(Math, _toConsumableArray(labelWidthList));
|
|
116
|
+
setAutoLabelWidth(maxWidth ? "".concat(maxWidth, "px") : '');
|
|
117
|
+
}, []);
|
|
88
118
|
useImperativeHandle(ref, function () {
|
|
89
119
|
return formInstance;
|
|
90
120
|
});
|
|
@@ -159,12 +189,16 @@ function InternalForm(props, ref) {
|
|
|
159
189
|
hideRequiredAsterisk: hideRequiredAsterisk,
|
|
160
190
|
requireAsteriskPosition: requireAsteriskPosition,
|
|
161
191
|
showMessage: showMessage,
|
|
162
|
-
scrollToError: scrollToError
|
|
192
|
+
scrollToError: scrollToError,
|
|
193
|
+
autoLabelWidth: autoLabelWidth,
|
|
194
|
+
statusIcon: statusIcon,
|
|
195
|
+
registerLabelWidth: registerLabelWidth,
|
|
196
|
+
deregisterLabelWidth: deregisterLabelWidth
|
|
163
197
|
});
|
|
164
|
-
}, [colon, disabled, formInstance, hideRequiredAsterisk, inline, labelPosition, labelWidth, requireAsteriskPosition, rules, scrollToError, showMessage, size, validateTrigger]);
|
|
198
|
+
}, [autoLabelWidth, colon, deregisterLabelWidth, disabled, formInstance, hideRequiredAsterisk, inline, labelPosition, labelWidth, registerLabelWidth, requireAsteriskPosition, rules, scrollToError, showMessage, size, statusIcon, validateTrigger]);
|
|
165
199
|
|
|
166
200
|
// @ts-ignore
|
|
167
|
-
var wrapperNode = /*#__PURE__*/React.createElement(
|
|
201
|
+
var wrapperNode = /*#__PURE__*/React.createElement(InternalFormContext.Provider, {
|
|
168
202
|
value: formContextValue
|
|
169
203
|
}, childrenNode);
|
|
170
204
|
if (Comp === false) {
|
|
@@ -172,7 +206,7 @@ function InternalForm(props, ref) {
|
|
|
172
206
|
}
|
|
173
207
|
return /*#__PURE__*/React.createElement(Comp, _extends({
|
|
174
208
|
method: "post",
|
|
175
|
-
className: classNames(
|
|
209
|
+
className: classNames(b(), [m(size || 'default')], _defineProperty(_defineProperty(_defineProperty({}, m('inline'), inline), m("label-".concat(labelPosition)), !inline && labelPosition), "".concat(m(_templateObject || (_templateObject = _taggedTemplateLiteral(["col"]))), "-").concat(cols), cols), is({
|
|
176
210
|
flat: flat
|
|
177
211
|
}), className),
|
|
178
212
|
style: formStyle
|
|
@@ -190,11 +224,5 @@ function InternalForm(props, ref) {
|
|
|
190
224
|
}
|
|
191
225
|
}), wrapperNode);
|
|
192
226
|
}
|
|
193
|
-
var ForwardForm = /*#__PURE__*/forwardRef(InternalForm);
|
|
194
|
-
|
|
195
|
-
Form.FormProvider = FormProvider;
|
|
196
|
-
Form.Item = Field;
|
|
197
|
-
Form.List = List;
|
|
198
|
-
Form.useForm = useForm;
|
|
199
|
-
Form.useWatch = useWatch;
|
|
200
|
-
export default Form;
|
|
227
|
+
var ForwardForm = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(InternalForm));
|
|
228
|
+
export default ForwardForm;
|
package/dist/Form/FormItem.d.ts
CHANGED
|
@@ -1,59 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type ShouldUpdate<Values = any> = boolean | ((prevValues: Values, nextValues: Values, info: {
|
|
5
|
-
source?: string;
|
|
6
|
-
}) => boolean);
|
|
7
|
-
interface ChildProps {
|
|
8
|
-
[name: string]: any;
|
|
9
|
-
}
|
|
10
|
-
export interface InternalFieldProps<Values = any> extends Omit<FormItemProps<Values>, 'children'> {
|
|
11
|
-
children?: ComponentChildren | ((control: ChildProps, meta: Meta, form: FormInstance<Values>) => React.ReactElement);
|
|
12
|
-
/**
|
|
13
|
-
* Set up `dependencies` field.
|
|
14
|
-
* When dependencies field update and current field is touched,
|
|
15
|
-
* will trigger validate rules and render.
|
|
16
|
-
*/
|
|
17
|
-
dependencies?: NamePath[];
|
|
18
|
-
getValueFromEvent?: (...args: EventArgs) => StoreValue;
|
|
19
|
-
/** 字段名,支持数组 */
|
|
20
|
-
name?: InternalNamePath;
|
|
21
|
-
normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
|
|
22
|
-
/** 校验规则,设置字段的校验逻辑。点击此处查看示例 */
|
|
23
|
-
rules?: Rule[];
|
|
24
|
-
shouldUpdate?: ShouldUpdate<Values>;
|
|
25
|
-
trigger?: string;
|
|
26
|
-
validateTrigger?: string | string[] | false;
|
|
27
|
-
/** 当某一规则校验不通过时,是否停止剩下的规则的校验。设置 parallel 时会并行校验 */
|
|
28
|
-
validateFirst?: boolean | 'parallel';
|
|
29
|
-
valuePropName?: string;
|
|
30
|
-
getValueProps?: (value: StoreValue) => Record<string, unknown>;
|
|
31
|
-
messageVariables?: Record<string, string>;
|
|
32
|
-
initialValue?: any;
|
|
33
|
-
onReset?: () => void;
|
|
34
|
-
onMetaChange?: (meta: Meta & {
|
|
35
|
-
destroy?: boolean;
|
|
36
|
-
}) => void;
|
|
37
|
-
preserve?: boolean;
|
|
38
|
-
/** @private Passed by Form.List props. Do not use since it will break by path check. */
|
|
39
|
-
isListField?: boolean;
|
|
40
|
-
/** @private Passed by Form.List props. Do not use since it will break by path check. */
|
|
41
|
-
isList?: boolean;
|
|
42
|
-
/** @private Pass context as prop instead of context api
|
|
43
|
-
* since class component can not get context in constructor */
|
|
44
|
-
fieldContext?: InternalFormInstance;
|
|
45
|
-
}
|
|
46
|
-
export interface FieldProps<Values = any> extends Omit<InternalFieldProps<Values>, 'name' | 'fieldContext'> {
|
|
2
|
+
import type { InternalFormItemProps, NamePath } from './typings';
|
|
3
|
+
export interface FieldProps<Values = any> extends Omit<InternalFormItemProps<Values>, 'name' | 'fieldContext'> {
|
|
47
4
|
name?: NamePath;
|
|
48
5
|
}
|
|
49
6
|
export interface FieldState {
|
|
50
7
|
resetCount: number;
|
|
51
8
|
}
|
|
52
|
-
declare function
|
|
53
|
-
|
|
54
|
-
interface FormItemInterface extends InternalFormItemType {
|
|
55
|
-
displayName?: string;
|
|
56
|
-
defaultProps?: Partial<FieldProps<any>>;
|
|
57
|
-
}
|
|
58
|
-
declare const FormItem: FormItemInterface;
|
|
9
|
+
declare function Field(props: FieldProps): React.JSX.Element;
|
|
10
|
+
declare const FormItem: React.MemoExoticComponent<typeof Field>;
|
|
59
11
|
export default FormItem;
|