@univerjs/sheets-ui 0.5.5 → 0.6.0-experimental.20250125-1d060b9
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 -1
- package/lib/cjs/index.js +30 -34
- package/lib/es/facade.js +374 -322
- package/lib/es/index.js +11136 -10953
- package/lib/index.css +1 -1
- package/lib/types/commands/commands/clipboard.command.d.ts +1 -0
- package/lib/types/commands/commands/headersize-changed.command.d.ts +8 -0
- package/lib/types/components/border-panel/BorderPanel.d.ts +1 -2
- package/lib/types/components/border-panel/border-line/BorderLine.d.ts +1 -2
- package/lib/types/components/border-panel/border-line/icons/BorderDashDot.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderDashDotDot.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderDashed.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderDotted.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderHair.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderMedium.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDot.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDotDot.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashed.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderThick.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderThin.d.ts +16 -2
- package/lib/types/components/menu-item-input/MenuItemInput.d.ts +1 -2
- package/lib/types/controllers/clipboard/clipboard.controller.d.ts +1 -0
- package/lib/types/controllers/editor/formula-editor.controller.d.ts +0 -1
- package/lib/types/controllers/render-controllers/freeze.render-controller.d.ts +10 -4
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +4 -0
- package/lib/types/facade/f-event.d.ts +56 -32
- package/lib/types/facade/f-permission.d.ts +3 -0
- package/lib/types/facade/f-range.d.ts +27 -5
- package/lib/types/facade/f-sheet-hooks.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +12 -1
- package/lib/types/facade/f-workbook.d.ts +3 -0
- package/lib/types/facade/f-worksheet.d.ts +86 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/clipboard/clipboard.service.d.ts +5 -2
- package/lib/types/services/clipboard/type.d.ts +9 -1
- package/lib/types/services/clipboard/utils.d.ts +1 -1
- package/lib/types/services/selection/base-selection-render.service.d.ts +1 -0
- package/lib/types/services/selection/selection-control.d.ts +2 -2
- package/lib/types/services/sheet-skeleton-manager.service.d.ts +3 -1
- package/lib/types/views/cell-alert/CellAlertPopup.d.ts +1 -2
- package/lib/types/views/clipboard/ClipboardPopupMenu.d.ts +16 -2
- package/lib/types/views/count-bar/CountBar.d.ts +16 -2
- package/lib/types/views/count-bar/ZoomSlider.d.ts +16 -2
- package/lib/types/views/defined-name/DefinedName.d.ts +16 -2
- package/lib/types/views/defined-name/DefinedNameContainer.d.ts +16 -2
- package/lib/types/views/defined-name/DefinedNameInput.d.ts +1 -2
- package/lib/types/views/defined-name/DefinedNameOverlay.d.ts +16 -2
- package/lib/types/views/formula-bar/FormulaBar.d.ts +16 -2
- package/lib/types/views/mobile/sheet-bar/MobileSheetBar.d.ts +16 -2
- package/lib/types/views/permission/error-msg-dialog/index.d.ts +16 -2
- package/lib/types/views/permission/panel/index.d.ts +1 -2
- package/lib/types/views/permission/panel-detail/PermissionDetailFooterPart.d.ts +1 -2
- package/lib/types/views/permission/panel-detail/PermissionDetailMainPart.d.ts +1 -1
- package/lib/types/views/permission/panel-detail/PermissionDetailPanel.d.ts +1 -2
- package/lib/types/views/permission/panel-detail/PermissionDetailUserPart.d.ts +1 -2
- package/lib/types/views/permission/panel-list/index.d.ts +16 -2
- package/lib/types/views/permission/permission-dialog/index.d.ts +16 -2
- package/lib/types/views/permission/spin/index.d.ts +1 -1
- package/lib/types/views/permission/user-dialog/index.d.ts +16 -2
- package/lib/types/views/sheet-bar/SheetBar.d.ts +16 -2
- package/lib/types/views/sheet-bar/sheet-bar-button/SheetBarButton.d.ts +1 -1
- package/lib/types/views/sheet-bar/sheet-bar-menu/SheetBarMenu.d.ts +1 -1
- package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarItem.d.ts +1 -1
- package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.d.ts +16 -2
- package/lib/types/views/sheet-container/SheetContainer.d.ts +18 -4
- package/lib/types/views/status-bar/StatusBar.d.ts +16 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +33 -37
- package/package.json +16 -16
- package/LICENSE +0 -176
- package/lib/types/commands/commands/__tests__/add-worksheet-merge.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/auto-fill.controller.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +0 -7
- package/lib/types/commands/commands/__tests__/create-selection-command-test-bed.d.ts +0 -28
- package/lib/types/commands/commands/__tests__/create-sheet-skeleton-test-bed.d.ts +0 -22
- package/lib/types/commands/commands/__tests__/hide-row-col-confirm.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/remove-row-col-confirm.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/selection-utils.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-format-painter.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-frozen.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-selections.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/sheet-skeleton.spec.d.ts +0 -16
- package/lib/types/controllers/editor/__tests__/create-test-bed.d.ts +0 -7
- package/lib/types/controllers/editor/__tests__/end-edit.controller.spec.d.ts +0 -16
- package/lib/types/controllers/editor/__tests__/mock-function.service.d.ts +0 -5
- package/lib/types/controllers/menu/__tests__/create-menu-test-bed.d.ts +0 -13
- package/lib/types/controllers/menu/__tests__/menu.spec.d.ts +0 -16
- package/lib/types/controllers/menu/__tests__/row-col.menu.spec.d.ts +0 -16
- package/lib/types/controllers/utils/__tests__/cell-tools.spec.d.ts +0 -16
- package/lib/types/facade/__tests__/create-test-bed.d.ts +0 -10
- package/lib/types/facade/__tests__/f-sheet-hooks.spec.d.ts +0 -16
- package/lib/types/services/auto-fill/__tests__/tool.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-copy-filter.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-alignment.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-border.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-col-width.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-font.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-form-excel.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-from-google.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-from-notepad.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-rotate.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-service.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-test-bed.d.ts +0 -29
- package/lib/types/services/clipboard/__tests__/constant.d.ts +0 -28
- package/lib/types/services/clipboard/__tests__/mock-clipboard.d.ts +0 -39
- package/lib/types/services/clipboard/__tests__/sheet-paste.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/utils.spec.d.ts +0 -16
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ClipboardPopupMenu: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
2
16
|
interface ICountBarProps {
|
|
3
17
|
changeRatio?: (ratio: string) => void;
|
|
4
18
|
onChange?: (value: string) => void;
|
|
5
19
|
}
|
|
6
|
-
export declare function CountBar(props: ICountBarProps):
|
|
20
|
+
export declare function CountBar(props: ICountBarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
21
|
export {};
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ZoomSlider(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
2
16
|
export declare function DefinedName({ disable }: {
|
|
3
17
|
disable: boolean;
|
|
4
|
-
}):
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DefinedNameContainer: () => import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IDefinedNamesServiceParam } from '@univerjs/engine-formula';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
export interface IDefinedNameInputProps extends Omit<IDefinedNamesServiceParam, 'id'> {
|
|
4
3
|
inputId: string;
|
|
5
4
|
type?: string;
|
|
@@ -8,4 +7,4 @@ export interface IDefinedNameInputProps extends Omit<IDefinedNamesServiceParam,
|
|
|
8
7
|
cancel?: () => void;
|
|
9
8
|
id?: string;
|
|
10
9
|
}
|
|
11
|
-
export declare const DefinedNameInput: (props: IDefinedNameInputProps) =>
|
|
10
|
+
export declare const DefinedNameInput: (props: IDefinedNameInputProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
2
16
|
export interface IDefinedNameOverlayProps {
|
|
3
17
|
}
|
|
4
|
-
export declare function DefinedNameOverlay(props: IDefinedNameOverlayProps):
|
|
18
|
+
export declare function DefinedNameOverlay(props: IDefinedNameOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function FormulaBar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function MobileSheetBar(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
2
16
|
export declare const AlertDialog: ({ errorMsg }: {
|
|
3
17
|
errorMsg: string;
|
|
4
|
-
}) =>
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
interface ISheetPermissionPanelProps {
|
|
4
3
|
showDetail: boolean;
|
|
5
4
|
fromSheetBar: boolean;
|
|
6
5
|
rule?: IPermissionPanelRule;
|
|
7
6
|
oldRule?: IPermissionPanelRule;
|
|
8
7
|
}
|
|
9
|
-
export declare const SheetPermissionPanel: ({ showDetail, fromSheetBar, rule, oldRule }: ISheetPermissionPanelProps) =>
|
|
8
|
+
export declare const SheetPermissionPanel: ({ showDetail, fromSheetBar, rule, oldRule }: ISheetPermissionPanelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
9
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IRange } from '@univerjs/core';
|
|
2
2
|
import { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
|
|
3
3
|
import { EditStateEnum, ViewStateEnum } from '@univerjs/sheets';
|
|
4
|
-
import { default as React } from 'react';
|
|
5
4
|
interface IPermissionDetailFooterPartProps {
|
|
6
5
|
permissionId: string;
|
|
7
6
|
id: string;
|
|
@@ -12,5 +11,5 @@ interface IPermissionDetailFooterPartProps {
|
|
|
12
11
|
viewState: ViewStateEnum;
|
|
13
12
|
oldRule?: IPermissionPanelRule;
|
|
14
13
|
}
|
|
15
|
-
export declare const PermissionDetailFooterPart: (props: IPermissionDetailFooterPartProps) =>
|
|
14
|
+
export declare const PermissionDetailFooterPart: (props: IPermissionDetailFooterPartProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
15
|
export {};
|
|
@@ -11,5 +11,5 @@ interface IPermissionDetailMainPartProps {
|
|
|
11
11
|
rangeSelectorRef: React.MutableRefObject<any>;
|
|
12
12
|
onFocus: () => void;
|
|
13
13
|
}
|
|
14
|
-
export declare const PermissionDetailMainPart: (props: IPermissionDetailMainPartProps) =>
|
|
14
|
+
export declare const PermissionDetailMainPart: (props: IPermissionDetailMainPartProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
15
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
interface ISheetPermissionPanelDetailProps {
|
|
4
3
|
fromSheetBar: boolean;
|
|
5
4
|
rule?: IPermissionPanelRule;
|
|
6
5
|
oldRule?: IPermissionPanelRule;
|
|
7
6
|
}
|
|
8
|
-
export declare const SheetPermissionPanelDetail: (props: ISheetPermissionPanelDetailProps) =>
|
|
7
|
+
export declare const SheetPermissionPanelDetail: (props: ISheetPermissionPanelDetailProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EditStateEnum, ViewStateEnum } from '@univerjs/sheets';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
interface IPermissionDetailUserPartProps {
|
|
4
3
|
editState: EditStateEnum;
|
|
5
4
|
onEditStateChange: (v: EditStateEnum) => void;
|
|
@@ -7,5 +6,5 @@ interface IPermissionDetailUserPartProps {
|
|
|
7
6
|
onViewStateChange: (v: ViewStateEnum) => void;
|
|
8
7
|
permissionId: string;
|
|
9
8
|
}
|
|
10
|
-
export declare const PermissionDetailUserPart: (props: IPermissionDetailUserPartProps) =>
|
|
9
|
+
export declare const PermissionDetailUserPart: (props: IPermissionDetailUserPartProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
10
|
export {};
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SheetPermissionPanelList: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SheetPermissionDialog: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,5 +3,5 @@ interface ISpinProps {
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare const Spin: ({ loading, children }: ISpinProps) =>
|
|
6
|
+
declare const Spin: ({ loading, children }: ISpinProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default Spin;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SheetPermissionUserDialog: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SheetBar: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,4 +16,4 @@ export interface IBaseSheetBarButtonProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* Button Component
|
|
18
18
|
*/
|
|
19
|
-
export declare function SheetBarButton(props: IBaseSheetBarButtonProps):
|
|
19
|
+
export declare function SheetBarButton(props: IBaseSheetBarButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,4 +10,4 @@ export interface ISheetBarMenuProps {
|
|
|
10
10
|
style?: React.CSSProperties;
|
|
11
11
|
onClick?: (e?: MouseEvent) => void;
|
|
12
12
|
}
|
|
13
|
-
export declare function SheetBarMenu(props: ISheetBarMenuProps):
|
|
13
|
+
export declare function SheetBarMenu(props: ISheetBarMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,4 +10,4 @@ export interface IBaseSheetBarProps {
|
|
|
10
10
|
hidden?: BooleanNumber;
|
|
11
11
|
selected?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare function SheetBarItem(props: IBaseSheetBarProps):
|
|
13
|
+
export declare function SheetBarItem(props: IBaseSheetBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function SheetBarTabs(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare function RenderSheetFooter(): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export declare function RenderSheetHeader(): import("react/jsx-runtime").JSX.Element | null;
|
|
4
18
|
/**
|
|
5
19
|
* @deprecated We should not write into this component anymore.
|
|
6
20
|
*/
|
|
7
|
-
export declare function RenderSheetContent():
|
|
21
|
+
export declare function RenderSheetContent(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const StatusBar: () => false | import("react/jsx-runtime").JSX.Element;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/engine-render"),require("@univerjs/sheets"),require("@univerjs/sheets-ui"),require("@univerjs/sheets/facade"),require("@univerjs/ui"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs","@univerjs/engine-render","@univerjs/sheets","@univerjs/sheets-ui","@univerjs/sheets/facade","@univerjs/ui","rxjs"],s):(f=typeof globalThis<"u"?globalThis:f||self,s(f.UniverSheetsUiFacade={},f.UniverCore,f.UniverDocs,f.UniverEngineRender,f.UniverSheets,f.UniverSheetsUi,f.UniverSheetsFacade,f.UniverUi,f.rxjs))})(this,function(f,s,F,E,R,c,I,u,S){"use strict";class N extends s.FUniver{_initSheetUIEvent(e){const r=e.get(s.ICommandService);this.disposeWithMe(r.beforeCommandExecuted(t=>{if(t.id===c.SetCellEditVisibleOperation.id){if(!this._eventListend(this.Event.BeforeSheetEditStart)&&!this._eventListend(this.Event.BeforeSheetEditEnd))return;const i=this.getCommandSheetTarget(t);if(!i)return;const{workbook:o,worksheet:a}=i,l=e.get(c.IEditorBridgeService),C=e.get(s.IUniverInstanceService),m=t.params,{visible:v,keycode:g,eventType:b}=m,h=l.getEditLocation();if(v){const _={row:h.row,column:h.column,eventType:b,keycode:g,workbook:o,worksheet:a,isZenEditor:!1};if(this.fireEvent(this.Event.BeforeSheetEditStart,_),_.cancel)throw new s.CanceledError}else{const _={row:h.row,column:h.column,eventType:b,keycode:g,workbook:o,worksheet:a,isZenEditor:!1,value:s.RichTextValue.create(C.getUnit(s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY).getSnapshot()),isConfirm:g!==u.KeyCode.ESC};if(this.fireEvent(this.Event.BeforeSheetEditEnd,_),_.cancel)throw new s.CanceledError}}if(t.id===c.SetZoomRatioCommand.id){if(!this._eventListend(this.Event.BeforeSheetZoomChange))return;const i=this.getCommandSheetTarget(t);if(!i)return;const{workbook:o,worksheet:a}=i;this.fireEvent(this.Event.BeforeSheetZoomChange,{zoom:t.params.zoomRatio,workbook:o,worksheet:a})}})),this.disposeWithMe(r.onCommandExecuted(t=>{if(t.id===c.SetCellEditVisibleOperation.id){if(!this._eventListend(this.Event.SheetEditStarted)&&!this._eventListend(this.Event.SheetEditEnded))return;const i=this.getCommandSheetTarget(t);if(!i)return;const{workbook:o,worksheet:a}=i,l=e.get(c.IEditorBridgeService),C=t.params,{visible:m,keycode:v,eventType:g}=C,b=l.getEditLocation();if(m){const h={row:b.row,column:b.column,eventType:g,keycode:v,workbook:o,worksheet:a,isZenEditor:!1};this.fireEvent(this.Event.SheetEditStarted,h)}else{const h={row:b.row,column:b.column,eventType:g,keycode:v,workbook:o,worksheet:a,isZenEditor:!1,isConfirm:v!==u.KeyCode.ESC};this.fireEvent(this.Event.SheetEditEnded,h)}}if(t.id===F.RichTextEditingMutation.id){if(!this._eventListend(this.Event.SheetEditChanging))return;const i=this.getCommandSheetTarget(t);if(!i)return;const{workbook:o,worksheet:a}=i,l=e.get(c.IEditorBridgeService),C=e.get(s.IUniverInstanceService),m=t.params;if(!l.isVisible().visible)return;const{unitId:v}=m;if(v===s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY){const{row:g,column:b}=l.getEditLocation(),h={workbook:o,worksheet:a,row:g,column:b,value:s.RichTextValue.create(C.getUnit(s.DOCS_NORMAL_EDITOR_UNIT_ID_KEY).getSnapshot()),isZenEditor:!1};this.fireEvent(this.Event.SheetEditChanging,h)}}if(t.id===c.SetZoomRatioCommand.id){if(!this._eventListend(this.Event.SheetZoomChanged))return;const i=this.getCommandSheetTarget(t);if(!i)return;const{workbook:o,worksheet:a}=i;this.fireEvent(this.Event.SheetZoomChanged,{zoom:a.getZoom(),workbook:o,worksheet:a})}})),this._initObserverListener(e)}_initObserverListener(e){const t=e.get(s.IUniverInstanceService).getFocusedUnit(),i=t==null?void 0:t.getUnitId(),o=e.get(E.IRenderManagerService);if(i){const v=e.get(s.LifecycleService),g=new s.DisposableCollection;this.disposeWithMe(v.lifecycle$.subscribe(b=>{var M,D,p,w,k,T,L,B,x,A,O,U,W,$,j;if(b<s.LifecycleStages.Rendered)return;g.dispose();const h=e.get(c.HoverManagerService),_=e.get(c.DragManagerService);h&&(g.add((M=h.currentClickedCell$)==null?void 0:M.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellClicked))return;const d=this.getSheetTarget(n.location.unitId,n.location.subUnitId);d&&this.fireEvent(this.Event.CellClicked,{...d,...n,row:n.location.row,column:n.location.col})})),g.add((D=h.currentRichText$)==null?void 0:D.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellHover))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.CellHover,{...d,...n,row:n.row,column:n.col})})),g.add((p=h.currentPointerDownCell$)==null?void 0:p.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellPointerDown))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.CellPointerDown,{...d,...n,row:n.row,column:n.col})})),g.add((w=h.currentPointerUpCell$)==null?void 0:w.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellPointerUp))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.CellPointerUp,{...d,...n,row:n.row,column:n.col})})),g.add((k=h.currentCellPosWithEvent$)==null?void 0:k.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellPointerMove))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.CellPointerMove,{...d,...n,row:n.row,column:n.col})})),g.add((T=_.currentCell$)==null?void 0:T.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.DragOver))return;const d=this.getSheetTarget(n.location.unitId,n.location.subUnitId);d&&this.fireEvent(this.Event.DragOver,{...d,...n,row:n.location.row,column:n.location.col})})),g.add((L=_.endCell$)==null?void 0:L.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.Drop))return;const d=this.getSheetTarget(n.location.unitId,n.location.subUnitId);d&&this.fireEvent(this.Event.Drop,{...d,...n,row:n.location.row,column:n.location.col})})),g.add((B=h.currentRowHeaderClick$)==null?void 0:B.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.RowHeaderClick))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.RowHeaderClick,{...d,row:n.index})})),g.add((x=h.currentRowHeaderPointerDown$)==null?void 0:x.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.RowHeaderPointerDown))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.RowHeaderPointerDown,{...d,row:n.index})})),g.add((A=h.currentRowHeaderPointerUp$)==null?void 0:A.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.RowHeaderPointerUp))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.RowHeaderPointerUp,{...d,row:n.index})})),g.add((O=h.currentHoveredRowHeader$)==null?void 0:O.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.RowHeaderHover))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.RowHeaderHover,{...d,row:n.index})})),g.add((U=h.currentColHeaderClick$)==null?void 0:U.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.ColumnHeaderClick))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.ColumnHeaderClick,{...d,column:n.index})})),g.add((W=h.currentColHeaderPointerDown$)==null?void 0:W.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.ColumnHeaderPointerDown))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.ColumnHeaderPointerDown,{...d,column:n.index})})),g.add(($=h.currentColHeaderPointerUp$)==null?void 0:$.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.ColumnHeaderPointerUp))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.ColumnHeaderPointerUp,{...d,column:n.index})})),g.add((j=h.currentHoveredColHeader$)==null?void 0:j.pipe(S.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.ColumnHeaderHover))return;const d=this.getSheetTarget(n.unitId,n.subUnitId);d&&this.fireEvent(this.Event.ColumnHeaderHover,{...d,column:n.index})})))})),this.disposeWithMe(g)}const a=new Map;let l;const C=e.get(s.LifecycleService),m=S.combineLatest([o.created$,C.lifecycle$]);this.disposeWithMe(m.subscribe(([v,g])=>{var D;if(v.type===s.UniverInstanceType.UNIVER_SHEET&&(l=v),g<=s.LifecycleStages.Rendered)return;const b=new s.DisposableCollection;if(!l)return;const h=this.getWorkbook(l.unitId);if(!h)return;a.get(l.unitId)&&((D=a.get(l.unitId))==null||D.dispose()),a.set(l.unitId,b);const _=l.with(c.SheetScrollManagerService);b.add(_.validViewportScrollInfo$.subscribe(p=>{p&&this._eventListend(this.Event.Scroll)&&this.fireEvent(this.Event.Scroll,{workbook:h,worksheet:h.getActiveSheet(),...p})}));const M=l.with(R.SheetsSelectionsService);b.add(M.selectionMoveStart$.subscribe(p=>{var w;this._eventListend(this.Event.SelectionMoveStart)&&this.fireEvent(this.Event.SelectionMoveStart,{workbook:h,worksheet:h.getActiveSheet(),selections:(w=p==null?void 0:p.map(k=>k.range))!=null?w:[]})})),b.add(M.selectionMoving$.subscribe(p=>{var w;this._eventListend(this.Event.SelectionMoving)&&this.fireEvent(this.Event.SelectionMoving,{workbook:h,worksheet:h.getActiveSheet(),selections:(w=p==null?void 0:p.map(k=>k.range))!=null?w:[]})})),b.add(M.selectionMoveEnd$.subscribe(p=>{var w;this._eventListend(this.Event.SelectionMoveEnd)&&this.fireEvent(this.Event.SelectionMoveEnd,{workbook:h,worksheet:h.getActiveSheet(),selections:(w=p==null?void 0:p.map(k=>k.range))!=null?w:[]})})),b.add(M.selectionChanged$.subscribe(p=>{var w;this._eventListend(this.Event.SelectionChanged)&&this.fireEvent(this.Event.SelectionChanged,{workbook:h,worksheet:h.getActiveSheet(),selections:(w=p==null?void 0:p.map(k=>k.range))!=null?w:[]})})),l=null,this.disposeWithMe(b)})),this.disposeWithMe(o.disposed$.subscribe(v=>{var g;(g=a.get(v))==null||g.dispose(),a.delete(v)})),this.disposeWithMe(()=>{a.forEach(v=>{v.dispose()})})}_initialize(e){this._initSheetUIEvent(e);const r=e.get(s.ICommandService);this.disposeWithMe(r.beforeCommandExecuted(t=>{switch(t.id){case u.CopyCommand.id:case u.CutCommand.id:this._beforeClipboardChange();break;case c.SheetPasteShortKeyCommand.id:this._beforeClipboardPaste(t.params);break}})),this.disposeWithMe(r.onCommandExecuted(t=>{if(R.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(t.id)>-1){if(!this._eventListend(this.Event.SheetSkeletonChanged))return;const i=this.getActiveSheet();if(!i)return;const o=R.getSkeletonChangedEffectedRange(t).map(a=>{var l,C;return(C=(l=this.getWorkbook(a.unitId))==null?void 0:l.getSheetBySheetId(a.subUnitId))==null?void 0:C.getRange(a.range)}).filter(Boolean);if(!o.length)return;this.fireEvent(this.Event.SheetSkeletonChanged,{workbook:i.workbook,worksheet:i.worksheet,payload:t,skeleton:i.worksheet.getSkeleton(),effectedRanges:o});return}switch(t.id){case u.CopyCommand.id:case u.CutCommand.id:this._clipboardChanged();break;case c.SheetPasteShortKeyCommand.id:this._clipboardPaste();break;case u.PasteCommand.id:this._clipboardPasteAsync();break}})),this.disposeWithMe(r.beforeCommandExecuted(async t=>{switch(t.id){case u.PasteCommand.id:await this._beforeClipboardPasteAsync();break}}))}_generateClipboardCopyParam(){const e=this.getActiveWorkbook(),r=e==null?void 0:e.getActiveSheet(),t=e==null?void 0:e.getActiveRange();if(!e||!r||!t)return;const o=this._injector.get(c.ISheetClipboardService).generateCopyContent(e.getId(),r.getSheetId(),t.getRange());if(!o)return;const{html:a,plain:l}=o;return{workbook:e,worksheet:r,text:l,html:a,fromSheet:r,fromRange:t}}_beforeClipboardChange(){if(!this.hasEventCallback(this.Event.BeforeClipboardChange))return;const e=this._generateClipboardCopyParam();if(e&&(this.fireEvent(this.Event.BeforeClipboardChange,e),e.cancel))throw new Error("Before clipboard change is canceled")}_clipboardChanged(){if(!this.hasEventCallback(this.Event.ClipboardChanged))return;const e=this._generateClipboardCopyParam();if(e&&(this.fireEvent(this.Event.ClipboardChanged,e),e.cancel))throw new Error("Clipboard changed is canceled")}_generateClipboardPasteParam(e){if(!e)return;const{htmlContent:r,textContent:t}=e,i=this.getActiveWorkbook(),o=i==null?void 0:i.getActiveSheet();return!i||!o?void 0:{workbook:i,worksheet:o,text:t,html:r}}async _generateClipboardPasteParamAsync(){const e=this.getActiveWorkbook(),r=e==null?void 0:e.getActiveSheet();if(!e||!r)return;const o=(await this._injector.get(u.IClipboardInterfaceService).read())[0];let a;if(o){const l=o.types,C=l.indexOf(u.PLAIN_TEXT_CLIPBOARD_MIME_TYPE)!==-1?await o.getType(u.PLAIN_TEXT_CLIPBOARD_MIME_TYPE).then(v=>v&&v.text()):"",m=l.indexOf(u.HTML_CLIPBOARD_MIME_TYPE)!==-1?await o.getType(u.HTML_CLIPBOARD_MIME_TYPE).then(v=>v&&v.text()):"";a={workbook:e,worksheet:r,text:C,html:m}}return a}_beforeClipboardPaste(e){if(!this.hasEventCallback(this.Event.BeforeClipboardPaste))return;const r=this._generateClipboardPasteParam(e);if(r&&(this.fireEvent(this.Event.BeforeClipboardPaste,r),r.cancel))throw new Error("Before clipboard paste is canceled")}_clipboardPaste(e){if(!this.hasEventCallback(this.Event.BeforeClipboardPaste))return;const r=this._generateClipboardPasteParam(e);if(r&&(this.fireEvent(this.Event.BeforeClipboardPaste,r),r.cancel))throw new Error("Clipboard pasted is canceled")}async _beforeClipboardPasteAsync(){if(!this.hasEventCallback(this.Event.BeforeClipboardPaste))return;if(!u.supportClipboardAPI()){this._injector.get(s.ILogService).warn("[Facade]: The navigator object only supports the browser environment");return}const e=await this._generateClipboardPasteParamAsync();if(e&&(this.fireEvent(this.Event.BeforeClipboardPaste,e),e.cancel))throw new Error("Before clipboard paste is canceled")}async _clipboardPasteAsync(){if(!this.hasEventCallback(this.Event.ClipboardPasted))return;if(!u.supportClipboardAPI()){this._injector.get(s.ILogService).warn("[Facade]: The navigator object only supports the browser environment");return}const e=await this._generateClipboardPasteParamAsync();if(e&&(this.fireEvent(this.Event.ClipboardPasted,e),e.cancel))throw new Error("Clipboard pasted is canceled")}customizeColumnHeader(e){const r=this.getActiveWorkbook();if(!r){console.error("WorkBook not exist");return}const t=r==null?void 0:r.getId();this._getSheetRenderComponent(t,c.SHEET_VIEW_KEY.COLUMN).setCustomHeader(e)}customizeRowHeader(e){const r=this.getActiveWorkbook();if(!r){console.error("WorkBook not exist");return}const t=r==null?void 0:r.getId();this._getSheetRenderComponent(t,c.SHEET_VIEW_KEY.ROW).setCustomHeader(e)}registerSheetRowHeaderExtension(e,...r){const t=this._getSheetRenderComponent(e,c.SHEET_VIEW_KEY.ROW),i=t.register(...r);return s.toDisposable(()=>{i.dispose(),t.makeDirty(!0)})}registerSheetColumnHeaderExtension(e,...r){const t=this._getSheetRenderComponent(e,c.SHEET_VIEW_KEY.COLUMN),i=t.register(...r);return s.toDisposable(()=>{i.dispose(),t.makeDirty(!0)})}registerSheetMainExtension(e,...r){const t=this._getSheetRenderComponent(e,c.SHEET_VIEW_KEY.MAIN),i=t.register(...r);return s.toDisposable(()=>{i.dispose(),t.makeDirty(!0)})}_getSheetRenderComponent(e,r){const i=this._injector.get(E.IRenderManagerService).getRenderById(e);if(!i)throw new Error(`Render Unit with unitId ${e} not found`);const{components:o}=i,a=o.get(r);if(!a)throw new Error("Render component not found");return a}getSheetHooks(){return this._injector.createInstance(I.FSheetHooks)}}s.FUniver.extend(N);class V extends I.FWorkbook{openSiderbar(e){return this._logDeprecation("openSiderbar"),this._injector.get(u.ISidebarService).open(e)}openDialog(e){this._logDeprecation("openDialog");const t=this._injector.get(u.IDialogService).open({...e,onClose:()=>{t.dispose()}});return t}_logDeprecation(e){this._injector.get(s.ILogService).warn("[FWorkbook]",`${e} is deprecated. Please use the function of the same name on "FUniver".`)}generateCellParams(e){const r=this.getActiveSheet();return{row:e.row,column:e.col,workbook:this,worksheet:r}}onCellClick(e){const r=this._injector.get(c.HoverManagerService);return s.toDisposable(r.currentClickedCell$.pipe(S.filter(t=>!!t)).subscribe(t=>{e(t)}))}onCellHover(e){const r=this._injector.get(c.HoverManagerService);return s.toDisposable(r.currentRichText$.pipe(S.filter(t=>!!t)).subscribe(e))}onCellPointerDown(e){const r=this._injector.get(c.HoverManagerService);return s.toDisposable(r.currentPointerDownCell$.subscribe(e))}onCellPointerUp(e){const r=this._injector.get(c.HoverManagerService);return s.toDisposable(r.currentPointerUpCell$.subscribe(e))}onCellPointerMove(e){const r=this._injector.get(c.HoverManagerService);return s.toDisposable(r.currentCellPosWithEvent$.pipe(S.filter(t=>!!t)).subscribe(t=>{e(t,t.event)}))}onDragOver(e){const r=this._injector.get(c.DragManagerService);return s.toDisposable(r.currentCell$.pipe(S.filter(t=>!!t)).subscribe(t=>{e(t)}))}onDrop(e){const r=this._injector.get(c.DragManagerService);return s.toDisposable(r.endCell$.pipe(S.filter(t=>!!t)).subscribe(t=>{e(t)}))}startEditing(){return this._injector.get(s.ICommandService).syncExecuteCommand(c.SetCellEditVisibleOperation.id,{eventType:E.DeviceInputEventType.Dblclick,unitId:this._workbook.getUnitId(),visible:!0})}async endEditing(e){return this._injector.get(s.ICommandService).syncExecuteCommand(c.SetCellEditVisibleOperation.id,{eventType:E.DeviceInputEventType.Keyboard,keycode:e?u.KeyCode.ENTER:u.KeyCode.ESC,visible:!1,unitId:this._workbook.getUnitId()}),await s.awaitTime(0),!0}endEditingAsync(e=!0){return this.endEditing(e)}getScrollStateBySheetId(e){const r=this._workbook.getUnitId(),i=this._injector.get(E.IRenderManagerService).getRenderById(r);return i?i.with(c.SheetScrollManagerService).getScrollStateByParam({unitId:r,sheetId:e}):null}disableSelection(){const e=this._workbook.getUnitId(),t=this._injector.get(E.IRenderManagerService).getRenderById(e);return t&&t.with(c.ISheetSelectionRenderService).disableSelection(),this}enableSelection(){const e=this._workbook.getUnitId(),t=this._injector.get(E.IRenderManagerService).getRenderById(e);return t&&t.with(c.ISheetSelectionRenderService).enableSelection(),this}transparentSelection(){const e=this._workbook.getUnitId(),t=this._injector.get(E.IRenderManagerService).getRenderById(e);return t&&t.with(c.ISheetSelectionRenderService).transparentSelection(),this}showSelection(){const e=this._workbook.getUnitId(),t=this._injector.get(E.IRenderManagerService).getRenderById(e);return t&&t.with(c.ISheetSelectionRenderService).showSelection(),this}}I.FWorkbook.extend(V);class K extends I.FWorksheet{refreshCanvas(){const e=this._injector.get(E.IRenderManagerService),r=this._fWorkbook.id,t=e.getRenderById(r);if(!t)throw new Error(`Render Unit with unitId ${r} not found`);t.with(c.SheetSkeletonManagerService).reCalculate();const i=t.mainComponent;if(!i)throw new Error("Main component not found");return i.makeDirty(),this}zoom(e){return this._injector.get(s.ICommandService).syncExecuteCommand(c.ChangeZoomRatioCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),zoomRatio:e}),this}getZoom(){return this._worksheet.getZoomRatio()}getVisibleRange(){const e=this._workbook.getUnitId(),t=this._injector.get(E.IRenderManagerService).getRenderById(e);let i={startColumn:0,startRow:0,endColumn:0,endRow:0};if(!t)return i;const a=t.with(c.SheetSkeletonManagerService).getCurrentSkeleton();if(!a)return i;const l=a==null?void 0:a.getVisibleRanges();if(!l)return i;i=a.getVisibleRangeByViewport(E.SHEET_VIEWPORT_KEY.VIEW_MAIN);for(const[C,m]of l)E.sheetContentViewportKeys.indexOf(C)!==-1&&(i.startColumn=Math.min(i.startColumn,m.startColumn),i.startRow=Math.min(i.startRow,m.startRow),i.endColumn=Math.max(i.endColumn,m.endColumn),i.endRow=Math.max(i.endRow,m.endRow));return i}scrollToCell(e,r){const t=this._workbook.getUnitId(),o=this._injector.get(E.IRenderManagerService).getRenderById(t);return o&&(o==null?void 0:o.with(c.SheetsScrollRenderController)).scrollToCell(e,r),this}getScrollState(){const e={offsetX:0,offsetY:0,sheetViewStartColumn:0,sheetViewStartRow:0},r=this._workbook.getUnitId(),t=this._worksheet.getSheetId(),o=this._injector.get(E.IRenderManagerService).getRenderById(r);return o&&o.with(c.SheetScrollManagerService).getScrollStateByParam({unitId:r,sheetId:t})||e}onScroll(e){var o;const r=this._workbook.getUnitId(),i=(o=this._injector.get(E.IRenderManagerService).getRenderById(r))==null?void 0:o.with(c.SheetScrollManagerService);if(i){const a=i.validViewportScrollInfo$.subscribe(l=>{e(l)});return s.toDisposable(a)}return s.toDisposable(()=>{})}getSkeleton(){var r,t;const e=(r=this._injector.get(E.IRenderManagerService).getRenderById(this._workbook.getUnitId()))==null?void 0:r.with(c.SheetSkeletonManagerService);return(t=e==null?void 0:e.getWorksheetSkeleton(this._worksheet.getSheetId()))==null?void 0:t.skeleton}setColumnAutoWidth(e,r){const t=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=[{startColumn:e,endColumn:e+r-1,startRow:0,endRow:this._worksheet.getRowCount()-1}];return this._commandService.syncExecuteCommand(c.SetWorksheetColAutoWidthCommand.id,{unitId:t,subUnitId:i,ranges:o}),this}}I.FWorksheet.extend(K);class Y extends I.FPermission{setPermissionDialogVisible(e){this._permissionService.setShowComponents(e)}}I.FPermission.extend(Y);class Z extends I.FSheetHooks{onCellPointerMove(e){return s.toDisposable(this._injector.get(c.HoverManagerService).currentPosition$.subscribe(e))}onCellPointerOver(e){return s.toDisposable(this._injector.get(c.HoverManagerService).currentCell$.subscribe(e))}onCellDragOver(e){return s.toDisposable(this._injector.get(c.DragManagerService).currentCell$.subscribe(e))}onCellDrop(e){return s.toDisposable(this._injector.get(c.DragManagerService).endCell$.subscribe(e))}onCellRender(e,r=s.InterceptorEffectEnum.Style,t=R.InterceptCellContentPriority.DATA_VALIDATION){return this._injector.get(R.SheetInterceptorService).intercept(R.INTERCEPTOR_POINT.CELL_CONTENT,{effect:r,handler:(i,o,a)=>a({...i,customRender:[...(i==null?void 0:i.customRender)||[],...e||[]]}),priority:t})}onBeforeCellEdit(e){return this._injector.get(s.ICommandService).beforeCommandExecuted(r=>{const t=r.params;r.id===c.SetCellEditVisibleOperation.id&&t.visible&&e(t)})}onAfterCellEdit(e){return this._injector.get(s.ICommandService).onCommandExecuted(r=>{const t=r.params;r.id===c.SetCellEditVisibleOperation.id&&!t.visible&&e(t)})}}I.FSheetHooks.extend(Z);const y={CellClicked:"CellClicked",CellPointerDown:"CellPointerDown",CellPointerUp:"CellPointerUp",CellPointerMove:"CellPointerMove",CellHover:"CellHover",DragOver:"DragOver",Drop:"Drop",Scroll:"Scroll",SelectionMoveStart:"SelectionMoveStart",SelectionMoving:"SelectionMoving",SelectionMoveEnd:"SelectionMoveEnd",SelectionChanged:"SelectionChanged"};class z extends s.FEventName{get BeforeClipboardChange(){return"BeforeClipboardChange"}get ClipboardChanged(){return"ClipboardChanged"}get BeforeClipboardPaste(){return"BeforeClipboardPaste"}get ClipboardPasted(){return"ClipboardPasted"}get BeforeSheetEditStart(){return"BeforeSheetEditStart"}get SheetEditStarted(){return"SheetEditStarted"}get SheetEditChanging(){return"SheetEditChanging"}get BeforeSheetEditEnd(){return"BeforeSheetEditEnd"}get SheetEditEnded(){return"SheetEditEnded"}get CellClicked(){return y.CellClicked}get CellHover(){return y.CellHover}get CellPointerDown(){return y.CellPointerDown}get CellPointerUp(){return y.CellPointerUp}get CellPointerMove(){return y.CellPointerMove}get DragOver(){return"DragOver"}get Drop(){return"Drop"}get Scroll(){return"Scroll"}get SelectionMoveStart(){return"SelectionMoveStart"}get SelectionChanged(){return"SelectionChanged"}get SelectionMoving(){return"SelectionMoving"}get SelectionMoveEnd(){return"SelectionMoveEnd"}get RowHeaderClick(){return"RowHeaderClick"}get RowHeaderPointerDown(){return"RowHeaderPointerDown"}get RowHeaderPointerUp(){return"RowHeaderPointerUp"}get RowHeaderHover(){return"RowHeaderHover"}get ColumnHeaderClick(){return"ColumnHeaderClick"}get ColumnHeaderPointerDown(){return"ColumnHeaderPointerDown"}get ColumnHeaderPointerUp(){return"ColumnHeaderPointerUp"}get ColumnHeaderHover(){return"ColumnHeaderHover"}get SheetSkeletonChanged(){return"SheetSkeletonChanged"}}s.FEventName.extend(z);class q extends I.FRange{getCell(){var l;const e=this._injector.get(E.IRenderManagerService),r=this._injector.get(s.ILogService),t=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=e.getRenderById(t),a=(l=o==null?void 0:o.with(c.SheetSkeletonManagerService).getWorksheetSkeleton(i))==null?void 0:l.skeleton;if(!a)throw r.error("[Facade]: `FRange.getCell` can only be called in current worksheet"),new Error("`FRange.getCell` can only be called in current worksheet");return a.getCellWithCoordByIndex(this._range.startRow,this._range.startColumn)}getCellRect(){const{startX:e,startY:r,endX:t,endY:i}=this.getCell(),o={x:e,y:r,width:t-e,height:i-r,top:r,left:e,bottom:i,right:t};return{...o,toJSON:()=>JSON.stringify(o)}}generateHTML(){var r;const e=this._injector.get(c.ISheetClipboardService).generateCopyContent(this._workbook.getUnitId(),this._worksheet.getSheetId(),this._range);return(r=e==null?void 0:e.html)!=null?r:""}attachPopup(e){var a,l,C;e.direction=(a=e.direction)!=null?a:"horizontal",e.extraProps=(l=e.extraProps)!=null?l:{},e.offset=(C=e.offset)!=null?C:[0,0];const{key:r,disposableCollection:t}=H(e,this._injector.get(u.ComponentManager)),o=this._injector.get(c.SheetCanvasPopManagerService).attachPopupToCell(this._range.startRow,this._range.startColumn,{...e,componentKey:r},this.getUnitId(),this._worksheet.getSheetId());return o?(t.add(o),t):(t.dispose(),null)}attachAlertPopup(e){const r=this._injector.get(c.CellAlertManagerService),t={workbook:this._workbook,worksheet:this._worksheet,row:this._range.startRow,col:this._range.startColumn,unitId:this.getUnitId(),subUnitId:this._worksheet.getSheetId()};return r.showAlert({...e,location:t}),{dispose:()=>{r.removeAlert(e.key)}}}attachRangePopup(e){var a,l,C;e.direction=(a=e.direction)!=null?a:"horizontal",e.extraProps=(l=e.extraProps)!=null?l:{},e.offset=(C=e.offset)!=null?C:[0,0];const{key:r,disposableCollection:t}=H(e,this._injector.get(u.ComponentManager)),o=this._injector.get(c.SheetCanvasPopManagerService).attachRangePopup(this._range,{...e,componentKey:r},this.getUnitId(),this._worksheet.getSheetId());return o?(t.add(o),t):(t.dispose(),null)}highlight(e,r){const t=this._injector.get(c.IMarkSelectionService),i=t.addShape({range:this._range,style:e,primary:r});if(!i)throw new Error("Failed to highlight current range");return s.toDisposable(()=>{t.removeShape(i)})}}I.FRange.extend(q);function H(P,e){const{componentKey:r,isVue3:t}=P;let i;const o=new s.DisposableCollection;return typeof r=="string"?i=r:(i=`External_${s.generateRandomId(6)}`,o.add(e.register(i,r,{framework:t?"vue3":"react"}))),{key:i,disposableCollection:o}}f.transformComponentKey=H,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@univerjs/core"),require("@univerjs/docs"),require("@univerjs/engine-render"),require("@univerjs/sheets"),require("@univerjs/sheets-ui"),require("@univerjs/sheets/facade"),require("@univerjs/ui"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/docs","@univerjs/engine-render","@univerjs/sheets","@univerjs/sheets-ui","@univerjs/sheets/facade","@univerjs/ui","rxjs"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f.UniverSheetsUiFacade={},f.UniverCore,f.UniverDocs,f.UniverEngineRender,f.UniverSheets,f.UniverSheetsUi,f.UniverSheetsFacade,f.UniverUi,f.rxjs))})(this,function(f,d,F,S,R,a,I,C,m){"use strict";class V extends d.FUniver{_initSheetUIEvent(e){const t=e.get(d.ICommandService);this.disposeWithMe(t.beforeCommandExecuted(r=>{if(r.id===a.SetCellEditVisibleOperation.id){if(!this._eventListend(this.Event.BeforeSheetEditStart)&&!this._eventListend(this.Event.BeforeSheetEditEnd))return;const i=this.getActiveSheet();if(!i)return;const{workbook:o,worksheet:s}=i,c=e.get(a.IEditorBridgeService),u=e.get(d.IUniverInstanceService),b=r.params,{visible:v,keycode:g,eventType:E}=b,l=c.getEditLocation();if(v){const _={row:l.row,column:l.column,eventType:E,keycode:g,workbook:o,worksheet:s,isZenEditor:!1};if(this.fireEvent(this.Event.BeforeSheetEditStart,_),_.cancel)throw new d.CanceledError}else{const _={row:l.row,column:l.column,eventType:E,keycode:g,workbook:o,worksheet:s,isZenEditor:!1,value:d.RichTextValue.create(u.getUnit(d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY).getSnapshot()),isConfirm:g!==C.KeyCode.ESC};if(this.fireEvent(this.Event.BeforeSheetEditEnd,_),_.cancel)throw new d.CanceledError}}if(r.id===a.SetZoomRatioCommand.id){if(!this._eventListend(this.Event.BeforeSheetZoomChange))return;const i=this.getCommandSheetTarget(r);if(!i)return;const{workbook:o,worksheet:s}=i;this.fireEvent(this.Event.BeforeSheetZoomChange,{zoom:r.params.zoomRatio,workbook:o,worksheet:s})}})),this.disposeWithMe(t.onCommandExecuted(r=>{if(r.id===a.SetCellEditVisibleOperation.id){if(!this._eventListend(this.Event.SheetEditStarted)&&!this._eventListend(this.Event.SheetEditEnded))return;const i=this.getCommandSheetTarget(r);if(!i)return;const{workbook:o,worksheet:s}=i,c=e.get(a.IEditorBridgeService),u=r.params,{visible:b,keycode:v,eventType:g}=u,E=c.getEditLocation();if(b){const l={row:E.row,column:E.column,eventType:g,keycode:v,workbook:o,worksheet:s,isZenEditor:!1};this.fireEvent(this.Event.SheetEditStarted,l)}else{const l={row:E.row,column:E.column,eventType:g,keycode:v,workbook:o,worksheet:s,isZenEditor:!1,isConfirm:v!==C.KeyCode.ESC};this.fireEvent(this.Event.SheetEditEnded,l)}}if(r.id===F.RichTextEditingMutation.id){if(!this._eventListend(this.Event.SheetEditChanging))return;const i=this.getCommandSheetTarget(r);if(!i)return;const{workbook:o,worksheet:s}=i,c=e.get(a.IEditorBridgeService),u=e.get(d.IUniverInstanceService),b=r.params;if(!c.isVisible().visible)return;const{unitId:v}=b;if(v===d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY){const{row:g,column:E}=c.getEditLocation(),l={workbook:o,worksheet:s,row:g,column:E,value:d.RichTextValue.create(u.getUnit(d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY).getSnapshot()),isZenEditor:!1};this.fireEvent(this.Event.SheetEditChanging,l)}}if(r.id===a.SetZoomRatioCommand.id){if(!this._eventListend(this.Event.SheetZoomChanged))return;const i=this.getCommandSheetTarget(r);if(!i)return;const{workbook:o,worksheet:s}=i;this.fireEvent(this.Event.SheetZoomChanged,{zoom:s.getZoom(),workbook:o,worksheet:s})}})),this._initObserverListener(e)}_initObserverListener(e){const r=e.get(d.IUniverInstanceService).getFocusedUnit(),i=r==null?void 0:r.getUnitId(),o=e.get(S.IRenderManagerService);if(i){const v=e.get(d.LifecycleService),g=new d.DisposableCollection;this.disposeWithMe(v.lifecycle$.subscribe(E=>{var P,H,p,w,k,T,B,L,x,W,A,O,U,$,j;if(E<d.LifecycleStages.Rendered)return;g.dispose();const l=e.get(a.HoverManagerService),_=e.get(a.DragManagerService);l&&(g.add((P=l.currentClickedCell$)==null?void 0:P.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellClicked))return;const h=this.getSheetTarget(n.location.unitId,n.location.subUnitId);h&&this.fireEvent(this.Event.CellClicked,{...h,...n,row:n.location.row,column:n.location.col})})),g.add((H=l.currentRichText$)==null?void 0:H.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellHover))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.CellHover,{...h,...n,row:n.row,column:n.col})})),g.add((p=l.currentPointerDownCell$)==null?void 0:p.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellPointerDown))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.CellPointerDown,{...h,...n,row:n.row,column:n.col})})),g.add((w=l.currentPointerUpCell$)==null?void 0:w.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellPointerUp))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.CellPointerUp,{...h,...n,row:n.row,column:n.col})})),g.add((k=l.currentCellPosWithEvent$)==null?void 0:k.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.CellPointerMove))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.CellPointerMove,{...h,...n,row:n.row,column:n.col})})),g.add((T=_.currentCell$)==null?void 0:T.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.DragOver))return;const h=this.getSheetTarget(n.location.unitId,n.location.subUnitId);h&&this.fireEvent(this.Event.DragOver,{...h,...n,row:n.location.row,column:n.location.col})})),g.add((B=_.endCell$)==null?void 0:B.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.Drop))return;const h=this.getSheetTarget(n.location.unitId,n.location.subUnitId);h&&this.fireEvent(this.Event.Drop,{...h,...n,row:n.location.row,column:n.location.col})})),g.add((L=l.currentRowHeaderClick$)==null?void 0:L.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.RowHeaderClick))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.RowHeaderClick,{...h,row:n.index})})),g.add((x=l.currentRowHeaderPointerDown$)==null?void 0:x.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.RowHeaderPointerDown))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.RowHeaderPointerDown,{...h,row:n.index})})),g.add((W=l.currentRowHeaderPointerUp$)==null?void 0:W.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.RowHeaderPointerUp))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.RowHeaderPointerUp,{...h,row:n.index})})),g.add((A=l.currentHoveredRowHeader$)==null?void 0:A.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.RowHeaderHover))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.RowHeaderHover,{...h,row:n.index})})),g.add((O=l.currentColHeaderClick$)==null?void 0:O.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.ColumnHeaderClick))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.ColumnHeaderClick,{...h,column:n.index})})),g.add((U=l.currentColHeaderPointerDown$)==null?void 0:U.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.ColumnHeaderPointerDown))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.ColumnHeaderPointerDown,{...h,column:n.index})})),g.add(($=l.currentColHeaderPointerUp$)==null?void 0:$.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.ColumnHeaderPointerUp))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.ColumnHeaderPointerUp,{...h,column:n.index})})),g.add((j=l.currentHoveredColHeader$)==null?void 0:j.pipe(m.filter(n=>!!n)).subscribe(n=>{if(!this._eventListend(this.Event.ColumnHeaderHover))return;const h=this.getSheetTarget(n.unitId,n.subUnitId);h&&this.fireEvent(this.Event.ColumnHeaderHover,{...h,column:n.index})})))})),this.disposeWithMe(g)}const s=new Map;let c;const u=e.get(d.LifecycleService),b=m.combineLatest([o.created$,u.lifecycle$]);this.disposeWithMe(b.subscribe(([v,g])=>{var H;if(v.type===d.UniverInstanceType.UNIVER_SHEET&&(c=v),g<=d.LifecycleStages.Rendered)return;const E=new d.DisposableCollection;if(!c)return;const l=this.getWorkbook(c.unitId);if(!l)return;s.get(c.unitId)&&((H=s.get(c.unitId))==null||H.dispose()),s.set(c.unitId,E);const _=c.with(a.SheetScrollManagerService);E.add(_.validViewportScrollInfo$.subscribe(p=>{p&&this._eventListend(this.Event.Scroll)&&this.fireEvent(this.Event.Scroll,{workbook:l,worksheet:l.getActiveSheet(),...p})}));const P=c.with(R.SheetsSelectionsService);E.add(P.selectionMoveStart$.subscribe(p=>{var w;this._eventListend(this.Event.SelectionMoveStart)&&this.fireEvent(this.Event.SelectionMoveStart,{workbook:l,worksheet:l.getActiveSheet(),selections:(w=p==null?void 0:p.map(k=>k.range))!=null?w:[]})})),E.add(P.selectionMoving$.subscribe(p=>{var w;this._eventListend(this.Event.SelectionMoving)&&this.fireEvent(this.Event.SelectionMoving,{workbook:l,worksheet:l.getActiveSheet(),selections:(w=p==null?void 0:p.map(k=>k.range))!=null?w:[]})})),E.add(P.selectionMoveEnd$.subscribe(p=>{var w;this._eventListend(this.Event.SelectionMoveEnd)&&this.fireEvent(this.Event.SelectionMoveEnd,{workbook:l,worksheet:l.getActiveSheet(),selections:(w=p==null?void 0:p.map(k=>k.range))!=null?w:[]})})),E.add(P.selectionChanged$.subscribe(p=>{var w;this._eventListend(this.Event.SelectionChanged)&&this.fireEvent(this.Event.SelectionChanged,{workbook:l,worksheet:l.getActiveSheet(),selections:(w=p==null?void 0:p.map(k=>k.range))!=null?w:[]})})),c=null,this.disposeWithMe(E)})),this.disposeWithMe(o.disposed$.subscribe(v=>{var g;(g=s.get(v))==null||g.dispose(),s.delete(v)})),this.disposeWithMe(()=>{s.forEach(v=>{v.dispose()})})}_initialize(e){this._initSheetUIEvent(e);const t=e.get(d.ICommandService);this.disposeWithMe(t.beforeCommandExecuted(r=>{switch(r.id){case C.CopyCommand.id:case C.CutCommand.id:this._beforeClipboardChange();break;case a.SheetPasteShortKeyCommand.id:this._beforeClipboardPaste(r.params);break}})),this.disposeWithMe(t.onCommandExecuted(r=>{if(R.COMMAND_LISTENER_SKELETON_CHANGE.indexOf(r.id)>-1){if(!this._eventListend(this.Event.SheetSkeletonChanged))return;const i=this.getActiveSheet();if(!i)return;const o=R.getSkeletonChangedEffectedRange(r).map(s=>{var c,u;return(u=(c=this.getWorkbook(s.unitId))==null?void 0:c.getSheetBySheetId(s.subUnitId))==null?void 0:u.getRange(s.range)}).filter(Boolean);if(!o.length)return;this.fireEvent(this.Event.SheetSkeletonChanged,{workbook:i.workbook,worksheet:i.worksheet,payload:r,skeleton:i.worksheet.getSkeleton(),effectedRanges:o});return}switch(r.id){case C.CopyCommand.id:case C.CutCommand.id:this._clipboardChanged();break;case a.SheetPasteShortKeyCommand.id:this._clipboardPaste();break;case C.PasteCommand.id:this._clipboardPasteAsync();break}})),this.disposeWithMe(t.beforeCommandExecuted(async r=>{switch(r.id){case C.PasteCommand.id:await this._beforeClipboardPasteAsync();break}}))}_generateClipboardCopyParam(){const e=this.getActiveWorkbook(),t=e==null?void 0:e.getActiveSheet(),r=e==null?void 0:e.getActiveRange();if(!e||!t||!r)return;const o=this._injector.get(a.ISheetClipboardService).generateCopyContent(e.getId(),t.getSheetId(),r.getRange());if(!o)return;const{html:s,plain:c}=o;return{workbook:e,worksheet:t,text:c,html:s,fromSheet:t,fromRange:r}}_beforeClipboardChange(){if(!this.hasEventCallback(this.Event.BeforeClipboardChange))return;const e=this._generateClipboardCopyParam();if(e&&(this.fireEvent(this.Event.BeforeClipboardChange,e),e.cancel))throw new Error("Before clipboard change is canceled")}_clipboardChanged(){if(!this.hasEventCallback(this.Event.ClipboardChanged))return;const e=this._generateClipboardCopyParam();if(e&&(this.fireEvent(this.Event.ClipboardChanged,e),e.cancel))throw new Error("Clipboard changed is canceled")}_generateClipboardPasteParam(e){if(!e)return;const{htmlContent:t,textContent:r}=e,i=this.getActiveWorkbook(),o=i==null?void 0:i.getActiveSheet();return!i||!o?void 0:{workbook:i,worksheet:o,text:r,html:t}}async _generateClipboardPasteParamAsync(){const e=this.getActiveWorkbook(),t=e==null?void 0:e.getActiveSheet();if(!e||!t)return;const o=(await this._injector.get(C.IClipboardInterfaceService).read())[0];let s;if(o){const c=o.types,u=c.indexOf(C.PLAIN_TEXT_CLIPBOARD_MIME_TYPE)!==-1?await o.getType(C.PLAIN_TEXT_CLIPBOARD_MIME_TYPE).then(v=>v&&v.text()):"",b=c.indexOf(C.HTML_CLIPBOARD_MIME_TYPE)!==-1?await o.getType(C.HTML_CLIPBOARD_MIME_TYPE).then(v=>v&&v.text()):"";s={workbook:e,worksheet:t,text:u,html:b}}return s}_beforeClipboardPaste(e){if(!this.hasEventCallback(this.Event.BeforeClipboardPaste))return;const t=this._generateClipboardPasteParam(e);if(t&&(this.fireEvent(this.Event.BeforeClipboardPaste,t),t.cancel))throw new Error("Before clipboard paste is canceled")}_clipboardPaste(e){if(!this.hasEventCallback(this.Event.BeforeClipboardPaste))return;const t=this._generateClipboardPasteParam(e);if(t&&(this.fireEvent(this.Event.BeforeClipboardPaste,t),t.cancel))throw new Error("Clipboard pasted is canceled")}async _beforeClipboardPasteAsync(){if(!this.hasEventCallback(this.Event.BeforeClipboardPaste))return;if(!C.supportClipboardAPI()){this._injector.get(d.ILogService).warn("[Facade]: The navigator object only supports the browser environment");return}const e=await this._generateClipboardPasteParamAsync();if(e&&(this.fireEvent(this.Event.BeforeClipboardPaste,e),e.cancel))throw new Error("Before clipboard paste is canceled")}async _clipboardPasteAsync(){if(!this.hasEventCallback(this.Event.ClipboardPasted))return;if(!C.supportClipboardAPI()){this._injector.get(d.ILogService).warn("[Facade]: The navigator object only supports the browser environment");return}const e=await this._generateClipboardPasteParamAsync();if(e&&(this.fireEvent(this.Event.ClipboardPasted,e),e.cancel))throw new Error("Clipboard pasted is canceled")}customizeColumnHeader(e){var b,v;const t=this.getActiveWorkbook();if(!t){console.error("WorkBook not exist");return}const r=t==null?void 0:t.getId(),i=this._injector.get(S.IRenderManagerService),o=t.getActiveSheet(),s=o.getSheetId(),c=i.getRenderById(r);c&&((b=e.headerStyle)!=null&&b.size)&&(c.with(a.SheetSkeletonManagerService).setColumnHeaderSize(c,s,(v=e.headerStyle)==null?void 0:v.size),o==null||o.refreshCanvas()),this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.COLUMN).setCustomHeader(e),o==null||o.refreshCanvas()}customizeRowHeader(e){const t=this.getActiveWorkbook();if(!t){console.error("WorkBook not exist");return}const r=t==null?void 0:t.getId();this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.ROW).setCustomHeader(e)}registerSheetRowHeaderExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.ROW),i=r.register(...t);return d.toDisposable(()=>{i.dispose(),r.makeDirty(!0)})}registerSheetColumnHeaderExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.COLUMN),i=r.register(...t);return d.toDisposable(()=>{i.dispose(),r.makeDirty(!0)})}registerSheetMainExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.MAIN),i=r.register(...t);return d.toDisposable(()=>{i.dispose(),r.makeDirty(!0)})}_getSheetRenderComponent(e,t){const i=this._injector.get(S.IRenderManagerService).getRenderById(e);if(!i)throw new Error(`Render Unit with unitId ${e} not found`);const{components:o}=i,s=o.get(t);if(!s)throw new Error("Render component not found");return s}getSheetHooks(){return this._injector.createInstance(I.FSheetHooks)}}d.FUniver.extend(V);class N extends I.FWorkbook{openSiderbar(e){return this._logDeprecation("openSiderbar"),this._injector.get(C.ISidebarService).open(e)}openDialog(e){this._logDeprecation("openDialog");const r=this._injector.get(C.IDialogService).open({...e,onClose:()=>{r.dispose()}});return r}_logDeprecation(e){this._injector.get(d.ILogService).warn("[FWorkbook]",`${e} is deprecated. Please use the function of the same name on "FUniver".`)}generateCellParams(e){const t=this.getActiveSheet();return{row:e.row,column:e.col,workbook:this,worksheet:t}}onCellClick(e){const t=this._injector.get(a.HoverManagerService);return d.toDisposable(t.currentClickedCell$.pipe(m.filter(r=>!!r)).subscribe(r=>{e(r)}))}onCellHover(e){const t=this._injector.get(a.HoverManagerService);return d.toDisposable(t.currentRichText$.pipe(m.filter(r=>!!r)).subscribe(e))}onCellPointerDown(e){const t=this._injector.get(a.HoverManagerService);return d.toDisposable(t.currentPointerDownCell$.subscribe(e))}onCellPointerUp(e){const t=this._injector.get(a.HoverManagerService);return d.toDisposable(t.currentPointerUpCell$.subscribe(e))}onCellPointerMove(e){const t=this._injector.get(a.HoverManagerService);return d.toDisposable(t.currentCellPosWithEvent$.pipe(m.filter(r=>!!r)).subscribe(r=>{e(r,r.event)}))}onDragOver(e){const t=this._injector.get(a.DragManagerService);return d.toDisposable(t.currentCell$.pipe(m.filter(r=>!!r)).subscribe(r=>{e(r)}))}onDrop(e){const t=this._injector.get(a.DragManagerService);return d.toDisposable(t.endCell$.pipe(m.filter(r=>!!r)).subscribe(r=>{e(r)}))}startEditing(){return this._injector.get(d.ICommandService).syncExecuteCommand(a.SetCellEditVisibleOperation.id,{eventType:S.DeviceInputEventType.Dblclick,unitId:this._workbook.getUnitId(),visible:!0})}async endEditing(e){return this._injector.get(d.ICommandService).syncExecuteCommand(a.SetCellEditVisibleOperation.id,{eventType:S.DeviceInputEventType.Keyboard,keycode:e?C.KeyCode.ENTER:C.KeyCode.ESC,visible:!1,unitId:this._workbook.getUnitId()}),await d.awaitTime(0),!0}endEditingAsync(e=!0){return this.endEditing(e)}getScrollStateBySheetId(e){const t=this._workbook.getUnitId(),i=this._injector.get(S.IRenderManagerService).getRenderById(t);return i?i.with(a.SheetScrollManagerService).getScrollStateByParam({unitId:t,sheetId:e}):null}disableSelection(){const e=this._workbook.getUnitId(),r=this._injector.get(S.IRenderManagerService).getRenderById(e);return r&&r.with(a.ISheetSelectionRenderService).disableSelection(),this}enableSelection(){const e=this._workbook.getUnitId(),r=this._injector.get(S.IRenderManagerService).getRenderById(e);return r&&r.with(a.ISheetSelectionRenderService).enableSelection(),this}transparentSelection(){const e=this._workbook.getUnitId(),r=this._injector.get(S.IRenderManagerService).getRenderById(e);return r&&r.with(a.ISheetSelectionRenderService).transparentSelection(),this}showSelection(){const e=this._workbook.getUnitId(),r=this._injector.get(S.IRenderManagerService).getRenderById(e);return r&&r.with(a.ISheetSelectionRenderService).showSelection(),this}}I.FWorkbook.extend(N);class K extends I.FWorksheet{refreshCanvas(){const e=this._injector.get(S.IRenderManagerService),t=this._fWorkbook.id,r=e.getRenderById(t);if(!r)throw new Error(`Render Unit with unitId ${t} not found`);r.with(a.SheetSkeletonManagerService).reCalculate();const i=r.mainComponent;if(!i)throw new Error("Main component not found");return i.makeDirty(),this}zoom(e){return this._injector.get(d.ICommandService).syncExecuteCommand(a.ChangeZoomRatioCommand.id,{unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),zoomRatio:e}),this}getZoom(){return this._worksheet.getZoomRatio()}getVisibleRange(){const e=this._workbook.getUnitId(),r=this._injector.get(S.IRenderManagerService).getRenderById(e);let i={startColumn:0,startRow:0,endColumn:0,endRow:0};if(!r)return i;const s=r.with(a.SheetSkeletonManagerService).getCurrentSkeleton();if(!s)return i;const c=s==null?void 0:s.getVisibleRanges();if(!c)return i;i=s.getVisibleRangeByViewport(S.SHEET_VIEWPORT_KEY.VIEW_MAIN);for(const[u,b]of c)S.sheetContentViewportKeys.indexOf(u)!==-1&&(i.startColumn=Math.min(i.startColumn,b.startColumn),i.startRow=Math.min(i.startRow,b.startRow),i.endColumn=Math.max(i.endColumn,b.endColumn),i.endRow=Math.max(i.endRow,b.endRow));return i}scrollToCell(e,t){const r=this._workbook.getUnitId(),o=this._injector.get(S.IRenderManagerService).getRenderById(r);return o&&(o==null?void 0:o.with(a.SheetsScrollRenderController)).scrollToCell(e,t),this}getScrollState(){const e={offsetX:0,offsetY:0,sheetViewStartColumn:0,sheetViewStartRow:0},t=this._workbook.getUnitId(),r=this._worksheet.getSheetId(),o=this._injector.get(S.IRenderManagerService).getRenderById(t);return o&&o.with(a.SheetScrollManagerService).getScrollStateByParam({unitId:t,sheetId:r})||e}onScroll(e){var o;const t=this._workbook.getUnitId(),i=(o=this._injector.get(S.IRenderManagerService).getRenderById(t))==null?void 0:o.with(a.SheetScrollManagerService);if(i){const s=i.validViewportScrollInfo$.subscribe(c=>{e(c)});return d.toDisposable(s)}return d.toDisposable(()=>{})}getSkeleton(){var t,r;const e=(t=this._injector.get(S.IRenderManagerService).getRenderById(this._workbook.getUnitId()))==null?void 0:t.with(a.SheetSkeletonManagerService);return(r=e==null?void 0:e.getWorksheetSkeleton(this._worksheet.getSheetId()))==null?void 0:r.skeleton}setColumnAutoWidth(e,t){const r=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=[{startColumn:e,endColumn:e+t-1,startRow:0,endRow:this._worksheet.getRowCount()-1}];return this._commandService.syncExecuteCommand(a.SetWorksheetColAutoWidthCommand.id,{unitId:r,subUnitId:i,ranges:o}),this}customizeColumnHeader(e){var u,b;const t=this,r=this._fWorkbook.getId(),i=this._injector.get(S.IRenderManagerService),o=t.getSheetId(),s=i.getRenderById(r);s&&((u=e.headerStyle)!=null&&u.size)&&(s.with(a.SheetSkeletonManagerService).setColumnHeaderSize(s,o,(b=e.headerStyle)==null?void 0:b.size),t==null||t.refreshCanvas());const c=this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.COLUMN);c&&(c.setCustomHeader(e),t==null||t.refreshCanvas())}customizeRowHeader(e){const t=this._fWorkbook.getId();this._getSheetRenderComponent(t,a.SHEET_VIEW_KEY.ROW).setCustomHeader(e)}setColumnHeaderHeight(e){const t=this,r=this._fWorkbook.getId(),i=t.getSheetId();return this._commandService.executeCommand(a.SetColumnHeaderHeightCommand.id,{unitId:r,subUnitId:i,size:e}),t==null||t.refreshCanvas(),this}setRowHeaderWidth(e){const t=this,r=this._fWorkbook.getId(),i=t.getSheetId();this._commandService.executeCommand(a.SetRowHeaderWidthCommand.id,{unitId:r,subUnitId:i,size:e});const o=this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.ROW);return o&&o.setCustomHeader({headerStyle:{size:e}}),t==null||t.refreshCanvas(),this}_getSheetRenderComponent(e,t){const i=this._injector.get(S.IRenderManagerService).getRenderById(e);if(!i)throw new Error(`Render Unit with unitId ${e} not found`);const{components:o}=i,s=o.get(t);if(!s)throw new Error("Render component not found");return s}}I.FWorksheet.extend(K);class z extends I.FPermission{setPermissionDialogVisible(e){this._permissionService.setShowComponents(e)}}I.FPermission.extend(z);class Y extends I.FSheetHooks{onCellPointerMove(e){return d.toDisposable(this._injector.get(a.HoverManagerService).currentPosition$.subscribe(e))}onCellPointerOver(e){return d.toDisposable(this._injector.get(a.HoverManagerService).currentCell$.subscribe(e))}onCellDragOver(e){return d.toDisposable(this._injector.get(a.DragManagerService).currentCell$.subscribe(e))}onCellDrop(e){return d.toDisposable(this._injector.get(a.DragManagerService).endCell$.subscribe(e))}onCellRender(e,t=d.InterceptorEffectEnum.Style,r=R.InterceptCellContentPriority.DATA_VALIDATION){return this._injector.get(R.SheetInterceptorService).intercept(R.INTERCEPTOR_POINT.CELL_CONTENT,{effect:t,handler:(i,o,s)=>s({...i,customRender:[...(i==null?void 0:i.customRender)||[],...e||[]]}),priority:r})}onBeforeCellEdit(e){return this._injector.get(d.ICommandService).beforeCommandExecuted(t=>{const r=t.params;t.id===a.SetCellEditVisibleOperation.id&&r.visible&&e(r)})}onAfterCellEdit(e){return this._injector.get(d.ICommandService).onCommandExecuted(t=>{const r=t.params;t.id===a.SetCellEditVisibleOperation.id&&!r.visible&&e(r)})}}I.FSheetHooks.extend(Y);const y={CellClicked:"CellClicked",CellPointerDown:"CellPointerDown",CellPointerUp:"CellPointerUp",CellPointerMove:"CellPointerMove",CellHover:"CellHover",DragOver:"DragOver",Drop:"Drop",Scroll:"Scroll",SelectionMoveStart:"SelectionMoveStart",SelectionMoving:"SelectionMoving",SelectionMoveEnd:"SelectionMoveEnd",SelectionChanged:"SelectionChanged"};class Z extends d.FEventName{get BeforeClipboardChange(){return"BeforeClipboardChange"}get ClipboardChanged(){return"ClipboardChanged"}get BeforeClipboardPaste(){return"BeforeClipboardPaste"}get ClipboardPasted(){return"ClipboardPasted"}get BeforeSheetEditStart(){return"BeforeSheetEditStart"}get SheetEditStarted(){return"SheetEditStarted"}get SheetEditChanging(){return"SheetEditChanging"}get BeforeSheetEditEnd(){return"BeforeSheetEditEnd"}get SheetEditEnded(){return"SheetEditEnded"}get CellClicked(){return y.CellClicked}get CellHover(){return y.CellHover}get CellPointerDown(){return y.CellPointerDown}get CellPointerUp(){return y.CellPointerUp}get CellPointerMove(){return y.CellPointerMove}get DragOver(){return"DragOver"}get Drop(){return"Drop"}get Scroll(){return"Scroll"}get SelectionMoveStart(){return"SelectionMoveStart"}get SelectionChanged(){return"SelectionChanged"}get SelectionMoving(){return"SelectionMoving"}get SelectionMoveEnd(){return"SelectionMoveEnd"}get RowHeaderClick(){return"RowHeaderClick"}get RowHeaderPointerDown(){return"RowHeaderPointerDown"}get RowHeaderPointerUp(){return"RowHeaderPointerUp"}get RowHeaderHover(){return"RowHeaderHover"}get ColumnHeaderClick(){return"ColumnHeaderClick"}get ColumnHeaderPointerDown(){return"ColumnHeaderPointerDown"}get ColumnHeaderPointerUp(){return"ColumnHeaderPointerUp"}get ColumnHeaderHover(){return"ColumnHeaderHover"}get SheetSkeletonChanged(){return"SheetSkeletonChanged"}}d.FEventName.extend(Z);class q extends I.FRange{getCell(){var c;const e=this._injector.get(S.IRenderManagerService),t=this._injector.get(d.ILogService),r=this._workbook.getUnitId(),i=this._worksheet.getSheetId(),o=e.getRenderById(r),s=(c=o==null?void 0:o.with(a.SheetSkeletonManagerService).getWorksheetSkeleton(i))==null?void 0:c.skeleton;if(!s)throw t.error("[Facade]: `FRange.getCell` can only be called in current worksheet"),new Error("`FRange.getCell` can only be called in current worksheet");return s.getCellWithCoordByIndex(this._range.startRow,this._range.startColumn)}getCellRect(){const{startX:e,startY:t,endX:r,endY:i}=this.getCell(),o={x:e,y:t,width:r-e,height:i-t,top:t,left:e,bottom:i,right:r};return{...o,toJSON:()=>JSON.stringify(o)}}generateHTML(){var t;const e=this._injector.get(a.ISheetClipboardService).generateCopyContent(this._workbook.getUnitId(),this._worksheet.getSheetId(),this._range);return(t=e==null?void 0:e.html)!=null?t:""}attachPopup(e){var s,c,u;e.direction=(s=e.direction)!=null?s:"horizontal",e.extraProps=(c=e.extraProps)!=null?c:{},e.offset=(u=e.offset)!=null?u:[0,0];const{key:t,disposableCollection:r}=D(e,this._injector.get(C.ComponentManager)),o=this._injector.get(a.SheetCanvasPopManagerService).attachPopupToCell(this._range.startRow,this._range.startColumn,{...e,componentKey:t},this.getUnitId(),this._worksheet.getSheetId());return o?(r.add(o),r):(r.dispose(),null)}attachAlertPopup(e){const t=this._injector.get(a.CellAlertManagerService),r={workbook:this._workbook,worksheet:this._worksheet,row:this._range.startRow,col:this._range.startColumn,unitId:this.getUnitId(),subUnitId:this._worksheet.getSheetId()};return t.showAlert({...e,location:r}),{dispose:()=>{t.removeAlert(e.key)}}}attachRangePopup(e){var s,c,u;e.direction=(s=e.direction)!=null?s:"top-center",e.extraProps=(c=e.extraProps)!=null?c:{},e.offset=(u=e.offset)!=null?u:[0,0];const{key:t,disposableCollection:r}=D(e,this._injector.get(C.ComponentManager)),o=this._injector.get(a.SheetCanvasPopManagerService).attachRangePopup(this._range,{...e,componentKey:t},this.getUnitId(),this._worksheet.getSheetId());return o?(r.add(o),r):(r.dispose(),null)}highlight(e,t){const r=this._injector.get(a.IMarkSelectionService),i=r.addShape({range:this._range,style:e,primary:t});if(!i)throw new Error("Failed to highlight current range");return d.toDisposable(()=>{r.removeShape(i)})}}I.FRange.extend(q);function D(M,e){const{componentKey:t,isVue3:r}=M;let i;const o=new d.DisposableCollection;return typeof t=="string"?i=t:(i=`External_${d.generateRandomId(6)}`,o.add(e.register(i,t,{framework:r?"vue3":"react"}))),{key:i,disposableCollection:o}}f.transformComponentKey=D,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|