@univerjs-pro/shape-editor-ui 1.0.4 → 1.2.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/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/index.css +36 -4
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/services/formula-binding.service.d.ts +4 -3
- package/lib/types/views/shape-text-editor/shape-text-behavior.d.ts +4 -3
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +23 -23
- package/lib/types/services/formula-binding-unit-viewer.service.d.ts +0 -67
- package/lib/types/services/shape-formula-editor.d.ts +0 -20
- package/lib/types/services/shape-formula-reference.d.ts +0 -15
- package/lib/types/services/shape-formula-unit-viewer.service.d.ts +0 -67
- package/lib/types/views/formula-shape/FormulaShapeNumberFormat.d.ts +0 -24
- package/lib/types/views/formula-shape/formula-shape-number-format-utils.d.ts +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/shape-editor-ui",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Reusable shape editor UI building blocks for Univer Pro.",
|
|
6
6
|
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
@@ -57,33 +57,33 @@
|
|
|
57
57
|
"rxjs": ">=7.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@univerjs-pro/embed": "1.0
|
|
61
|
-
"@univerjs-pro/embed-unit-ui": "1.0
|
|
62
|
-
"@univerjs-pro/engine-formula": "1.0
|
|
63
|
-
"@univerjs-pro/engine-shape": "1.0
|
|
64
|
-
"@univerjs-pro/license": "1.0
|
|
65
|
-
"@univerjs-pro/shape-editor": "1.0
|
|
66
|
-
"@univerjs/core": "1.0
|
|
67
|
-
"@univerjs/design": "1.0
|
|
68
|
-
"@univerjs/docs": "1.0
|
|
69
|
-
"@univerjs/docs-ui": "1.0
|
|
70
|
-
"@univerjs/drawing": "1.0
|
|
71
|
-
"@univerjs/engine-formula": "1.0
|
|
72
|
-
"@univerjs/engine-render": "1.0
|
|
73
|
-
"@univerjs/icons": "1.
|
|
74
|
-
"@univerjs/sheets-formula-ui": "1.0
|
|
75
|
-
"@univerjs/sheets-numfmt": "1.0
|
|
76
|
-
"@univerjs/ui": "1.0
|
|
60
|
+
"@univerjs-pro/embed": "1.2.0",
|
|
61
|
+
"@univerjs-pro/embed-unit-ui": "1.2.0",
|
|
62
|
+
"@univerjs-pro/engine-formula": "1.2.0",
|
|
63
|
+
"@univerjs-pro/engine-shape": "1.2.0",
|
|
64
|
+
"@univerjs-pro/license": "1.2.0",
|
|
65
|
+
"@univerjs-pro/shape-editor": "1.2.0",
|
|
66
|
+
"@univerjs/core": "1.2.0",
|
|
67
|
+
"@univerjs/design": "1.2.0",
|
|
68
|
+
"@univerjs/docs": "1.2.0",
|
|
69
|
+
"@univerjs/docs-ui": "1.2.0",
|
|
70
|
+
"@univerjs/drawing": "1.2.0",
|
|
71
|
+
"@univerjs/engine-formula": "1.2.0",
|
|
72
|
+
"@univerjs/engine-render": "1.2.0",
|
|
73
|
+
"@univerjs/icons": "1.46.0",
|
|
74
|
+
"@univerjs/sheets-formula-ui": "1.2.0",
|
|
75
|
+
"@univerjs/sheets-numfmt": "1.2.0",
|
|
76
|
+
"@univerjs/ui": "1.2.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@univerjs-infra/shared": "1.0
|
|
80
|
-
"@univerjs/sheets": "1.0
|
|
81
|
-
"postcss": "^8.5.
|
|
79
|
+
"@univerjs-infra/shared": "1.2.0",
|
|
80
|
+
"@univerjs/sheets": "1.2.0",
|
|
81
|
+
"postcss": "^8.5.29",
|
|
82
82
|
"react": "18.3.1",
|
|
83
83
|
"rxjs": "7.8.2",
|
|
84
|
-
"tailwindcss": "3.4.
|
|
84
|
+
"tailwindcss": "3.4.18",
|
|
85
85
|
"typescript": "^6.0.3",
|
|
86
|
-
"vitest": "^5.0.
|
|
86
|
+
"vitest": "^5.0.4"
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
89
|
"test": "vitest run",
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { BaseDataModel } from '@univerjs/core';
|
|
2
|
-
import type { FormulaSequenceNode, IFormulaRefSelection } from '@univerjs/engine-formula';
|
|
3
|
-
import type { IFormulaBindingHost, IFormulaBindingUnitResource } from '../config/config';
|
|
4
|
-
import type { IFormulaBindingReferenceSelectionChange } from './formula-binding-editor';
|
|
5
|
-
import { Disposable, IConfigService, IUniverInstanceService, LocaleService, ThemeService, Workbook } from '@univerjs/core';
|
|
6
|
-
export type FormulaBindingViewerUnit = Workbook | BaseDataModel;
|
|
7
|
-
export interface IFormulaBindingViewerFormulaContext {
|
|
8
|
-
formula: string;
|
|
9
|
-
sequenceNodes: FormulaSequenceNode[];
|
|
10
|
-
refSelections: IFormulaRefSelection[];
|
|
11
|
-
selectionStart: number;
|
|
12
|
-
selectionEnd: number;
|
|
13
|
-
}
|
|
14
|
-
/** Owns the real, isolated Univer rendered inside the cross-unit formula editor. */
|
|
15
|
-
export declare class FormulaBindingUnitViewerService extends Disposable {
|
|
16
|
-
private readonly _configService;
|
|
17
|
-
private readonly _instanceService;
|
|
18
|
-
private readonly _localeService;
|
|
19
|
-
private readonly _themeService;
|
|
20
|
-
private _univer;
|
|
21
|
-
private _activeUnitId;
|
|
22
|
-
private _container;
|
|
23
|
-
private _generation;
|
|
24
|
-
private _selectionDisposables;
|
|
25
|
-
private _formulaContext;
|
|
26
|
-
private _host;
|
|
27
|
-
private _resource;
|
|
28
|
-
private _onSelectReferences;
|
|
29
|
-
private _activeWorkbook;
|
|
30
|
-
private _activeBase;
|
|
31
|
-
private _visibleReferenceIndexes;
|
|
32
|
-
private _isApplyingBaseHighlight;
|
|
33
|
-
private _pointerCtrlKey;
|
|
34
|
-
private _pointerListener;
|
|
35
|
-
private _selectionChangingDisposable;
|
|
36
|
-
private _controlDisposables;
|
|
37
|
-
private _isDraggingFormulaSelection;
|
|
38
|
-
private _closeRequest;
|
|
39
|
-
constructor(_configService: IConfigService, _instanceService: IUniverInstanceService, _localeService: LocaleService, _themeService: ThemeService);
|
|
40
|
-
listUnits(): Promise<IFormulaBindingUnitResource[]>;
|
|
41
|
-
mount(container: HTMLElement): void;
|
|
42
|
-
switchUnit(resource: IFormulaBindingUnitResource, host: IFormulaBindingHost, onSelectReferences: (change: IFormulaBindingReferenceSelectionChange) => void): Promise<FormulaBindingViewerUnit | null>;
|
|
43
|
-
private _makeBaseSnapshotReadOnly;
|
|
44
|
-
private _setBasePermissionsReadOnly;
|
|
45
|
-
updateFormulaContext(context: IFormulaBindingViewerFormulaContext): void;
|
|
46
|
-
close(): void;
|
|
47
|
-
/** Defers nested Univer disposal until the owning React tree has finished unmounting. */
|
|
48
|
-
scheduleClose(): void;
|
|
49
|
-
private _closeNow;
|
|
50
|
-
dispose(): void;
|
|
51
|
-
private _createUniver;
|
|
52
|
-
private _observeSheetSelection;
|
|
53
|
-
private _observeBaseSelection;
|
|
54
|
-
private _handleBaseSelectionChange;
|
|
55
|
-
private _getBaseReferenceSource;
|
|
56
|
-
private _emitSheetSelectionChange;
|
|
57
|
-
private _refreshFormulaSelections;
|
|
58
|
-
private _refreshSheetFormulaSelections;
|
|
59
|
-
private _refreshBaseFormulaSelection;
|
|
60
|
-
private _bindFormulaSelectionControls;
|
|
61
|
-
private _getEditingContext;
|
|
62
|
-
private _canSelectFormulaReference;
|
|
63
|
-
private _matchesSheetReference;
|
|
64
|
-
private _matchesUnitQualifier;
|
|
65
|
-
private _createExternalReference;
|
|
66
|
-
private _listLoadedUnits;
|
|
67
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { FormulaSequenceNode, IFormulaRefSelection } from '@univerjs/engine-formula';
|
|
2
|
-
export interface IShapeFormulaReferenceSelectionChange {
|
|
3
|
-
references: string[];
|
|
4
|
-
visibleReferenceIndexes: number[];
|
|
5
|
-
activeReferenceIndex?: number;
|
|
6
|
-
isCtrlAddMode: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface IShapeFormulaReferenceEditResult {
|
|
9
|
-
formula: string;
|
|
10
|
-
selectionStart: number;
|
|
11
|
-
selectionEnd: number;
|
|
12
|
-
}
|
|
13
|
-
export declare function applyShapeFormulaReferenceSelection(options: {
|
|
14
|
-
formula: string;
|
|
15
|
-
sequenceNodes: FormulaSequenceNode[];
|
|
16
|
-
referenceSelections?: IFormulaRefSelection[];
|
|
17
|
-
selectionStart: number;
|
|
18
|
-
selectionEnd: number;
|
|
19
|
-
change: IShapeFormulaReferenceSelectionChange;
|
|
20
|
-
}): IShapeFormulaReferenceEditResult | null;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { IShapeFormulaIdentity } from '@univerjs-pro/shape-editor';
|
|
2
|
-
import type { IBaseSnapshot, IRange, Workbook, Worksheet } from '@univerjs/core';
|
|
3
|
-
export declare function buildSheetShapeFormulaReference(options: {
|
|
4
|
-
host: IShapeFormulaIdentity;
|
|
5
|
-
range: IRange;
|
|
6
|
-
workbook: Workbook;
|
|
7
|
-
worksheet: Worksheet;
|
|
8
|
-
}): string;
|
|
9
|
-
export declare function buildBaseShapeFormulaReference(options: {
|
|
10
|
-
fieldIds: string[];
|
|
11
|
-
hostUnitId: string;
|
|
12
|
-
snapshot: IBaseSnapshot;
|
|
13
|
-
sourceUnitId: string;
|
|
14
|
-
tableId: string;
|
|
15
|
-
}): string | null;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { IShapeFormulaIdentity } from '@univerjs-pro/shape-editor';
|
|
2
|
-
import type { BaseDataModel } from '@univerjs/core';
|
|
3
|
-
import type { FormulaSequenceNode, IFormulaRefSelection } from '@univerjs/engine-formula';
|
|
4
|
-
import type { IShapeFormulaUnitResource } from '../config/config';
|
|
5
|
-
import type { IShapeFormulaReferenceSelectionChange } from './shape-formula-editor';
|
|
6
|
-
import { Disposable, IConfigService, IUniverInstanceService, LocaleService, ThemeService, Workbook } from '@univerjs/core';
|
|
7
|
-
export type ShapeFormulaViewerUnit = Workbook | BaseDataModel;
|
|
8
|
-
export interface IShapeFormulaViewerFormulaContext {
|
|
9
|
-
formula: string;
|
|
10
|
-
sequenceNodes: FormulaSequenceNode[];
|
|
11
|
-
refSelections: IFormulaRefSelection[];
|
|
12
|
-
selectionStart: number;
|
|
13
|
-
selectionEnd: number;
|
|
14
|
-
}
|
|
15
|
-
/** Owns the real, isolated Univer rendered inside the cross-unit formula editor. */
|
|
16
|
-
export declare class ShapeFormulaUnitViewerService extends Disposable {
|
|
17
|
-
private readonly _configService;
|
|
18
|
-
private readonly _instanceService;
|
|
19
|
-
private readonly _localeService;
|
|
20
|
-
private readonly _themeService;
|
|
21
|
-
private _univer;
|
|
22
|
-
private _activeUnitId;
|
|
23
|
-
private _container;
|
|
24
|
-
private _generation;
|
|
25
|
-
private _selectionDisposables;
|
|
26
|
-
private _formulaContext;
|
|
27
|
-
private _host;
|
|
28
|
-
private _resource;
|
|
29
|
-
private _onSelectReferences;
|
|
30
|
-
private _activeWorkbook;
|
|
31
|
-
private _activeBase;
|
|
32
|
-
private _visibleReferenceIndexes;
|
|
33
|
-
private _isApplyingBaseHighlight;
|
|
34
|
-
private _pointerCtrlKey;
|
|
35
|
-
private _pointerListener;
|
|
36
|
-
private _selectionChangingDisposable;
|
|
37
|
-
private _controlDisposables;
|
|
38
|
-
private _isDraggingFormulaSelection;
|
|
39
|
-
private _closeRequest;
|
|
40
|
-
constructor(_configService: IConfigService, _instanceService: IUniverInstanceService, _localeService: LocaleService, _themeService: ThemeService);
|
|
41
|
-
listUnits(): Promise<IShapeFormulaUnitResource[]>;
|
|
42
|
-
mount(container: HTMLElement): void;
|
|
43
|
-
switchUnit(resource: IShapeFormulaUnitResource, host: IShapeFormulaIdentity, onSelectReferences: (change: IShapeFormulaReferenceSelectionChange) => void): Promise<ShapeFormulaViewerUnit | null>;
|
|
44
|
-
private _makeBaseSnapshotReadOnly;
|
|
45
|
-
private _setBasePermissionsReadOnly;
|
|
46
|
-
updateFormulaContext(context: IShapeFormulaViewerFormulaContext): void;
|
|
47
|
-
close(): void;
|
|
48
|
-
/** Defers nested Univer disposal until the owning React tree has finished unmounting. */
|
|
49
|
-
scheduleClose(): void;
|
|
50
|
-
private _closeNow;
|
|
51
|
-
dispose(): void;
|
|
52
|
-
private _createUniver;
|
|
53
|
-
private _observeSheetSelection;
|
|
54
|
-
private _observeBaseSelection;
|
|
55
|
-
private _handleBaseSelectionChange;
|
|
56
|
-
private _getBaseReferenceSource;
|
|
57
|
-
private _emitSheetSelectionChange;
|
|
58
|
-
private _refreshFormulaSelections;
|
|
59
|
-
private _refreshSheetFormulaSelections;
|
|
60
|
-
private _refreshBaseFormulaSelection;
|
|
61
|
-
private _bindFormulaSelectionControls;
|
|
62
|
-
private _getEditingContext;
|
|
63
|
-
private _canSelectFormulaReference;
|
|
64
|
-
private _matchesSheetReference;
|
|
65
|
-
private _matchesUnitQualifier;
|
|
66
|
-
private _listLoadedUnits;
|
|
67
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type * as ReactTypes from "react";
|
|
2
|
-
export type FormulaShapeNumberFormatType = 'general' | 'accounting' | 'currency' | 'date' | 'number' | 'custom';
|
|
3
|
-
export type FormulaShapeNumberFormatMenuEntry = {
|
|
4
|
-
kind: 'format';
|
|
5
|
-
key: string;
|
|
6
|
-
pattern: string;
|
|
7
|
-
} | {
|
|
8
|
-
kind: 'separator';
|
|
9
|
-
key: string;
|
|
10
|
-
} | {
|
|
11
|
-
kind: 'more';
|
|
12
|
-
};
|
|
13
|
-
export declare function createFormulaShapeNumberFormatMenuEntries(currencySymbol: string): FormulaShapeNumberFormatMenuEntry[];
|
|
14
|
-
export declare function resolveFormulaShapeNumberFormatType(pattern: string): FormulaShapeNumberFormatType;
|
|
15
|
-
export declare function FormulaShapeNumberFormatMenu(props: {
|
|
16
|
-
onSelect: (pattern: string) => void;
|
|
17
|
-
onMore: () => void;
|
|
18
|
-
}): ReactTypes.JSX.Element;
|
|
19
|
-
export declare function FormulaShapeNumberFormatDialog(props: {
|
|
20
|
-
open: boolean;
|
|
21
|
-
pattern: string;
|
|
22
|
-
onClose: () => void;
|
|
23
|
-
onConfirm: (pattern: string) => void;
|
|
24
|
-
}): ReactTypes.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function getFormulaShapeCurrencyType(pattern: string): string | undefined;
|
|
2
|
-
export declare function getFormulaShapeDecimalFromPattern(pattern: string, defaultValue?: number): number;
|
|
3
|
-
export declare function setFormulaShapePatternDecimal(patterns: string, decimalLength: number): string;
|
|
4
|
-
export declare function getFormulaShapeCurrencyFormatOptions(symbol: string): {
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
color: string | undefined;
|
|
8
|
-
}[];
|
|
9
|
-
export declare function getFormulaShapeDateFormatOptions(): {
|
|
10
|
-
label: string;
|
|
11
|
-
value: string;
|
|
12
|
-
}[];
|
|
13
|
-
export declare function getFormulaShapeNumberFormatOptions(): {
|
|
14
|
-
label: string;
|
|
15
|
-
value: string;
|
|
16
|
-
color: string | undefined;
|
|
17
|
-
}[];
|