haze-ui 1.26.0 → 1.28.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/README.md +420 -36
- package/dist/components/Anchor/Anchor.js +78 -0
- package/dist/components/Anchor/index.js +3 -0
- package/dist/components/AppShell/AppShell.js +44 -0
- package/dist/components/AppShell/index.js +3 -0
- package/dist/components/AspectRatio/AspectRatio.js +0 -1
- package/dist/components/AspectRatio/index.js +0 -1
- package/dist/components/Badge/Badge.js +5 -17
- package/dist/components/Badge/badge-styles.js +15 -0
- package/dist/components/Badge/index.js +3 -3
- package/dist/components/BottomSheet/BottomSheet.js +133 -22
- package/dist/components/Button/index.js +4 -3
- package/dist/components/Calendar/Calendar.js +525 -78
- package/dist/components/Calendar/date.js +35 -2
- package/dist/components/Card/Card.js +0 -1
- package/dist/components/Card/index.js +0 -1
- package/dist/components/Carousel/Carousel.js +64 -41
- package/dist/components/Cascader/Cascader.js +222 -140
- package/dist/components/Chart/Chart.js +34 -0
- package/dist/components/Chart/chart-elements.js +164 -0
- package/dist/components/Chart/index.js +3 -0
- package/dist/components/ChatContainer/ChatContainer.js +36 -16
- package/dist/components/ChatInput/ChatInput.js +49 -29
- package/dist/components/ChatMessage/ChatMessage.js +76 -29
- package/dist/components/Checkbox/Checkbox.js +6 -5
- package/dist/components/Checkbox/CheckboxCore.js +6 -5
- package/dist/components/CodeBlock/CodeBlock.js +39 -10
- package/dist/components/CodeBlock/index.js +0 -1
- package/dist/components/Collapsible/Collapsible.js +23 -10
- package/dist/components/ColorPicker/ColorPicker.js +5 -4
- package/dist/components/ColorPicker/ColorPickerCore.js +5 -4
- package/dist/components/Combobox/Combobox.js +202 -75
- package/dist/components/Combobox/ComboboxGroup.js +23 -0
- package/dist/components/Combobox/ComboboxOption.js +7 -6
- package/dist/components/Combobox/index.js +4 -3
- package/dist/components/Command/Command.js +102 -59
- package/dist/components/Command/CommandDialog.js +48 -0
- package/dist/components/Command/command-filter.js +16 -0
- package/dist/components/Command/index.js +3 -2
- package/dist/components/ConfirmDialog/ConfirmDialog.js +3 -3
- package/dist/components/Container/Container.js +0 -1
- package/dist/components/Container/index.js +0 -1
- package/dist/components/ContextMenu/ContextMenuContent.js +4 -4
- package/dist/components/DataTable/CellEditor.js +38 -0
- package/dist/components/DataTable/DataTable.js +394 -143
- package/dist/components/DataTable/csv.js +29 -0
- package/dist/components/DataTable/features.js +25 -0
- package/dist/components/DataTable/index.js +3 -1
- package/dist/components/DataTable/summary.js +17 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +31 -13
- package/dist/components/DateRangePicker/DateRangePickerCore.js +59 -27
- package/dist/components/DateRangePicker/presets.js +43 -0
- package/dist/components/Datepicker/Datepicker.js +17 -12
- package/dist/components/Datepicker/DatepickerCore.js +73 -39
- package/dist/components/Datepicker/datetime.js +23 -0
- package/dist/components/Descriptions/Descriptions.js +46 -0
- package/dist/components/Descriptions/index.js +3 -0
- package/dist/components/Dialog/Dialog.js +56 -32
- package/dist/components/DiffViewer/DiffViewer.js +31 -30
- package/dist/components/Divider/Divider.js +0 -1
- package/dist/components/Divider/index.js +0 -1
- package/dist/components/Drawer/Drawer.js +49 -29
- package/dist/components/DropdownMenu/DropdownMenu.js +38 -26
- package/dist/components/DropdownMenu/DropdownMenuSub.js +23 -0
- package/dist/components/DropdownMenu/DropdownMenuSubContent.js +24 -0
- package/dist/components/DropdownMenu/DropdownMenuSubTrigger.js +30 -0
- package/dist/components/DropdownMenu/index.js +4 -1
- package/dist/components/FilePreview/FilePreview.js +135 -0
- package/dist/components/FilePreview/file-preview-format.js +23 -0
- package/dist/components/FilePreview/index.js +3 -0
- package/dist/components/Flex/Flex.js +0 -1
- package/dist/components/Flex/index.js +0 -1
- package/dist/components/FloatButton/FloatButton.js +42 -0
- package/dist/components/FloatButton/FloatButtonGroup.js +58 -0
- package/dist/components/FloatButton/float-button-context.js +9 -0
- package/dist/components/FloatButton/float-button-glyphs.js +26 -0
- package/dist/components/FloatButton/float-button-styles.js +14 -0
- package/dist/components/FloatButton/index.js +4 -0
- package/dist/components/Fullscreen/Fullscreen.js +29 -0
- package/dist/components/Fullscreen/index.js +3 -0
- package/dist/components/Grid/Grid.js +0 -1
- package/dist/components/Grid/GridItem.js +0 -1
- package/dist/components/Grid/index.js +0 -1
- package/dist/components/Icon/Icon.js +0 -1
- package/dist/components/Icon/index.js +0 -1
- package/dist/components/Image/Image.js +37 -19
- package/dist/components/Image/ImagePreview.js +233 -0
- package/dist/components/InlineCompletion/InlineCompletion.js +81 -0
- package/dist/components/InlineCompletion/index.js +3 -0
- package/dist/components/Input/Input.js +6 -5
- package/dist/components/Input/InputCore.js +3 -2
- package/dist/components/JsonView/JsonView.js +209 -0
- package/dist/components/JsonView/index.js +3 -0
- package/dist/components/JsonView/json-view-utils.js +24 -0
- package/dist/components/Kbd/Kbd.js +0 -1
- package/dist/components/Kbd/index.js +0 -1
- package/dist/components/LocaleProvider/LocaleProvider.js +16 -13
- package/dist/components/LocaleProvider/index.js +5 -3
- package/dist/components/LocaleProvider/ja-jp.js +222 -0
- package/dist/components/LocaleProvider/locale.js +99 -5
- package/dist/components/LocaleProvider/strings.js +15 -0
- package/dist/components/LocaleProvider/useStrings.js +13 -11
- package/dist/components/LocaleProvider/zh-cn.js +99 -5
- package/dist/components/Masonry/Masonry.js +29 -0
- package/dist/components/Masonry/index.js +3 -0
- package/dist/components/Masonry/masonry-distribute.js +15 -0
- package/dist/components/Mentions/Mentions.js +6 -5
- package/dist/components/Mentions/MentionsCore.js +69 -68
- package/dist/components/Menu/Menu.js +5 -5
- package/dist/components/Menu/MenuSub.js +23 -0
- package/dist/components/Menu/MenuSubContent.js +24 -0
- package/dist/components/Menu/MenuSubTrigger.js +30 -0
- package/dist/components/Menu/index.js +4 -1
- package/dist/components/NumberInput/NumberInput.js +6 -5
- package/dist/components/NumberInput/NumberInputCore.js +9 -8
- package/dist/components/OTPInput/OTPInput.js +5 -4
- package/dist/components/OTPInput/OTPInputCore.js +34 -33
- package/dist/components/PasswordInput/PasswordInput.js +5 -4
- package/dist/components/PasswordInput/PasswordInputCore.js +8 -7
- package/dist/components/Popover/Popover.js +43 -31
- package/dist/components/PromptInput/PromptInput.js +213 -0
- package/dist/components/PromptInput/index.js +3 -0
- package/dist/components/Radio/Radio.js +7 -6
- package/dist/components/Radio/RadioGroup.js +5 -4
- package/dist/components/Radio/RadioGroupCore.js +23 -14
- package/dist/components/Rating/Rating.js +5 -4
- package/dist/components/Rating/RatingCore.js +62 -28
- package/dist/components/Resizable/index.js +1 -1
- package/dist/components/Segmented/Segmented.js +5 -4
- package/dist/components/Segmented/SegmentedCore.js +22 -18
- package/dist/components/Select/OptionGroup.js +12 -0
- package/dist/components/Select/Select.js +20 -9
- package/dist/components/Select/SelectCore.js +74 -13
- package/dist/components/Select/SelectFloating.js +256 -0
- package/dist/components/Select/index.js +5 -4
- package/dist/components/Select/select-options.js +57 -0
- package/dist/components/Sidebar/Sidebar.js +9 -9
- package/dist/components/Signature/Signature.js +165 -0
- package/dist/components/Signature/index.js +3 -0
- package/dist/components/Signature/signature-points.js +28 -0
- package/dist/components/Skeleton/Skeleton.js +0 -1
- package/dist/components/Skeleton/index.js +0 -1
- package/dist/components/Slider/Slider.js +16 -8
- package/dist/components/Slider/SliderCore.js +75 -12
- package/dist/components/Sources/Sources.js +109 -0
- package/dist/components/Sources/index.js +3 -0
- package/dist/components/Stat/Stat.js +0 -1
- package/dist/components/Stat/index.js +0 -1
- package/dist/components/Switch/Switch.js +6 -5
- package/dist/components/Switch/SwitchCore.js +3 -2
- package/dist/components/Tabs/Tab.js +7 -4
- package/dist/components/Tabs/TabList.js +38 -7
- package/dist/components/Tabs/TabPanel.js +4 -3
- package/dist/components/Tabs/Tabs.js +11 -6
- package/dist/components/TagGroup/SortableTagGroup.js +26 -0
- package/dist/components/TagGroup/TagGroup.js +4 -6
- package/dist/components/TagGroup/TagGroupItem.js +17 -11
- package/dist/components/TagGroup/index.js +2 -1
- package/dist/components/TagGroup/tag-group-styles.js +7 -0
- package/dist/components/TagInput/SortableTagInput.js +24 -0
- package/dist/components/TagInput/SortableTagInputCore.js +52 -0
- package/dist/components/TagInput/TagInput.js +5 -4
- package/dist/components/TagInput/TagInputCore.js +71 -57
- package/dist/components/TagInput/index.js +3 -1
- package/dist/components/TagInput/tag-input-styles.js +7 -0
- package/dist/components/Textarea/Textarea.js +6 -5
- package/dist/components/Textarea/TextareaCore.js +3 -2
- package/dist/components/TimePicker/TimePicker.js +6 -5
- package/dist/components/TimePicker/TimePickerCore.js +3 -2
- package/dist/components/Toast/Toast.js +44 -42
- package/dist/components/Toast/ToastContainer.js +67 -47
- package/dist/components/Toast/ToastContext.js +23 -4
- package/dist/components/Toast/toast2.js +63 -28
- package/dist/components/Toast/useToast.js +9 -7
- package/dist/components/Toggle/Toggle.js +20 -0
- package/dist/components/Toggle/ToggleCore.js +31 -0
- package/dist/components/Toggle/index.js +4 -0
- package/dist/components/Toolbar/Toolbar.js +33 -32
- package/dist/components/Toolbar/ToolbarToggle.js +31 -0
- package/dist/components/Toolbar/index.js +2 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tour/Tour.js +57 -53
- package/dist/components/Tree/Tree.js +265 -80
- package/dist/components/Tree/TreeItem.js +91 -55
- package/dist/components/Tree/utils.js +82 -10
- package/dist/components/Typography/Typography.js +0 -1
- package/dist/components/Typography/index.js +0 -1
- package/dist/components/Upload/Upload.js +24 -8
- package/dist/components/Upload/UploadCore.js +230 -37
- package/dist/components/Upload/UploadList.js +300 -0
- package/dist/components/Upload/xhr-upload.js +22 -0
- package/dist/components/VirtualList/VirtualList.js +84 -56
- package/dist/components/Watermark/Watermark.js +55 -0
- package/dist/components/Watermark/index.js +3 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/app-shell.css +2 -0
- package/dist/css/badge.css +1 -1
- package/dist/css/bottom-sheet.css +1 -1
- package/dist/css/button.css +1 -1
- package/dist/css/calendar.css +1 -1
- package/dist/css/cascader.css +1 -1
- package/dist/css/chart.css +2 -0
- package/dist/css/chat-container.css +1 -1
- package/dist/css/chat-message.css +1 -1
- package/dist/css/combobox.css +3 -2
- package/dist/css/command.css +2 -1
- package/dist/css/context-menu.css +1 -1
- package/dist/css/data-table.css +2 -1
- package/dist/css/date-range-picker.css +1 -1
- package/dist/css/datepicker.css +2 -2
- package/dist/css/descriptions.css +2 -0
- package/dist/css/dialog.css +1 -1
- package/dist/css/drawer.css +1 -1
- package/dist/css/dropdown-menu.css +4 -1
- package/dist/css/file-preview.css +2 -0
- package/dist/css/float-button.css +2 -0
- package/dist/css/image.css +2 -1
- package/dist/css/inline-completion.css +2 -0
- package/dist/css/json-view.css +2 -0
- package/dist/css/masonry.css +2 -0
- package/dist/css/menu.css +4 -1
- package/dist/css/popover.css +1 -1
- package/dist/css/prompt-input.css +2 -0
- package/dist/css/rating.css +1 -1
- package/dist/css/select.css +3 -1
- package/dist/css/signature.css +2 -0
- package/dist/css/slider.css +1 -1
- package/dist/css/sources.css +2 -0
- package/dist/css/tag-group.css +3 -1
- package/dist/css/tag-input.css +2 -1
- package/dist/css/toggle.css +2 -0
- package/dist/css/toolbar.css +1 -0
- package/dist/css/tooltip.css +1 -1
- package/dist/css/tree.css +2 -2
- package/dist/css/upload.css +2 -1
- package/dist/css/watermark.css +2 -0
- package/dist/css-manifest.json +75 -1
- package/dist/form/FormItem.js +55 -50
- package/dist/form/FormList.js +79 -0
- package/dist/form/index.js +5 -1
- package/dist/form/standard-schema.js +16 -0
- package/dist/haze-ui.css +61 -30
- package/dist/headless/index.js +19 -0
- package/dist/hooks/useClickOutside.js +24 -0
- package/dist/hooks/useDarkMode.js +27 -0
- package/dist/hooks/useFullscreen.js +42 -0
- package/dist/hooks/useHotkeys.js +77 -0
- package/dist/hooks/useInView.js +27 -0
- package/dist/hooks/useLocalStorage.js +8 -0
- package/dist/hooks/useMediaQuery.js +2 -1
- package/dist/hooks/usePrevious.js +11 -0
- package/dist/hooks/useSessionStorage.js +8 -0
- package/dist/hooks/useStorageState.js +80 -0
- package/dist/index.js +220 -171
- package/dist/registry.json +2435 -91
- package/dist/tokens/colors.js +0 -1
- package/dist/tokens/index.js +0 -1
- package/dist/tokens/motion.js +0 -1
- package/dist/tokens/oklch.js +0 -1
- package/dist/tokens/palette.js +0 -1
- package/dist/tokens/registry.js +17 -28
- package/dist/tokens/spacing.js +0 -1
- package/dist/tokens/typography.js +0 -1
- package/dist/types/components/Anchor/Anchor.d.ts +25 -0
- package/dist/types/components/Anchor/index.d.ts +2 -0
- package/dist/types/components/AppShell/AppShell.d.ts +17 -0
- package/dist/types/components/AppShell/index.d.ts +2 -0
- package/dist/types/components/Badge/badge-styles.d.ts +21 -0
- package/dist/types/components/Badge/index.d.ts +1 -0
- package/dist/types/components/BottomSheet/BottomSheet.d.ts +52 -3
- package/dist/types/components/BottomSheet/index.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +7 -0
- package/dist/types/components/Button/ButtonLink.d.ts +3 -0
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/types/components/Button/styles.d.ts +17 -0
- package/dist/types/components/Calendar/Calendar.d.ts +71 -7
- package/dist/types/components/Calendar/date.d.ts +52 -0
- package/dist/types/components/Calendar/index.d.ts +1 -1
- package/dist/types/components/Cascader/Cascader.d.ts +48 -3
- package/dist/types/components/Chart/Chart.d.ts +43 -0
- package/dist/types/components/Chart/chart-elements.d.ts +104 -0
- package/dist/types/components/Chart/index.d.ts +2 -0
- package/dist/types/components/ChatContainer/ChatContainer.d.ts +18 -3
- package/dist/types/components/ChatInput/ChatInput.d.ts +11 -1
- package/dist/types/components/ChatMessage/ChatMessage.d.ts +13 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +6 -2
- package/dist/types/components/Checkbox/CheckboxCore.d.ts +4 -2
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +19 -2
- package/dist/types/components/CodeBlock/index.d.ts +1 -1
- package/dist/types/components/Collapsible/Collapsible.d.ts +24 -2
- package/dist/types/components/Collapsible/index.d.ts +1 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +7 -1
- package/dist/types/components/ColorPicker/ColorPickerCore.d.ts +7 -1
- package/dist/types/components/Combobox/Combobox.d.ts +111 -7
- package/dist/types/components/Combobox/ComboboxGroup.d.ts +22 -0
- package/dist/types/components/Combobox/ComboboxOption.d.ts +7 -2
- package/dist/types/components/Combobox/index.d.ts +3 -1
- package/dist/types/components/Command/Command.d.ts +70 -6
- package/dist/types/components/Command/CommandDialog.d.ts +36 -0
- package/dist/types/components/Command/command-filter.d.ts +34 -0
- package/dist/types/components/Command/index.d.ts +4 -2
- package/dist/types/components/DataTable/CellEditor.d.ts +24 -0
- package/dist/types/components/DataTable/DataTable.d.ts +184 -32
- package/dist/types/components/DataTable/csv.d.ts +36 -0
- package/dist/types/components/DataTable/features.d.ts +124 -0
- package/dist/types/components/DataTable/index.d.ts +4 -1
- package/dist/types/components/DataTable/summary.d.ts +19 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +28 -2
- package/dist/types/components/DateRangePicker/DateRangePickerCore.d.ts +26 -2
- package/dist/types/components/DateRangePicker/index.d.ts +2 -2
- package/dist/types/components/DateRangePicker/presets.d.ts +23 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +21 -1
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +29 -2
- package/dist/types/components/Datepicker/datetime.d.ts +27 -0
- package/dist/types/components/Datepicker/index.d.ts +1 -1
- package/dist/types/components/Descriptions/Descriptions.d.ts +30 -0
- package/dist/types/components/Descriptions/index.d.ts +2 -0
- package/dist/types/components/Dialog/Dialog.d.ts +68 -3
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/Drawer/Drawer.d.ts +33 -3
- package/dist/types/components/Drawer/index.d.ts +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +23 -3
- package/dist/types/components/DropdownMenu/DropdownMenuSub.d.ts +18 -0
- package/dist/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +13 -0
- package/dist/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +14 -0
- package/dist/types/components/DropdownMenu/index.d.ts +7 -1
- package/dist/types/components/FilePreview/FilePreview.d.ts +35 -0
- package/dist/types/components/FilePreview/file-preview-format.d.ts +20 -0
- package/dist/types/components/FilePreview/index.d.ts +2 -0
- package/dist/types/components/FloatButton/FloatButton.d.ts +43 -0
- package/dist/types/components/FloatButton/FloatButtonGroup.d.ts +33 -0
- package/dist/types/components/FloatButton/float-button-context.d.ts +11 -0
- package/dist/types/components/FloatButton/float-button-glyphs.d.ts +3 -0
- package/dist/types/components/FloatButton/float-button-styles.d.ts +58 -0
- package/dist/types/components/FloatButton/index.d.ts +4 -0
- package/dist/types/components/Fullscreen/Fullscreen.d.ts +34 -0
- package/dist/types/components/Fullscreen/index.d.ts +3 -0
- package/dist/types/components/Image/Image.d.ts +20 -5
- package/dist/types/components/Image/ImagePreview.d.ts +13 -0
- package/dist/types/components/Image/index.d.ts +1 -1
- package/dist/types/components/InlineCompletion/InlineCompletion.d.ts +29 -0
- package/dist/types/components/InlineCompletion/index.d.ts +2 -0
- package/dist/types/components/Input/Input.d.ts +5 -2
- package/dist/types/components/Input/InputCore.d.ts +4 -2
- package/dist/types/components/JsonView/JsonView.d.ts +26 -0
- package/dist/types/components/JsonView/index.d.ts +2 -0
- package/dist/types/components/JsonView/json-view-utils.d.ts +22 -0
- package/dist/types/components/LocaleProvider/LocaleContext.d.ts +9 -0
- package/dist/types/components/LocaleProvider/LocaleProvider.d.ts +12 -1
- package/dist/types/components/LocaleProvider/index.d.ts +3 -0
- package/dist/types/components/LocaleProvider/ja-jp.d.ts +13 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +100 -0
- package/dist/types/components/LocaleProvider/strings.d.ts +28 -0
- package/dist/types/components/Masonry/Masonry.d.ts +34 -0
- package/dist/types/components/Masonry/index.d.ts +2 -0
- package/dist/types/components/Masonry/masonry-distribute.d.ts +16 -0
- package/dist/types/components/Mentions/Mentions.d.ts +5 -2
- package/dist/types/components/Mentions/MentionsCore.d.ts +4 -2
- package/dist/types/components/Menu/MenuSub.d.ts +18 -0
- package/dist/types/components/Menu/MenuSubContent.d.ts +12 -0
- package/dist/types/components/Menu/MenuSubTrigger.d.ts +14 -0
- package/dist/types/components/Menu/index.d.ts +6 -0
- package/dist/types/components/NumberInput/NumberInput.d.ts +5 -2
- package/dist/types/components/NumberInput/NumberInputCore.d.ts +4 -2
- package/dist/types/components/OTPInput/OTPInput.d.ts +5 -1
- package/dist/types/components/OTPInput/OTPInputCore.d.ts +4 -1
- package/dist/types/components/PasswordInput/PasswordInput.d.ts +5 -1
- package/dist/types/components/PasswordInput/PasswordInputCore.d.ts +4 -1
- package/dist/types/components/Popover/Popover.d.ts +41 -3
- package/dist/types/components/Popover/index.d.ts +1 -1
- package/dist/types/components/PromptInput/PromptInput.d.ts +46 -0
- package/dist/types/components/PromptInput/index.d.ts +2 -0
- package/dist/types/components/Radio/Radio.d.ts +5 -2
- package/dist/types/components/Radio/RadioGroup.d.ts +8 -2
- package/dist/types/components/Radio/RadioGroupCore.d.ts +7 -2
- package/dist/types/components/Rating/Rating.d.ts +8 -1
- package/dist/types/components/Rating/RatingCore.d.ts +7 -1
- package/dist/types/components/Resizable/index.d.ts +2 -0
- package/dist/types/components/Segmented/Segmented.d.ts +8 -1
- package/dist/types/components/Segmented/SegmentedCore.d.ts +7 -2
- package/dist/types/components/Select/OptionGroup.d.ts +16 -0
- package/dist/types/components/Select/Select.d.ts +78 -4
- package/dist/types/components/Select/SelectCore.d.ts +79 -6
- package/dist/types/components/Select/SelectFloating.d.ts +94 -0
- package/dist/types/components/Select/index.d.ts +2 -0
- package/dist/types/components/Select/select-options.d.ts +53 -0
- package/dist/types/components/Signature/Signature.d.ts +51 -0
- package/dist/types/components/Signature/index.d.ts +2 -0
- package/dist/types/components/Signature/signature-points.d.ts +31 -0
- package/dist/types/components/Slider/Slider.d.ts +29 -4
- package/dist/types/components/Slider/SliderCore.d.ts +35 -6
- package/dist/types/components/Sources/Sources.d.ts +37 -0
- package/dist/types/components/Sources/index.d.ts +2 -0
- package/dist/types/components/Switch/Switch.d.ts +5 -2
- package/dist/types/components/Switch/SwitchCore.d.ts +4 -2
- package/dist/types/components/Tabs/TabList.d.ts +7 -0
- package/dist/types/components/Tabs/Tabs.d.ts +8 -1
- package/dist/types/components/Tabs/TabsContext.d.ts +20 -0
- package/dist/types/components/Tabs/index.d.ts +1 -0
- package/dist/types/components/TagGroup/SortableTagGroup.d.ts +20 -0
- package/dist/types/components/TagGroup/TagGroup.d.ts +3 -0
- package/dist/types/components/TagGroup/index.d.ts +2 -0
- package/dist/types/components/TagGroup/tag-group-styles.d.ts +7 -0
- package/dist/types/components/TagInput/SortableTagInput.d.ts +34 -0
- package/dist/types/components/TagInput/SortableTagInputCore.d.ts +18 -0
- package/dist/types/components/TagInput/TagInput.d.ts +5 -1
- package/dist/types/components/TagInput/TagInputCore.d.ts +6 -2
- package/dist/types/components/TagInput/index.d.ts +4 -0
- package/dist/types/components/TagInput/tag-input-styles.d.ts +12 -0
- package/dist/types/components/Textarea/Textarea.d.ts +5 -2
- package/dist/types/components/Textarea/TextareaCore.d.ts +4 -2
- package/dist/types/components/TimePicker/TimePicker.d.ts +5 -2
- package/dist/types/components/TimePicker/TimePickerCore.d.ts +4 -2
- package/dist/types/components/Toast/Toast.d.ts +31 -2
- package/dist/types/components/Toast/ToastContainer.d.ts +11 -1
- package/dist/types/components/Toast/ToastContext.d.ts +44 -3
- package/dist/types/components/Toast/index.d.ts +1 -1
- package/dist/types/components/Toast/toast.d.ts +35 -4
- package/dist/types/components/Toast/useToast.d.ts +16 -4
- package/dist/types/components/Toggle/Toggle.d.ts +19 -0
- package/dist/types/components/Toggle/ToggleCore.d.ts +23 -0
- package/dist/types/components/Toggle/index.d.ts +4 -0
- package/dist/types/components/Toolbar/ToolbarToggle.d.ts +19 -0
- package/dist/types/components/Toolbar/index.d.ts +2 -0
- package/dist/types/components/Tour/Tour.d.ts +3 -3
- package/dist/types/components/Tree/Tree.d.ts +3 -3
- package/dist/types/components/Tree/TreeItem.d.ts +16 -1
- package/dist/types/components/Tree/types.d.ts +51 -0
- package/dist/types/components/Tree/utils.d.ts +73 -0
- package/dist/types/components/Upload/Upload.d.ts +47 -3
- package/dist/types/components/Upload/UploadCore.d.ts +95 -4
- package/dist/types/components/Upload/UploadList.d.ts +18 -0
- package/dist/types/components/Upload/index.d.ts +1 -0
- package/dist/types/components/Upload/types.d.ts +60 -0
- package/dist/types/components/Upload/xhr-upload.d.ts +20 -0
- package/dist/types/components/VirtualList/VirtualList.d.ts +16 -1
- package/dist/types/components/Watermark/Watermark.d.ts +32 -0
- package/dist/types/components/Watermark/index.d.ts +2 -0
- package/dist/types/form/FormItem.d.ts +33 -8
- package/dist/types/form/FormList.d.ts +113 -0
- package/dist/types/form/index.d.ts +26 -0
- package/dist/types/form/standard-schema.d.ts +30 -0
- package/dist/types/headless/index.d.ts +399 -0
- package/dist/types/hooks/index.d.ts +13 -0
- package/dist/types/hooks/useClickOutside.d.ts +46 -0
- package/dist/types/hooks/useDarkMode.d.ts +40 -0
- package/dist/types/hooks/useFullscreen.d.ts +33 -0
- package/dist/types/hooks/useHotkeys.d.ts +53 -0
- package/dist/types/hooks/useInView.d.ts +32 -0
- package/dist/types/hooks/useLocalStorage.d.ts +33 -0
- package/dist/types/hooks/useMediaQuery.d.ts +3 -0
- package/dist/types/hooks/usePrevious.d.ts +18 -0
- package/dist/types/hooks/useSessionStorage.d.ts +26 -0
- package/dist/types/hooks/useStorageState.d.ts +12 -0
- package/dist/types/index.d.ts +79 -37
- package/dist/types/utils/collision.d.ts +39 -1
- package/dist/types/utils/direction.d.ts +22 -0
- package/dist/types/utils/floating.d.ts +32 -4
- package/dist/types/utils/focus-scope.d.ts +2 -1
- package/dist/types/utils/focus.d.ts +2 -1
- package/dist/types/utils/menuKeyboard.d.ts +19 -4
- package/dist/types/utils/refs.d.ts +16 -0
- package/dist/types/utils/sortable-handle.d.ts +25 -0
- package/dist/types/utils/sortable-shared.d.ts +30 -0
- package/dist/types/utils/sortable.d.ts +36 -0
- package/dist/types/utils/submenu.d.ts +63 -0
- package/dist/types/utils/view-transition.d.ts +28 -0
- package/dist/utils/classnames.js +0 -1
- package/dist/utils/collision.js +37 -26
- package/dist/utils/direction.js +34 -0
- package/dist/utils/floating.js +163 -143
- package/dist/utils/menuKeyboard.js +59 -46
- package/dist/utils/refs.js +9 -0
- package/dist/utils/sortable-handle.js +12 -0
- package/dist/utils/sortable-shared.js +16 -0
- package/dist/utils/sortable.js +47 -0
- package/dist/utils/submenu.js +106 -0
- package/dist/utils/view-transition.js +26 -0
- package/package.json +169 -16
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ToastClassNames } from './Toast';
|
|
2
3
|
type ToastPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
3
4
|
type ToastContainerProps = {
|
|
4
5
|
children: ReactNode;
|
|
@@ -6,6 +7,15 @@ type ToastContainerProps = {
|
|
|
6
7
|
maxCount?: number;
|
|
7
8
|
/** Viewport edge the stack is pinned to. */
|
|
8
9
|
placement?: ToastPlacement;
|
|
10
|
+
/**
|
|
11
|
+
* Semantic slot classes (AntD v6 `classNames` shape) for the whole
|
|
12
|
+
* toast family — `viewport` lands on the fixed stack this container
|
|
13
|
+
* renders, `item`/`content`/`close` flow to every toast (see
|
|
14
|
+
* {@link ToastClassNames}). Toasts are fired imperatively through
|
|
15
|
+
* `useToast()`/`toast()`, so this prop is the one place to theme
|
|
16
|
+
* them. Omitting it changes nothing.
|
|
17
|
+
*/
|
|
18
|
+
classNames?: ToastClassNames;
|
|
9
19
|
};
|
|
10
20
|
export declare const toastPlacements: {
|
|
11
21
|
readonly 'top-left': import("@linaria/core").LinariaClassName;
|
|
@@ -13,5 +23,5 @@ export declare const toastPlacements: {
|
|
|
13
23
|
readonly 'bottom-left': import("@linaria/core").LinariaClassName;
|
|
14
24
|
readonly 'bottom-right': import("@linaria/core").LinariaClassName;
|
|
15
25
|
};
|
|
16
|
-
export default function ToastContainer({ children, maxCount, placement, }: ToastContainerProps): import("react").JSX.Element;
|
|
26
|
+
export default function ToastContainer({ children, maxCount, placement, classNames, }: ToastContainerProps): import("react").JSX.Element;
|
|
17
27
|
export type { ToastContainerProps, ToastPlacement };
|
|
@@ -1,15 +1,56 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
type ToastVariant = 'info' | 'success' | 'warning' | 'danger';
|
|
2
3
|
type ToastItem = {
|
|
3
4
|
id: number;
|
|
4
|
-
variant:
|
|
5
|
+
variant: ToastVariant;
|
|
5
6
|
content: ReactNode;
|
|
6
7
|
duration: number;
|
|
7
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Patch accepted by `toast.update(id, patch)` and `useToast().update(id,
|
|
11
|
+
* patch)`. Only fields present in the patch change; an omitted (or
|
|
12
|
+
* undefined) field keeps the toast's current value.
|
|
13
|
+
*/
|
|
14
|
+
type ToastUpdateOptions = {
|
|
15
|
+
/** Replacement message content. */
|
|
16
|
+
content?: ReactNode;
|
|
17
|
+
/** Replacement color variant. */
|
|
18
|
+
variant?: ToastVariant;
|
|
19
|
+
/** New auto-dismiss budget in ms. Changing it re-arms the countdown
|
|
20
|
+
* from the full value; leaving it out keeps the running countdown. */
|
|
21
|
+
duration?: number;
|
|
22
|
+
};
|
|
23
|
+
/** The `toast.promise` phases whose default copy lives in the locale pack. */
|
|
24
|
+
type ToastDeferredCopyKey = 'loading' | 'success' | 'error';
|
|
25
|
+
/**
|
|
26
|
+
* Sentinel ReactNode standing in for promise-phase copy that resolves
|
|
27
|
+
* against the locale pack at render time: `toast.promise` may fire from
|
|
28
|
+
* outside any React tree, so it cannot read `useStrings` itself — the
|
|
29
|
+
* container resolves the marker when it renders the toast. The sentinel
|
|
30
|
+
* rides the `content` channel as an opaque marker (cast once at the
|
|
31
|
+
* factory below); only the container ever interprets it.
|
|
32
|
+
*/
|
|
33
|
+
type ToastDeferredCopy = {
|
|
34
|
+
readonly deferredCopy: ToastDeferredCopyKey;
|
|
35
|
+
};
|
|
36
|
+
/** Creates the locale-deferred sentinel for one promise phase. */
|
|
37
|
+
declare function deferredToastCopy(key: ToastDeferredCopyKey): ReactNode;
|
|
38
|
+
declare function deferredCopyKey(node: ReactNode): ToastDeferredCopyKey | null;
|
|
39
|
+
/**
|
|
40
|
+
* Pure merge of an update patch onto a toast item: keys absent (or
|
|
41
|
+
* undefined) in the patch keep the item's current value, so an update
|
|
42
|
+
* never clobbers fields it did not name.
|
|
43
|
+
*/
|
|
44
|
+
declare function applyToastPatch(item: ToastItem, patch: ToastUpdateOptions): ToastItem;
|
|
8
45
|
type ToastContextValue = {
|
|
9
46
|
toasts: ToastItem[];
|
|
10
|
-
addToast: (toast: Omit<ToastItem, 'id'>) =>
|
|
47
|
+
addToast: (toast: Omit<ToastItem, 'id'>) => number;
|
|
11
48
|
removeToast: (id: number) => void;
|
|
49
|
+
/** Patches a live toast in place — the same id and React key, so the
|
|
50
|
+
* enter/exit animations never replay (see `toast.update`). */
|
|
51
|
+
updateToast: (id: number, patch: ToastUpdateOptions) => void;
|
|
12
52
|
};
|
|
13
53
|
export declare const ToastProvider: import("react").Provider<ToastContextValue | undefined>;
|
|
14
54
|
export declare function useToastContext(): ToastContextValue;
|
|
15
|
-
export
|
|
55
|
+
export { applyToastPatch, deferredCopyKey, deferredToastCopy, };
|
|
56
|
+
export type { ToastDeferredCopy, ToastDeferredCopyKey, ToastItem, ToastContextValue, ToastUpdateOptions, ToastVariant, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Toast } from './Toast';
|
|
2
|
-
export type { ToastProps } from './Toast';
|
|
2
|
+
export type { ToastProps, ToastClassNames } from './Toast';
|
|
3
3
|
export { default as ToastContainer } from './ToastContainer';
|
|
4
4
|
export type { ToastContainerProps } from './ToastContainer';
|
|
5
5
|
export { default as useToast } from './useToast';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ToastItem } from './ToastContext';
|
|
3
|
-
type ToastVariant = ToastItem['variant'];
|
|
2
|
+
import type { ToastDeferredCopyKey, ToastItem, ToastUpdateOptions, ToastVariant } from './ToastContext';
|
|
4
3
|
/** Options accepted by `toast()` — the same call shape `useToast()` takes. */
|
|
5
4
|
type ToastOptions = {
|
|
6
5
|
variant?: ToastVariant;
|
|
@@ -8,10 +7,29 @@ type ToastOptions = {
|
|
|
8
7
|
};
|
|
9
8
|
/** Options accepted by the variant sugar methods (`toast.success()` …). */
|
|
10
9
|
type ToastVariantOptions = Omit<ToastOptions, 'variant'>;
|
|
10
|
+
/** Copy for one `toast.promise` phase: a literal, or derived from the
|
|
11
|
+
* settled value / rejection when the promise settles. */
|
|
12
|
+
type ToastPhaseContent<T> = ReactNode | ((data: T) => ReactNode);
|
|
13
|
+
/** Options accepted by `toast.promise(promise, options)`. */
|
|
14
|
+
type ToastPromiseOptions<T> = {
|
|
15
|
+
/** Copy shown while the promise is pending. Defaults to the locale
|
|
16
|
+
* pack's `toast.loading`. The loading toast never auto-dismisses. */
|
|
17
|
+
loading?: ReactNode;
|
|
18
|
+
/** Copy shown once the promise resolves; a function receives the
|
|
19
|
+
* resolved value. Defaults to the locale pack's `toast.success`. */
|
|
20
|
+
success?: ToastPhaseContent<T>;
|
|
21
|
+
/** Copy shown once the promise rejects; a function receives the
|
|
22
|
+
* rejection value. Defaults to the locale pack's `toast.error`. */
|
|
23
|
+
error?: ToastPhaseContent<unknown>;
|
|
24
|
+
/** Auto-dismiss delay in ms applied once the promise settles — the
|
|
25
|
+
* loading toast stays until then. Defaults to 3000. */
|
|
26
|
+
duration?: number;
|
|
27
|
+
};
|
|
11
28
|
/** Sink a mounted `ToastContainer` registers to receive imperative calls. */
|
|
12
29
|
type ToastChannel = {
|
|
13
30
|
onToast: (item: ToastItem) => void;
|
|
14
31
|
onDismiss: (id?: number) => void;
|
|
32
|
+
onUpdate: (id: number, patch: ToastUpdateOptions) => void;
|
|
15
33
|
};
|
|
16
34
|
/**
|
|
17
35
|
* The single id sequence, shared by this module and the container's
|
|
@@ -21,7 +39,8 @@ export declare function nextToastId(): number;
|
|
|
21
39
|
/**
|
|
22
40
|
* Fires a toast without `useToast` — module-level, callable from anywhere
|
|
23
41
|
* (outside React, in event callbacks, before a container has mounted).
|
|
24
|
-
* Returns the toast id, usable with `toast.dismiss(id)
|
|
42
|
+
* Returns the toast id, usable with `toast.dismiss(id)` and
|
|
43
|
+
* `toast.update(id, patch)`.
|
|
25
44
|
*
|
|
26
45
|
* Mirrors the `useToast()` call shape (content + `{variant, duration}`,
|
|
27
46
|
* defaulting to `info` / 3000ms). With no container mounted the toast is
|
|
@@ -35,7 +54,19 @@ declare namespace toast {
|
|
|
35
54
|
var warning: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
36
55
|
var danger: (content: ReactNode, options?: ToastVariantOptions) => number;
|
|
37
56
|
var dismiss: (id?: number) => void;
|
|
57
|
+
var update: (id: number, patch: ToastUpdateOptions) => void;
|
|
58
|
+
var promise: <T>(p: Promise<T>, options?: ToastPromiseOptions<T>) => Promise<T>;
|
|
38
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Shared engine behind `toast.promise` and `useToast().promise`: fires the
|
|
62
|
+
* loading toast through `show` (persistent — duration 0), then patches it
|
|
63
|
+
* in place when the promise settles, so the toast never remounts and its
|
|
64
|
+
* animations never replay. Returns the original promise untouched:
|
|
65
|
+
* rejections keep propagating to the caller's `await`/`catch`, and a
|
|
66
|
+
* loading toast dismissed before settling is simply not found by the
|
|
67
|
+
* update — it never resurrects.
|
|
68
|
+
*/
|
|
69
|
+
export declare function driveToastPromise<T>(show: (content: ReactNode, options?: ToastOptions) => number, updateById: (id: number, patch: ToastUpdateOptions) => void, promise: Promise<T>, options?: ToastPromiseOptions<T>): Promise<T>;
|
|
39
70
|
/**
|
|
40
71
|
* Called from `ToastContainer`'s mount effect. The first subscriber also
|
|
41
72
|
* replays everything queued before any container existed, in call order;
|
|
@@ -43,4 +74,4 @@ declare namespace toast {
|
|
|
43
74
|
*/
|
|
44
75
|
export declare function subscribeToastChannel(channel: ToastChannel): () => void;
|
|
45
76
|
export { toast };
|
|
46
|
-
export type { ToastOptions, ToastVariant, ToastVariantOptions };
|
|
77
|
+
export type { ToastDeferredCopyKey, ToastOptions, ToastPhaseContent, ToastPromiseOptions, ToastUpdateOptions, ToastVariant, ToastVariantOptions, };
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { ToastOptions, ToastPromiseOptions, ToastUpdateOptions } from './toast';
|
|
3
|
+
/**
|
|
4
|
+
* The `useToast()` return value: the toast trigger itself (returns the id,
|
|
5
|
+
* usable with `update`) plus `update` and `promise` — one-to-one with the
|
|
6
|
+
* module-level `toast` API, but routed through the enclosing container's
|
|
7
|
+
* context instead of the first-mounted channel subscriber.
|
|
8
|
+
*/
|
|
9
|
+
type ShowToast = {
|
|
10
|
+
(content: ReactNode, options?: ToastOptions): number;
|
|
11
|
+
/** Patches a toast in place — see `toast.update`. */
|
|
12
|
+
update: (id: number, patch: ToastUpdateOptions) => void;
|
|
13
|
+
/** Loading → success/danger lifecycle — see `toast.promise`. */
|
|
14
|
+
promise: <T>(promise: Promise<T>, options?: ToastPromiseOptions<T>) => Promise<T>;
|
|
15
|
+
};
|
|
16
|
+
export default function useToast(): ShowToast;
|
|
17
|
+
export type { ShowToast };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
type ToggleProps = {
|
|
4
|
+
/** Whether the toggle is pressed; a control for full external ownership. */
|
|
5
|
+
pressed?: ControlOrValue<boolean>;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
/** Equal padding on all sides — for icon-only square toggles. */
|
|
8
|
+
square?: boolean;
|
|
9
|
+
/** Forwarded to the underlying `<button>` — form bridges and
|
|
10
|
+
* `ref.current.focus()` reach. */
|
|
11
|
+
ref?: Ref<HTMLButtonElement>;
|
|
12
|
+
} & Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'aria-pressed'>;
|
|
13
|
+
/**
|
|
14
|
+
* A momentary pressed-state button (aria-pressed) for one-shot modes —
|
|
15
|
+
* bold, mute, grid/list view. `pressed` is one prop, two modes: a plain
|
|
16
|
+
* boolean leaves state internal, a control hands ownership to the caller.
|
|
17
|
+
*/
|
|
18
|
+
export default function Toggle({ pressed: pressedControl, size, square, className, onClick, ref, ...rest }: ToggleProps): import("react").JSX.Element;
|
|
19
|
+
export type { ToggleProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, Ref } from 'react';
|
|
2
|
+
type ToggleCoreProps = {
|
|
3
|
+
pressed: boolean;
|
|
4
|
+
onPressedChange: (pressed: boolean) => void;
|
|
5
|
+
/** Native click event passthrough — invoked with the DOM event after
|
|
6
|
+
* `onPressedChange`, so a spread can never override the controlled callback. */
|
|
7
|
+
onNativeClick?: ComponentPropsWithoutRef<'button'>['onClick'];
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
/** Equal padding on all sides — for icon-only square toggles. */
|
|
10
|
+
square?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Forwarded to the `<button>` element. */
|
|
13
|
+
ref?: Ref<HTMLButtonElement>;
|
|
14
|
+
} & Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'aria-pressed'>;
|
|
15
|
+
/**
|
|
16
|
+
* The controlled half of Toggle: a momentary pressed-state button
|
|
17
|
+
* (`<button aria-pressed>`) — one-shot commands like bold/mute, not the
|
|
18
|
+
* on/off *setting* that Switch's `role="switch"` carries. State never
|
|
19
|
+
* lives here: it renders `pressed` and reports clicks through
|
|
20
|
+
* `onPressedChange`, so the sugar (or any owner) owns the truth.
|
|
21
|
+
*/
|
|
22
|
+
export default function ToggleCore({ pressed, onPressedChange, onNativeClick, size, square, className, ref, ...rest }: ToggleCoreProps): import("react").JSX.Element;
|
|
23
|
+
export type { ToggleCoreProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
/**
|
|
4
|
+
* A toolbar item that toggles: ToolbarButton's skin and roving behavior
|
|
5
|
+
* with a pressed state of its own. `pressed` is self-contained by
|
|
6
|
+
* default (no external wiring needed) and switches to external ownership
|
|
7
|
+
* when passed a control. The pressed look is keyed off `aria-pressed`,
|
|
8
|
+
* so the visual state can never drift from what assistive tech announces.
|
|
9
|
+
*/
|
|
10
|
+
type ToolbarToggleProps = {
|
|
11
|
+
/** Whether the item is pressed; a control for full external ownership. */
|
|
12
|
+
pressed?: ControlOrValue<boolean>;
|
|
13
|
+
variant?: 'solid' | 'outline' | 'ghost';
|
|
14
|
+
size?: 'sm' | 'md' | 'lg';
|
|
15
|
+
/** Equal padding on all sides — for icon-only square items. */
|
|
16
|
+
square?: boolean;
|
|
17
|
+
} & Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'aria-pressed'>;
|
|
18
|
+
export default function ToolbarToggle({ pressed: pressedControl, variant, size, square, className, onClick, ...rest }: ToolbarToggleProps): import("react").JSX.Element;
|
|
19
|
+
export type { ToolbarToggleProps };
|
|
@@ -4,3 +4,5 @@ export { default as ToolbarButton } from './ToolbarButton';
|
|
|
4
4
|
export type { ToolbarButtonProps } from './ToolbarButton';
|
|
5
5
|
export { default as ToolbarSeparator } from './ToolbarSeparator';
|
|
6
6
|
export type { ToolbarSeparatorProps } from './ToolbarSeparator';
|
|
7
|
+
export { default as ToolbarToggle } from './ToolbarToggle';
|
|
8
|
+
export type { ToolbarToggleProps } from './ToolbarToggle';
|
|
@@ -4,9 +4,9 @@ import type { FloatingPlacement } from '../../utils/floating';
|
|
|
4
4
|
/** Why the tour closed: the last step's Done button vs. an early exit. */
|
|
5
5
|
type TourCloseReason = 'done' | 'skip';
|
|
6
6
|
/**
|
|
7
|
-
* Step-card placement relative to the spotlighted target —
|
|
8
|
-
* semantics
|
|
9
|
-
* meaning without a floating trigger pair).
|
|
7
|
+
* Step-card placement relative to the spotlighted target — logical
|
|
8
|
+
* semantics (mirrors under RTL, like FloatingPlacement), the anchorable
|
|
9
|
+
* subset ('point' has no meaning without a floating trigger pair).
|
|
10
10
|
*/
|
|
11
11
|
type TourPlacement = Exclude<FloatingPlacement, 'point'>;
|
|
12
12
|
type TourStep = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TreeProps } from './types';
|
|
2
|
-
export default function Tree({ treeData, multiple, checkable, checkStrictly, selectable, disabled, blockNode, showLine, showIcon, switcherIcon, loadingIcon, titleRender, iconRender, expandedKeys: expandedKeysControl, selectedKeys: selectedKeysControl, checkedKeys: checkedKeysControl, className, onExpand, onSelect, onCheck, }: TreeProps): import("react").JSX.Element;
|
|
3
|
-
export type { TreeProps };
|
|
1
|
+
import type { TreeProps, TreeVirtualizedConfig } from './types';
|
|
2
|
+
export default function Tree({ treeData, multiple, checkable, checkStrictly, selectable, disabled, blockNode, showLine, showIcon, switcherIcon, loadingIcon, titleRender, iconRender, virtualized, loadData, searchValue, expandedKeys: expandedKeysControl, selectedKeys: selectedKeysControl, checkedKeys: checkedKeysControl, className, onExpand, onSelect, onCheck, }: TreeProps): import("react").JSX.Element;
|
|
3
|
+
export type { TreeProps, TreeVirtualizedConfig };
|
|
@@ -15,12 +15,27 @@ type TreeItemProps = {
|
|
|
15
15
|
switcherIcon?: ReactNode;
|
|
16
16
|
loadingIcon?: ReactNode;
|
|
17
17
|
loading: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Lazy loading is armed (`loadData` provided): a childless node
|
|
20
|
+
* without `isLeaf: true` renders as expandable instead of a leaf.
|
|
21
|
+
*/
|
|
22
|
+
loadable?: boolean;
|
|
23
|
+
/** The last lazy load of this node rejected — show the retry note. */
|
|
24
|
+
loadFailed?: boolean;
|
|
25
|
+
/** Active search query — string titles highlight their matches. */
|
|
26
|
+
searchValue?: string;
|
|
18
27
|
titleRender?: (node: TreeNodeData) => ReactNode;
|
|
19
28
|
iconRender?: (node: TreeNodeData) => ReactNode;
|
|
20
29
|
isLast: boolean[];
|
|
30
|
+
/**
|
|
31
|
+
* Roving-tabindex stop (WAI-ARIA tree pattern): `0` on the row that
|
|
32
|
+
* owns the tree's single tab stop, `-1` on every other row.
|
|
33
|
+
*/
|
|
34
|
+
tabIndex: 0 | -1;
|
|
21
35
|
onToggle: () => void;
|
|
22
36
|
onSelect: () => void;
|
|
23
37
|
onCheck: () => void;
|
|
38
|
+
onRetry?: () => void;
|
|
24
39
|
};
|
|
25
|
-
export default function TreeItem({ node, level, expanded, selected, checked, disabled, checkable, selectable, blockNode, showLine, showIcon, switcherIcon, loadingIcon: loadingIconProp, loading, titleRender, iconRender, isLast, onToggle, onSelect, onCheck, }: TreeItemProps): import("react").JSX.Element;
|
|
40
|
+
export default function TreeItem({ node, level, expanded, selected, checked, disabled, checkable, selectable, blockNode, showLine, showIcon, switcherIcon, loadingIcon: loadingIconProp, loading, loadable, loadFailed, searchValue, titleRender, iconRender, isLast, tabIndex, onToggle, onSelect, onCheck, onRetry, }: TreeItemProps): import("react").JSX.Element;
|
|
26
41
|
export {};
|
|
@@ -32,6 +32,20 @@ export type TreeState = {
|
|
|
32
32
|
checkedKeys: string[];
|
|
33
33
|
halfCheckedKeys: string[];
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Virtualized windowing metrics for `Tree.virtualized`.
|
|
37
|
+
*/
|
|
38
|
+
export type TreeVirtualizedConfig = {
|
|
39
|
+
/** Scrollport height in px. Default `320`. */
|
|
40
|
+
height?: number;
|
|
41
|
+
/** Row height in px. Default `32` — the treeitem min-height (2rem). */
|
|
42
|
+
itemHeight?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Extra rows kept mounted above/below the visible window. Defaults to
|
|
45
|
+
* `VirtualList`'s `5`.
|
|
46
|
+
*/
|
|
47
|
+
overscan?: number;
|
|
48
|
+
};
|
|
35
49
|
/**
|
|
36
50
|
* Tree 组件 Props
|
|
37
51
|
*/
|
|
@@ -62,6 +76,43 @@ export type TreeProps = {
|
|
|
62
76
|
titleRender?: (node: TreeNodeData) => ReactNode;
|
|
63
77
|
/** 自定义节点图标渲染 */
|
|
64
78
|
iconRender?: (node: TreeNodeData) => ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* Render the tree through `VirtualList` so large trees mount only the
|
|
81
|
+
* visible window (plus overscan) instead of the full DOM list: the
|
|
82
|
+
* visible rows are flattened depth-first (depth indent preserved) and
|
|
83
|
+
* windowed. `false`/omitted (default) keeps the plain nested DOM
|
|
84
|
+
* path; an object additionally customizes row metrics.
|
|
85
|
+
* `expandedKeys`/`selectedKeys`/`checkedKeys` semantics are identical
|
|
86
|
+
* in both paths, and roving-tabindex keyboard navigation works the
|
|
87
|
+
* same way — focus moves `scrollToIndex` the target row into the
|
|
88
|
+
* window before focusing it.
|
|
89
|
+
*/
|
|
90
|
+
virtualized?: boolean | TreeVirtualizedConfig;
|
|
91
|
+
/**
|
|
92
|
+
* Async child loading: called when a node **without** `children` and
|
|
93
|
+
* without `isLeaf: true` is expanded (by click, keyboard, controlled
|
|
94
|
+
* `expandedKeys`, or the auto-expanded ancestor path of a search hit).
|
|
95
|
+
*
|
|
96
|
+
* While the promise is pending the node's switcher shows the loading
|
|
97
|
+
* spinner; resolved children are merged into an internal cache, so
|
|
98
|
+
* collapsing and re-expanding does **not** request again. Cache entries
|
|
99
|
+
* are dropped when the controlled `treeData` no longer maps onto them
|
|
100
|
+
* (the key disappeared, or the node now ships children of its own —
|
|
101
|
+
* controlled data always wins). An empty array marks the node as a
|
|
102
|
+
* leaf. A rejected promise renders an inline "Load failed · Retry"
|
|
103
|
+
* affordance on the node row; expanding a failed node again also
|
|
104
|
+
* retries.
|
|
105
|
+
*/
|
|
106
|
+
loadData?: (node: TreeNodeData) => Promise<TreeNodeData[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Search filter: when non-empty, only nodes whose (string) title
|
|
109
|
+
* matches case-insensitively — plus the ancestor path leading to
|
|
110
|
+
* them — are rendered, ancestors auto-expanded so hits stay visible,
|
|
111
|
+
* and every match is wrapped in a token-styled `<mark>`. `titleRender`
|
|
112
|
+
* output is passed through untouched. When nothing matches, the
|
|
113
|
+
* localized empty state is shown.
|
|
114
|
+
*/
|
|
115
|
+
searchValue?: string;
|
|
65
116
|
/** (受控)展开的节点 */
|
|
66
117
|
expandedKeys?: ControlOrValue<string[]>;
|
|
67
118
|
/** (受控)选中的节点 */
|
|
@@ -1,6 +1,79 @@
|
|
|
1
1
|
import type { TreeNodeData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A visible tree row: one treeitem in the depth-first order the tree
|
|
4
|
+
* renders (parents before children, expanded subtrees only). Backs both
|
|
5
|
+
* the roving-tabindex keyboard navigation and the virtualized windowing,
|
|
6
|
+
* which need the flat "visible rows" list rather than the recursive
|
|
7
|
+
* structure.
|
|
8
|
+
*/
|
|
9
|
+
export type VisibleTreeRow = {
|
|
10
|
+
key: string;
|
|
11
|
+
node: TreeNodeData;
|
|
12
|
+
/** Nesting depth; 0 for roots — matches TreeItem's `level` prop. */
|
|
13
|
+
level: number;
|
|
14
|
+
/** Parent row's key; null for roots. */
|
|
15
|
+
parentKey: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* showLine guide chain: one "is a last child" flag per ancestor level
|
|
18
|
+
* (length === level), the same chain the recursive render builds.
|
|
19
|
+
*/
|
|
20
|
+
isLast: boolean[];
|
|
21
|
+
/**
|
|
22
|
+
* Tree-level or per-node disabled flag. Disabled rows render (and can
|
|
23
|
+
* be expanded through controlled `expandedKeys`) but are skipped as
|
|
24
|
+
* keyboard focus stops.
|
|
25
|
+
*/
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Flatten the tree to its currently visible rows: children of a node are
|
|
30
|
+
* included only while that node is expanded — the exact visibility rule
|
|
31
|
+
* of the recursive render (`children?.length && expandedKeys.has(key)`).
|
|
32
|
+
*/
|
|
33
|
+
export declare function flattenVisibleTree(data: TreeNodeData[], expandedKeys: string[], treeDisabled: boolean): VisibleTreeRow[];
|
|
2
34
|
export declare function flattenTreeData(data: TreeNodeData[]): TreeNodeData[];
|
|
3
35
|
export declare function findNodeByKey(data: TreeNodeData[], key: string): TreeNodeData | null;
|
|
4
36
|
export declare function getChildKeys(data: TreeNodeData[], parentKey: string): string[];
|
|
5
37
|
export declare function getParentKey(data: TreeNodeData[], targetKey: string, parentKey?: string): string | null;
|
|
6
38
|
export declare function getAllLeafKeys(data: TreeNodeData[]): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Case-insensitive `[start, end)` ranges of every non-overlapping
|
|
41
|
+
* occurrence of `query` inside `text`, left to right. Empty when the
|
|
42
|
+
* query is empty or absent.
|
|
43
|
+
*/
|
|
44
|
+
export declare function matchRanges(text: string, query: string): [number, number][];
|
|
45
|
+
/** Does the node's own title match? Only string titles can match —
|
|
46
|
+
* ReactNode titles stay searchable through their descendants. */
|
|
47
|
+
export declare function nodeTitleMatches(node: TreeNodeData, query: string): boolean;
|
|
48
|
+
/** Result of `filterTreeByQuery`. */
|
|
49
|
+
export type FilteredTree = {
|
|
50
|
+
/** The pruned tree: matched nodes plus the ancestors leading to them. */
|
|
51
|
+
tree: TreeNodeData[];
|
|
52
|
+
/** Keys whose own title matched the query. */
|
|
53
|
+
matchedKeys: string[];
|
|
54
|
+
/** Keys of the strict ancestors of matches — auto-expanded while the
|
|
55
|
+
* search is active so every hit stays visible. */
|
|
56
|
+
ancestorKeys: string[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Filters the tree to the nodes whose own title matches `query`
|
|
60
|
+
* (case-insensitive) plus every ancestor on the path to them. Returns
|
|
61
|
+
* `null` when the query is empty (search inactive) so callers can keep
|
|
62
|
+
* the unfiltered data by reference.
|
|
63
|
+
*/
|
|
64
|
+
export declare function filterTreeByQuery(data: TreeNodeData[], query: string | undefined): FilteredTree | null;
|
|
65
|
+
/**
|
|
66
|
+
* Overlays lazy-loaded children onto the controlled data: a childless
|
|
67
|
+
* node with a cache entry adopts the loaded array; an empty load marks
|
|
68
|
+
* the node as a leaf (the server said "no children"). Returns `data`
|
|
69
|
+
* untouched (same reference) when nothing is cached, so memoized
|
|
70
|
+
* downstream work stays stable.
|
|
71
|
+
*/
|
|
72
|
+
export declare function mergeLoadedChildren(data: TreeNodeData[], loaded: Record<string, TreeNodeData[]>): TreeNodeData[];
|
|
73
|
+
/**
|
|
74
|
+
* Drops cache entries that no longer map onto the controlled data: keys
|
|
75
|
+
* that vanished, or nodes that now ship children of their own
|
|
76
|
+
* (controlled data wins over a stale load). Keeps the same reference
|
|
77
|
+
* when nothing is pruned.
|
|
78
|
+
*/
|
|
79
|
+
export declare function pruneLoadedChildren(loaded: Record<string, TreeNodeData[]>, data: TreeNodeData[]): Record<string, TreeNodeData[]>;
|
|
@@ -1,15 +1,59 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
2
|
import type { ControlOrValue } from 'react-use-control';
|
|
3
|
+
import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest } from './types';
|
|
3
4
|
type UploadProps = {
|
|
4
5
|
/** Selected files; uncontrolled (accumulating internally) when omitted. */
|
|
5
6
|
value?: ControlOrValue<File[]>;
|
|
6
7
|
accept?: string;
|
|
8
|
+
/** Renders the drag-and-drop drop area (default) or a plain
|
|
9
|
+
* click-only picker area — see `UploadCoreProps.droppable`. */
|
|
10
|
+
droppable?: boolean;
|
|
11
|
+
/** Gatekeeper for every picked or dropped file — see
|
|
12
|
+
* `UploadCoreProps.beforeUpload`. */
|
|
13
|
+
beforeUpload?: (file: File) => boolean | Promise<boolean>;
|
|
14
|
+
/** Cap for the committed list — see `UploadCoreProps.maxCount`. */
|
|
15
|
+
maxCount?: number;
|
|
7
16
|
multiple?: boolean;
|
|
17
|
+
/** Custom upload executor — see `UploadCoreProps.request`. */
|
|
18
|
+
request?: UploadRequest;
|
|
19
|
+
/** Upload endpoint for the built-in XHR executor — see
|
|
20
|
+
* `UploadCoreProps.action`. */
|
|
21
|
+
action?: string;
|
|
22
|
+
/** HTTP method for `action` uploads (default `POST`). */
|
|
23
|
+
method?: string;
|
|
24
|
+
/** Extra request headers for `action` uploads. */
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
/** Form field name carrying the file in `action` mode (default `file`). */
|
|
27
|
+
name?: string;
|
|
28
|
+
/** Extra form fields appended alongside the file in `action` mode. */
|
|
29
|
+
data?: Record<string, string | Blob>;
|
|
30
|
+
/** Picks only enter the list; uploads start via the `UploadHandle`
|
|
31
|
+
* ref — see `UploadCoreProps.manual`. */
|
|
32
|
+
manual?: boolean;
|
|
33
|
+
/** Built-in file list with progress and per-state actions — see
|
|
34
|
+
* `UploadCoreProps.showUploadList`. */
|
|
35
|
+
showUploadList?: boolean | {
|
|
36
|
+
itemRender?: UploadListItemRender;
|
|
37
|
+
};
|
|
38
|
+
/** Rendering style of the built-in list (`text` rows or a
|
|
39
|
+
* `picture-card` thumbnail grid) — see `UploadCoreProps.listType`. */
|
|
40
|
+
listType?: 'text' | 'picture-card';
|
|
41
|
+
/** Overrides the built-in remove-button label — see
|
|
42
|
+
* `UploadCoreProps.removeLabel`. */
|
|
43
|
+
removeLabel?: string;
|
|
44
|
+
/** Picks directories instead of files — see
|
|
45
|
+
* `UploadCoreProps.directory`. */
|
|
46
|
+
directory?: boolean;
|
|
47
|
+
/** Status-machine snapshot callback — see
|
|
48
|
+
* `UploadCoreProps.onStatusChange`. */
|
|
49
|
+
onStatusChange?: (files: UploadFileStatus[]) => void;
|
|
8
50
|
/** Fires with the freshly picked files only — the accumulated list is
|
|
9
|
-
* the `value` channel (or internal state when uncontrolled).
|
|
51
|
+
* the `value` channel (or internal state when uncontrolled).
|
|
52
|
+
* Removals and `clear()` do not fire this (they are not picks). */
|
|
10
53
|
onChange?: (files: File[]) => void;
|
|
11
54
|
className?: string;
|
|
12
55
|
children?: ReactNode;
|
|
56
|
+
ref?: Ref<UploadHandle>;
|
|
13
57
|
};
|
|
14
|
-
export default function Upload({ value: valueControl, accept, multiple, onChange, className, children, }: UploadProps): import("react").JSX.Element;
|
|
58
|
+
export default function Upload({ value: valueControl, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, removeLabel, directory, onStatusChange, onChange, className, children, ref, }: UploadProps): import("react").JSX.Element;
|
|
15
59
|
export type { UploadProps };
|
|
@@ -1,15 +1,106 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest } from './types';
|
|
2
3
|
type UploadCoreProps = {
|
|
3
4
|
/** The selected files — the field value, emitted verbatim (as the
|
|
4
5
|
* complete next list) by `onChange`. */
|
|
5
6
|
value: File[];
|
|
6
7
|
/** Emits the next file list: a single pick replaces `value`, a
|
|
7
|
-
* `multiple` pick appends to it.
|
|
8
|
+
* `multiple` pick appends to it. Removals from the built-in list
|
|
9
|
+
* (and `clear()`) also flow through here. */
|
|
8
10
|
onChange: (files: File[]) => void;
|
|
11
|
+
/** Comma-separated accept tokens (`.txt`, `image/*`, `text/plain`) —
|
|
12
|
+
* the same grammar the native picker uses. Dropped files that do not
|
|
13
|
+
* match are discarded silently (the native dialog already enforces
|
|
14
|
+
* this for click picks). */
|
|
9
15
|
accept?: string;
|
|
16
|
+
/** Gate for the drag-and-drop affordance. `true` (default) renders
|
|
17
|
+
* the dashed drop area with a drag-over highlight and accepts dropped
|
|
18
|
+
* files; `false` renders a plain click-only picker area. */
|
|
19
|
+
droppable?: boolean;
|
|
20
|
+
/** Gatekeeper applied to every file — click picks and drops alike —
|
|
21
|
+
* before it enters the value: return `false` (or a promise resolving
|
|
22
|
+
* to `false`) to drop the file. Verdicts for one pick are awaited
|
|
23
|
+
* together (`Promise.all`) and committed as a single `onChange` once
|
|
24
|
+
* every verdict resolved; the UI is not blocked while waiting.
|
|
25
|
+
* A refused file never enters the list, so it never uploads. */
|
|
26
|
+
beforeUpload?: (file: File) => boolean | Promise<boolean>;
|
|
27
|
+
/** Cap for the committed list. Applied last: existing entries win,
|
|
28
|
+
* then the freshly picked survivors; anything beyond the first
|
|
29
|
+
* `maxCount` entries is discarded silently. */
|
|
30
|
+
maxCount?: number;
|
|
31
|
+
/** A `multiple` pick appends to `value`, a single pick replaces it. */
|
|
10
32
|
multiple?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Custom upload executor. When given, every file entering the list
|
|
35
|
+
* (see `manual`) runs through it: call `options.onProgress` with a
|
|
36
|
+
* 0–100 percent, honor `options.signal` for cancellation, resolve on
|
|
37
|
+
* success and reject on failure. Takes precedence over `action`.
|
|
38
|
+
* Neither `request` nor `action` → pure collection mode, exactly the
|
|
39
|
+
* pre-executor behavior.
|
|
40
|
+
*/
|
|
41
|
+
request?: UploadRequest;
|
|
42
|
+
/**
|
|
43
|
+
* Upload endpoint for the built-in XHR executor: the file is sent as
|
|
44
|
+
* multipart FormData (field `name`, extra fields `data`) with `method`
|
|
45
|
+
* and `headers`; progress is wired to `xhr.upload.onprogress` and
|
|
46
|
+
* cancellation to `xhr.abort()`. Ignored when `request` is given.
|
|
47
|
+
*/
|
|
48
|
+
action?: string;
|
|
49
|
+
/** HTTP method for `action` uploads — defaults to `POST`. */
|
|
50
|
+
method?: string;
|
|
51
|
+
/** Extra request headers for `action` uploads. */
|
|
52
|
+
headers?: Record<string, string>;
|
|
53
|
+
/** Form field name carrying the file in `action` mode — defaults
|
|
54
|
+
* to `file`. */
|
|
55
|
+
name?: string;
|
|
56
|
+
/** Extra form fields appended alongside the file in `action` mode. */
|
|
57
|
+
data?: Record<string, string | Blob>;
|
|
58
|
+
/**
|
|
59
|
+
* `true` keeps picked files at `idle` — the upload only starts via
|
|
60
|
+
* the `UploadHandle` ref (`upload()`/`uploadAll()`). Only meaningful
|
|
61
|
+
* with `request` or `action`.
|
|
62
|
+
*/
|
|
63
|
+
manual?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Renders the built-in file list below the zone (default `false`):
|
|
66
|
+
* file name, live progress (reusing `Progress`), status icon and
|
|
67
|
+
* per-state actions — cancel while uploading, retry + remove on
|
|
68
|
+
* error, remove otherwise. Pass an `itemRender` to replace whole
|
|
69
|
+
* rows. Without `request`/`action` the list still tracks picks as
|
|
70
|
+
* `idle` rows with remove actions.
|
|
71
|
+
*/
|
|
72
|
+
showUploadList?: boolean | {
|
|
73
|
+
itemRender?: UploadListItemRender;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Rendering style of the built-in list (default `text`): `text`
|
|
77
|
+
* rows, or a `picture-card` grid of square thumbnail cards —
|
|
78
|
+
* object-URL previews for image files (revoked once the card leaves),
|
|
79
|
+
* a type-icon fallback for the rest, an upload mask with the live
|
|
80
|
+
* percent, and a danger border + retry on error.
|
|
81
|
+
*/
|
|
82
|
+
listType?: 'text' | 'picture-card';
|
|
83
|
+
/**
|
|
84
|
+
* Overrides the built-in remove-button label (list rows and
|
|
85
|
+
* picture-card corners); defaults to the locale string.
|
|
86
|
+
*/
|
|
87
|
+
removeLabel?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Picks directories instead of files: forwards the non-standard
|
|
90
|
+
* `webkitdirectory`/`directory` attributes to the hidden input, so
|
|
91
|
+
* the native dialog enumerates every file inside the chosen folder
|
|
92
|
+
* (combine with `multiple` so the whole tree stays in the list).
|
|
93
|
+
*/
|
|
94
|
+
directory?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Fires whenever the tracked entries change (added, removed, status
|
|
97
|
+
* or percent) with the complete snapshot in value order. Only tracks
|
|
98
|
+
* while `request`/`action` or `showUploadList` is in play.
|
|
99
|
+
*/
|
|
100
|
+
onStatusChange?: (files: UploadFileStatus[]) => void;
|
|
11
101
|
className?: string;
|
|
12
102
|
children?: ReactNode;
|
|
13
|
-
|
|
14
|
-
|
|
103
|
+
ref?: Ref<UploadHandle>;
|
|
104
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'value' | 'onChange' | 'children' | 'onClick' | 'onDrop' | 'onDragOver' | 'onDragEnter' | 'onDragLeave' | 'onKeyDown' | 'role' | 'tabIndex'>;
|
|
105
|
+
export default function UploadCore({ value, onChange, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, removeLabel, directory, onStatusChange, className, children, ref, ...rest }: UploadCoreProps): import("react").JSX.Element;
|
|
15
106
|
export type { UploadCoreProps };
|