@qsxy/element-plus-react 1.0.0-next.1 → 1.0.0-next.10
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/README.md +95 -0
- package/dist/Avatar/Avatar.d.ts +4 -0
- package/dist/Avatar/Avatar.js +86 -0
- package/dist/Avatar/index.d.ts +2 -0
- package/dist/{VirtualList → Avatar}/index.js +7 -7
- package/dist/Avatar/typings.d.ts +21 -0
- package/dist/{VirtualList/interface.js → Avatar/typings.js} +3 -3
- package/dist/Badge/Badge.js +4 -5
- package/dist/Badge/typings.d.ts +10 -0
- package/dist/Breadcrumb/Breadcrumb.js +1 -4
- package/dist/Breadcrumb/typings.d.ts +4 -0
- package/dist/Button/Button.d.ts +0 -1
- package/dist/Button/Button.js +21 -9
- package/dist/Button/typings.d.ts +28 -0
- package/dist/Calendar/Calendar.js +1 -2
- package/dist/Calendar/CalendarContext.d.ts +10 -0
- package/dist/Calendar/Footer.js +1 -2
- package/dist/Calendar/Header.js +3 -8
- package/dist/Calendar/ShortCuts.d.ts +2 -0
- package/dist/Calendar/typings.d.ts +18 -0
- package/dist/Card/typings.d.ts +4 -0
- package/dist/Carousel/Carousel.d.ts +4 -0
- package/dist/Carousel/Carousel.js +168 -0
- package/dist/Carousel/CarouselContext.d.ts +4 -0
- package/dist/{VirtualList/Item.js → Carousel/CarouselContext.js} +29 -14
- package/dist/Carousel/CarouselItem.d.ts +4 -0
- package/dist/Carousel/CarouselItem.js +75 -0
- package/dist/Carousel/hooks/useCarousel.d.ts +37 -0
- package/dist/Carousel/hooks/useCarousel.js +348 -0
- package/dist/Carousel/hooks/useCarouselItem.d.ts +8 -0
- package/dist/Carousel/hooks/useCarouselItem.js +161 -0
- package/dist/Carousel/index.d.ts +3 -0
- package/dist/Carousel/index.js +42 -0
- package/dist/Carousel/typings.d.ts +83 -0
- package/dist/{VirtualList/utils/findDOMNode.js → Carousel/typings.js} +3 -16
- package/dist/Cascader/Cascader.js +148 -182
- package/dist/Cascader/CascaderContext.d.ts +4 -10
- package/dist/Cascader/CascaderContext.js +2 -6
- package/dist/Cascader/CascaderDropdown.d.ts +1 -0
- package/dist/Cascader/CascaderDropdown.js +1 -1
- package/dist/Cascader/CascaderMenu.js +4 -77
- package/dist/Cascader/Utils.d.ts +0 -2
- package/dist/Cascader/Utils.js +0 -44
- package/dist/Cascader/index.d.ts +1 -1
- package/dist/Cascader/typings.d.ts +76 -12
- package/dist/Cascader/useCascader.d.ts +61 -3
- package/dist/Cascader/useCascader.js +14 -41
- package/dist/Checkbox/Checkbox.js +2 -6
- package/dist/Checkbox/CheckboxButton.js +2 -6
- package/dist/Checkbox/typings.d.ts +11 -0
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +4 -0
- package/dist/CheckboxGroup/CheckboxGroupContext.d.ts +1 -0
- package/dist/Col/Col.js +1 -8
- package/dist/Col/typings.d.ts +10 -0
- package/dist/Collapse/CollapseContext.d.ts +3 -0
- package/dist/Collapse/CollapseItem.js +10 -8
- package/dist/Collapse/CollapseTransition.d.ts +7 -6
- package/dist/Collapse/CollapseTransition.js +49 -31
- package/dist/Collapse/typings.d.ts +7 -0
- package/dist/ColorPicker/AlphaSlider.d.ts +7 -0
- package/dist/ColorPicker/AlphaSlider.js +0 -1
- package/dist/ColorPicker/ColorPicker.js +0 -1
- package/dist/ColorPicker/HueSlider.d.ts +7 -0
- package/dist/ColorPicker/HueSlider.js +0 -1
- package/dist/ColorPicker/Predefine.d.ts +7 -0
- package/dist/ColorPicker/Predefine.js +0 -1
- package/dist/ColorPicker/SvPanel.d.ts +7 -0
- package/dist/ColorPicker/SvPanel.js +0 -1
- package/dist/ColorPicker/typings.d.ts +9 -0
- package/dist/ConfigProvider/ConfigProvider.d.ts +5 -0
- package/dist/DatePicker/DatePicker.js +25 -14
- package/dist/DatePicker/DateRangePicker.js +11 -10
- package/dist/DatePicker/typings.d.ts +69 -0
- package/dist/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +13 -11
- package/dist/DateTimePicker/typings.d.ts +1 -0
- package/dist/Descriptions/Descriptions.js +1 -5
- package/dist/Descriptions/DescriptionsContext.d.ts +2 -0
- package/dist/Descriptions/typings.d.ts +13 -0
- package/dist/Dialog/Dialog.d.ts +0 -1
- package/dist/Dialog/Dialog.js +5 -8
- package/dist/Dialog/DialogBody.js +0 -3
- package/dist/Dialog/DialogContext.d.ts +8 -0
- package/dist/Dialog/DialogHeader.js +1 -4
- package/dist/Dialog/typings.d.ts +38 -2
- package/dist/Divider/Divider.d.ts +4 -0
- package/dist/Divider/Divider.js +1 -6
- package/dist/Drawer/Drawer.js +28 -14
- package/dist/Drawer/DrawerBody.js +1 -4
- package/dist/Drawer/DrawerContext.d.ts +10 -0
- package/dist/Drawer/DrawerHeader.js +1 -4
- package/dist/Drawer/typings.d.ts +16 -0
- package/dist/Dropdown/Dropdown.js +12 -8
- package/dist/Dropdown/DropdownContext.d.ts +2 -0
- package/dist/Dropdown/typings.d.ts +16 -1
- package/dist/Empty/Empty.js +1 -4
- package/dist/Empty/ImgEmpty.js +1 -1
- package/dist/Form/Form.js +10 -6
- package/dist/Form/FormItem.d.ts +12 -0
- package/dist/Form/FormItem.js +3 -1
- package/dist/Form/typings.d.ts +55 -0
- package/dist/Form/useForm.d.ts +22 -0
- package/dist/Form/utils/NameMap.d.ts +3 -0
- package/dist/Form/utils/classUtil.js +2 -2
- package/dist/Form/utils/validateUtil.d.ts +4 -0
- package/dist/Form/utils/valueUtil.d.ts +17 -0
- package/dist/Icon/Icon.js +1 -4
- package/dist/Icon/typings.d.ts +7 -0
- package/dist/Input/Input.js +18 -10
- package/dist/Input/InputRange.js +14 -11
- package/dist/Input/TextArea.js +8 -4
- package/dist/Input/typings.d.ts +61 -0
- package/dist/InputNumber/InputNumber.js +10 -7
- package/dist/InputNumber/typings.d.ts +21 -0
- package/dist/Link/Link.js +1 -4
- package/dist/Link/typings.d.ts +6 -1
- package/dist/Loading/Loading.js +17 -9
- package/dist/Loading/typings.d.ts +5 -0
- package/dist/Message/Main.d.ts +7 -0
- package/dist/Message/Message.js +11 -8
- package/dist/Message/index.d.ts +8 -0
- package/dist/Message/typings.d.ts +11 -0
- package/dist/MessageBox/Main.js +3 -1
- package/dist/MessageBox/MessageBox.js +1 -1
- package/dist/MessageBox/index.d.ts +17 -3
- package/dist/MessageBox/index.js +1 -1
- package/dist/MessageBox/typings.d.ts +50 -0
- package/dist/Notification/Main.d.ts +7 -0
- package/dist/Notification/Notification.js +17 -14
- package/dist/Notification/index.d.ts +15 -0
- package/dist/Notification/typings.d.ts +13 -0
- package/dist/Pagination/Pagination.js +15 -11
- package/dist/Pagination/typings.d.ts +28 -0
- package/dist/Popconfirm/Popconfirm.js +14 -10
- package/dist/Popconfirm/typings.d.ts +12 -1
- package/dist/Popover/Popover.js +13 -9
- package/dist/Popover/typings.d.ts +13 -1
- package/dist/Popper/Popper.js +22 -18
- package/dist/Popper/typings.d.ts +7 -1
- package/dist/Progress/Progress.js +13 -9
- package/dist/Progress/typings.d.ts +12 -0
- package/dist/Radio/typings.d.ts +7 -0
- package/dist/RadioGroup/typings.d.ts +1 -0
- package/dist/Row/Row.js +8 -5
- package/dist/Row/RowContext.d.ts +1 -0
- package/dist/Row/typings.d.ts +4 -0
- package/dist/Scrollbar/Scrollbar.js +13 -9
- package/dist/Scrollbar/Thumb.js +1 -1
- package/dist/Scrollbar/typings.d.ts +20 -0
- package/dist/Select/SelectCore.js +17 -14
- package/dist/Select/typings.d.ts +33 -0
- package/dist/Skeleton/PlaceholderGraph.d.ts +4 -0
- package/dist/Skeleton/PlaceholderGrid.d.ts +4 -0
- package/dist/Skeleton/PlaceholderGrid.js +0 -4
- package/dist/Skeleton/PlaceholderParagraph.d.ts +4 -0
- package/dist/Skeleton/PlaceholderParagraph.js +0 -4
- package/dist/Switch/Switch.js +13 -10
- package/dist/Switch/typings.d.ts +15 -0
- package/dist/Table/Colgroup.d.ts +1 -0
- package/dist/Table/Table.js +13 -9
- package/dist/Table/TableBody.js +10 -41
- package/dist/Table/TableCell.js +0 -5
- package/dist/Table/TableColumn.js +0 -4
- package/dist/Table/TableContext.d.ts +8 -0
- package/dist/Table/hooks/useSelection.d.ts +10 -0
- package/dist/Table/hooks/useTable.d.ts +7 -0
- package/dist/Table/treeUtil.d.ts +39 -0
- package/dist/Table/typings.d.ts +137 -1
- package/dist/Table/util.d.ts +10 -0
- package/dist/Table/util.js +2 -2
- package/dist/Tabs/Tabs.js +2 -5
- package/dist/Tabs/typings.d.ts +38 -0
- package/dist/Tag/Tag.d.ts +1 -1
- package/dist/Tag/Tag.js +7 -8
- package/dist/Tag/typings.d.ts +10 -0
- package/dist/TimeLine/TimeLineItem.js +7 -4
- package/dist/TimeLine/typings.d.ts +9 -0
- package/dist/TimePicker/TimePicker.js +16 -12
- package/dist/TimePicker/TimePickerRange.js +15 -12
- package/dist/TimePicker/TimeSpinnerPanel.js +3 -5
- package/dist/TimePicker/typings.d.ts +13 -0
- package/dist/TimePicker/useTimePicker.d.ts +7 -0
- package/dist/Tooltip/Tooltip.js +8 -15
- package/dist/Tooltip/TooltipContext.d.ts +1 -0
- package/dist/Tooltip/typings.d.ts +14 -1
- package/dist/Transfer/List.js +12 -8
- package/dist/Transfer/ListItem.d.ts +1 -0
- package/dist/Transfer/Transfer.js +11 -7
- package/dist/Transfer/typings/index.d.ts +27 -0
- package/dist/Transfer/typings/list.d.ts +25 -0
- package/dist/Transfer/typings/listBody.d.ts +1 -0
- package/dist/Transition/Transition.d.ts +16 -3
- package/dist/Transition/Transition.js +6 -4
- package/dist/Transition/TransitionGroup.d.ts +59 -0
- package/dist/Transition/childMapping.d.ts +23 -0
- package/dist/Tree/DirectoryTree.d.ts +6 -13
- package/dist/Tree/DirectoryTree.js +32 -81
- package/dist/Tree/DropIndicator.d.ts +4 -2
- package/dist/Tree/DropIndicator.js +7 -2
- package/dist/Tree/Indent.d.ts +2 -2
- package/dist/Tree/Indent.js +4 -4
- package/dist/Tree/MotionTreeNode.d.ts +4 -5
- package/dist/Tree/MotionTreeNode.js +69 -52
- package/dist/Tree/NodeList.d.ts +18 -11
- package/dist/Tree/NodeList.js +38 -29
- package/dist/Tree/RCTree.d.ts +92 -75
- package/dist/Tree/RCTree.js +199 -188
- package/dist/Tree/Tree.d.ts +18 -3
- package/dist/Tree/Tree.js +27 -27
- package/dist/Tree/TreeNode.d.ts +5 -83
- package/dist/Tree/TreeNode.js +320 -425
- package/dist/Tree/contextTypes.d.ts +40 -30
- package/dist/Tree/contextTypes.js +17 -4
- package/dist/Tree/index.d.ts +2 -2
- package/dist/Tree/typings.d.ts +63 -19
- package/dist/Tree/typings.js +1 -13
- package/dist/Tree/typings.tsx--bak +245 -0
- package/dist/Tree/useUnmount.d.ts +5 -0
- package/dist/{VirtualList/hooks/useChildren.js → Tree/useUnmount.js} +24 -16
- package/dist/Tree/util.d.ts +31 -18
- package/dist/Tree/util.js +21 -52
- package/dist/Tree/utils/conductUtil.d.ts +8 -2
- package/dist/Tree/utils/conductUtil.js +14 -3
- package/dist/Tree/utils/dictUtil.d.ts +8 -3
- package/dist/Tree/utils/dictUtil.js +49 -32
- package/dist/Tree/utils/diffUtil.d.ts +4 -3
- package/dist/Tree/utils/keyUtil.d.ts +2 -0
- package/dist/{VirtualList/utils/isFirefox.js → Tree/utils/keyUtil.js} +8 -7
- package/dist/Tree/utils/motion.js +6 -5
- package/dist/Tree/utils/pickAttrs.d.ts +5 -0
- package/dist/Tree/utils/treeUtil.d.ts +40 -18
- package/dist/Tree/utils/treeUtil.js +35 -14
- package/dist/TreeSelect/TreeSelect.js +14 -13
- package/dist/TreeSelect/Utils.d.ts +2 -1
- package/dist/TreeSelect/typings.d.ts +19 -0
- package/dist/Upload/Upload.js +9 -8
- package/dist/Upload/UploadList.js +2 -1
- package/dist/Upload/typings.d.ts +34 -0
- package/dist/Upload/use-handlers.d.ts +1 -0
- package/dist/Upload/use-handlers.js +1 -1
- package/dist/Util/Math.d.ts +34 -0
- package/dist/Util/base.d.ts +22 -0
- package/dist/Util/base.js +17 -0
- package/dist/Util/shallowEqual.d.ts +11 -0
- package/dist/Util/treeUtils.d.ts +8 -0
- package/dist/fonts/fa-brands-400.ttf +0 -0
- package/dist/fonts/fa-brands-400.woff2 +0 -0
- package/dist/fonts/fa-duotone-900.ttf +0 -0
- package/dist/fonts/fa-duotone-900.woff2 +0 -0
- package/dist/fonts/fa-light-300.ttf +0 -0
- package/dist/fonts/fa-light-300.woff2 +0 -0
- package/dist/fonts/fa-regular-400.ttf +0 -0
- package/dist/fonts/fa-regular-400.woff2 +0 -0
- package/dist/fonts/fa-solid-900.ttf +0 -0
- package/dist/fonts/fa-solid-900.woff2 +0 -0
- package/dist/fonts/fa-thin-100.ttf +0 -0
- package/dist/fonts/fa-thin-100.woff2 +0 -0
- package/dist/fonts/fa-v4compatibility.ttf +0 -0
- package/dist/fonts/fa-v4compatibility.woff2 +0 -0
- package/dist/hooks/animationPropsUtils.d.ts +12 -0
- package/dist/hooks/htmlPropsUtils.d.ts +8 -0
- package/dist/hooks/popperPropsUtils.d.ts +12 -0
- package/dist/hooks/prefix.d.ts +1 -1
- package/dist/hooks/prefix.js +4 -4
- package/dist/hooks/treePropsUtils.d.ts +12 -0
- package/dist/hooks/useChildrenInstance.d.ts +11 -0
- package/dist/hooks/useClassNames.d.ts +79 -0
- package/dist/hooks/useClassNames.js +12 -2
- package/dist/hooks/useControlled.d.ts +8 -0
- package/dist/hooks/useForceUpdate.d.ts +1 -0
- package/dist/index.css +1029 -1290
- package/dist/index.d.ts +8 -5
- package/dist/index.js +8 -5
- package/dist/theme-chalk/avatar/index.scss +50 -0
- package/dist/theme-chalk/build.scss +2 -0
- package/dist/theme-chalk/calendar/month-table.scss +1 -1
- package/dist/theme-chalk/carousel/index.scss +237 -0
- package/dist/theme-chalk/checkbox/index.scss +2 -2
- package/dist/theme-chalk/common/_var.scss +1 -0
- package/dist/theme-chalk/dev.scss +2 -0
- package/dist/theme-chalk/doc.scss +2 -0
- package/dist/theme-chalk/fonts/fa-brands-400.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-brands-400.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-duotone-900.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-duotone-900.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-light-300.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-light-300.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-regular-400.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-regular-400.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-solid-900.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-solid-900.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-thin-100.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-thin-100.woff2 +0 -0
- package/dist/theme-chalk/fonts/fa-v4compatibility.ttf +0 -0
- package/dist/theme-chalk/fonts/fa-v4compatibility.woff2 +0 -0
- package/dist/theme-chalk/icon/fonts.scss +9 -0
- package/dist/theme-chalk/icon/index.scss +0 -9
- package/dist/theme-chalk/icon/scss/_shims.scss +318 -318
- package/dist/theme-chalk/icon/scss/_variables.scss +1 -3
- package/dist/theme-chalk/icon/scss/brands.scss +0 -5
- package/dist/theme-chalk/icon/scss/duotone.scss +0 -5
- package/dist/theme-chalk/icon/scss/fontawesome.scss +0 -8
- package/dist/theme-chalk/icon/scss/light.scss +2 -7
- package/dist/theme-chalk/icon/scss/regular.scss +2 -7
- package/dist/theme-chalk/icon/scss/solid.scss +2 -7
- package/dist/theme-chalk/icon/scss/thin.scss +2 -7
- package/dist/theme-chalk/icon/scss/v4-shims.scss +0 -8
- package/dist/theme-chalk/index.scss +3 -0
- package/dist/theme-chalk/input/input.scss +5 -3
- package/dist/theme-chalk/link/index.scss +0 -85
- package/dist/theme-chalk/loading/index.scss +5 -7
- package/dist/theme-chalk/message/index.scss +5 -5
- package/dist/theme-chalk/notification/index.scss +5 -5
- package/dist/theme-chalk/pagination/index.scss +1 -1
- package/dist/theme-chalk/tabs/index.scss +1 -1
- package/dist/types/common.d.ts +24 -0
- package/dist/types/type.d.ts +5 -0
- package/package.json +4 -24
- package/theme-chalk/avatar/index.scss +50 -0
- package/theme-chalk/badge/index.scss +63 -0
- package/theme-chalk/breadcrumb/index.scss +65 -0
- package/theme-chalk/build.scss +2 -0
- package/{dist/theme-chalk/bak/mixins/_button.scss → theme-chalk/button/_mixins.scss} +151 -58
- package/theme-chalk/button/button-group.scss +83 -0
- package/theme-chalk/button/button.scss +382 -0
- package/theme-chalk/button/index.scss +2 -0
- package/theme-chalk/calendar/date-picker.scss +112 -0
- package/theme-chalk/calendar/date-range-picker.scss +139 -0
- package/theme-chalk/calendar/date-table.scss +156 -0
- package/theme-chalk/calendar/index.scss +6 -0
- package/theme-chalk/calendar/month-table.scss +92 -0
- package/theme-chalk/calendar/picker-panel.scss +136 -0
- package/theme-chalk/calendar/year-table.scss +107 -0
- package/theme-chalk/card/index.scss +44 -0
- package/theme-chalk/carousel/index.scss +237 -0
- package/theme-chalk/cascader/cascader-panel.scss +184 -0
- package/theme-chalk/cascader/cascader.scss +239 -0
- package/theme-chalk/cascader/index.scss +2 -0
- package/theme-chalk/checkbox/index.scss +255 -0
- package/theme-chalk/checkbox-button/index.scss +117 -0
- package/theme-chalk/checkbox-group/index.scss +33 -0
- package/{dist/theme-chalk/bak/mixins/_col.scss → theme-chalk/col/_mixins.scss} +27 -3
- package/theme-chalk/col/index.scss +50 -0
- package/theme-chalk/collapse/index.scss +84 -0
- package/theme-chalk/color-picker/index.scss +340 -0
- package/{dist/theme-chalk/bak/mixins/config.scss → theme-chalk/common/_var.scss} +1 -0
- package/theme-chalk/common/index.scss +222 -0
- package/theme-chalk/common/index.ts +1 -0
- package/theme-chalk/date-picker/index.scss +253 -0
- package/theme-chalk/date-time-picker/index.scss +3 -0
- package/theme-chalk/date-time-picker/time-picker.scss +83 -0
- package/theme-chalk/date-time-picker/time-range-picker.scss +32 -0
- package/theme-chalk/descriptions/descriptions-item.scss +66 -0
- package/theme-chalk/descriptions/descriptions.scss +160 -0
- package/theme-chalk/descriptions/index.scss +2 -0
- package/theme-chalk/dev.scss +2 -0
- package/theme-chalk/dialog/index.scss +190 -0
- package/theme-chalk/divider/index.scss +51 -0
- package/theme-chalk/doc.scss +2 -0
- package/theme-chalk/drawer/index.scss +250 -0
- package/theme-chalk/dropdown/index.scss +147 -0
- package/theme-chalk/empty/index.scss +69 -0
- package/theme-chalk/fonts/fa-brands-400.ttf +0 -0
- package/theme-chalk/fonts/fa-brands-400.woff2 +0 -0
- package/theme-chalk/fonts/fa-duotone-900.ttf +0 -0
- package/theme-chalk/fonts/fa-duotone-900.woff2 +0 -0
- package/theme-chalk/fonts/fa-light-300.ttf +0 -0
- package/theme-chalk/fonts/fa-light-300.woff2 +0 -0
- package/theme-chalk/fonts/fa-regular-400.ttf +0 -0
- package/theme-chalk/fonts/fa-regular-400.woff2 +0 -0
- package/theme-chalk/fonts/fa-solid-900.ttf +0 -0
- package/theme-chalk/fonts/fa-solid-900.woff2 +0 -0
- package/theme-chalk/fonts/fa-thin-100.ttf +0 -0
- package/theme-chalk/fonts/fa-thin-100.woff2 +0 -0
- package/theme-chalk/fonts/fa-v4compatibility.ttf +0 -0
- package/theme-chalk/fonts/fa-v4compatibility.woff2 +0 -0
- package/theme-chalk/form/index.scss +359 -0
- package/theme-chalk/icon/fonts.scss +9 -0
- package/theme-chalk/icon/index.scss +44 -0
- package/theme-chalk/icon/scss/_animated.scss +205 -0
- package/theme-chalk/icon/scss/_bordered-pulled.scss +20 -0
- package/theme-chalk/icon/scss/_core.scss +33 -0
- package/theme-chalk/icon/scss/_duotone-icons.scss +12 -0
- package/theme-chalk/icon/scss/_fixed-width.scss +7 -0
- package/theme-chalk/icon/scss/_functions.scss +57 -0
- package/theme-chalk/icon/scss/_icons.scss +11 -0
- package/theme-chalk/icon/scss/_list.scss +20 -0
- package/theme-chalk/icon/scss/_mixins.scss +102 -0
- package/theme-chalk/icon/scss/_rotated-flipped.scss +31 -0
- package/theme-chalk/icon/scss/_screen-reader.scss +14 -0
- package/theme-chalk/icon/scss/_shims.scss +2606 -0
- package/theme-chalk/icon/scss/_sizing.scss +16 -0
- package/theme-chalk/icon/scss/_stacked.scss +32 -0
- package/theme-chalk/icon/scss/_variables.scss +9189 -0
- package/theme-chalk/icon/scss/brands.scss +27 -0
- package/theme-chalk/icon/scss/duotone.scss +72 -0
- package/theme-chalk/icon/scss/fontawesome.scss +13 -0
- package/theme-chalk/icon/scss/index.scss +15 -0
- package/theme-chalk/icon/scss/light.scss +21 -0
- package/theme-chalk/icon/scss/regular.scss +21 -0
- package/theme-chalk/icon/scss/solid.scss +21 -0
- package/theme-chalk/icon/scss/thin.scss +21 -0
- package/theme-chalk/icon/scss/v4-shims.scss +3 -0
- package/theme-chalk/index.scss +67 -0
- package/theme-chalk/input/_mixins.scss +16 -0
- package/theme-chalk/input/index.scss +3 -0
- package/theme-chalk/input/input-range.scss +208 -0
- package/theme-chalk/input/input.scss +577 -0
- package/theme-chalk/input-number/index.scss +172 -0
- package/theme-chalk/link/index.scss +99 -0
- package/theme-chalk/loading/index.scss +94 -0
- package/theme-chalk/message/index.scss +169 -0
- package/theme-chalk/message-box/index.scss +184 -0
- package/theme-chalk/notification/index.scss +155 -0
- package/theme-chalk/pagination/index.scss +515 -0
- package/theme-chalk/placeholder/index.scss +135 -0
- package/theme-chalk/popconfirm/index.scss +35 -0
- package/theme-chalk/popover/index.scss +54 -0
- package/theme-chalk/popper/index.scss +86 -0
- package/theme-chalk/progress/index.scss +155 -0
- package/theme-chalk/radio/index.scss +2 -0
- package/theme-chalk/radio/radio-button.scss +128 -0
- package/theme-chalk/radio/radio.scss +171 -0
- package/theme-chalk/radio-group/index.scss +31 -0
- package/theme-chalk/row/index.scss +30 -0
- package/theme-chalk/scrollbar/index.scss +103 -0
- package/theme-chalk/select/index.scss +244 -0
- package/theme-chalk/select/option-group.scss +54 -0
- package/theme-chalk/select/option.scss +63 -0
- package/theme-chalk/select/select-dropdown.scss +57 -0
- package/theme-chalk/switch/index.scss +273 -0
- package/theme-chalk/table/index.scss +714 -0
- package/theme-chalk/tabs/index.scss +620 -0
- package/theme-chalk/tag/index.scss +360 -0
- package/theme-chalk/time-line/_timeline-item.scss +90 -0
- package/theme-chalk/time-line/_timeline.scss +50 -0
- package/theme-chalk/time-line/index.scss +2 -0
- package/theme-chalk/time-picker/index.scss +109 -0
- package/theme-chalk/tooltip/index.scss +13 -0
- package/theme-chalk/transfer/index.scss +247 -0
- package/theme-chalk/transition/index.scss +756 -0
- package/theme-chalk/tree/_directory.scss +73 -0
- package/theme-chalk/tree/_tree.scss +401 -0
- package/theme-chalk/tree/index.scss +2 -0
- package/theme-chalk/tree-select/index.scss +25 -0
- package/theme-chalk/upload/index.scss +631 -0
- package/dist/Tree/utils/KeyCode.d.ts +0 -110
- package/dist/Tree/utils/KeyCode.js +0 -550
- package/dist/VirtualList/Filler.d.ts +0 -11
- package/dist/VirtualList/Filler.js +0 -78
- package/dist/VirtualList/Item.d.ts +0 -7
- package/dist/VirtualList/ScrollBar.d.ts +0 -43
- package/dist/VirtualList/ScrollBar.js +0 -216
- package/dist/VirtualList/VirtualList.d.ts +0 -33
- package/dist/VirtualList/VirtualList.js +0 -280
- package/dist/VirtualList/hooks/useChildren.d.ts +0 -3
- package/dist/VirtualList/hooks/useDiffItem.d.ts +0 -2
- package/dist/VirtualList/hooks/useDiffItem.js +0 -39
- package/dist/VirtualList/hooks/useFrameWheel.d.ts +0 -6
- package/dist/VirtualList/hooks/useFrameWheel.js +0 -72
- package/dist/VirtualList/hooks/useHeights.d.ts +0 -3
- package/dist/VirtualList/hooks/useHeights.js +0 -83
- package/dist/VirtualList/hooks/useLayoutEffect.d.ts +0 -3
- package/dist/VirtualList/hooks/useLayoutEffect.js +0 -30
- package/dist/VirtualList/hooks/useMobileTouchMove.d.ts +0 -2
- package/dist/VirtualList/hooks/useMobileTouchMove.js +0 -92
- package/dist/VirtualList/hooks/useOriginScroll.d.ts +0 -2
- package/dist/VirtualList/hooks/useOriginScroll.js +0 -56
- package/dist/VirtualList/hooks/useScrollTo.d.ts +0 -5
- package/dist/VirtualList/hooks/useScrollTo.js +0 -111
- package/dist/VirtualList/index.d.ts +0 -2
- package/dist/VirtualList/interface.d.ts +0 -8
- package/dist/VirtualList/mock.d.ts +0 -6
- package/dist/VirtualList/mock.js +0 -29
- package/dist/VirtualList/utils/CacheMap.d.ts +0 -7
- package/dist/VirtualList/utils/CacheMap.js +0 -36
- package/dist/VirtualList/utils/algorithmUtil.d.ts +0 -6
- package/dist/VirtualList/utils/algorithmUtil.js +0 -81
- package/dist/VirtualList/utils/findDOMNode.d.ts +0 -2
- package/dist/VirtualList/utils/isFirefox.d.ts +0 -2
- package/dist/VirtualList/utils/raf.d.ts +0 -5
- package/dist/VirtualList/utils/raf.js +0 -57
- package/dist/theme-chalk/bak/common/popup.scss +0 -47
- package/dist/theme-chalk/bak/common/transition.scss +0 -118
- package/dist/theme-chalk/bak/common/var.scss +0 -1476
- package/dist/theme-chalk/bak/mixins/_var.scss +0 -55
- package/dist/theme-chalk/bak/mixins/function.scss +0 -85
- package/dist/theme-chalk/bak/mixins/mixins.scss +0 -215
- package/dist/theme-chalk/bak/mixins/utils.scss +0 -39
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/VirtualList/hooks/useHeights.tsx
|
|
30
|
-
var useHeights_exports = {};
|
|
31
|
-
__export(useHeights_exports, {
|
|
32
|
-
default: () => useHeights
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(useHeights_exports);
|
|
35
|
-
var import_react = require("react");
|
|
36
|
-
var import_CacheMap = __toESM(require("../utils/CacheMap"));
|
|
37
|
-
var import_findDOMNode = __toESM(require("../utils/findDOMNode"));
|
|
38
|
-
var import_raf = __toESM(require("../utils/raf"));
|
|
39
|
-
function useHeights(getKey, onItemAdd, onItemRemove) {
|
|
40
|
-
const [updatedMark, setUpdatedMark] = (0, import_react.useState)(0);
|
|
41
|
-
const instanceRef = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
42
|
-
const heightsRef = (0, import_react.useRef)(new import_CacheMap.default());
|
|
43
|
-
const collectRafRef = (0, import_react.useRef)();
|
|
44
|
-
function cancelRaf() {
|
|
45
|
-
import_raf.default.cancel(collectRafRef.current);
|
|
46
|
-
}
|
|
47
|
-
function collectHeight() {
|
|
48
|
-
cancelRaf();
|
|
49
|
-
collectRafRef.current = (0, import_raf.default)(() => {
|
|
50
|
-
instanceRef.current.forEach((element, key) => {
|
|
51
|
-
if (element && element.offsetParent) {
|
|
52
|
-
const htmlElement = (0, import_findDOMNode.default)(element);
|
|
53
|
-
const { offsetHeight } = htmlElement;
|
|
54
|
-
if (heightsRef.current.get(key) !== offsetHeight) {
|
|
55
|
-
heightsRef.current.set(key, htmlElement.offsetHeight);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
setUpdatedMark((c) => c + 1);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function setInstanceRef(item, instance) {
|
|
63
|
-
const key = getKey(item);
|
|
64
|
-
const origin = instanceRef.current.get(key);
|
|
65
|
-
if (instance) {
|
|
66
|
-
instanceRef.current.set(key, instance);
|
|
67
|
-
collectHeight();
|
|
68
|
-
} else {
|
|
69
|
-
instanceRef.current.delete(key);
|
|
70
|
-
}
|
|
71
|
-
if (!origin !== !instance) {
|
|
72
|
-
if (instance) {
|
|
73
|
-
onItemAdd == null ? void 0 : onItemAdd(item);
|
|
74
|
-
} else {
|
|
75
|
-
onItemRemove == null ? void 0 : onItemRemove(item);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
(0, import_react.useEffect)(() => {
|
|
80
|
-
return cancelRaf;
|
|
81
|
-
}, []);
|
|
82
|
-
return [setInstanceRef, collectHeight, heightsRef.current, updatedMark];
|
|
83
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/VirtualList/hooks/useLayoutEffect.ts
|
|
20
|
-
var useLayoutEffect_exports = {};
|
|
21
|
-
__export(useLayoutEffect_exports, {
|
|
22
|
-
default: () => useLayoutEffect_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(useLayoutEffect_exports);
|
|
25
|
-
var import_react = require("react");
|
|
26
|
-
function canUseDom() {
|
|
27
|
-
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
28
|
-
}
|
|
29
|
-
var useLayoutEffect = canUseDom() ? import_react.useLayoutEffect : import_react.useEffect;
|
|
30
|
-
var useLayoutEffect_default = useLayoutEffect;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/VirtualList/hooks/useMobileTouchMove.ts
|
|
30
|
-
var useMobileTouchMove_exports = {};
|
|
31
|
-
__export(useMobileTouchMove_exports, {
|
|
32
|
-
default: () => useMobileTouchMove
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(useMobileTouchMove_exports);
|
|
35
|
-
var import_react = require("react");
|
|
36
|
-
var import_useLayoutEffect = __toESM(require("./useLayoutEffect"));
|
|
37
|
-
var SMOOTH_PTG = 14 / 15;
|
|
38
|
-
function useMobileTouchMove(inVirtual, listRef, callback) {
|
|
39
|
-
const touchedRef = (0, import_react.useRef)(false);
|
|
40
|
-
const touchYRef = (0, import_react.useRef)(0);
|
|
41
|
-
const elementRef = (0, import_react.useRef)(null);
|
|
42
|
-
const intervalRef = (0, import_react.useRef)(null);
|
|
43
|
-
let cleanUpEvents;
|
|
44
|
-
const onTouchMove = (e) => {
|
|
45
|
-
if (touchedRef.current) {
|
|
46
|
-
const currentY = Math.ceil(e.touches[0].pageY);
|
|
47
|
-
let offsetY = touchYRef.current - currentY;
|
|
48
|
-
touchYRef.current = currentY;
|
|
49
|
-
if (callback(offsetY)) {
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
}
|
|
52
|
-
clearInterval(intervalRef.current);
|
|
53
|
-
intervalRef.current = setInterval(() => {
|
|
54
|
-
offsetY *= SMOOTH_PTG;
|
|
55
|
-
if (!callback(offsetY, true) || Math.abs(offsetY) <= 0.1) {
|
|
56
|
-
clearInterval(intervalRef.current);
|
|
57
|
-
}
|
|
58
|
-
}, 16);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const onTouchEnd = () => {
|
|
62
|
-
touchedRef.current = false;
|
|
63
|
-
cleanUpEvents();
|
|
64
|
-
};
|
|
65
|
-
const onTouchStart = (e) => {
|
|
66
|
-
cleanUpEvents();
|
|
67
|
-
if (e.touches.length === 1 && !touchedRef.current) {
|
|
68
|
-
touchedRef.current = true;
|
|
69
|
-
touchYRef.current = Math.ceil(e.touches[0].pageY);
|
|
70
|
-
elementRef.current = e.target;
|
|
71
|
-
elementRef.current.addEventListener("touchmove", onTouchMove);
|
|
72
|
-
elementRef.current.addEventListener("touchend", onTouchEnd);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
cleanUpEvents = () => {
|
|
76
|
-
if (elementRef.current) {
|
|
77
|
-
elementRef.current.removeEventListener("touchmove", onTouchMove);
|
|
78
|
-
elementRef.current.removeEventListener("touchend", onTouchEnd);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
(0, import_useLayoutEffect.default)(() => {
|
|
82
|
-
if (inVirtual) {
|
|
83
|
-
listRef.current.addEventListener("touchstart", onTouchStart);
|
|
84
|
-
}
|
|
85
|
-
return () => {
|
|
86
|
-
var _a;
|
|
87
|
-
(_a = listRef.current) == null ? void 0 : _a.removeEventListener("touchstart", onTouchStart);
|
|
88
|
-
cleanUpEvents();
|
|
89
|
-
clearInterval(intervalRef.current);
|
|
90
|
-
};
|
|
91
|
-
}, [inVirtual]);
|
|
92
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/VirtualList/hooks/useOriginScroll.ts
|
|
20
|
-
var useOriginScroll_exports = {};
|
|
21
|
-
__export(useOriginScroll_exports, {
|
|
22
|
-
default: () => useOriginScroll_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(useOriginScroll_exports);
|
|
25
|
-
var import_react = require("react");
|
|
26
|
-
var useOriginScroll_default = (isScrollAtTop, isScrollAtBottom) => {
|
|
27
|
-
const lockRef = (0, import_react.useRef)(false);
|
|
28
|
-
const lockTimeoutRef = (0, import_react.useRef)(null);
|
|
29
|
-
function lockScroll() {
|
|
30
|
-
clearTimeout(lockTimeoutRef.current);
|
|
31
|
-
lockRef.current = true;
|
|
32
|
-
lockTimeoutRef.current = setTimeout(() => {
|
|
33
|
-
lockRef.current = false;
|
|
34
|
-
}, 50);
|
|
35
|
-
}
|
|
36
|
-
const scrollPingRef = (0, import_react.useRef)({
|
|
37
|
-
top: isScrollAtTop,
|
|
38
|
-
bottom: isScrollAtBottom
|
|
39
|
-
});
|
|
40
|
-
scrollPingRef.current.top = isScrollAtTop;
|
|
41
|
-
scrollPingRef.current.bottom = isScrollAtBottom;
|
|
42
|
-
return (deltaY, smoothOffset = false) => {
|
|
43
|
-
const originScroll = (
|
|
44
|
-
// Pass origin wheel when on the top
|
|
45
|
-
deltaY < 0 && scrollPingRef.current.top || // Pass origin wheel when on the bottom
|
|
46
|
-
deltaY > 0 && scrollPingRef.current.bottom
|
|
47
|
-
);
|
|
48
|
-
if (smoothOffset && originScroll) {
|
|
49
|
-
clearTimeout(lockTimeoutRef.current);
|
|
50
|
-
lockRef.current = false;
|
|
51
|
-
} else if (!originScroll || lockRef.current) {
|
|
52
|
-
lockScroll();
|
|
53
|
-
}
|
|
54
|
-
return !lockRef.current && originScroll;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import type { ScrollTo } from '../VirtualList';
|
|
3
|
-
import type { GetKey } from '../interface';
|
|
4
|
-
import type CacheMap from '../utils/CacheMap';
|
|
5
|
-
export default function useScrollTo<T>(containerRef: RefObject<HTMLDivElement>, data: T[], heights: CacheMap, itemHeight: number, getKey: GetKey<T>, collectHeight: () => void, syncScrollTop: (newTop: number) => void, triggerFlash: () => void): ScrollTo;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/VirtualList/hooks/useScrollTo.tsx
|
|
30
|
-
var useScrollTo_exports = {};
|
|
31
|
-
__export(useScrollTo_exports, {
|
|
32
|
-
default: () => useScrollTo
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(useScrollTo_exports);
|
|
35
|
-
var import_react = require("react");
|
|
36
|
-
var import_raf = __toESM(require("../utils/raf"));
|
|
37
|
-
function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHeight, syncScrollTop, triggerFlash) {
|
|
38
|
-
const scrollRef = (0, import_react.useRef)();
|
|
39
|
-
return (arg) => {
|
|
40
|
-
if (arg === null || arg === void 0) {
|
|
41
|
-
triggerFlash();
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
import_raf.default.cancel(scrollRef.current);
|
|
45
|
-
if (typeof arg === "number") {
|
|
46
|
-
syncScrollTop(arg);
|
|
47
|
-
} else if (arg && typeof arg === "object") {
|
|
48
|
-
let index;
|
|
49
|
-
const { align } = arg;
|
|
50
|
-
if ("index" in arg) {
|
|
51
|
-
({ index } = arg);
|
|
52
|
-
} else {
|
|
53
|
-
index = data.findIndex((item) => getKey(item) === arg.key);
|
|
54
|
-
}
|
|
55
|
-
const { offset = 0 } = arg;
|
|
56
|
-
const syncScroll = (times, targetAlign) => {
|
|
57
|
-
if (times < 0 || !containerRef.current) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const height = containerRef.current.clientHeight;
|
|
61
|
-
let needCollectHeight = false;
|
|
62
|
-
let newTargetAlign = targetAlign;
|
|
63
|
-
if (height) {
|
|
64
|
-
const mergedAlign = targetAlign || align;
|
|
65
|
-
let stackTop = 0;
|
|
66
|
-
let itemTop = 0;
|
|
67
|
-
let itemBottom = 0;
|
|
68
|
-
const maxLen = Math.min(data.length, index);
|
|
69
|
-
for (let i = 0; i <= maxLen; i += 1) {
|
|
70
|
-
const key = getKey(data[i]);
|
|
71
|
-
itemTop = stackTop;
|
|
72
|
-
const cacheHeight = heights.get(key);
|
|
73
|
-
itemBottom = itemTop + (cacheHeight === void 0 ? itemHeight : cacheHeight);
|
|
74
|
-
stackTop = itemBottom;
|
|
75
|
-
if (i === index && cacheHeight === void 0) {
|
|
76
|
-
needCollectHeight = true;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
let targetTop = null;
|
|
80
|
-
switch (mergedAlign) {
|
|
81
|
-
case "top":
|
|
82
|
-
targetTop = itemTop - offset;
|
|
83
|
-
break;
|
|
84
|
-
case "bottom":
|
|
85
|
-
targetTop = itemBottom - height + offset;
|
|
86
|
-
break;
|
|
87
|
-
default: {
|
|
88
|
-
const { scrollTop } = containerRef.current;
|
|
89
|
-
const scrollBottom = scrollTop + height;
|
|
90
|
-
if (itemTop < scrollTop) {
|
|
91
|
-
newTargetAlign = "top";
|
|
92
|
-
} else if (itemBottom > scrollBottom) {
|
|
93
|
-
newTargetAlign = "bottom";
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (targetTop !== null && targetTop !== containerRef.current.scrollTop) {
|
|
98
|
-
syncScrollTop(targetTop);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
scrollRef.current = (0, import_raf.default)(() => {
|
|
102
|
-
if (needCollectHeight) {
|
|
103
|
-
collectHeight();
|
|
104
|
-
}
|
|
105
|
-
syncScroll(times - 1, newTargetAlign);
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
syncScroll(3);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React, { Key } from 'react';
|
|
2
|
-
export type RenderFunc<T> = (item: T, index: number, props: {
|
|
3
|
-
style?: React.CSSProperties;
|
|
4
|
-
}) => React.ReactElement;
|
|
5
|
-
export interface SharedConfig<T> {
|
|
6
|
-
getKey: (item: T) => Key;
|
|
7
|
-
}
|
|
8
|
-
export type GetKey<T> = (item: T) => Key;
|
package/dist/VirtualList/mock.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/VirtualList/mock.tsx
|
|
20
|
-
var mock_exports = {};
|
|
21
|
-
__export(mock_exports, {
|
|
22
|
-
default: () => mock_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(mock_exports);
|
|
25
|
-
var import_react = require("react");
|
|
26
|
-
var import_VirtualList = require("./VirtualList");
|
|
27
|
-
var List = (0, import_react.forwardRef)((props, ref) => (0, import_VirtualList.RawList)({ ...props, virtual: false }, ref));
|
|
28
|
-
List.displayName = "List";
|
|
29
|
-
var mock_default = List;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/VirtualList/utils/CacheMap.ts
|
|
20
|
-
var CacheMap_exports = {};
|
|
21
|
-
__export(CacheMap_exports, {
|
|
22
|
-
default: () => CacheMap_default
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(CacheMap_exports);
|
|
25
|
-
var CacheMap = class {
|
|
26
|
-
constructor() {
|
|
27
|
-
this.maps = /* @__PURE__ */ Object.create(null);
|
|
28
|
-
}
|
|
29
|
-
set(key, value) {
|
|
30
|
-
this.maps[key] = value;
|
|
31
|
-
}
|
|
32
|
-
get(key) {
|
|
33
|
-
return this.maps[key];
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var CacheMap_default = CacheMap;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Key } from 'react';
|
|
2
|
-
export declare function getIndexByStartLoc(min: number, max: number, start: number, index: number): number;
|
|
3
|
-
export declare function findListDiffIndex<T>(originList: T[], targetList: T[], getKey: (item: T) => Key): {
|
|
4
|
-
index: number;
|
|
5
|
-
multiple: boolean;
|
|
6
|
-
} | null;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/VirtualList/utils/algorithmUtil.ts
|
|
20
|
-
var algorithmUtil_exports = {};
|
|
21
|
-
__export(algorithmUtil_exports, {
|
|
22
|
-
findListDiffIndex: () => findListDiffIndex,
|
|
23
|
-
getIndexByStartLoc: () => getIndexByStartLoc
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(algorithmUtil_exports);
|
|
26
|
-
function getIndexByStartLoc(min, max, start, index) {
|
|
27
|
-
const beforeCount = start - min;
|
|
28
|
-
const afterCount = max - start;
|
|
29
|
-
const balanceCount = Math.min(beforeCount, afterCount) * 2;
|
|
30
|
-
if (index <= balanceCount) {
|
|
31
|
-
const stepIndex = Math.floor(index / 2);
|
|
32
|
-
if (index % 2) {
|
|
33
|
-
return start + stepIndex + 1;
|
|
34
|
-
}
|
|
35
|
-
return start - stepIndex;
|
|
36
|
-
}
|
|
37
|
-
if (beforeCount > afterCount) {
|
|
38
|
-
return start - (index - afterCount);
|
|
39
|
-
}
|
|
40
|
-
return start + (index - beforeCount);
|
|
41
|
-
}
|
|
42
|
-
function findListDiffIndex(originList, targetList, getKey) {
|
|
43
|
-
const originLen = originList.length;
|
|
44
|
-
const targetLen = targetList.length;
|
|
45
|
-
let shortList;
|
|
46
|
-
let longList;
|
|
47
|
-
if (originLen === 0 && targetLen === 0) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
if (originLen < targetLen) {
|
|
51
|
-
shortList = originList;
|
|
52
|
-
longList = targetList;
|
|
53
|
-
} else {
|
|
54
|
-
shortList = targetList;
|
|
55
|
-
longList = originList;
|
|
56
|
-
}
|
|
57
|
-
const notExistKey = { __EMPTY_ITEM__: true };
|
|
58
|
-
function getItemKey(item) {
|
|
59
|
-
if (item !== void 0) {
|
|
60
|
-
return getKey(item);
|
|
61
|
-
}
|
|
62
|
-
return notExistKey;
|
|
63
|
-
}
|
|
64
|
-
let diffIndex = null;
|
|
65
|
-
let multiple = Math.abs(originLen - targetLen) !== 1;
|
|
66
|
-
for (let i = 0; i < longList.length; i += 1) {
|
|
67
|
-
const shortKey = getItemKey(shortList[i]);
|
|
68
|
-
const longKey = getItemKey(longList[i]);
|
|
69
|
-
if (shortKey !== longKey) {
|
|
70
|
-
diffIndex = i;
|
|
71
|
-
multiple = multiple || shortKey !== getItemKey(longList[i + 1]);
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return diffIndex === null ? null : { index: diffIndex, multiple };
|
|
76
|
-
}
|
|
77
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
-
0 && (module.exports = {
|
|
79
|
-
findListDiffIndex,
|
|
80
|
-
getIndexByStartLoc
|
|
81
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/VirtualList/utils/raf.ts
|
|
20
|
-
var raf_exports = {};
|
|
21
|
-
__export(raf_exports, {
|
|
22
|
-
default: () => wrapperRaf
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(raf_exports);
|
|
25
|
-
var raf = (callback) => +setTimeout(callback, 16);
|
|
26
|
-
var caf = (num) => clearTimeout(num);
|
|
27
|
-
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
|
|
28
|
-
raf = (callback) => window.requestAnimationFrame(callback);
|
|
29
|
-
caf = (handle) => window.cancelAnimationFrame(handle);
|
|
30
|
-
}
|
|
31
|
-
var rafUUID = 0;
|
|
32
|
-
var rafIds = /* @__PURE__ */ new Map();
|
|
33
|
-
function cleanup(id) {
|
|
34
|
-
rafIds.delete(id);
|
|
35
|
-
}
|
|
36
|
-
function wrapperRaf(callback, times = 1) {
|
|
37
|
-
rafUUID += 1;
|
|
38
|
-
const id = rafUUID;
|
|
39
|
-
function callRef(leftTimes) {
|
|
40
|
-
if (leftTimes === 0) {
|
|
41
|
-
cleanup(id);
|
|
42
|
-
callback();
|
|
43
|
-
} else {
|
|
44
|
-
const realId = raf(() => {
|
|
45
|
-
callRef(leftTimes - 1);
|
|
46
|
-
});
|
|
47
|
-
rafIds.set(id, realId);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
callRef(times);
|
|
51
|
-
return id;
|
|
52
|
-
}
|
|
53
|
-
wrapperRaf.cancel = (id) => {
|
|
54
|
-
const realId = rafIds.get(id);
|
|
55
|
-
cleanup(realId);
|
|
56
|
-
return caf(realId);
|
|
57
|
-
};
|