@univerjs/design 0.6.1 → 0.6.2
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/lib/cjs/index.js +156 -74
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +15220 -11356
- package/lib/es/locale/en-US.js +3 -6
- package/lib/es/locale/fa-IR.js +0 -3
- package/lib/es/locale/fr-FR.js +72 -75
- package/lib/es/locale/ru-RU.js +48 -51
- package/lib/es/locale/vi-VN.js +16 -19
- package/lib/es/locale/zh-CN.js +0 -3
- package/lib/es/locale/zh-TW.js +0 -3
- package/lib/index.css +1 -1
- package/lib/types/components/avatar/Avatar.d.ts +3 -3
- package/lib/types/components/button/Button.d.ts +4 -4
- package/lib/types/components/checkbox-group/CheckboxGroup.d.ts +3 -3
- package/lib/types/components/config-provider/ConfigProvider.d.ts +1 -1
- package/lib/types/components/dialog/Dialog.d.ts +5 -0
- package/lib/types/components/dropdown/Dropdown.d.ts +11 -0
- package/lib/types/components/dropdown/Dropdown.stories.d.ts +2 -2
- package/lib/types/components/dropdown/PopoverPrimitive.d.ts +7 -0
- package/lib/types/components/dropdown/index.d.ts +1 -3
- package/lib/types/components/dropdown-legacy/DropdownLegacy.d.ts +1 -0
- package/lib/types/components/dropdown-menu/DropdownMenu.d.ts +31 -0
- package/lib/types/components/dropdown-menu/DropdownMenuPrimitive.d.ts +25 -0
- package/lib/types/components/dropdown-menu/index.d.ts +16 -0
- package/lib/types/components/input/Input.d.ts +1 -0
- package/lib/types/components/message/Message.d.ts +16 -2
- package/lib/types/components/radio-group/RadioGroup.d.ts +3 -3
- package/lib/types/components/segmented/Segmented.d.ts +28 -4
- package/lib/types/components/segmented/index.d.ts +1 -1
- package/lib/types/components/select/Select.d.ts +6 -6
- package/lib/types/components/separator/Separator.d.ts +4 -0
- package/lib/types/components/{slider/__test__/index.spec.d.ts → separator/index.d.ts} +1 -1
- package/lib/types/components/tooltip/Tooltip.d.ts +2 -1
- package/lib/types/{components/slider/index.d.ts → helper/is-browser.d.ts} +1 -1
- package/lib/types/index.d.ts +6 -4
- package/lib/types/locale/interface.d.ts +0 -1
- package/lib/umd/index.js +155 -73
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +9 -11
- package/lib/types/components/dropdown/DropdownContext.d.ts +0 -11
- package/lib/types/components/dropdown/DropdownOverlay.d.ts +0 -14
- package/lib/types/components/dropdown/DropdownProvider.d.ts +0 -9
- package/lib/types/components/dropdown/DropdownTrigger.d.ts +0 -6
- package/lib/types/components/icon/Icon.stories.d.ts +0 -6
- package/lib/types/components/slider/Slider.d.ts +0 -47
- package/lib/types/components/slider/Slider.stories.d.ts +0 -7
- /package/lib/types/{utils/render.d.ts → helper/react-dom.d.ts} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { Anchor, Content, Root, Trigger } from '@radix-ui/react-popover';
|
|
3
|
+
declare function PopoverPrimitive({ ...props }: ComponentProps<typeof Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: ComponentProps<typeof Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: ComponentProps<typeof Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function PopoverAnchor({ ...props }: ComponentProps<typeof Anchor>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { PopoverAnchor, PopoverContent, PopoverPrimitive, PopoverTrigger };
|
|
@@ -13,6 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
17
|
-
export { DropdownProvider } from './DropdownProvider';
|
|
18
|
-
export { DropdownTrigger } from './DropdownTrigger';
|
|
16
|
+
export { Dropdown } from './Dropdown';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Content } from '@radix-ui/react-popover';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
type DropdownMenu = {
|
|
4
|
+
type: 'item';
|
|
5
|
+
className?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onSelect?: (item: DropdownMenu) => void;
|
|
9
|
+
} | {
|
|
10
|
+
type?: 'separator';
|
|
11
|
+
className?: string;
|
|
12
|
+
} | {
|
|
13
|
+
type?: 'radio';
|
|
14
|
+
className?: string;
|
|
15
|
+
value: string;
|
|
16
|
+
options: {
|
|
17
|
+
value: string;
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
onSelect?: (item: string) => void;
|
|
22
|
+
};
|
|
23
|
+
export interface IDropdownProps {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
items: DropdownMenu[];
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
open?: boolean;
|
|
28
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function DropdownMenu(props: IDropdownProps & ComponentProps<typeof Content>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { CheckboxItem, Content, Group, Item, Label, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger } from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
declare function DropdownMenuPrimitive({ ...props }: ComponentProps<typeof Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: ComponentProps<typeof Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: ComponentProps<typeof Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DropdownMenuGroup({ ...props }: ComponentProps<typeof Group>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuSub({ ...props }: ComponentProps<typeof Sub>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DropdownMenuRadioGroup({ ...props }: ComponentProps<typeof RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: ComponentProps<typeof SubTrigger> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DropdownMenuSubContent({ className, ...props }: ComponentProps<typeof SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: ComponentProps<typeof Content>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: ComponentProps<typeof Item> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
variant?: 'default' | 'destructive';
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: ComponentProps<typeof CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: ComponentProps<typeof RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: ComponentProps<typeof Label> & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuPrimitive, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { DropdownMenu, type IDropdownProps } from './DropdownMenu';
|
|
@@ -13,6 +13,7 @@ export interface IInputProps extends Pick<InputProps, 'onFocus' | 'onBlur'> {
|
|
|
13
13
|
onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
14
14
|
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
15
15
|
onChange?: (value: string) => void;
|
|
16
|
+
style?: React.CSSProperties;
|
|
16
17
|
}
|
|
17
18
|
export declare const Input: ({ autoFocus, className, affixWrapperStyle, type, placeholder, value, size, allowClear, disabled, onClick, onKeyDown, onChange, onFocus, onBlur, ...props }: IInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
2
16
|
export declare enum MessageType {
|
|
3
17
|
Success = "success",
|
|
4
18
|
Info = "info",
|
|
@@ -13,4 +27,4 @@ export interface IMessageProps {
|
|
|
13
27
|
type?: MessageType;
|
|
14
28
|
onClose?: () => void;
|
|
15
29
|
}
|
|
16
|
-
export declare const Messager: () =>
|
|
30
|
+
export declare const Messager: () => import('react').ReactPortal | null, message: (props: Omit<IMessageProps, "id">) => void, removeMessage: (id?: string) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
export interface IRadioGroupProps {
|
|
3
|
-
children:
|
|
3
|
+
children: ReactNode[];
|
|
4
4
|
/**
|
|
5
5
|
* The class name of the checkbox group
|
|
6
6
|
*/
|
|
@@ -8,7 +8,7 @@ export interface IRadioGroupProps {
|
|
|
8
8
|
/**
|
|
9
9
|
* The style of the checkbox group
|
|
10
10
|
*/
|
|
11
|
-
style?:
|
|
11
|
+
style?: CSSProperties;
|
|
12
12
|
/**
|
|
13
13
|
* Define which radio is selected
|
|
14
14
|
*/
|
|
@@ -1,5 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
type ItemValue = string | number;
|
|
17
|
+
interface ISegmentedItem<T extends ItemValue = ItemValue> {
|
|
18
|
+
label: string;
|
|
19
|
+
value: T;
|
|
4
20
|
}
|
|
5
|
-
|
|
21
|
+
interface ISegmentedProps<T extends ItemValue = ItemValue> {
|
|
22
|
+
items: ISegmentedItem<T>[];
|
|
23
|
+
value?: T;
|
|
24
|
+
defaultValue?: T;
|
|
25
|
+
onChange?: (value: T) => void;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function Segmented<T extends ItemValue = ItemValue>({ items, value, defaultValue, onChange, className, }: ISegmentedProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { LabelInValueType } from 'rc-select/lib/Select';
|
|
2
|
+
import { CSSProperties, JSXElementConstructor, ReactElement, ReactNode } from 'react';
|
|
3
3
|
interface IOption {
|
|
4
|
-
label?: string |
|
|
4
|
+
label?: string | ReactNode;
|
|
5
5
|
value?: string;
|
|
6
6
|
options?: IOption[];
|
|
7
7
|
}
|
|
@@ -19,7 +19,7 @@ export interface ISelectProps {
|
|
|
19
19
|
* The callback function that is triggered when the value is changed
|
|
20
20
|
*/
|
|
21
21
|
onChange: (value: string) => void;
|
|
22
|
-
style?:
|
|
22
|
+
style?: CSSProperties;
|
|
23
23
|
/**
|
|
24
24
|
* Whether the borderless style is used
|
|
25
25
|
* @default false
|
|
@@ -30,10 +30,10 @@ export interface ISelectProps {
|
|
|
30
30
|
* select mode
|
|
31
31
|
*/
|
|
32
32
|
mode?: 'combobox' | 'multiple' | 'tags' | undefined;
|
|
33
|
-
dropdownRender?: (menu:
|
|
34
|
-
labelRender?: ((props: LabelInValueType) =>
|
|
33
|
+
dropdownRender?: (menu: ReactElement<any, string | JSXElementConstructor<any>>) => ReactElement<any, string | JSXElementConstructor<any>>;
|
|
34
|
+
labelRender?: ((props: LabelInValueType) => ReactNode) | undefined;
|
|
35
35
|
open?: boolean;
|
|
36
|
-
dropdownStyle?:
|
|
36
|
+
dropdownStyle?: CSSProperties;
|
|
37
37
|
onDropdownVisibleChange?: (open: boolean) => void;
|
|
38
38
|
disabled?: boolean;
|
|
39
39
|
}
|
|
@@ -33,5 +33,6 @@ export interface ITooltipProps {
|
|
|
33
33
|
* Callback when the visibility of the tooltip changes
|
|
34
34
|
*/
|
|
35
35
|
onVisibleChange?: (visible: boolean) => void;
|
|
36
|
+
className?: string;
|
|
36
37
|
}
|
|
37
|
-
export declare function Tooltip(
|
|
38
|
+
export declare function Tooltip(props: ITooltipProps): import("react/jsx-runtime").JSX.Element | undefined;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export { Confirm, type IConfirmProps } from './components/confirm';
|
|
|
25
25
|
export { DatePanel, DatePicker, type IDatePanelProps, type IDatePickerProps } from './components/date-picker';
|
|
26
26
|
export { Dialog, type IDialogProps } from './components/dialog';
|
|
27
27
|
export { DropdownLegacy, type IDropdownLegacyProps } from './components/dropdown-legacy';
|
|
28
|
-
export {
|
|
28
|
+
export { Dropdown } from './components/dropdown';
|
|
29
29
|
export { FormDualColumnLayout, FormLayout, type IFormDualColumnLayoutProps, type IFormLayoutProps } from './components/form-layout';
|
|
30
30
|
export { type IInputProps, type IInputWithSlotProps, Input, InputWithSlot } from './components/input';
|
|
31
31
|
export { type IInputNumberProps, InputNumber } from './components/input-number';
|
|
@@ -38,8 +38,7 @@ export { type IRadioGroupProps, RadioGroup } from './components/radio-group';
|
|
|
38
38
|
export { type IScrollbarProps, Scrollbar } from './components/scrollbar';
|
|
39
39
|
export { type ISelectProps, Select } from './components/select';
|
|
40
40
|
export { type ISelectListProps, SelectList } from './components/select-list';
|
|
41
|
-
export {
|
|
42
|
-
export { type ISliderProps, Slider } from './components/slider';
|
|
41
|
+
export { Segmented } from './components/segmented';
|
|
43
42
|
export { type ITooltipProps, Tooltip } from './components/tooltip';
|
|
44
43
|
export { filterLeafNode, findNodePathFromTree, findSubTreeFromPath, type ITreeNodeProps, type ITreeProps, mergeTreeSelected, Tree, TreeSelectionMode } from './components/tree';
|
|
45
44
|
export { Switch } from './components/switch';
|
|
@@ -48,4 +47,7 @@ export { defaultTheme, greenTheme, themeInstance } from './themes';
|
|
|
48
47
|
export { DraggableList, type IDraggableListProps } from './components/draggable-list';
|
|
49
48
|
export { clsx } from './helper/clsx';
|
|
50
49
|
export { resizeObserverCtor } from './helper/resize-observer';
|
|
51
|
-
export { render, unmount } from './
|
|
50
|
+
export { render, unmount } from './helper/react-dom';
|
|
51
|
+
export { isBrowser } from './helper/is-browser';
|
|
52
|
+
export { DropdownMenu, type IDropdownProps } from './components/dropdown-menu';
|
|
53
|
+
export { Separator } from './components/separator';
|