@univerjs/ui 0.4.2 → 0.5.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +22 -22
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +46 -0
- package/lib/es/index.js +6077 -6255
- package/lib/es/locale/en-US.js +64 -0
- package/lib/es/locale/fa-IR.js +64 -0
- package/lib/es/locale/ru-RU.js +64 -0
- package/lib/es/locale/vi-VN.js +64 -0
- package/lib/es/locale/zh-CN.js +64 -0
- package/lib/es/locale/zh-TW.js +64 -0
- package/lib/index.css +1 -1
- package/lib/types/common/menu-hidden-observable.d.ts +1 -1
- package/lib/types/components/hooks/observable.d.ts +2 -0
- package/lib/types/components/progress-bar/ProgressBar.d.ts +1 -0
- package/lib/types/facade/f-hooks.d.ts +38 -0
- package/lib/types/facade/f-univer.d.ts +23 -0
- package/lib/types/facade/index.d.ts +17 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/types/services/popup/canvas-popup.service.d.ts +5 -2
- package/lib/types/services/shortcut/shortcut.service.d.ts +2 -2
- package/lib/types/services/sidebar/desktop-sidebar.service.d.ts +4 -1
- package/lib/types/services/sidebar/hooks/useSidebarClick.d.ts +19 -0
- package/lib/types/services/sidebar/sidebar.service.d.ts +2 -0
- package/lib/types/views/components/popup/RectPopup.d.ts +41 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +22 -22
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +38 -20
- package/lib/locale/en-US.json +0 -61
- package/lib/locale/fa-IR.json +0 -61
- package/lib/locale/ru-RU.json +0 -61
- package/lib/locale/vi-VN.json +0 -61
- package/lib/locale/zh-CN.json +0 -61
- package/lib/locale/zh-TW.json +0 -61
|
@@ -8,6 +8,8 @@ export interface ISidebarService {
|
|
|
8
8
|
close(id?: string): void;
|
|
9
9
|
get visible(): boolean;
|
|
10
10
|
get options(): ISidebarMethodOptions;
|
|
11
|
+
getContainer(): HTMLElement | undefined;
|
|
12
|
+
setContainer(element?: HTMLElement): void;
|
|
11
13
|
}
|
|
12
14
|
export declare const ILeftSidebarService: import('@wendellhu/redi').IdentifierDecorator<ISidebarService>;
|
|
13
15
|
export declare const ISidebarService: import('@wendellhu/redi').IdentifierDecorator<ISidebarService>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Nullable } from '@univerjs/core';
|
|
2
|
+
import { RefObject, default as React } from 'react';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
interface IAbsolutePosition {
|
|
5
|
+
left: number;
|
|
6
|
+
right: number;
|
|
7
|
+
top: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
}
|
|
10
|
+
export interface IRectPopupProps {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* the anchor element bounding rect
|
|
14
|
+
*/
|
|
15
|
+
anchorRect$: Observable<IAbsolutePosition>;
|
|
16
|
+
excludeRects?: RefObject<Nullable<IAbsolutePosition[]>>;
|
|
17
|
+
direction?: 'vertical' | 'horizontal' | 'left' | 'top' | 'right' | 'left' | 'bottom' | 'bottom-center' | 'top-center';
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
onClickOutside?: (e: MouseEvent) => void;
|
|
20
|
+
excludeOutside?: HTMLElement[];
|
|
21
|
+
onContextMenu?: () => void;
|
|
22
|
+
onPointerEnter?: (e: React.PointerEvent<HTMLElement>) => void;
|
|
23
|
+
onPointerLeave?: (e: React.PointerEvent<HTMLElement>) => void;
|
|
24
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
|
|
27
|
+
position: IAbsolutePosition;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
containerWidth: number;
|
|
31
|
+
containerHeight: number;
|
|
32
|
+
}
|
|
33
|
+
declare function RectPopup(props: IRectPopupProps): React.JSX.Element;
|
|
34
|
+
declare namespace RectPopup {
|
|
35
|
+
var calcPopupPosition: (layout: IPopupLayoutInfo) => {
|
|
36
|
+
top: number;
|
|
37
|
+
left: number;
|
|
38
|
+
};
|
|
39
|
+
var useContext: () => RefObject<IAbsolutePosition | undefined>;
|
|
40
|
+
}
|
|
41
|
+
export { RectPopup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(require("@univerjs/core"),require("@univerjs/ui")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/ui"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.UniverCore,e.UniverUi))})(this,function(e,n){"use strict";class d extends e.FUniver{copy(){return this._commandService.executeCommand(n.CopyCommand.id)}paste(){return this._commandService.executeCommand(n.PasteCommand.id)}openSiderbar(i){return this._injector.get(n.ISidebarService).open(i)}openDialog(i){const o=this._injector.get(n.IDialogService).open({...i,onClose:()=>{o.dispose()}});return o}}e.FUniver.extend(d);class r extends e.FHooks{onBeforeCopy(i){return this._injector.get(e.ICommandService).beforeCommandExecuted(o=>{o.id===n.CopyCommand.id&&i()})}onCopy(i){return this._injector.get(e.ICommandService).onCommandExecuted(o=>{o.id===n.CopyCommand.id&&i()})}onBeforePaste(i){return this._injector.get(e.ICommandService).beforeCommandExecuted(o=>{o.id===n.PasteCommand.id&&i()})}onPaste(i){return this._injector.get(e.ICommandService).onCommandExecuted(o=>{o.id===n.PasteCommand.id&&i()})}}e.FHooks.extend(r)});
|