Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat(design): revamp `Dialog`, `Confirm`, `InputNumber` (#347)

白熱3537154160b9
diff --git a/packages/base-ui/src/Components/CellRange/CellRange.stories.tsx b/packages/base-ui/src/Components/CellRange/CellRange.stories.tsx
deleted file mode 100644
index 82b66dc610..0000000000
--- a/packages/base-ui/src/Components/CellRange/CellRange.stories.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { Meta } from '@storybook/react';
-
-import { CellRange } from './CellRange';
-
-const meta: Meta<typeof CellRange> = {
- title: 'Components / CellRange',
- component: CellRange,
- parameters: {
- layout: 'centered',
- },
- tags: ['autodocs'],
- args: {},
-};
-
-export default meta;
-
-export const Playground = {
- args: {},
-};
diff --git a/packages/base-ui/src/Components/CellRange/CellRange.tsx b/packages/base-ui/src/Components/CellRange/CellRange.tsx
deleted file mode 100644
index 740b8ed5d4..0000000000
--- a/packages/base-ui/src/Components/CellRange/CellRange.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import React, { useState } from 'react';
-
-import { BaseComponentProps } from '../../BaseComponent';
-// import * as Icon from '../Icon';
-import { Input } from '../Input';
-import { Modal } from '../Modal';
-import { ModalButtonGroup } from '../Modal/Modal';
-import styles from './index.module.less';
-
-export interface BaseCellRangeModalProps extends BaseComponentProps {
- value?: string;
- placeholder?: string;
- title?: string;
- contentPlaceholder?: string;
- onClick: () => void;
- onChange?: (e: Event) => void;
-}
-
-export function CellRange(props: BaseCellRangeModalProps) {
- const [value, setValue] = useState(props.value ?? '');
- const [show, setShow] = useState(false);
-
- const group: ModalButtonGroup[] = [
- {
- label: 'button.confirm',
- type: 'primary',
- onClick: props.onClick,
- },
- ];
-
- // const handleOk = (e: Event) => {
- // const { onClick } = props;
- // onClick?.(e);
- // setShow(false);
- // };
-
- const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
- const { onChange } = props;
- setValue(e.target.value);
- onChange?.(e.nativeEvent);
- };
-
- return (
- <div className={styles.cellRangeModal}>
- <Input placeholder={props.placeholder} value={value} onChange={handleChange}></Input>
- <span className={styles.cellModalIcon} onClick={() => setShow(true)}>
- {/* <Icon.Sheet.TableIcon /> */}
- </span>
- <Modal title={props.title} visible={show} group={group}>
- <Input readonly={true} placeholder={props.contentPlaceholder} value={value}></Input>
- </Modal>
- </div>
- );
-}
diff --git a/packages/base-ui/src/Components/CellRange/cell-range-zh.md b/packages/base-ui/src/Components/CellRange/cell-range-zh.md
deleted file mode 100644
index 9437dd87f1..0000000000
--- a/packages/base-ui/src/Components/CellRange/cell-range-zh.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-category: Components
-type: 通用
-title: CellRangeModal
-subtitle: 范围选择组件
-cover: ''
----
-
-## 介绍
-
-范围选择组件
-
-## API
-
-属性说明如下:
-
-```jsx
-type ModalButtonGroup = {
- name?: string,
- label?: string,
- onClick?: (e?: any) => void,
- type?: string,
-};
-
-interface ModalProps extends ModalBaseProps {
- show?: boolean;
- name?: string;
-}
-```
-
-| 属性 | 说明 | 类型 | 默认值 |
-
-| placeholderProps | 范围选择输入框占位符 | string | - |
-| valueProps | 范围 | string | - |
-| placeholderState | 范围选择确定框占位符 | string | - |
-| modalData | 范围选择确定模态框内容 | ModalProps | - |
-| value | 范围选择确定框值 | string | - |
-
-## 案例
-
-```jsx
-import { CellRangeModal } from '@univerjs/style-univer';
-
-<CellRangeModal placeholderProps="请使用字符串" valueProps="A10:B10"></CellRangeModal>;
-```
diff --git a/packages/base-ui/src/Components/CellRange/cell-range.md b/packages/base-ui/src/Components/CellRange/cell-range.md
deleted file mode 100644
index 3bfa8b72e7..0000000000
--- a/packages/base-ui/src/Components/CellRange/cell-range.md
+++ /dev/null
@@ -1,44 +0,0 @@
----
-category: Components
-type: General
-title: CellRangeModal
-cover: ''
----
-
-## Introduce
-
-CellRangeModal Component
-
-## API
-
-Property Introduction:
-
-```jsx
-type ModalButtonGroup = {
- name?: string,
- label?: string,
- onClick?: (e?: any) => void,
- type?: string,
-};
-
-interface ModalProps extends ModalBaseProps {
- show?: boolean;
- name?: string;
-}
-```
-
-| Property | Description | Type | Default |
-
-| placeholderProps | placeholders of Range select input | string | - |
-| valueProps | range value | string | - |
-| placeholderState | placeholder of Range selection confirmation input | string | - |
-| modalData | contents of the range selection modal | ModalProps | - |
-| value | range value of range selection modal | string | - |
-
-## Case
-
-```jsx
-import { CellRangeModal } from '@univerjs/style-univer';
-
-<CellRangeModal placeholderProps="请使用字符串" valueProps="A10:B10"></CellRangeModal>;
-```
diff --git a/packages/base-ui/src/Components/CellRange/index.module.less b/packages/base-ui/src/Components/CellRange/index.module.less
deleted file mode 100644
index a5e3fdac0e..0000000000
--- a/packages/base-ui/src/Components/CellRange/index.module.less
+++ /dev/null
@@ -1,20 +0,0 @@
-.cell-range-modal {
- position: relative;
- height: 100%;
-
- .input {
- height: 100%;
- }
-
- .cell-modal-icon {
- position: absolute;
- right: 0.5em;
- top: 50%;
- transform: translateY(-50%);
- height: 100%;
- color: rgb(var(--primary-color));
- cursor: pointer;
- display: flex;
- align-items: center;
- }
-}
diff --git a/packages/base-ui/src/Components/CellRange/index.ts b/packages/base-ui/src/Components/CellRange/index.ts
deleted file mode 100644
index 0fa08e1641..0000000000
--- a/packages/base-ui/src/Components/CellRange/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './CellRange';
diff --git a/packages/base-ui/src/Components/Collapse/Collapse.stories.tsx b/packages/base-ui/src/Components/Collapse/Collapse.stories.tsx
deleted file mode 100644
index d645ccb840..0000000000
--- a/packages/base-ui/src/Components/Collapse/Collapse.stories.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import type { Meta } from '@storybook/react';
-
-import { Collapse } from './Collapse';
-
-const meta: Meta<typeof Collapse> = {
- title: 'Components / Collapse',
- component: Collapse,
- parameters: {
- layout: 'centered',
- },
- tags: ['autodocs'],
- args: {
- children: 'Collapse Content',
- header: 'Collapse Header',
- },
-};
-
-export default meta;
-
-export const Playground = {
- args: {},
-};
diff --git a/packages/base-ui/src/Components/Collapse/Collapse.tsx b/packages/base-ui/src/Components/Collapse/Collapse.tsx
deleted file mode 100644
index 02d0a202fb..0000000000
--- a/packages/base-ui/src/Components/Collapse/Collapse.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { useState } from 'react';
-
-import { joinClassNames } from '../../Utils';
-// import { NextIcon } from '../Icon/Format';
-import Style from './index.module.less';
-
-export interface BaseCollapseProps {
- children: React.ReactNode;
-
- /**
- * Set the header of collapse
- */
- header: string;
-}
-
-/**
- * Collapse Component
- */
-export function Collapse(props: BaseCollapseProps) {
- const { header, children } = props;
- const [panelBodyClassName, setPanelBodyClassName] = useState(joinClassNames(Style.panelBody));
-
- const handelClick = () => {
- const className: string | undefined = panelBodyClassName;
- if ((className as string).includes('active')) {
- setPanelBodyClassName(joinClassNames(Style.panelBody));
- } else {
- setPanelBodyClassName(joinClassNames(Style.panelBody, Style.active));
- }
- };
-
- return (
- <div className={Style.panelWrapper}>
- <div className={Style.panelHeader} onClick={handelClick}>
- {header}
- <span
- className={`${Style.panelHeaderIcon} ${
- panelBodyClassName!.includes('active') ? Style.panelHeaderIconRotate : ''
- }`}
- >
- {/* <NextIcon /> */}
- </span>
- </div>
- <div className={panelBodyClassName}>{children}</div>
- </div>
- );
-}
diff --git a/packages/base-ui/src/Components/Collapse/index.module.less b/packages/base-ui/src/Components/Collapse/index.module.less
deleted file mode 100644
index c9b1938f1b..0000000000
--- a/packages/base-ui/src/Components/Collapse/index.module.less
+++ /dev/null
@@ -1,28 +0,0 @@
-.panel-wrapper {
- width: 100%;
- &:first-child ~ & {
- margin-top: -1px;
- }
- border-bottom: 1px solid var(--border-color);
-
- .panel-header {
- padding: 10px;
- cursor: pointer;
- display: flex;
- .panel-header-icon {
- margin-left: auto;
- transition: all 0.1s;
- &.panel-header-icon-rotate {
- transform: rotate(180deg);
- }
- }
- }
-
- .panel-body {
- padding-bottom: 10px;
- display: none;
- &.active {
- display: block;
- }
- }
-}
diff --git a/packages/base-ui/src/Components/Collapse/index.ts b/packages/base-ui/src/Components/Collapse/index.ts
deleted file mode 100644
index 5fda998267..0000000000
--- a/packages/base-ui/src/Components/Collapse/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Collapse';
diff --git a/packages/base-ui/src/Components/Collapse/test/index.test.tsx b/packages/base-ui/src/Components/Collapse/test/index.test.tsx
deleted file mode 100644
index bd7e01faaf..0000000000
--- a/packages/base-ui/src/Components/Collapse/test/index.test.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-// test Collapse
-
-import { render } from '@testing-library/react';
-import { describe, expect, test } from 'vitest';
-
-import { Collapse } from '../Collapse';
-
-describe('Collapse', () => {
- test('renders correctly', () => {
- const { container } = render(<Collapse header="Collapse Header">Collapse Content</Collapse>);
- expect(container);
- });
-});
diff --git a/packages/base-ui/src/Components/Confirm/Confirm.stories.tsx b/packages/base-ui/src/Components/Confirm/Confirm.stories.tsx
deleted file mode 100644
index 234bb8b5e5..0000000000
--- a/packages/base-ui/src/Components/Confirm/Confirm.stories.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { Meta } from '@storybook/react';
-
-import { Confirm } from './Confirm';
-
-const meta: Meta<typeof Confirm> = {
- title: 'Components / Confirm',
- component: Confirm,
- parameters: {
- layout: 'centered',
- },
- tags: ['autodocs'],
- args: {
- content: '#abcdef',
- },
-};
-
-export default meta;
-
-export const Playground = {
- args: {},
-};
diff --git a/packages/base-ui/src/Components/Confirm/Confirm.tsx b/packages/base-ui/src/Components/Confirm/Confirm.tsx
deleted file mode 100644
index d27df5bbf3..0000000000
--- a/packages/base-ui/src/Components/Confirm/Confirm.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-// interface IState {
-// show: boolean;
-// }
-// export class Confirm extends Component<BaseConfirmProps, IState> {
-// constructor(props: BaseConfirmProps) {
-// super();
-// this.state = {
-// show: props.show ?? false,
-// };
-// }
-// showModal(show: boolean) {
-// this.setState({
-// show,
-// });
-// }
-// handleClick() {
-// const { onClick } = this.props;
-// onClick?.();
-// this.showModal(false);
-// }
-// getGroup() {
-// const group = [
-// {
-// label: <CustomLabel label="button.confirm" />,
-// type: 'primary',
-// onClick: () => this.handleClick(),
-// },
-// {
-// label: <CustomLabel label="button.cancel" />,
-// onClick: () => this.showModal(false),
-// },
-// ];
-// return group;
-// }
-// override UNSAFE_componentWillReceiveProps(props: BaseConfirmProps): void {
-// if (props.show !== this.props.show) {
-// this.setState({
-// show: props.show,
-// });
-// }
-// }
-// render() {
-// const { title, content } = this.props;
-// const { show } = this.state;
-// return (
-// <div className={styles.confirmModal}>
-// <Modal visible={show} isDrag={true} title={title} group={this.getGroup()}>
-// {content}
-// </Modal>
-// </div>
-// );
-// }
-// }
-import React, { useEffect, useState } from 'react';
-
-import { Modal, ModalButtonGroup } from '../Modal';
-import styles from './index.module.less';
-
-interface BaseConfirmProps {
- title: string;
- content: string;
- onClick?: () => void;
- show?: boolean;
-}
-
-export function Confirm({ title, content, onClick, show = false }: BaseConfirmProps) {
- const [visible, setVisible] = useState(show);
-
- useEffect(() => {
- setVisible(show);
- }, [show]);
-
- const handleClick = () => {
- onClick?.();
- setVisible(false);
- };
-
- const getGroup: ModalButtonGroup[] = [
- {
- label: 'button.confirm',
- type: 'primary',
- onClick: handleClick,
- },
- {
- type: 'default',
- label: 'button.cancel',
- onClick: () => setVisible(false),
- },
- ];
-
- return (
- <div className={styles.confirmModal}>
- <Modal visible={visible} isDrag={true} title={title} group={getGroup}>
- {content}
- </Modal>
- </div>
- );
-}
diff --git a/packages/base-ui/src/Components/Confirm/index.module.less b/packages/base-ui/src/Components/Confirm/index.module.less
deleted file mode 100644
index fe2d440bba..0000000000
--- a/packages/base-ui/src/Components/Confirm/index.module.less
+++ /dev/null
@@ -1,27 +0,0 @@
-@import '../../Basics/CSS/Skin/default.module.less';
-
-.confirm-modal {
- .modal-mask {
- background-color: rgba(255, 255, 255, 0.6);
- }
-
- .modal-header {
- position: relative;
- }
-
- .modal-close {
- position: absolute;
- right: 1.5rem;
- top: 0
- }
-
- .drag {
- box-shadow: 0 4px 16px rgb(0 0 0 / 20%);
- background-clip: padding-box;
- border: 1px solid rgba(0, 0, 0, .333)
- }
-
- .modal-body {
- color: rgba(0, 0, 0, 0.6);
- }
-}
\ No newline at end of file
diff --git a/packages/base-ui/src/Components/Confirm/index.ts b/packages/base-ui/src/Components/Confirm/index.ts
deleted file mode 100644
index d8e1c97b8c..0000000000
--- a/packages/base-ui/src/Components/Confirm/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Confirm';
diff --git a/packages/base-ui/src/Components/Drag/Drag.stories.tsx b/packages/base-ui/src/Components/Drag/Drag.stories.tsx
deleted file mode 100644
index 4da2f2479d..0000000000
--- a/packages/base-ui/src/Components/Drag/Drag.stories.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { Meta, StoryFn } from '@storybook/react';
-import { Container } from '@univerjs/design'; // Introduction to components for parent containers
-
-import { BaseDragProps, Drag } from './Drag';
-
-const meta: Meta<typeof Drag> = {
- title: 'Components / Drag',
- component: Drag,
- parameters: {
- layout: 'left',
- },
- tags: ['autodocs'],
- decorators: [
- (Story) => (
- <Container style={{ height: '300px' }}>
- <Story />
- </Container>
- ),
- ],
-};
-
-export default meta;
-// 创建一个模板
-const Template: StoryFn<BaseDragProps> = (args) => <Drag {...args} />;
-
-// 添加一些默认属性
-export const Default: StoryFn<BaseDragProps> = Template.bind({});
-Default.args = {
- // 在这里设置您的组件的默认属性
- children: <div>test drag</div>,
-};
diff --git a/packages/base-ui/src/Components/Drag/Drag.tsx b/packages/base-ui/src/Components/Drag/Drag.tsx
deleted file mode 100644
index 86c243ade8..0000000000
--- a/packages/base-ui/src/Components/Drag/Drag.tsx
+++ /dev/null
@@ -1,139 +0,0 @@
-import { IKeyValue } from '@univerjs/core';
-import React, { useEffect, useRef } from 'react';
-
-import styles from './index.module.less';
-
-export interface BaseDragProps {
- children: React.ReactNode;
-
- /**
- * Semantic DOM class
- * @default ''
- * */
- className?: string;
-
- /**
- * Whether to enable drag
- * @default true
- */
- isDrag?: boolean;
-}
-
-/**
- * Drag Component
- */
-export function Drag({ isDrag = true, className = '', children }: BaseDragProps) {
- const rootRef = useRef<HTMLDivElement | null>(null);
-
- const getPosition = () => {
- const w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
- const h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
- const rootW = rootRef.current?.offsetWidth || 0;
- const rootH = rootRef.current?.offsetHeight || 0;
- const top = (h - rootH) / 2;
- const left = (w - rootW) / 2;
-
- return {
- top,
- left,
- };
- };
-
- const initDragDialog = () => {
- const drag = rootRef.current;
-
- if (!drag) return;
-
- const divMask = drag.querySelector(`.${styles.dragMask}`) as HTMLElement;
-
- const dragBarTop = drag.querySelector(`.${styles.dragBarTop}`) as HTMLElement;
- const dragBarBottom = drag.querySelector(`.${styles.dragBarBottom}`) as HTMLElement;
- const dragBarLeft = drag.querySelector(`.${styles.dragBarLeft}`) as HTMLElement;
- const dragBarRight = drag.querySelector(`.${styles.dragBarRight}`) as HTMLElement;
-
- const pointerDownListener = (e: PointerEvent) => {
- e = e || window.event;
- const diffX = e.clientX - drag.offsetLeft;
- const diffY = e.clientY - drag.offsetTop;
- console.info('diffX', e, drag.offsetLeft, diffX);
-
- if (typeof (drag as IKeyValue).setCapture !== 'undefined') {
- (drag as IKeyValue).setCapture();
- }
-
- divMask.style.width = '100%';
- divMask.style.height = '100%';
-
- document.body.style.userSelect = 'none';
-
- const pointerMoveListener = (e: PointerEvent) => {
- e = e || window.event;
- let left = e.clientX - diffX;
- let top = e.clientY - diffY;
-
- if (left < -drag.offsetWidth + 100) {
- left = -drag.offsetWidth + 100;
- } else if (left > window.innerWidth - 100) {
- left = window.innerWidth - 100;
- }
- if (top < -drag.offsetHeight + 100) {
- top = -drag.offsetHeight + 100;
- } else if (top > window.innerHeight - 100) {
- top = window.innerHeight - 100;
- }
-
- drag.style.left = `${left}px`;
- drag.style.top = `${top}px`;
- drag.style.transform = '';
- };
-
- const pointerUpListener = (e: PointerEvent) => {
- document.removeEventListener('pointermove', pointerMoveListener);
- document.removeEventListener('pointerup', pointerUpListener);
-
- if (typeof (drag as IKeyValue).releaseCapture !== 'undefined') {
- (drag as IKeyValue).releaseCapture();
- }
-
- divMask.style.width = '0';
- divMask.style.height = '0';
- document.body.style.userSelect = '';
- };
-
- document.addEventListener('pointermove', pointerMoveListener);
- document.addEventListener('pointerup', pointerUpListener);
- };
-
- dragBarTop?.addEventListener('pointerdown', pointerDownListener);
- dragBarBottom?.addEventListener('pointerdown', pointerDownListener);
- dragBarLeft?.addEventListener('pointerdown', pointerDownListener);
- dragBarRight?.addEventListener('pointerdown', pointerDownListener);
- };
-
- useEffect(() => {
- if (isDrag) {
- initDragDialog();
- }
- }, [isDrag]);
-
- return (
- <>
- {isDrag ? (
- <div className={styles.dragContainer} ref={rootRef}>
- <div className={`${styles.dragDialog} ${className}`}>
- {children}
-
- <div className={styles.dragBarLeft}></div>
- <div className={styles.dragBarRight}></div>
- <div className={styles.dragBarTop}></div>
- <div className={styles.dragBarBottom}></div>
-
- <div className={styles.dragMask}></div>
- </div>
- </div>
- ) : (
- children
- )}
- </>
- );
-}
diff --git a/packages/base-ui/src/Components/Drag/index.module.less b/packages/base-ui/src/Components/Drag/index.module.less
deleted file mode 100644
index c6ad4f50bb..0000000000
--- a/packages/base-ui/src/Components/Drag/index.module.less
+++ /dev/null
@@ -1,108 +0,0 @@
-// .drag {
-// // width: fit-content;
-// // height: max-content;
-// position: fixed;
-// padding: 10px;
-// background-color: #fff;
-// cursor: move;
-// z-index: 1;
-// // & * {
-// cursor: auto;
-// // }
-// }
-
-// .drag-top {
-// width: 100%;
-// height: 10px;
-// position: absolute;
-// top: 0;
-// background-color: #222;
-// }
-
-// .drag-bottom {
-// width: 100%;
-// height: 10px;
-// position: absolute;
-// bottom: 0;
-// background-color: #555;
-// }
-
-// .drag-left {
-// width: 10px;
-// height: 100%;
-// position: absolute;
-// left: 0;
-// top: 0;
-// background-color: #888;
-// }
-
-// .drag-right {
-// width: 10px;
-// height: 100%;
-// position: absolute;
-// top: 0;
-// right: 0;
-// background-color: #222;
-// }
-
-
-.drag-container{
- position: fixed;
- top: 0;
- left: 0;
- z-index: 4;
-}
-
-// .drag-dialog{
-// position:absolute;
-// }
-
-.drag-bar-left{
- background:transparent;
- position: absolute;
- left:0;
- top:0;
- bottom:0;
- width:10px;
- cursor: move;
- display: block;
-}
-.drag-bar-right{
- background:transparent;
- position: absolute;
- right:0;
- top:0;
- bottom:0;
- width:10px;
- cursor: move;
- display: block;
-}
-.drag-bar-top{
- background:transparent;
- position: absolute;
- left:0;
- top:0;
- right:0;
- height:10px;
- cursor: move;
- display: block;
-}
-.drag-bar-bottom{
- background:transparent;
- position: absolute;
- left:0;
- right:0;
- bottom:0;
- height:10px;
- cursor: move;
- display: block;
-}
-
-/* 拖动时遮住整个弹框放置鼠标触发了里面的按钮 */
-.drag-mask{
- position: absolute;
- cursor: move;
- user-select: none;
- left:0;
- top:0;
-}
\ No newline at end of file
diff --git a/packages/base-ui/src/Components/Drag/index.ts b/packages/base-ui/src/Components/Drag/index.ts
deleted file mode 100644
index b96083f624..0000000000
--- a/packages/base-ui/src/Components/Drag/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Drag';
diff --git a/packages/base-ui/src/Components/Drag/test/Drag.test.tsx b/packages/base-ui/src/Components/Drag/test/Drag.test.tsx
deleted file mode 100644
index 98f43988df..0000000000
--- a/packages/base-ui/src/Components/Drag/test/Drag.test.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { render } from '@testing-library/react';
-import { describe, expect, test } from 'vitest';
-
-import { Drag } from '../Drag';
-
-describe('Drag', () => {
- test('should display initial Drag', () => {
- const { container } = render(<Drag>drag content text</Drag>);
-
- expect(container.textContent).toMatch('drag content text');
- });
-});
diff --git a/packages/base-ui/src/Components/InputNumber/InputNumber.stories.tsx b/packages/base-ui/src/Components/InputNumber/InputNumber.stories.tsx
deleted file mode 100644
index eb0247f3d7..0000000000
--- a/packages/base-ui/src/Components/InputNumber/InputNumber.stories.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import type { Meta } from '@storybook/react';
-
-import { InputNumber } from './InputNumber';
-
-const meta: Meta<typeof InputNumber> = {
- title: 'Components / InputNumber',
- component: InputNumber,
- parameters: {
- layout: 'centered',
- },
- tags: ['autodocs'],
- args: {
- value: 1,
- min: 0,
- max: 10,
- },
-};
-
-export default meta;
-
-export const Playground = {
- args: {},
-};
diff --git a/packages/base-ui/src/Components/InputNumber/InputNumber.tsx b/packages/base-ui/src/Components/InputNumber/InputNumber.tsx
deleted file mode 100644
index 74eab7fef4..0000000000
--- a/packages/base-ui/src/Components/InputNumber/InputNumber.tsx
+++ /dev/null
@@ -1,163 +0,0 @@
-import React, { useRef, useState } from 'react';
-
-import { joinClassNames } from '../../Utils/util';
-import styles from './Style/index.module.less';
-
-export interface BaseInputNumberProps {
- /**
- * Input's class name
- */
- className?: string;
-
- /**
- * The input content value
- */
- value?: number;
-
- /**
- * minimum value
- */
- min?: number;
-
- /**
- * maximum number
- */
- max?: number;
-
- /**
- * Whether the input is read only
- * @default false
- */
- readonly?: boolean;
-
- /**
- * Whether the input is disabled
- * @default false
- */
- disabled?: boolean;
-
- /**
- * Whether has border style
- * @default true
- */
- bordered?: boolean;
-
- /**
- * Callback when user input
- */
- onChange?: (value: number) => void;
-
- /**
- * The callback function that is triggered when Enter key is pressed
- */
- onPressEnter?: (value: number) => void;
-
- /**
- * Whether the input is blur
- */
- onBlur?: (value: number) => void;
-}
-
-/**
- * Input Number Component
- */
-export const InputNumber: React.FC<BaseInputNumberProps> = ({
- value = 0,
- onChange,
- min = -Infinity,
- max = Infinity,
- onPressEnter,
- onBlur,
- readonly = false,
- disabled = false,
- bordered = true,
- className = '',
-}) => {
- const [inputValue, setInputValue] = useState(value);
- const ref = useRef<HTMLInputElement>(null);
-
- const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
- let newValue = parseFloat(e.target.value);
- if (isNaN(newValue)) {
- newValue = 0;
- }
- if (newValue < min) {
- newValue = min;
- } else if (newValue > max) {
- newValue = max;
- }
- setInputValue(newValue);
- if (onChange) {
- onChange(newValue);
- }
- };
-
- const handleIncrement = () => {
- if (readonly) return;
-
- const newValue = inputValue + 1;
- if (newValue <= max) {
- setInputValue(newValue);
- if (onChange) {
- onChange(newValue);
- }
- }
- };
-
- const handleDecrement = () => {
- if (readonly) return;
-
- const newValue = inputValue - 1;
- if (newValue >= min) {
- setInputValue(newValue);
- if (onChange) {
- onChange(newValue);
- }
- }
- };
-
- const handlePressEnter = (e: React.KeyboardEvent<HTMLInputElement>) => {
- if (e.key === 'Enter' && onPressEnter) {
- onPressEnter(inputValue);
- ref.current?.blur();
- }
- };
-
- const handleBlur = (e: React.FocusEvent<HTMLInputElement, Element>) => {
- if (onBlur) {
- onBlur(inputValue);
- }
- };
-
- const classes = joinClassNames(styles.input, {
- [`${styles.input}-disable`]: disabled,
- [`${styles.input}-borderless`]: !bordered,
- });
-
- return (
- <div className={`${styles.inputNumber} ${className}`}>
- <div className={styles.inputWrap}>
- <input
- ref={ref}
- type="text"
- value={inputValue}
- disabled={disabled}
- onChange={handleInputChange}
- className={classes}
- onKeyUp={handlePressEnter}
- onBlur={handleBlur}
- readOnly={readonly}
- />
- </div>
-
- <div className={styles.inputButtons} style={{ display: disabled ? 'none' : 'flex' }}>
- <button onClick={handleIncrement} className={styles.inputButton}>
- <span>+</span>
- </button>
- <button onClick={handleDecrement} className={styles.inputButton}>
- <span>-</span>
- </button>
- </div>
- </div>
- );
-};
diff --git a/packages/base-ui/src/Components/InputNumber/Style/index.module.less b/packages/base-ui/src/Components/InputNumber/Style/index.module.less
deleted file mode 100644
index f08c879505..0000000000
--- a/packages/base-ui/src/Components/InputNumber/Style/index.module.less
+++ /dev/null
@@ -1,84 +0,0 @@
-@import '../../../Basics/CSS/Skin/default.module.less';
-@import '../../Input/Style/mixin.less';
-
-.input {
- .input();
-}
-
-
-.input-number {
- position: relative;
- display: flex;
- align-items: center;
- width: 32px;
- box-sizing: border-box;
-
- &:hover {
- .input-buttons {
- // opacity: 1;
- }
- }
- .input{
- background-color: var(--bg-color-secondary);
- border: 2px solid var(--primary-color);
- border-radius: var(--border-radius-base);
-
- // Center
- text-align: center;
- }
-}
-
-
-.input-wrap {
- position: absolute;
- right: 0;
- height: 100%;
-}
-
-.input-buttons {
- position: absolute;
- right: 1px;
- display: flex;
- // opacity: 0;
- flex-direction: column;
- transition: opacity 0.1s linear;
-
- .input-button {
- background-color: transparent;
- border-style: solid;
- border-color: var(--primary-color);
- color: var(--text-color);
- cursor: pointer;
-
- span {
- display: block;
- font-size: 9px;
- text-align: center;
- line-height: 0;
- }
-
- }
-
- .input-button:first-child {
- border-width: 0px 0px 2px 2px;
- // padding-top: 1px;
- height: 13px;
-
- &:hover{
- background-color: fade(@primary-color,10%);
- border-radius: 0px var(--border-radius-base) 0px 0px;
-
- }
- }
-
- .input-button:last-child {
- border-width: 0px 0px 0px 2px;
- // padding-bottom: 1px;
- height: 11px;
-
- &:hover{
- background-color: fade(@primary-color,10%);
- border-radius: 0px 0px var(--border-radius-base) 0px;
- }
- }
-}
\ No newline at end of file
diff --git a/packages/base-ui/src/Components/InputNumber/index.ts b/packages/base-ui/src/Components/InputNumber/index.ts
deleted file mode 100644
index 69c441376d..0000000000
--- a/packages/base-ui/src/Components/InputNumber/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './InputNumber';
diff --git a/packages/base-ui/src/Components/InputNumber/test/index.test.tsx b/packages/base-ui/src/Components/InputNumber/test/index.test.tsx
deleted file mode 100644
index 182832f77c..0000000000
--- a/packages/base-ui/src/Components/InputNumber/test/index.test.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import { fireEvent, render } from '@testing-library/react';
-import { describe, expect, test } from 'vitest';
-
-import { InputNumber } from '../InputNumber';
-
-describe('input number', () => {
- test('render', () => {
- const { container } = render(<InputNumber value={0} />);
- expect(container);
- });
-
- test('min max', () => {
- const { container } = render(<InputNumber value={0} min={0} max={5} />);
- const input = container.querySelector('input') as HTMLInputElement;
- const buttonAddition = container?.querySelectorAll('button')[0];
- const buttonSubtraction = container?.querySelectorAll('button')[1];
-
- // buttonAddition clicked 10 times
- for (let i = 0; i < 10; i++) {
- fireEvent.click(buttonAddition!);
- }
-
- // Test the value of the input
- expect(input!.value).toBe('5');
-
- // buttonSubtraction click 10 times
- for (let i = 0; i < 10; i++) {
- fireEvent.click(buttonSubtraction!);
- }
-
- // Test the value of the input
- expect(input!.value).toBe('0');
- });
-
- test('input/change event', () => {
- const { container } = render(<InputNumber value={0} />);
- const input = container.querySelector('input');
- fireEvent.input(input!, { target: { value: 1 } });
- expect(input!.value).toBe('1');
- fireEvent.change(input!, { target: { value: 2 } });
- expect(input!.value).toBe('2');
- });
-
- test('blur event', () => {
- let a = 1;
- const { container } = render(<InputNumber value={0} onBlur={() => a++} disabled />);
- fireEvent.click(container.querySelector('input')!);
- fireEvent.blur(container.querySelector('input')!);
- expect(a).toEqual(2);
- });
-
- test('press enter event', () => {
- let a = 0;
- const { container } = render(
- <InputNumber
- value={1}
- onPressEnter={(v) => {
- a = v;
- }}
- />
- );
- const input = container.querySelector('input');
- fireEvent.keyUp(input!, {
- key: 'Enter',
- code: 'Enter',
- keyCode: 13,
- charCode: 13,
- });
- expect(a).toEqual(1);
- });
-});
diff --git a/packages/base-ui/src/Components/Modal/Modal-zh.md b/packages/base-ui/src/Components/Modal/Modal-zh.md
deleted file mode 100644
index d2f93dcaed..0000000000
--- a/packages/base-ui/src/Components/Modal/Modal-zh.md
+++ /dev/null
@@ -1,40 +0,0 @@
----
-category: Modal
-type: 通用
-title: Modal
-subtitle: 模态框
-cover: ''
----
-
-## 介绍
-
-模态框
-
-## API
-
-模态框的属性说明如下:
-
-| 属性 | 说明 | 类型 | 默认值 |
-| --------- | ------------------------------------ | -------- | ------ |
-| title | 模态框标题 | string | - |
-| width | 模态框宽度 | number | 500px |
-| className | 模态框类名 | string | - |
-| isDrag | 模态框是否可以拖动 | boolean | false |
-| visible | 模态框是否可见 | boolean | false |
-| mask | 模态框遮罩 | boolean | true |
-| footer | 模态框是否显示底部 | boolean | false |
-| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function | - |
-
-## 案例
-
-```jsx
-import { Modal } from '@univerjs/style-univer';
-
-const Demo = () => {
- return (
- <Modal visible={false} title="this is mode" width={500} className="className" isDrag={true} mask={false} footer={false} onCancel={() => {}}>
- {}
- </Modal>
- );
-};
-```
diff --git a/packages/base-ui/src/Components/Modal/Modal.stories.tsx b/packages/base-ui/src/Components/Modal/Modal.stories.tsx
deleted file mode 100644
index 1d47f2ef14..0000000000
--- a/packages/base-ui/src/Components/Modal/Modal.stories.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { Meta } from '@storybook/react';
-
-import { Modal } from './Modal';
-
-const meta: Meta<typeof Modal> = {
- title: 'Components / Modal',
- component: Modal,
- parameters: {
- layout: 'centered',
- },
- tags: ['autodocs'],
- args: {
- children: <div>test modal</div>,
- },
-};
-
-export default meta;
-
-export const Playground = {
- args: {},
-};
diff --git a/packages/base-ui/src/Components/Modal/Modal.tsx b/packages/base-ui/src/Components/Modal/Modal.tsx
deleted file mode 100644
index c8911620a8..0000000000
--- a/packages/base-ui/src/Components/Modal/Modal.tsx
+++ /dev/null
@@ -1,216 +0,0 @@
-// class Modal extends Component<BaseModalProps, IState> {
-// constructor(props: BaseModalProps) {
-// super(props);
-// this.initialize();
-// }
-// initialize() {
-// this.state = {
-// visible: this.props.visible ?? false,
-// };
-// }
-// handleClickCancel = (cb: Function | undefined) => {
-// // this.setState({ visible: false });
-// if (cb) cb();
-// };
-// showModal = (value: boolean) => {
-// this.setState((prevState) => ({
-// visible: value,
-// }));
-// };
-// override UNSAFE_componentWillReceiveProps(props: BaseModalProps) {
-// if (props.visible !== this.state.visible) {
-// this.setState({
-// visible: props.visible,
-// });
-// }
-// }
-// handleClick = (cb?: () => void) => {
-// this.showModal(false);
-// if (cb) cb();
-// };
-// render() {
-// const { title, width = 500, top = 0, style, children, className = '', group = [], isDrag = false, mask = true, footer = true } = this.props;
-// const { visible } = this.state;
-// return (
-// <>
-// {visible ? (
-// <div className={className}>
-// {mask ? (
-// <div
-// className={styles.modalMask}
-// onClick={(e) => {
-// this.props.onCancel?.(e);
-// this.showModal(false);
-// }}
-// ></div>
-// ) : null}
-// <Drag isDrag={isDrag} className={styles.modalDrag}>
-// <div
-// className={`${isDrag ? styles.modalDargWrapper : styles.modalWrapper}`}
-// style={{
-// width: `${width}px`,
-// // top: `${top}px`,
-// ...style,
-// }}
-// >
-// <div className={styles.modalHeader}>
-// <span>{title}</span>
-// <span
-// className={styles.modalClose}
-// onClick={(e) => {
-// this.props.onCancel?.(e);
-// this.showModal(false);
-// }}
-// >
-// <Icon.Other.Close></Icon.Other.Close>
-// </span>
-// </div>
-// <div className={styles.modalBody}>{children}</div>
-// {footer ? (
-// <div className={styles.modalFooter}>
-// {group.map((item, index) => (
-// <Button key={index} type={item.type} onClick={() => this.handleClick(item.onClick)}>
-// <CustomLabel label={item.label} />
-// </Button>
-// ))}
-// </div>
-// ) : null}
-// </div>
-// </Drag>
-// </div>
-// ) : null}
-// </>
-// );
-// }
-// }
-import { Button, ButtonType } from '@univerjs/design';
-import React, { useEffect, useState } from 'react';
-
-import { CustomLabel } from '../CustomLabel';
-import { Drag } from '../Drag';
-// import * as Icon from '../Icon';
-import styles from './index.module.less';
-
-export interface BaseModalProps {
- title?: string | JSX.Element;
- width?: number;
- top?: number;
- style?: React.CSSProperties;
- children?: React.ReactNode;
- className?: string;
- group?: ModalButtonGroup[];
- maskClick?: () => void;
- /** 模态框是否可以拖动 */
- isDrag?: boolean;
-
- /** 模态框是否可见 */
- visible?: boolean;
-
- /** 是否显示遮罩 */
- mask?: boolean;
-
- /** 是否显示底部 */
- footer?: boolean;
-
- /** 点击遮罩层或右上角叉或取消按钮的回调 */
- onCancel?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
- ref?: any;
-}
-
-export interface ModalButtonGroup {
- type: ButtonType;
- onClick: () => void;
- label: string;
-}
-
-export interface ModalProps extends BaseModalProps {
- show?: boolean;
- locale?: string;
-}
-
-export function Modal(props: BaseModalProps) {
- const {
- title,
- width = 500,
- top = 0,
- style,
- children,
- className = '',
- group = [],
- isDrag = false,
- mask = true,
- footer = true,
- onCancel,
- visible: propsVisible,
- } = props;
-
- const [visible, setVisible] = useState<boolean>(propsVisible || false);
-
- useEffect(() => {
- setVisible(propsVisible || false);
- }, [propsVisible]);
-
- // const handleClickCancel = (cb: Function | undefined) => {
- // if (cb) cb();
- // };
-
- const showModal = (value: boolean) => {
- setVisible(value);
- };
-
- const handleClick = (cb?: () => void) => {
- setVisible(false);
- if (cb) cb();
- };
-
- return (
- <>
- {visible ? (
- <div className={className}>
- {mask ? (
- <div
- className={styles.modalMask}
- onClick={(e) => {
- onCancel?.(e);
- showModal(false);
- }}
- ></div>
- ) : null}
- <Drag isDrag={isDrag} className={styles.modalDrag}>
- <div
- className={`${isDrag ? styles.modalDargWrapper : styles.modalWrapper}`}
- style={{
- width: `${width}px`,
- // top: `${top}px`,
- ...style,
- }}
- >
- <div className={styles.modalHeader}>
- <span>{title}</span>
- <span
- className={styles.modalClose}
- onClick={(e) => {
- onCancel?.(e);
- showModal(false);
- }}
- >
- {/* <Icon.Other.Close></Icon.Other.Close> */}
- </span>
- </div>
- <div className={styles.modalBody}>{children}</div>
- {footer ? (
- <div className={styles.modalFooter}>
- {group.map((item, index) => (
- <Button key={index} type={item.type} onClick={() => handleClick(item.onClick)}>
- <CustomLabel label={item.label} />
- </Button>
- ))}
- </div>
- ) : null}
- </div>
- </Drag>
- </div>
- ) : null}
- </>
- );
-}
diff --git a/packages/base-ui/src/Components/Modal/index.module.less b/packages/base-ui/src/Components/Modal/index.module.less
deleted file mode 100644
index e5d93f8d6a..0000000000
--- a/packages/base-ui/src/Components/Modal/index.module.less
+++ /dev/null
@@ -1,63 +0,0 @@
-@import '../../Basics/CSS/Skin/default.module.less';
-
-.modal-mask {
- width: 100%;
- height: 100%;
- position: fixed;
- left: 0;
- top: 0;
- background-color: rgba(0, 0, 0, 0.3);
- z-index: 4;
-}
-
-.modal-wrapper {
- width: 50%;
- overflow: auto;
- position: fixed;
- z-index: 4;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- background-color: rgba(255, 255, 255, 1);
-}
-
-.modal-drag {
- box-shadow: 0 4px 16px rgb(0 0 0 / 20%);
- background-clip: padding-box;
- border: 1px solid rgba(0, 0, 0, .333)
-}
-
-.modal-darg-wrapper {
- width: 50%;
- overflow: auto;
- background-color: rgba(255, 255, 255, 1);
-}
-
-.modal-header {
- padding: 1rem 1.5em;
- border-bottom: 1px solid @gray-4;
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- .modal-close * {
- cursor: pointer;
- }
-}
-
-.modal-body {
- padding: 1rem 1.5em;
- max-height: 70vh;
- overflow: auto;
-}
-
-.modal-footer {
- padding: 1rem 1.5em;
- border-top: 1px solid @gray-4;
- text-align: right;
-
- button {
- margin-right: 0.5em;
- font-size: 1rem !important;
- }
-}
\ No newline at end of file
diff --git a/packages/base-ui/src/Components/Modal/index.ts b/packages/base-ui/src/Components/Modal/index.ts
deleted file mode 100644
index cb89ee1788..0000000000
--- a/packages/base-ui/src/Components/Modal/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Modal';
diff --git a/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.stories.tsx b/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.stories.tsx
deleted file mode 100644
index 8e5e7e64be..0000000000
--- a/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.stories.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import type { Meta } from '@storybook/react';
-
-import { ResizeDialog } from './ResizeDialog';
-
-const meta: Meta<typeof ResizeDialog> = {
- title: 'Components / ResizeDialog',
- component: ResizeDialog,
- parameters: {
- layout: 'centered',
- },
- tags: ['autodocs'],
- args: {
- left: 20,
- top: 20,
- width: 20,
- height: 20,
- children: <div>test ResizeDialog</div>,
- ratio: 1,
- },
-};
-
-export default meta;
-
-export const Playground = {
- args: {},
-};
diff --git a/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.tsx b/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.tsx
deleted file mode 100644
index 0160927b53..0000000000
--- a/packages/base-ui/src/Components/ResizeDialog/ResizeDialog.tsx
+++ /dev/null
@@ -1,225 +0,0 @@
-import { useEffect, useRef } from 'react';
-
-import { BaseComponentProps } from '../../BaseComponent';
-import styles from './index.module.less';
-
-// Component Interface
-export interface BaseResizeDialogProps extends BaseComponentProps {
- /**
- * Distance from the top left corner of the parent element.
- * @default 0
- */
- left?: number;
-
- /**
- * Distance from the top left corner of the parent element.
- * @default 0
- */
- top?: number;
-
- /**
- * Resize dialog's width
- * @default 100
- */
- width?: number;
-
- /**
- * Resize dialog's height
- * @default 50
- */
- height?: number;
-
- /**
- * Resize dialog's children
- */
- children: React.ReactNode;
-
- /**
- * Resize dialog's ratio
- * @default 1
- */
- ratio?: number;
-}
-
-/**
- * Resize Dialog Component
- */
-export const ResizeDialog = (props: BaseResizeDialogProps) => {
- let { left = 0, top = 0 } = props;
- const { width = 100, height = 50, children, ratio = 1 } = props;
- const ref = useRef<HTMLDivElement>(null);
- const resizeRef = useRef<HTMLDivElement>(null);
-
- useEffect(() => {
- const dialog = ref.current;
- if (!dialog) return;
- dialog.style.width = `${width * ratio}px`;
- dialog.style.height = `${height * ratio}px`;
- dialog.style.left = `${left * ratio}px`;
- dialog.style.top = `${top * ratio}px`;
-
- // window.addEventListener('mousemove', mouseMove);
- // window.addEventListener('mouseup', mouseUp);
- // window.addEventListener('click', handleClick);
-
- // return () => {
- // TODO:应该在元素隐藏后即remove监听
- // window.removeEventListener('mousemove', mouseMove);
- // window.removeEventListener('mouseup', mouseUp);
- // window.removeEventListener('click', handleClick);
- // };
- }, []);
- let pastMove = [0, 0];
- let currentMove = [0, 0];
- let move = false;
- let resize = false;
- let resizeItem: any = null;
-
- const cancelHighlight = () => {
- if (!ref.current) return;
- const parent = ref.current.parentElement;
- if (!parent) return;
- const dom = parent.querySelectorAll(`.${styles.dialogResize}`);
- dom.forEach((item) => {
- item.classList.remove(styles.dialogResizeActive);
- });
- };
- const highLight = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
- if (!ref.current || !resizeRef.current) return;
- const classList = resizeRef.current.classList;
- if (!ref.current.contains(e.target as HTMLElement)) {
- if (classList.contains(styles.dialogResizeActive)) {
- classList.remove(styles.dialogResizeActive);
- }
- } else {
- classList.add(styles.dialogResizeActive);
- }
- };
- const handleClick = (e: MouseEvent) => {
- e.stopPropagation();
- cancelHighlight();
- highLight(e as unknown as React.MouseEvent<HTMLDivElement, MouseEvent>);
- };
- const mouseDown = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
- window.addEventListener('mousemove', mouseMove);
- window.addEventListener('mouseup', mouseUp);
- window.addEventListener('click', handleClick);
- e.stopPropagation();
- cancelHighlight();
- highLight(e);
- pastMove = [e.pageX, e.pageY];
- move = true;
- };
- const resizeMouseDown = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
- e.stopPropagation();
- const target = e.target as HTMLElement;
- if (!target.className.includes(`${styles.resizeItem}`)) return;
- resizeItem = target;
- pastMove = [e.pageX, e.pageY];
- resize = true;
- };
- const mouseMove = (e: MouseEvent) => {
- e.stopPropagation();
- if (!ref.current) return;
- const parent = ref.current.parentElement;
- if (!parent) return;
- if (!parent.contains(e.target as HTMLElement)) return;
-
- if (!move && !resize) return;
- const dialog = ref.current;
- if (!dialog) return;
- currentMove = [e.pageX, e.pageY];
-
- left = parseFloat(dialog.style.left) + currentMove[0] - pastMove[0];
- left = left < 0 ? 0 : left;
-
- if (left + ref.current.offsetWidth > parent.offsetWidth) {
- left = parent.offsetWidth - ref.current.offsetWidth;
- }
- top = parseFloat(dialog.style.top) + currentMove[1] - pastMove[1];
- top = top < 0 ? 0 : top;
-
- if (top + ref.current.offsetHeight > parent.offsetHeight) {
- top = parent.offsetHeight - ref.current.offsetHeight;
- }
-
- if (resize) {
- let width;
- let height;
- const type = resizeItem.dataset.type;
- if (type === 'rm' || type === 'rb' || type === 'rt') {
- width = parseFloat(dialog.style.width) + currentMove[0] - pastMove[0];
- if (width < 10) width = 10;
- if (left + width > parent.offsetWidth) {
- width = parent.offsetWidth - left;
- }
- dialog.style.width = `${width}px`;
- }
- if (type === 'lm' || type === 'lb' || type === 'lt') {
- width = parseFloat(dialog.style.width) - (currentMove[0] - pastMove[0]);
- if (width < 10) width = 10;
- if (left + width > parent.offsetWidth) {
- width = parent.offsetWidth - left;
- }
- dialog.style.width = `${width}px`;
- dialog.style.left = `${left}px`;
- }
- if (type === 'lb' || type === 'mb' || type === 'rb') {
- height = parseFloat(dialog.style.height) + currentMove[1] - pastMove[1];
- if (height < 10) height = 10;
- if (height + top > parent.offsetHeight) {
- height = parent.offsetHeight - top;
- }
- dialog.style.height = `${height}px`;
- }
- if (type === 'lt' || type === 'mt' || type === 'rt') {
- height = parseFloat(dialog.style.height) - (currentMove[1] - pastMove[1]);
- if (height < 10) height = 10;
- if (height + top > parent.offsetHeight) {
- height = parent.offsetHeight - top;
- }
- dialog.style.height = `${height}px`;
- dialog.style.top = `${top}px`;
- }
- }
- if (move) {
- dialog.style.left = `${left}px`;
- dialog.style.top = `${top}px`;
- }
-
- pastMove = currentMove;
- };
- const mouseUp = (e: MouseEvent) => {
- window.removeEventListener('mousemove', mouseMove);
- window.removeEventListener('mouseup', mouseUp);
- window.removeEventListener('click', handleClick);
- e.stopPropagation();
- if (!move && !resize) return;
- const dialog = ref.current;
- if (!dialog) return;
- move = false;
- resize = false;
- };
-
- return (
- <div className={styles.resizeDialog} ref={ref}>
- <div className={styles.dialogMove} onMouseDown={mouseDown}>
- <div className={`${styles.moveItem} ${styles.moveTop}`}></div>
- <div className={`${styles.moveItem} ${styles.moveRight}`}></div>
- <div className={`${styles.moveItem} ${styles.moveBottom}`}></div>
- <div className={`${styles.moveItem} ${styles.moveLeft}`}></div>
- </div>
- <div className={styles.dialogResize} onMouseDown={resizeMouseDown} ref={resizeRef}>
- <div data-type="lt" className={`${styles.resizeItem} ${styles.resizeLt}`}></div>
- <div data-type="mt" className={`${styles.resizeItem} ${styles.resizeMt}`}></div>
- <div data-type="lm" className={`${styles.resizeItem} ${styles.resizeLm}`}></div>
- <div data-type="rm" className={`${styles.resizeItem} ${styles.resizeRm}`}></div>
- <div data-type="rt" className={`${styles.resizeItem} ${styles.resizeRt}`}></div>
- <div data-type="lb" className={`${styles.resizeItem} ${styles.resizeLb}`}></div>
- <div data-type="mb" className={`${styles.resizeItem} ${styles.resizeMb}`}></div>
- <div data-type="rb" className={`${styles.resizeItem} ${styles.resizeRb}`}></div>
- </div>
- <div className={styles.dialogContent}>{children}</div>
- </div>
- );
-};
diff --git a/packages/base-ui/src/Components/ResizeDialog/index.module.less b/packages/base-ui/src/Components/ResizeDialog/index.module.less
deleted file mode 100644
index 0cae756c69..0000000000
--- a/packages/base-ui/src/Components/ResizeDialog/index.module.less
+++ /dev/null
@@ -1,124 +0,0 @@
-@import '../../Basics/CSS/Skin/default.module.less';
-
-.resize-dialog {
- position: absolute;
- z-index: 5;
-
- .dialog-move {
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
-
- .move-item {
- position: absolute;
- cursor: move;
- }
-
- .move-top {
- width: 100%;
- height: 3px;
- border-bottom: 1px solid @gray-13;
- left: 0;
- top: -4px;
- }
-
- .move-right {
- width: 3px;
- height: 100%;
- border-left: 1px solid @gray-13;
- top: 0;
- right: -4px;
- }
-
- .move-bottom {
- width: 100%;
- height: 3px;
- border-top: 1px solid @gray-13;
- left: 0;
- bottom: -4px;
- }
-
- .move-left {
- width: 3px;
- height: 100%;
- border-right: 1px solid @gray-13;
- top: 0;
- left: -4px;
- }
- }
-
- .dialog-resize,
- .dialog-resize-active {
- position: absolute;
- top: -2px;
- left: -2px;
- bottom: -2px;
- right: -2px;
- display: none;
-
- .resize-item {
- position: absolute;
- height: 6px;
- width: 6px;
- border: 1px solid var(--primary-color);
- }
-
- .resize-lt {
- left: -6px;
- top: -6px;
- cursor: se-resize;
- }
-
- .resize-mt {
- left: 50%;
- top: -6px;
- margin-left: -4px;
- cursor: s-resize;
- }
-
- .resize-lm {
- top: 50%;
- left: -6px;
- margin-top: -4px;
- cursor: w-resize;
- }
-
- .resize-rm {
- top: 50%;
- right: -6px;
- margin-top: -4px;
- cursor: w-resize;
- }
-
- .resize-rt {
- top: -6px;
- right: -6px;
- cursor: ne-resize;
- }
-
- .resize-lb {
- left: -6px;
- bottom: -6px;
- cursor: ne-resize;
- }
-
- .resize-mb {
- left: 50%;
- bottom: -6px;
- margin-left: -4px;
- cursor: s-resize;
- }
-
- .resize-rb {
- right: -6px;
- bottom: -6px;
- cursor: se-resize;
- }
- }
-
- .dialog-resize-active {
- display: block;
- }
-}
diff --git a/packages/base-ui/src/Components/ResizeDialog/index.ts b/packages/base-ui/src/Components/ResizeDialog/index.ts
deleted file mode 100644
index f52677ed22..0000000000
--- a/packages/base-ui/src/Components/ResizeDialog/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './ResizeDialog';
diff --git a/packages/base-ui/src/Components/ResizeDialog/test/index.test.tsx b/packages/base-ui/src/Components/ResizeDialog/test/index.test.tsx
deleted file mode 100644
index 15d695ada5..0000000000
--- a/packages/base-ui/src/Components/ResizeDialog/test/index.test.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { render } from '@testing-library/react';
-import { describe, expect, test } from 'vitest';
-
-import { ResizeDialog } from '../ResizeDialog';
-
-describe('ResizeDialog', () => {
- test('renders correctly', () => {
- const { container } = render(
- <ResizeDialog>
- <div>test resize dialog</div>
- </ResizeDialog>
- );
- expect(container);
- });
-});
diff --git a/packages/base-ui/src/Components/Separator/Separator.stories.tsx b/packages/base-ui/src/Components/Separator/Separator.stories.tsx
deleted file mode 100644
index 6582254b30..0000000000
--- a/packages/base-ui/src/Components/Separator/Separator.stories.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { Meta } from '@storybook/react';
-
-import { Separator } from './Separator';
-
-const meta: Meta<typeof Separator> = {
- title: 'Components / Separator',
- component: Separator,
- parameters: {
- layout: 'centered',
- },
- tags: ['autodocs'],
- args: {
- mode: false,
- },
-};
-
-export default meta;
-
-export const Playground = {
- args: {},
-};
diff --git a/packages/base-ui/src/Components/Separator/Separator.tsx b/packages/base-ui/src/Components/Separator/Separator.tsx
deleted file mode 100644
index f2e5cf9cb6..0000000000
--- a/packages/base-ui/src/Components/Separator/Separator.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import styles from './index.module.less';
-
-export interface IProps {
- mode: boolean;
-}
-
-const Separator = (props: IProps) => {
- const { mode } = props;
-
- return <div className={`${styles.line} ${mode ? styles.vertical : ''}`}></div>;
-};
-
-export { Separator };
diff --git a/packages/base-ui/src/Components/Separator/index.module.less b/packages/base-ui/src/Components/Separator/index.module.less
deleted file mode 100644
index b8e99f6610..0000000000
--- a/packages/base-ui/src/Components/Separator/index.module.less
+++ /dev/null
@@ -1,17 +0,0 @@
-.line {
- display: inline-block;
- line-height: normal;
- list-style: none;
- outline: 0;
- overflow: hidden;
- padding: 0;
- text-decoration: none;
-
- &.vertical {
- width: 0;
- height: 20px;
- vertical-align: top;
- border-left: 1px solid #e0e0e0;
- margin: 3px 2px;
- }
-}
diff --git a/packages/base-ui/src/Components/Separator/index.ts b/packages/base-ui/src/Components/Separator/index.ts
deleted file mode 100644
index 6e97479974..0000000000
--- a/packages/base-ui/src/Components/Separator/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './Separator';
diff --git a/packages/base-ui/src/Components/SiderModal/SiderModal.stories.tsx b/packages/base-ui/src/Components/SiderModal/SiderModal.stories.tsx
deleted file mode 100644
index 83a7b71792..0000000000
--- a/packages/base-ui/src/Components/SiderModal/SiderModal.stories.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import type { Meta } from '@storybook/react';
-
-import { SiderModal } from './SiderModal';
-
-const meta: Meta<typeof SiderModal> = {
- title: 'Components / SiderModal',
- component: SiderModal,
- parameters: {
- layout: 'centered',
- },
- tags: ['autodocs'],
- args: {
- name: 'sider',
- title: 'test sider modal',
- children: <div>test test</div>,
- },
-};
-
-export default meta;
-
-export const Playground = {
- args: {},
-};
diff --git a/packages/base-ui/src/Components/SiderModal/SiderModal.tsx b/packages/base-ui/src/Components/SiderModal/SiderModal.tsx
deleted file mode 100644
index 90b8737a9b..0000000000
--- a/packages/base-ui/src/Components/SiderModal/SiderModal.tsx
+++ /dev/null
@@ -1,125 +0,0 @@
-import { RefObject, useContext, useEffect, useState } from 'react';
-
-import { AppContext } from '../../Common/AppContext';
-// import { Icon } from '../index';
-
-// class SiderModal extends Component<BaseSiderModalProps, IState> {
-// static override contextType = AppContext;
-
-// constructor(props: BaseSiderModalProps) {
-// super();
-// this.initialize(props);
-// }
-
-// initialize(props: BaseSiderModalProps) {
-// this.state = {
-// zIndex: props.zIndex ?? 0,
-// show: props.show ?? true,
-// };
-// }
-
-// close() {
-// this.setState({
-// show: false,
-// });
-// }
-
-// handleClick() {
-// const zIndex = this.context.zIndexManager.getMaxIndex() + 1;
-// this.setState({
-// zIndex,
-// });
-// }
-
-// UNSAFE_componentWillReceiveProps(props: BaseSiderModalProps): void {
-// this.setState({
-// show: props.show ?? true,
-// });
-// }
-
-// render() {
-// const { className = '', style } = this.props;
-// const { zIndex, show } = this.state;
-// this.context.zIndexManager.setIndex(this.props.name, zIndex);
-
-// return show ? (
-// <div className={`${Style.siderModal} ${className}`} style={{ ...style, zIndex }} onClick={() => this.handleClick()}>
-// <div className={Style.siderModalHeader}>
-// <h3 className={Style.siderModalTitle}>{this.props.title}</h3>
-// <span className={Style.siderModalClose} onClick={() => this.close()}>
-// <Icon.Other.Close></Icon.Other.Close>
-// </span>
-// </div>
-// <div className={Style.siderModalBody}>
-// <div className={Style.siderModalBodyInner}>{this.props.children}</div>
-// </div>
-// <div className={Style.siderModalFooter}>{this.props.footer}</div>
-// </div>
-// ) : null;
-// }
-// }
-
-// export { SiderModal };
-
-export interface BaseSiderModalProps {
- name: string;
- title: string | any;
- show?: boolean;
- children?: React.ReactNode;
- footer?: React.ReactNode;
- ref?: RefObject<HTMLElement>;
- className?: string;
- zIndex?: number;
- style?: React.CSSProperties;
-}
-
-export function SiderModal(props: BaseSiderModalProps) {
- const context = useContext(AppContext);
- const { className = '', style } = props;
- const [zIndex, setZIndex] = useState<number>(props.zIndex ?? 0);
- const [show, setShow] = useState<boolean>(props.show ?? true);
-
- useEffect(() => {
- // Assuming you have a function getMaxIndex() and setIndex() in your context
- const contextZIndexManager = context.zIndexManager;
- if (contextZIndexManager) {
- const newZIndex = contextZIndexManager.getMaxIndex() + 1;
- setZIndex(newZIndex);
- contextZIndexManager.setIndex(props.name, newZIndex);
- }
- }, [props.name]);
-
- useEffect(() => {
- if (props.show !== show) {
- setShow(props.show ?? true);
- }
- }, [props.show]);
-
- const close = () => {
- setShow(false);
- };
-
- const handleClick = () => {
- const contextZIndexManager = context.zIndexManager;
- if (contextZIndexManager) {
- const newZIndex = contextZIndexManager.getMaxIndex() + 1;
- setZIndex(newZIndex);
- contextZIndexManager.setIndex(props.name, newZIndex);
- }
- };
-
- return show ? (
- <div className={`siderModal ${className}`} style={{ ...style, zIndex }} onClick={handleClick}>
- <div className="siderModalHeader">
- <h3 className="siderModalTitle">{props.title}</h3>
- <span className="siderModalClose" onClick={close}>
- {/* <Icon.Other.Close></Icon.Other.Close> */}
- </span>
- </div>
- <div className="siderModalBody">
- <div className="siderModalBodyInner">{props.children}</div>
- </div>
- <div className="siderModalFooter">{props.footer}</div>
- </div>
- ) : null;
-}
diff --git a/packages/base-ui/src/Components/SiderModal/index.module.less b/packages/base-ui/src/Components/SiderModal/index.module.less
deleted file mode 100644
index 8b06b985f8..0000000000
--- a/packages/base-ui/src/Components/SiderModal/index.module.less
+++ /dev/null
@@ -1,57 +0,0 @@
-@import '../../Basics/CSS/Skin/default.module.less';
-
-.sider-modal {
- width: 100%;
- height: 100%;
- border-left: 1px solid;
- background-color: var(--bg);
- position: fixed;
-
- .sider-modal-header {
- overflow: hidden;
- height: 50px;
- padding: 0 20px 0 20px;
- border-bottom: 1px solid var(--border-color);
-
- .sider-modal-title {
- line-height: 50px;
- display: inline-block;
- }
-
- .sider-modal-close {
- display: inline-block;
- float: right;
- line-height: 50px;
- color: var(--text-color);
-
- &:hover {
- cursor: pointer;
- color: var(--text-color-secondary);
- }
- }
- }
-
- .sider-modal-body {
- position: absolute;
- top: 50px;
- left: 0;
- right: 0;
- bottom: 50px;
- width: 100%;
-
- .sider-modal-body-inner {
- width: 100%;
- height: 100%;
- position: absolute;
- overflow-y: auto;
- overflow-x: hidden;
- }
- }
-
- .sider-modal-footer {
- position: absolute;
- bottom: 0;
- width: 100%;
- height: 50px;
- }
-}
\ No newline at end of file
diff --git a/packages/base-ui/src/Components/SiderModal/index.ts b/packages/base-ui/src/Components/SiderModal/index.ts
deleted file mode 100644
index f082a36274..0000000000
--- a/packages/base-ui/src/Components/SiderModal/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './SiderModal';
diff --git a/packages/base-ui/src/Components/SiderModal/sider-modal-zh.md b/packages/base-ui/src/Components/SiderModal/sider-modal-zh.md
deleted file mode 100644
index 472f767ae0..0000000000
--- a/packages/base-ui/src/Components/SiderModal/sider-modal-zh.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-category: SiderModal
-type: 通用
-title: SiderModal
-subtitle: 右侧弹窗
-cover: ''
----
-
-## 介绍
-
-模态框
-
-## SiderModal API
-
-`SiderModal` 的属性说明如下:
-
-| 属性 | 说明 | 类型 | 默认值 |
-| ---------- | ------------ | ---------- | ------ |
-| title | 默认选中 | `string` | - |
-| closeSide | 是否垂直排列 | `function` | - |
-| footer | 单选组类名 | `jsx` | - |
-| pluginName | plugin name | `string` | - |
-
-## 案例
-
-```jsx
-import { SiderModal } from '@univerjs/style-univer';
-
-const Demo = () => {
- return (
- <SiderModal title="this is demo">
- <>`container`</>
- </SiderModal>
- );
-};
-```
diff --git a/packages/base-ui/src/Components/index.ts b/packages/base-ui/src/Components/index.ts
index e1296df0b4..fc2866bccb 100644
--- a/packages/base-ui/src/Components/index.ts
+++ b/packages/base-ui/src/Components/index.ts
@@ -1,14 +1,7 @@
-export * from './CellRange';
-export * from './Collapse';
export * from './CustomLabel';
export * from './Dropdown';
export * from './Input';
-export * from './InputNumber';
export * from './Menu';
-export * from './Modal';
-export * from './ResizeDialog';
export * from './Select';
-export * from './Separator';
-export * from './SiderModal';
export * from './Slider';
export * from './Tabs';
diff --git a/packages/design/package.json b/packages/design/package.json
index 67dc967063..f387447df7 100644
--- a/packages/design/package.json
+++ b/packages/design/package.json
@@ -51,13 +51,13 @@
"@rc-component/trigger": "^1.18.0",
"@univerjs/icons": "^0.1.3",
"clsx": "^2.0.0",
+ "rc-dialog": "^9.3.4",
"rc-dropdown": "^4.1.0",
"rc-input-number": "^8.5.0",
- "rc-menu": "^9.12.2",
- "rc-notification": "^5.3.0",
"rc-tooltip": "^6.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
+ "react-draggable": "^4.4.6",
"react-transition-group": "^4.4.5"
},
"devDependencies": {
diff --git a/packages/design/src/components/color-picker/ColorPicker.tsx b/packages/design/src/components/color-picker/ColorPicker.tsx
index f3caa9508e..412037aa78 100644
--- a/packages/design/src/components/color-picker/ColorPicker.tsx
+++ b/packages/design/src/components/color-picker/ColorPicker.tsx
@@ -1,7 +1,7 @@
import RcColorPicker, { Color, ColorBlock } from '@rc-component/color-picker';
import { useContext, useState } from 'react';
-import { ConfigContext } from '../config-provider';
+import { ConfigContext } from '../config-provider/ConfigProvider';
import styles from './index.module.less';
import { colorPresets } from './presets';
diff --git a/packages/design/src/components/confirm/Confirm.stories.tsx b/packages/design/src/components/confirm/Confirm.stories.tsx
new file mode 100644
index 0000000000..f2d11dda3b
--- /dev/null
+++ b/packages/design/src/components/confirm/Confirm.stories.tsx
@@ -0,0 +1,40 @@
+import type { Meta } from '@storybook/react';
+import { useState } from 'react';
+
+import { Button } from '../button/Button';
+import { Confirm } from './Confirm';
+
+const meta: Meta<typeof Confirm> = {
+ title: 'Components / Confirm',
+ component: Confirm,
+ parameters: {
+ layout: 'centered',
+ },
+ tags: ['autodocs'],
+};
+
+export default meta;
+
+export const ConfirmBasic = {
+ render() {
+ const [visible, setVisible] = useState(false);
+
+ function handleToggleVisible() {
+ setVisible(!visible);
+ }
+
+ return (
+ <>
+ <Button onClick={handleToggleVisible}>open confirm</Button>
+ <Confirm
+ visible={visible}
+ title="hello world"
+ onClose={handleToggleVisible}
+ onConfirm={handleToggleVisible}
+ >
+ xxxx
+ </Confirm>
+ </>
+ );
+ },
+};
diff --git a/packages/design/src/components/confirm/Confirm.tsx b/packages/design/src/components/confirm/Confirm.tsx
new file mode 100644
index 0000000000..daf819b282
--- /dev/null
+++ b/packages/design/src/components/confirm/Confirm.tsx
@@ -0,0 +1,54 @@
+import { useContext } from 'react';
+
+import { Button } from '../button/Button';
+import { ConfigContext } from '../config-provider/ConfigProvider';
+import { Dialog } from '../dialog/Dialog';
+import styles from './index.module.less';
+
+export interface IConfirmProps {
+ children: React.ReactNode;
+
+ /**
+ * Whether the Confirm is visible.
+ * @default false
+ */
+ visible?: boolean;
+
+ /**
+ * The title of the Confirm.
+ */
+ title?: React.ReactNode;
+
+ /**
+ * Callback when the Confirm is closed.
+ */
+ onClose?: () => void;
+
+ /**
+ * Callback when the Confirm is confirmed.
+ */
+ onConfirm?: () => void;
+}
+
+export function Confirm(props: IConfirmProps) {
+ const { children, visible = false, title, onClose, onConfirm } = props;
+
+ const { locale } = useContext(ConfigContext);
+
+ function Footer() {
+ return (
+ <footer className={styles.confirmFooter}>
+ <Button onClick={onClose}>{locale.design.Confirm.cancel}</Button>
+ <Button type="primary" onClick={onConfirm}>
+ {locale.design.Confirm.confirm}
+ </Button>
+ </footer>
+ );
+ }
+
+ return (
+ <Dialog visible={visible} title={title} footer={<Footer />} onClose={onClose}>
+ {children}
+ </Dialog>
+ );
+}
diff --git a/packages/design/src/components/confirm/index.module.less b/packages/design/src/components/confirm/index.module.less
new file mode 100644
index 0000000000..5cb8d0c787
--- /dev/null
+++ b/packages/design/src/components/confirm/index.module.less
@@ -0,0 +1,7 @@
+.confirm {
+ &-footer {
+ display: flex;
+ justify-content: flex-end;
+ gap: var(--margin-sm);
+ }
+}
diff --git a/packages/design/src/components/confirm/index.ts b/packages/design/src/components/confirm/index.ts
new file mode 100644
index 0000000000..5f1dc8fb98
--- /dev/null
+++ b/packages/design/src/components/confirm/index.ts
@@ -0,0 +1 @@
+export { Confirm, type IConfirmProps } from './Confirm';
diff --git a/packages/design/src/components/dialog/Dialog.stories.tsx b/packages/design/src/components/dialog/Dialog.stories.tsx
new file mode 100644
index 0000000000..0320e8db93
--- /dev/null
+++ b/packages/design/src/components/dialog/Dialog.stories.tsx
@@ -0,0 +1,43 @@
+import type { Meta } from '@storybook/react';
+import { CloseSingle } from '@univerjs/icons';
+import { useState } from 'react';
+
+import { Button } from '../button/Button';
+import { Dialog } from './Dialog';
+
+const meta: Meta<typeof Dialog> = {
+ title: 'Components / Dialog',
+ component: Dialog,
+ parameters: {
+ layout: 'centered',
+ },
+ tags: ['autodocs'],
+};
+
+export default meta;
+
+export const DialogBasic = {
+ render() {
+ const [visible, setVisible] = useState(false);
+
+ function handleToggleVisible() {
+ setVisible(!visible);
+ }
+
+ return (
+ <>
+ <Button onClick={handleToggleVisible}>open dialog</Button>
+ <Dialog
+ visible={visible}
+ title="hello world"
+ draggable
+ closeIcon={<CloseSingle />}
+ footer={<footer>footer</footer>}
+ onClose={handleToggleVisible}
+ >
+ xxxx
+ </Dialog>
+ </>
+ );
+ },
+};
diff --git a/packages/design/src/components/dialog/Dialog.tsx b/packages/design/src/components/dialog/Dialog.tsx
new file mode 100644
index 0000000000..2de74ba2b1
--- /dev/null
+++ b/packages/design/src/components/dialog/Dialog.tsx
@@ -0,0 +1,86 @@
+import RcDialog from 'rc-dialog';
+import { useState } from 'react';
+import Draggable from 'react-draggable';
+
+import styles from './index.module.less';
+
+export interface IDialogProps {
+ children: React.ReactNode;
+
+ /**
+ * Whether the dialog is visible.
+ * @default false
+ */
+ visible?: boolean;
+
+ /**
+ * The title of the dialog.
+ */
+ title?: React.ReactNode;
+
+ /**
+ * Whether the dialog can be dragged.
+ * @default false
+ */
+ draggable?: boolean;
+
+ /**
+ * The close icon of the dialog.
+ */
+ closeIcon?: React.ReactNode;
+
+ /**
+ * The footer of the dialog.
+ */
+ footer?: React.ReactNode;
+
+ /**
+ * Callback when the dialog is closed.
+ */
+ onClose?: () => void;
+}
+
+export function Dialog(props: IDialogProps) {
+ const { children, visible = false, title, draggable = false, closeIcon, footer, onClose } = props;
+ const [dragDisabled, setDragDisabled] = useState(false);
+
+ const TitleIfDraggable = draggable ? (
+ <div
+ style={{
+ width: '100%',
+ cursor: 'pointer',
+ }}
+ onMouseOver={() => {
+ if (dragDisabled) {
+ setDragDisabled(false);
+ }
+ }}
+ onMouseOut={() => {
+ setDragDisabled(true);
+ }}
+ onFocus={() => {}}
+ onBlur={() => {}}
+ >
+ {title}
+ </div>
+ ) : (
+ title
+ );
+
+ const modalRender = (modal: React.ReactNode) =>
+ draggable ? <Draggable disabled={dragDisabled}>{modal}</Draggable> : modal;
+
+ return (
+ <RcDialog
+ prefixCls={styles.dialog}
+ visible={visible}
+ title={TitleIfDraggable}
+ modalRender={modalRender}
+ closeIcon={closeIcon}
+ footer={footer}
+ onClose={onClose}
+ >
+ {children}
+ </RcDialog>
+ );
+}
diff --git a/packages/design/src/components/dialog/index.module.less b/packages/design/src/components/dialog/index.module.less
new file mode 100644
index 0000000000..44eeed12c8
--- /dev/null
+++ b/packages/design/src/components/dialog/index.module.less
@@ -0,0 +1,180 @@
+.dialog {
+ position: relative;
+ width: 640px;
+ margin: 10% auto;
+
+ &-wrap {
+ position: fixed;
+ overflow: auto;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1050;
+ -webkit-overflow-scrolling: touch;
+ outline: 0;
+ }
+
+ &-title {
+ margin: 0;
+ font-size: var(--font-size-lg);
+ font-weight: 500;
+ }
+
+ &-content {
+ position: relative;
+ color: rgb(var(--text-color));
+ background-color: rgb(var(--bg-color-secondary));
+ background-clip: padding-box;
+ border: 1px solid rgb(var(--border-color));
+ border-radius: var(--border-radius-lg);
+ box-shadow: var(--box-shadow-base);
+ }
+
+ &-close {
+ position: absolute;
+ right: 28px;
+ top: 24px;
+ padding: 0;
+ font-size: var(--font-size-base);
+ font-weight: 500;
+ line-height: 1;
+ text-decoration: none;
+ color: rgb(var(--text-color));
+ background: transparent;
+ border: 0;
+ opacity: .2;
+ cursor: pointer;
+
+ &:hover {
+ text-decoration: none;
+ opacity: 1;
+ }
+ }
+
+ &-header {
+ padding: 24px 28px 20px 28px;
+ color: rgb(var(--text-color));
+ border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
+ box-sizing: border-box;
+ }
+
+ &-body {
+ padding: 0 28px 20px 28px;
+ }
+
+ &-footer {
+ padding: 0 28px 24px 28px;
+ text-align: right;
+ border-radius: 0 0 5px 5px;
+ }
+
+ .effect() {
+ animation-duration: 0.3s;
+ animation-fill-mode: both;
+ }
+
+ &-zoom-enter, &-zoom-appear {
+ opacity: 0;
+ .effect();
+ animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
+ animation-play-state: paused;
+ }
+
+ &-zoom-leave {
+ .effect();
+ animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
+ animation-play-state: paused;
+ }
+
+ &-zoom-enter&-zoom-enter-active, &-zoom-appear&-zoom-appear-active {
+ animation-name: rcDialogZoomIn;
+ animation-play-state: running;
+ }
+
+ &-zoom-leave&-zoom-leave-active {
+ animation-name: rcDialogZoomOut;
+ animation-play-state: running;
+ }
+
+ @keyframes rcDialogZoomIn {
+ 0% {
+ opacity: 0;
+ transform: scale(0, 0);
+ }
+ 100% {
+ opacity: 1;
+ transform: scale(1, 1);
+ }
+ }
+ @keyframes rcDialogZoomOut {
+ 0% {
+
+ transform: scale(1, 1);
+ }
+ 100% {
+ opacity: 0;
+ transform: scale(0, 0);
+ }
+ }
+
+ &-mask {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ height: 100%;
+ // background-color: rgba(55, 55, 55, 0.6);
+ z-index: 1050;
+
+ &-hidden {
+ display: none;
+ }
+ }
+
+ .fade-effect() {
+ animation-duration: 0.3s;
+ animation-fill-mode: both;
+ animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
+ }
+
+ &-fade-enter,&-fade-appear {
+ opacity: 0;
+ .fade-effect();
+ animation-play-state: paused;
+ }
+
+ &-fade-leave {
+ .fade-effect();
+ animation-play-state: paused;
+ }
+
+ &-fade-enter&-fade-enter-active,&-fade-appear&-fade-appear-active {
+ animation-name: rcDialogFadeIn;
+ animation-play-state: running;
+ }
+
+ &-fade-leave&-fade-leave-active {
+ animation-name: rcDialogFadeOut;
+ animation-play-state: running;
+ }
+
+ @keyframes rcDialogFadeIn {
+ 0% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+ }
+
+ @keyframes rcDialogFadeOut {
+ 0% {
+ opacity: 1;
+ }
+ 100% {
+ opacity: 0;
+ }
+ }
+}
diff --git a/packages/design/src/components/dialog/index.ts b/packages/design/src/components/dialog/index.ts
new file mode 100644
index 0000000000..3961f88700
--- /dev/null
+++ b/packages/design/src/components/dialog/index.ts
@@ -0,0 +1 @@
+export { Dialog, type IDialogProps } from './Dialog';
diff --git a/packages/design/src/components/input-number/InputNumber.stories.tsx b/packages/design/src/components/input-number/InputNumber.stories.tsx
new file mode 100644
index 0000000000..edf4746833
--- /dev/null
+++ b/packages/design/src/components/input-number/InputNumber.stories.tsx
@@ -0,0 +1,37 @@
+import type { Meta } from '@storybook/react';
+
+import { InputNumber } from './InputNumber';
+
+const meta: Meta<typeof InputNumber> = {
+ title: 'Components / InputNumber',
+ component: InputNumber,
+ parameters: {
+ layout: 'centered',
+ },
+ tags: ['autodocs'],
+};
+
+export default meta;
+
+export const InputNumberBasic = {
+ render() {
+ return (
+ <>
+ <InputNumber />
+ <InputNumber precision={0} />
+ </>
+ );
+ },
+};
+
+export const InputNumberDisabled = {
+ render() {
+ return <InputNumber disabled />;
+ },
+};
+
+export const InputNumberHideControls = {
+ render() {
+ return <InputNumber controls={false} />;
+ },
+};
diff --git a/packages/design/src/components/input-number/InputNumber.tsx b/packages/design/src/components/input-number/InputNumber.tsx
new file mode 100644
index 0000000000..b3db56344a
--- /dev/null
+++ b/packages/design/src/components/input-number/InputNumber.tsx
@@ -0,0 +1,98 @@
+import RcInputNumber from 'rc-input-number';
+
+import styles from './index.module.less';
+
+export interface IInputNumberProps {
+ /**
+ * The input content value
+ */
+ value?: number | null;
+
+ /**
+ * The maximum value of the input
+ */
+ max?: number;
+
+ /**
+ * The minimum value of the input
+ */
+ min?: number;
+
+ /**
+ * The step of the input
+ * @default 1
+ */
+ step?: number;
+
+ /**
+ * The precision of the input
+ */
+ precision?: number;
+
+ /**
+ * Whether the input is disabled
+ * @default false
+ */
+ disabled?: boolean;
+
+ /**
+ * Whether to show the up and down buttons
+ * @default true
+ */
+ controls?: boolean;
+
+ /**
+ * Callback when user click
+ * @param e
+ */
+ onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
+
+ /**
+ * Callback when user press a key
+ * @param e
+ */
+ onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
+
+ /**
+ * Callback when user input
+ * @param value
+ */
+ onChange?: (value: number | null) => void;
+}
+
+export function InputNumber(props: IInputNumberProps) {
+ const {
+ value,
+ max,
+ min,
+ step = 1,
+ precision,
+ disabled = false,
+ controls = true,
+ onClick,
+ onKeyDown,
+ onChange,
+ } = props;
+
+ function handleChange(value: number | null) {
+ if (value !== null) {
+ onChange?.(value);
+ }
+ }
+
+ return (
+ <RcInputNumber
+ prefixCls={styles.inputNumber}
+ value={value}
+ max={max}
+ min={min}
+ step={step}
+ precision={precision}
+ disabled={disabled}
+ controls={controls}
+ onClick={onClick}
+ onKeyDown={onKeyDown}
+ onChange={handleChange}
+ />
+ );
+}
diff --git a/packages/design/src/components/input-number/index.module.less b/packages/design/src/components/input-number/index.module.less
new file mode 100644
index 0000000000..fcd09f8ffd
--- /dev/null
+++ b/packages/design/src/components/input-number/index.module.less
@@ -0,0 +1,126 @@
+.input-number {
+ display: inline-block;
+ height: 26px;
+ margin: 0;
+ padding: 0;
+ font-size: 12px;
+ line-height: 26px;
+ vertical-align: middle;
+ background-color: rgb(var(--bg-color-secondary));
+ border: 1px solid rgb(var(--border-color));
+ border-radius: var(--border-radius-base);
+ transition: all 0.3s;
+
+ &-focused,
+ &:hover {
+ border-color: rgb(var(--primary-color));
+
+ .input-number-handler-up,
+ .input-number-handler-wrap {
+ border-color: rgb(var(--primary-color));
+ }
+ }
+
+ &-out-of-range {
+ .input-number-input {
+ color: rgb(var(--error-color));
+ }
+ }
+
+ &-handler {
+ text-align: center;
+ touch-action: none;
+ overflow: hidden;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ cursor: pointer;
+ }
+
+ &-handler-up-inner,
+ &-handler-down-inner {
+ color: rgb(var(--text-color));
+ user-select: none;
+ }
+
+ &-disabled:hover {
+ border-color: rgb(var(--border-color));
+ cursor: not-allowed;
+
+ .input-number-handler-up,
+ .input-number-handler-wrap {
+ border-color: rgb(var(--border-color));
+ }
+ }
+
+ &-input-wrap {
+ height: 100%;
+ overflow: hidden;
+ }
+
+ &-input {
+ width: 100%;
+ height: 100%;
+ padding: 0;
+ color: rgb(var(--text-color));
+ line-height: 26px;
+ text-align: center;
+ border: 0;
+ border-radius: var(--border-radius-base);
+ outline: 0;
+ transition: all 0.15s;
+ }
+
+ &-handler-wrap {
+ float: right;
+ width: 20px;
+ height: 100%;
+ border-left: 1px solid rgb(var(--border-color));
+ display: flex;
+ flex-direction: column;
+ transition: all 0.3s;
+ }
+
+ &-handler-up {
+ border-bottom: 1px solid rgb(var(--border-color));
+ transition: all 0.15s;
+
+ &-inner {
+ &:after {
+ content: '+';
+ }
+ }
+ }
+
+ &-handler-down {
+ transition: all 0.15s;
+
+ &-inner {
+ &:after {
+ content: '-';
+ }
+ }
+ }
+
+ .handler-disabled() {
+ opacity: 0.3;
+ &:hover {
+ color: #999;
+ border-color: rgb(var(--grey-200));
+ }
+ }
+
+ &-handler-down-disabled,
+ &-handler-up-disabled {
+ .handler-disabled();
+ }
+
+ &-disabled {
+ .input-number-input {
+ cursor: not-allowed;
+ }
+ .input-number-handler {
+ .handler-disabled();
+ }
+ }
+}
diff --git a/packages/design/src/components/input-number/index.ts b/packages/design/src/components/input-number/index.ts
new file mode 100644
index 0000000000..1b47c651c8
--- /dev/null
+++ b/packages/design/src/components/input-number/index.ts
@@ -0,0 +1 @@
+export { type IInputNumberProps, InputNumber } from './InputNumber';
diff --git a/packages/design/src/index.ts b/packages/design/src/index.ts
index eac16c97ca..38850c99ec 100644
--- a/packages/design/src/index.ts
+++ b/packages/design/src/index.ts
@@ -5,6 +5,8 @@ export { CheckboxGroup, type ICheckboxGroupProps } from './components/checkbox-g
export { ColorPicker, type IColorPickerProps } from './components/color-picker';
export { ConfigContext, ConfigProvider, type IConfigProviderProps } from './components/config-provider';
export { Container, type IContainerProps } from './components/container';
+export { Dialog, type IDialogProps } from './components/dialog';
+export { type IInputNumberProps, InputNumber } from './components/input-number';
export { Content, Footer, Header, type ILayoutProps, Layout, Sider } from './components/layout';
export { type IMessageProps, Message, message, type MessageType } from './components/message';
export { type IRadioProps, Radio } from './components/radio';
diff --git a/packages/design/src/locale/en-US.ts b/packages/design/src/locale/en-US.ts
index 889e57dc48..227e29691c 100644
--- a/packages/design/src/locale/en-US.ts
+++ b/packages/design/src/locale/en-US.ts
@@ -6,6 +6,10 @@ const locale: ILocale = {
custom: 'CUSTOM',
cancel: 'CANCEL',
},
+ Confirm: {
+ cancel: 'cancel',
+ confirm: 'ok',
+ },
},
};
diff --git a/packages/design/src/locale/interface.ts b/packages/design/src/locale/interface.ts
index 70977b36fa..51a9b2c579 100644
--- a/packages/design/src/locale/interface.ts
+++ b/packages/design/src/locale/interface.ts
@@ -1,5 +1,6 @@
export interface ILocale {
design: {
ColorPicker: Record<string, any>;
+ Confirm: Record<string, any>;
};
}
diff --git a/packages/design/src/locale/zh-CN.ts b/packages/design/src/locale/zh-CN.ts
index bc6fdd97df..ebe7d66594 100644
--- a/packages/design/src/locale/zh-CN.ts
+++ b/packages/design/src/locale/zh-CN.ts
@@ -6,6 +6,10 @@ const locale: ILocale = {
custom: '自定义',
cancel: '取消',
},
+ Confirm: {
+ cancel: '取消',
+ confirm: '确定',
+ },
},
};
diff --git a/packages/sheets-plugin-find/src/View/UI/FindModal.tsx b/packages/sheets-plugin-find/src/View/UI/FindModal.tsx
index 700d12187d..4e1f15a7e6 100644
--- a/packages/sheets-plugin-find/src/View/UI/FindModal.tsx
+++ b/packages/sheets-plugin-find/src/View/UI/FindModal.tsx
@@ -1,9 +1,7 @@
-import { BaseComponentProps, BaseItemProps, CellRange, CustomLabel, Input, Modal, Select } from '@univerjs/base-ui';
-import { Button, ICheckboxGroupProps } from '@univerjs/design';
+import { BaseComponentProps, BaseItemProps } from '@univerjs/base-ui';
+import { ICheckboxGroupProps } from '@univerjs/design';
import { Component } from 'react';
-import styles from './index.module.less';
-
type searchResult = {
count: number;
current: number;
@@ -193,81 +191,82 @@ export class FindModal extends Component<IProps, IState> {
const { show, hideAdvanced, showRange, current, count } = this.state;
// Set Provider for entire Container
return (
- <Modal
- onCancel={() => this.handleHideAdvanced(true)}
- className={styles.findModal}
- isDrag
- footer={false}
- mask={false}
- title={<CustomLabel label={hideAdvanced ? 'find.find' : 'find.findLabel'} />}
- visible={show}
- >
- <div className={styles.box}>
- {hideAdvanced ? null : (
- <span>
- <CustomLabel label="find.find" />
- </span>
- )}
- <Input onValueChange={this.findNext.bind(this)} onChange={(e) => this.onChange(e)}></Input>
- {count ? (
- <div className={styles.count}>
- <span onClick={this.findPrevious.bind(this)}>
- {/* <Icon.Format.NextIcon rotate={90}></Icon.Format.NextIcon> */}
- </span>
- {current}/{count}
- <span onClick={this.findNext.bind(this)}>
- {/* <Icon.Format.NextIcon rotate={-90}></Icon.Format.NextIcon> */}
- </span>
- </div>
- ) : null}
- </div>
- {hideAdvanced ? (
- <p
- style={{ display: hideAdvanced ? 'block' : 'none' }}
- onClick={() => this.handleHideAdvanced(false)}
- >
- <CustomLabel label="find.replace" />/<CustomLabel label="find.advanced" />
- {/* <Icon.Format.NextIcon /> */}
- </p>
- ) : (
- <>
- <div className={styles.box}>
- <span>
- <CustomLabel label="find.replaceWith" />
- </span>
- <Input></Input>
- </div>
- <div className={styles.box}>
- <span>
- <CustomLabel label="find.search" />
- </span>
- <Select onClick={this.selectSearch.bind(this)} children={this.getSelect()}></Select>
- {showRange ? <CellRange onClick={() => {}} /> : null}
- </div>
- <div className={styles.box}>
- <span></span>
- {/* <CheckboxGroup
- options={this.getMatchGroup()}
- onChange={this.handleChange.bind(this)}
- ></CheckboxGroup> */}
- </div>
- <div className={styles.buttonGroup}>
- <Button type="primary">
- <CustomLabel label="button.cancel" />
- </Button>
- <Button onClick={this.replaceAll.bind(this)}>
- <CustomLabel label="find.allReplaceBtn" />
- </Button>
- <Button onClick={this.replaceText.bind(this)}>
- <CustomLabel label="find.replace" />
- </Button>
- <Button onClick={this.findNext.bind(this)}>
- <CustomLabel label="find.find" />
- </Button>
- </div>
- </>
- )}
- </Modal>
+ // <Modal
+ // onCancel={() => this.handleHideAdvanced(true)}
+ // className={styles.findModal}
+ // isDrag
+ // footer={false}
+ // mask={false}
+ // title={<CustomLabel label={hideAdvanced ? 'find.find' : 'find.findLabel'} />}
+ // visible={show}
+ // >
+ // <div className={styles.box}>
+ // {hideAdvanced ? null : (
+ // <span>
+ // <CustomLabel label="find.find" />
+ // </span>
+ // )}
+ // <Input onValueChange={this.findNext.bind(this)} onChange={(e) => this.onChange(e)}></Input>
+ // {count ? (
+ // <div className={styles.count}>
+ // <span onClick={this.findPrevious.bind(this)}>
+ // {/* <Icon.Format.NextIcon rotate={90}></Icon.Format.NextIcon> */}
+ // </span>
+ // {current}/{count}
+ // <span onClick={this.findNext.bind(this)}>
+ // {/* <Icon.Format.NextIcon rotate={-90}></Icon.Format.NextIcon> */}
+ // </span>
+ // </div>
+ // ) : null}
+ // </div>
+ // {hideAdvanced ? (
+ // <p
+ // style={{ display: hideAdvanced ? 'block' : 'none' }}
+ // onClick={() => this.handleHideAdvanced(false)}
+ // >
+ // <CustomLabel label="find.replace" />/<CustomLabel label="find.advanced" />
+ // {/* <Icon.Format.NextIcon /> */}
+ // </p>
+ // ) : (
+ // <>
+ // <div className={styles.box}>
+ // <span>
+ // <CustomLabel label="find.replaceWith" />
+ // </span>
+ // <Input></Input>
+ // </div>
+ // <div className={styles.box}>
+ // <span>
+ // <CustomLabel label="find.search" />
+ // </span>
+ // <Select onClick={this.selectSearch.bind(this)} children={this.getSelect()}></Select>
+ // {showRange ? <CellRange onClick={() => {}} /> : null}
+ // </div>
+ // <div className={styles.box}>
+ // <span></span>
+ // {/* <CheckboxGroup
+ // options={this.getMatchGroup()}
+ // onChange={this.handleChange.bind(this)}
+ // ></CheckboxGroup> */}
+ // </div>
+ // <div className={styles.buttonGroup}>
+ // <Button type="primary">
+ // <CustomLabel label="button.cancel" />
+ // </Button>
+ // <Button onClick={this.replaceAll.bind(this)}>
+ // <CustomLabel label="find.allReplaceBtn" />
+ // </Button>
+ // <Button onClick={this.replaceText.bind(this)}>
+ // <CustomLabel label="find.replace" />
+ // </Button>
+ // <Button onClick={this.findNext.bind(this)}>
+ // <CustomLabel label="find.find" />
+ // </Button>
+ // </div>
+ // </>
+ // )}
+ // </Modal>
+ <></>
);
}
}
diff --git a/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx b/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx
index 71efe703ca..8c1713bc72 100644
--- a/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx
@@ -1,10 +1,8 @@
-import { AppContext, BaseSelectProps, Modal, Select } from '@univerjs/base-ui';
+import { AppContext } from '@univerjs/base-ui';
import { Nullable, Observer, Workbook } from '@univerjs/core';
-import { Button } from '@univerjs/design';
import { Component } from 'react';
import { IConfig } from '../../../Basics/Interfaces/IFormula';
-import styles from './index.module.less';
interface IProps {
visible: boolean;
@@ -56,82 +54,83 @@ class IfGenerate extends Component<IProps, IState> {
override render() {
const { locale } = this.state;
return (
- <Modal
- title={locale.formula.if}
- width={320}
- isDrag={true}
- footer={false}
- visible={this.props.visible}
- onCancel={this.props.onCancel}
- >
- <div className={styles.ifGenerate}>
- <div>
- <div className={styles.label}>{locale.ifFormula.ifGenCompareValueTitle}</div>
- <div className={styles.input}>
- <input type="text" />
- </div>
- </div>
- <div>
- <div className={styles.label}>{locale.ifFormula.ifGenRangeTitle}</div>
- <div className={styles.inputSection}>
- <div className={styles.input}>
- <input type="text" />
- </div>
- <div>&nbsp;{locale.ifFormula.ifGenRangeTo}&nbsp;</div>
- <div className={styles.input}>
- <input type="text" />
- </div>
- </div>
- <div className={styles.input}>
- <input type="text" />
- </div>
- </div>
- <div>
- <div className={styles.label}>{locale.ifFormula.ifGenCutWay}</div>
- <div className={styles.inputSection}>
- {/* <Select
- options={this.state.option}
- onChange={(val) => {
- this.setState({ divisionMode: val.value });
- }}
- /> */}
- <Select children={this.state.option as unknown as BaseSelectProps[]}></Select>
- <div className={styles.input} style={{ marginLeft: '10px' }}>
- <input type="text" />
- </div>
- </div>
- <div
- style={{
- textAlign: 'center',
- backgroundColor: '#1890ff',
- color: '#fff',
- fontSize: '14px',
- padding: '5px',
- borderRadius: '3px',
- }}
- >
- {locale.ifFormula.ifGenCutSame}
- </div>
- </div>
- <div className={styles.ifGenerateCode}>
- <div className={styles.input}>
- <input type="text" placeholder={locale.ifFormula.ifGenTipLableTitile} />
- </div>
- <div className={styles.inputGroup}>
- <input className={styles.inputGroupBig} type="text" />
- <input className={styles.inputGroupSmall} type="text" />
- <span>E6</span>
- <input className={styles.inputGroupSmall} type="text" />
- <input className={styles.inputGroupBig} type="text" />
- </div>
- </div>
- <div className={styles.btnGroup}>
- <Button className={`${styles.cancelBtn} ${styles.btn}`}>{locale.cancel}</Button>
- <Button className={`${styles.cleanBtn} ${styles.btn}`}>{locale.ClearValidation}</Button>
- <Button className={`${styles.okBtn} ${styles.btn}`}>{locale.ok}</Button>
- </div>
- </div>
- </Modal>
+ // <Modal
+ // title={locale.formula.if}
+ // width={320}
+ // isDrag={true}
+ // footer={false}
+ // visible={this.props.visible}
+ // onCancel={this.props.onCancel}
+ // >
+ // <div className={styles.ifGenerate}>
+ // <div>
+ // <div className={styles.label}>{locale.ifFormula.ifGenCompareValueTitle}</div>
+ // <div className={styles.input}>
+ // <input type="text" />
+ // </div>
+ // </div>
+ // <div>
+ // <div className={styles.label}>{locale.ifFormula.ifGenRangeTitle}</div>
+ // <div className={styles.inputSection}>
+ // <div className={styles.input}>
+ // <input type="text" />
+ // </div>
+ // <div>&nbsp;{locale.ifFormula.ifGenRangeTo}&nbsp;</div>
+ // <div className={styles.input}>
+ // <input type="text" />
+ // </div>
+ // </div>
+ // <div className={styles.input}>
+ // <input type="text" />
+ // </div>
+ // </div>
+ // <div>
+ // <div className={styles.label}>{locale.ifFormula.ifGenCutWay}</div>
+ // <div className={styles.inputSection}>
+ // {/* <Select
+ // options={this.state.option}
+ // onChange={(val) => {
+ // this.setState({ divisionMode: val.value });
+ // }}
+ // /> */}
+ // <Select children={this.state.option as unknown as BaseSelectProps[]}></Select>
+ // <div className={styles.input} style={{ marginLeft: '10px' }}>
+ // <input type="text" />
+ // </div>
+ // </div>
+ // <div
+ // style={{
+ // textAlign: 'center',
+ // backgroundColor: '#1890ff',
+ // color: '#fff',
+ // fontSize: '14px',
+ // padding: '5px',
+ // borderRadius: '3px',
+ // }}
+ // >
+ // {locale.ifFormula.ifGenCutSame}
+ // </div>
+ // </div>
+ // <div className={styles.ifGenerateCode}>
+ // <div className={styles.input}>
+ // <input type="text" placeholder={locale.ifFormula.ifGenTipLableTitile} />
+ // </div>
+ // <div className={styles.inputGroup}>
+ // <input className={styles.inputGroupBig} type="text" />
+ // <input className={styles.inputGroupSmall} type="text" />
+ // <span>E6</span>
+ // <input className={styles.inputGroupSmall} type="text" />
+ // <input className={styles.inputGroupBig} type="text" />
+ // </div>
+ // </div>
+ // <div className={styles.btnGroup}>
+ // <Button className={`${styles.cancelBtn} ${styles.btn}`}>{locale.cancel}</Button>
+ // <Button className={`${styles.cleanBtn} ${styles.btn}`}>{locale.ClearValidation}</Button>
+ // <Button className={`${styles.okBtn} ${styles.btn}`}>{locale.ok}</Button>
+ // </div>
+ // </div>
+ // </Modal>
+ <></>
);
}
}
diff --git a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaModal.tsx b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaModal.tsx
index 5207759b2a..83c1597f21 100644
--- a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaModal.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchFormulaModal.tsx
@@ -1,4 +1,4 @@
-import { BaseComponentProps, Modal, ModalButtonGroup } from '@univerjs/base-ui';
+import { BaseComponentProps } from '@univerjs/base-ui';
import { Component } from 'react';
import { SearchFormulaModalData } from '../../../Basics/Interfaces/IFormula';
@@ -49,17 +49,18 @@ export class SearchFormulaModal extends Component<IProps, IState> {
{modalData.map((item, index) => {
if (!item.show) return;
return (
- <Modal
- key={index}
- isDrag={true}
- mask={item.mask}
- title={item.label?.funParams.n}
- visible={item.show}
- group={item.group as ModalButtonGroup[]} // FIXME type error
- onCancel={item.onCancel}
- >
- {item.modal}
- </Modal>
+ // <Modal
+ // key={index}
+ // isDrag={true}
+ // mask={item.mask}
+ // title={item.label?.funParams.n}
+ // visible={item.show}
+ // group={item.group as ModalButtonGroup[]} // FIXME type error
+ // onCancel={item.onCancel}
+ // >
+ // {item.modal}
+ // </Modal>
+ <></>
);
})}
</>
diff --git a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchItem.tsx b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchItem.tsx
index 61e90d5ada..d7c45bf4ec 100644
--- a/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchItem.tsx
+++ b/packages/sheets-plugin-formula/src/View/UI/SearchFormulaModal/SearchItem.tsx
@@ -1,4 +1,4 @@
-import { BaseComponentProps, CellRange, CustomLabel } from '@univerjs/base-ui';
+import { BaseComponentProps } from '@univerjs/base-ui';
import { Component } from 'react';
import { FormulaParamType, FunParams } from '../../../Basics';
@@ -73,7 +73,7 @@ export class SearchItem extends Component<IProps, IState> {
<div key={index}>
<span>{item.name}:</span>
<div onClick={() => this.handleClick(index)}>
- <CellRange
+ {/* <CellRange
contentPlaceholder={
(
<CustomLabel label="formula.formulaMore.tipDataRangeTitle" />
@@ -86,7 +86,7 @@ export class SearchItem extends Component<IProps, IState> {
}
value={rangeList[index]}
onClick={() => {}}
- />
+ /> */}
</div>
<span>={'{}'}</span>
</div>
diff --git a/packages/sheets-plugin-image/src/View/UI/ImagePanel/ImagePanelUI.tsx b/packages/sheets-plugin-image/src/View/UI/ImagePanel/ImagePanelUI.tsx
index 6b356f494c..181787d101 100644
--- a/packages/sheets-plugin-image/src/View/UI/ImagePanel/ImagePanelUI.tsx
+++ b/packages/sheets-plugin-image/src/View/UI/ImagePanel/ImagePanelUI.tsx
@@ -1,9 +1,6 @@
-import { SiderModal } from '@univerjs/base-ui';
-import { ColorPicker } from '@univerjs/design';
import { Component } from 'react';
-import { BorderType, NormalType, OVER_GRID_IMAGE_PLUGIN_NAME } from '../../../Basics';
-import Style from './ImagePanelUI.module.less';
+import { BorderType, NormalType } from '../../../Basics';
export interface ImagePanelUIProps {
normal: NormalType;
@@ -36,78 +33,79 @@ export class ImagePanelUI extends Component<ImagePanelUIProps> {
override render() {
return (
- <SiderModal name={OVER_GRID_IMAGE_PLUGIN_NAME} title={'图片设置'} style={{}}>
- <div className={Style.imagePanelSetting}>
- {/* 常规 */}
- <div className={Style.section}>
- <div className={Style.wrap}>
- <div className={Style.wrapTitle}> 常规 </div>
- <div className={Style.wrapPanel}>
- <div className={Style.wrapItem}>
- <input name="type" type="radio" />
- <span> 移动图片并调整单元格大小 </span>
- </div>
- <div className={Style.wrapItem}>
- <input name="type" type="radio" />
- <span> 移动图片并不调整单元格大小 </span>
- </div>
- <div className={Style.wrapItem}>
- <input name="type" type="radio" />
- <span> 不移动图片并调整单元格大小 </span>
- </div>
- </div>
- </div>
- </div>
+ // <SiderModal name={OVER_GRID_IMAGE_PLUGIN_NAME} title={'图片设置'} style={{}}>
+ // <div className={Style.imagePanelSetting}>
+ // {/* 常规 */}
+ // <div className={Style.section}>
+ // <div className={Style.wrap}>
+ // <div className={Style.wrapTitle}> 常规 </div>
+ // <div className={Style.wrapPanel}>
+ // <div className={Style.wrapItem}>
+ // <input name="type" type="radio" />
+ // <span> 移动图片并调整单元格大小 </span>
+ // </div>
+ // <div className={Style.wrapItem}>
+ // <input name="type" type="radio" />
+ // <span> 移动图片并不调整单元格大小 </span>
+ // </div>
+ // <div className={Style.wrapItem}>
+ // <input name="type" type="radio" />
+ // <span> 不移动图片并调整单元格大小 </span>
+ // </div>
+ // </div>
+ // </div>
+ // </div>
- {/* 固定 */}
- <div className={Style.section}>
- <div className={Style.wrap}>
- <div className={Style.wrapPanel}>
- <input type="checkbox" className={Style.verticalMiddle} />
- <span className={Style.verticalMiddle}>固定位置</span>
- </div>
- </div>
- </div>
+ // {/* 固定 */}
+ // <div className={Style.section}>
+ // <div className={Style.wrap}>
+ // <div className={Style.wrapPanel}>
+ // <input type="checkbox" className={Style.verticalMiddle} />
+ // <span className={Style.verticalMiddle}>固定位置</span>
+ // </div>
+ // </div>
+ // </div>
- {/* 边框 */}
- <div className={Style.section}>
- <div className={Style.wrap}>
- <div className={Style.wrapTitle}></div>
- <div className={Style.wrapPanel}></div>
- </div>
- </div>
+ // {/* 边框 */}
+ // <div className={Style.section}>
+ // <div className={Style.wrap}>
+ // <div className={Style.wrapTitle}></div>
+ // <div className={Style.wrapPanel}></div>
+ // </div>
+ // </div>
- {/* 样式 */}
- <div className={Style.section}>
- <div className={Style.wrap}>
- <div className={Style.wrapTitle}>边框</div>
- <div className={Style.wrapPanel}>
- <div className={Style.wrapItem}>
- <span className={Style.label}>宽度:</span>
- <input type="text" value={this._width} />
- </div>
- <div className={Style.wrapItem}>
- <span className={Style.label}>半径:</span>
- <input type="text" value={this._radius} />
- </div>
- <div className={Style.wrapItem}>
- <span className={Style.label}>样式:</span>
- <select>
- <option>实线</option>
- <option>虚线</option>
- <option>点状</option>
- <option>双线</option>
- </select>
- </div>
- <div className={Style.wrapItem}>
- <span className={Style.label}>颜色:</span>
- <ColorPicker color={'#000'} />
- </div>
- </div>
- </div>
- </div>
- </div>
- </SiderModal>
+ // {/* 样式 */}
+ // <div className={Style.section}>
+ // <div className={Style.wrap}>
+ // <div className={Style.wrapTitle}>边框</div>
+ // <div className={Style.wrapPanel}>
+ // <div className={Style.wrapItem}>
+ // <span className={Style.label}>宽度:</span>
+ // <input type="text" value={this._width} />
+ // </div>
+ // <div className={Style.wrapItem}>
+ // <span className={Style.label}>半径:</span>
+ // <input type="text" value={this._radius} />
+ // </div>
+ // <div className={Style.wrapItem}>
+ // <span className={Style.label}>样式:</span>
+ // <select>
+ // <option>实线</option>
+ // <option>虚线</option>
+ // <option>点状</option>
+ // <option>双线</option>
+ // </select>
+ // </div>
+ // <div className={Style.wrapItem}>
+ // <span className={Style.label}>颜色:</span>
+ // <ColorPicker color={'#000'} />
+ // </div>
+ // </div>
+ // </div>
+ // </div>
+ // </div>
+ // </SiderModal>
+ <></>
);
}
}
diff --git a/packages/ui-plugin-sheets/src/View/ContextMenu/ContextMenuInput.tsx b/packages/ui-plugin-sheets/src/View/ContextMenu/ContextMenuInput.tsx
new file mode 100644
index 0000000000..8ee07792cf
--- /dev/null
+++ b/packages/ui-plugin-sheets/src/View/ContextMenu/ContextMenuInput.tsx
@@ -0,0 +1,44 @@
+import { CustomLabel, ICustomComponentProps } from '@univerjs/base-ui';
+import { InputNumber } from '@univerjs/design';
+import React, { useEffect, useState } from 'react';
+
+import styles from './index.module.less';
+
+interface IProps extends ICustomComponentProps<string> {
+ prefix: string;
+ suffix: string;
+
+ /**
+ * After ENTER, execute Command, close the right-click menu
+ */
+ onValueChange?: (value: string) => void;
+}
+
+export const ContextMenuInput: React.FC<IProps> = ({ prefix, suffix, value, onChange, onValueChange }) => {
+ const [inputValue, setInputValue] = useState<string>(); // Initialized to an empty string
+
+ const handleChange = (value: number | null) => {
+ setInputValue(value?.toString());
+ onChange(value?.toString() ?? '');
+ };
+
+ useEffect(() => {
+ setInputValue(value);
+ }, [value]);
+
+ function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {
+ if (e.key === 'Backspace') {
+ e.stopPropagation();
+ }
+ }
+
+ return (
+ <div className={styles.uiPluginSheetsContextMenuInput}>
+ <CustomLabel label={prefix} />
+ <span onClick={(e) => e.stopPropagation()}>
+ <InputNumber value={Number(inputValue)} onKeyDown={handleKeyDown} onChange={handleChange} />
+ </span>
+ <CustomLabel label={suffix} />
+ </div>
+ );
+};
diff --git a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuItem.tsx b/packages/ui-plugin-sheets/src/View/ContextMenu/ContextMenuItem.tsx
similarity index 88%
rename from packages/ui-plugin-sheets/src/View/RightMenu/RightMenuItem.tsx
rename to packages/ui-plugin-sheets/src/View/ContextMenu/ContextMenuItem.tsx
index fc54cded24..3c991be400 100644
--- a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuItem.tsx
+++ b/packages/ui-plugin-sheets/src/View/ContextMenu/ContextMenuItem.tsx
@@ -7,7 +7,7 @@ interface IProps {
label: string;
}
-export class RightMenuItem extends Component<IProps> {
+export class ContextMenuItem extends Component<IProps> {
override render() {
const { label } = this.props;
diff --git a/packages/ui-plugin-sheets/src/View/RightMenu/index.module.less b/packages/ui-plugin-sheets/src/View/ContextMenu/index.module.less
similarity index 83%
rename from packages/ui-plugin-sheets/src/View/RightMenu/index.module.less
rename to packages/ui-plugin-sheets/src/View/ContextMenu/index.module.less
index 6784e5ee0a..7542fc8655 100644
--- a/packages/ui-plugin-sheets/src/View/RightMenu/index.module.less
+++ b/packages/ui-plugin-sheets/src/View/ContextMenu/index.module.less
@@ -1,3 +1,10 @@
+.ui-plugin-sheets-context-menu-input {
+ display: flex;
+ align-items: center;
+ gap: var(--margin-sm);
+}
+
+// TODO: may be conflict with other styles, should be more specific
.context-menu {
position: fixed;
diff --git a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuInput.tsx b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuInput.tsx
deleted file mode 100644
index 773cddb618..0000000000
--- a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenuInput.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { CustomLabel, ICustomComponentProps, Input } from '@univerjs/base-ui';
-import React, { useEffect, useState } from 'react';
-
-interface IProps extends ICustomComponentProps<string> {
- prefix: string;
- suffix: string;
-
- /**
- * After ENTER, execute Command, close the right-click menu
- */
- onValueChange?: (value: string) => void;
-}
-
-export const RightMenuInput: React.FC<IProps> = ({ prefix, suffix, value, onChange, onValueChange }) => {
- const [inputValue, setInputValue] = useState<string>(); // Initialized to an empty string
-
- const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
- const newValue = e.target.value;
- setInputValue(newValue);
- onChange(newValue);
- };
-
- useEffect(() => {
- setInputValue(value);
- }, [value]);
-
- return (
- <div>
- <CustomLabel label={prefix} />
- <Input
- type="number"
- placeholder="1"
- value={inputValue}
- onClick={(e) => e.stopPropagation()}
- onChange={handleChange}
- onValueChange={onValueChange}
- ></Input>
- <CustomLabel label={suffix} />
- </div>
- );
-};
diff --git a/packages/ui-plugin-sheets/src/controller/sheet-ui.controller.ts b/packages/ui-plugin-sheets/src/controller/sheet-ui.controller.ts
index 1f75fbb6aa..e160b329ed 100644
--- a/packages/ui-plugin-sheets/src/controller/sheet-ui.controller.ts
+++ b/packages/ui-plugin-sheets/src/controller/sheet-ui.controller.ts
@@ -50,8 +50,8 @@ import {
BorderThick,
} from '../View/BorderLine';
import { BorderThin } from '../View/BorderLine/BorderThin';
-import { RightMenuInput } from '../View/RightMenu/RightMenuInput';
-import { RightMenuItem } from '../View/RightMenu/RightMenuItem';
+import { ContextMenuInput } from '../View/ContextMenu/ContextMenuInput';
+import { ContextMenuItem } from '../View/ContextMenu/ContextMenuItem';
import { RenderSheetContent, RenderSheetFooter, RenderSheetHeader } from '../View/SheetContainer/SheetContainer';
import { CellBorderSelectorMenuItemFactory } from './menu/border.menu';
import {
@@ -175,8 +175,8 @@ export class SheetUIController extends Disposable {
const componentManager = this._componentManager;
// FIXME: no dispose logic
- componentManager.register(CONTEXT_MENU_INPUT_LABEL, RightMenuInput);
- componentManager.register(RightMenuItem.name, RightMenuItem);
+ componentManager.register(CONTEXT_MENU_INPUT_LABEL, ContextMenuInput);
+ componentManager.register(ContextMenuItem.name, ContextMenuItem);
componentManager.register(SHEET_UI_PLUGIN_NAME + ColorPicker.name, ColorPicker);
[
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 2570705773..6de8bcb0eb 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -146,7 +146,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
examples/univer-sheet-ts:
dependencies:
@@ -301,7 +301,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/base-docs:
dependencies:
@@ -344,7 +344,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/base-formula-engine:
dependencies:
@@ -372,7 +372,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/base-numfmt-engine:
dependencies:
@@ -397,7 +397,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/base-render:
dependencies:
@@ -428,7 +428,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/base-sheets:
dependencies:
@@ -502,7 +502,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/base-ui:
dependencies:
@@ -633,7 +633,7 @@ importers:
version: 0.19.5
vitest:
specifier: ^0.34.6
packages/core:
dependencies:
@@ -692,18 +692,15 @@ importers:
clsx:
specifier: ^2.0.0
version: 2.0.0
+ rc-dialog:
+ specifier: ^9.3.4
rc-dropdown:
specifier: ^4.1.0
rc-input-number:
specifier: ^8.5.0
- rc-menu:
- specifier: ^9.12.2
- rc-notification:
- specifier: ^5.3.0
rc-tooltip:
specifier: ^6.1.2
@@ -713,6 +710,9 @@ importers:
react-dom:
specifier: ^18.2.0
version: 18.2.0([email protected])
+ react-draggable:
+ specifier: ^4.4.6
react-transition-group:
specifier: ^4.4.5
@@ -852,7 +852,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/sheets-plugin-formula:
dependencies:
@@ -910,7 +910,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/sheets-plugin-image:
dependencies:
@@ -968,7 +968,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/sheets-plugin-import-xlsx:
dependencies:
@@ -1014,7 +1014,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/sheets-plugin-numfmt:
dependencies:
@@ -1072,7 +1072,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/ui-plugin-docs:
dependencies:
@@ -1121,7 +1121,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages/ui-plugin-sheets:
dependencies:
@@ -1231,7 +1231,7 @@ importers:
version: 10.9.1(@types/[email protected])([email protected])
vitest:
specifier: ^0.34.6
packages:
@@ -2605,7 +2605,7 @@ packages:
/@changesets/[email protected]:
resolution: {integrity: sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
'@changesets/config': 2.3.1
'@changesets/get-version-range-type': 0.3.2
'@changesets/git': 2.0.0
@@ -2623,7 +2623,7 @@ packages:
/@changesets/[email protected]:
resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
'@changesets/errors': 0.1.4
'@changesets/get-dependents-graph': 1.3.6
'@changesets/types': 5.2.1
@@ -2707,7 +2707,7 @@ packages:
/@changesets/[email protected]:
resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
'@changesets/assemble-release-plan': 5.2.4
'@changesets/config': 2.3.1
'@changesets/pre': 1.0.14
@@ -2723,7 +2723,7 @@ packages:
/@changesets/[email protected]:
resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
'@changesets/errors': 0.1.4
'@changesets/types': 5.2.1
'@manypkg/get-packages': 1.1.3
@@ -2748,7 +2748,7 @@ packages:
/@changesets/[email protected]:
resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
'@changesets/errors': 0.1.4
'@changesets/types': 5.2.1
'@manypkg/get-packages': 1.1.3
@@ -2758,7 +2758,7 @@ packages:
/@changesets/[email protected]:
resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
'@changesets/git': 2.0.0
'@changesets/logger': 0.0.5
'@changesets/parse': 0.3.16
@@ -2779,7 +2779,7 @@ packages:
/@changesets/[email protected]:
resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
'@changesets/types': 5.2.1
fs-extra: 7.0.1
human-id: 1.0.2
@@ -3623,7 +3623,7 @@ packages:
/@manypkg/[email protected]:
resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
'@changesets/types': 4.1.0
'@manypkg/find-root': 1.1.0
fs-extra: 8.1.0
@@ -6577,6 +6577,11 @@ packages:
engines: {node: '>=0.8'}
dev: true
+ resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==}
+ engines: {node: '>=6'}
+ dev: false
+
resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==}
engines: {node: '>=6'}
@@ -7088,7 +7093,7 @@ packages:
resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
dependencies:
- '@babel/runtime': 7.23.1
+ '@babel/runtime': 7.23.2
csstype: 3.1.2
dev: false
@@ -10586,6 +10591,21 @@ packages:
unpipe: 1.0.0
dev: true
+ resolution: {integrity: sha512-975X3018GhR+EjZFbxA2Z57SX5rnu0G0/OxFgMMvZK4/hQWEm3MHaNvP4wXpxYDoJsp+xUvVW+GB9CMMCm81jA==}
+ peerDependencies:
+ react: '>=16.9.0'
+ react-dom: '>=16.9.0'
+ dependencies:
+ '@babel/runtime': 7.23.2
+ '@rc-component/portal': 1.1.2([email protected])([email protected])
+ classnames: 2.3.2
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
resolution: {integrity: sha512-VZjMunpBdlVzYpEdJSaV7WM7O0jf8uyDjirxXLZRNZ+tAC+NzD3PXPEtliFwGzVwBBdCmGuSqiS9DWcOLxQ9tw==}
peerDependencies:
@@ -10782,6 +10802,18 @@ packages:
react: 18.2.0
scheduler: 0.23.0
+ resolution: {integrity: sha512-LtY5Xw1zTPqHkVmtM3X8MUOxNDOUhv/khTgBgrUvwaS064bwVvxT+q5El0uUFNx5IEPKXuRejr7UqLwBIg5pdw==}
+ peerDependencies:
+ react: '>= 16.3.0'
+ react-dom: '>= 16.3.0'
+ dependencies:
+ clsx: 1.2.1
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
resolution: {integrity: sha512-UDg4lXB6BzlobN60P8fHWVPX3Kyw8ORrTeBtClmIlGdkOOE+GYQSFvmEU5iLLpwp/6v42DINwNcwOhOLfQ//FQ==}
peerDependencies: