@univerjs/sheets-ui 0.21.1 → 0.22.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/README.md +33 -21
- package/lib/cjs/index.js +444 -409
- package/lib/es/index.js +445 -410
- package/lib/index.js +445 -410
- package/lib/types/config/config.d.ts +21 -0
- package/lib/types/controllers/shortcuts/utils.d.ts +8 -0
- package/lib/types/services/clipboard/html-to-usm/converter.d.ts +11 -0
- package/lib/types/services/clipboard/type.d.ts +1 -0
- package/lib/types/services/editor/cell-editor-manager.service.d.ts +1 -1
- package/lib/types/services/editor/formula-editor-manager.service.d.ts +6 -4
- package/lib/types/services/editor-bridge.service.d.ts +2 -2
- package/lib/types/services/status-bar.service.d.ts +1 -1
- package/lib/umd/index.js +11 -11
- package/package.json +23 -19
|
@@ -57,6 +57,27 @@ export interface IUniverSheetsUIConfig {
|
|
|
57
57
|
* @default true
|
|
58
58
|
*/
|
|
59
59
|
zoomSlider?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The config of the add sheet button in the sheet bar.
|
|
62
|
+
*/
|
|
63
|
+
addSheetButtonConfig?: {
|
|
64
|
+
/**
|
|
65
|
+
* Whether to show the add sheet button in the sheet bar.
|
|
66
|
+
* When `footer` or `footer.sheetBar` is false, this config will not work because the sheet bar will not be rendered.
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
show?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The default row count of the new sheet created by the add sheet button.
|
|
72
|
+
* @default 1000
|
|
73
|
+
*/
|
|
74
|
+
defaultRowCount?: number;
|
|
75
|
+
/**
|
|
76
|
+
* The default column count of the new sheet created by the add sheet button.
|
|
77
|
+
* @default 20
|
|
78
|
+
*/
|
|
79
|
+
defaultColumnCount?: number;
|
|
80
|
+
};
|
|
60
81
|
};
|
|
61
82
|
/**
|
|
62
83
|
* @deprecated Use `footer.statisticBar` instead.
|
|
@@ -21,6 +21,14 @@ export declare function whenSheetFocused(contextService: IContextService): boole
|
|
|
21
21
|
* @returns If the sheet editor is focused but not activated.
|
|
22
22
|
*/
|
|
23
23
|
export declare function whenSheetEditorFocused(contextService: IContextService): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Requires the currently focused unit to be Workbook, regardless of whether the cell editor is activated.
|
|
26
|
+
* Used by inline-format shortcuts (bold/italic/underline/strikethrough) so they can also fire
|
|
27
|
+
* inside the cell editor — the corresponding command will route to the docs inline-format command
|
|
28
|
+
* when EDITOR_ACTIVATED is true.
|
|
29
|
+
* @param contextService
|
|
30
|
+
*/
|
|
31
|
+
export declare function whenSheetFocusedInlineFormat(contextService: IContextService): boolean;
|
|
24
32
|
export declare function whenSheetEditorFocusedAndFxNotFocused(contextService: IContextService): boolean;
|
|
25
33
|
/**
|
|
26
34
|
* Requires the currently focused unit to be Workbook and the sheet editor is activated.
|
|
@@ -35,9 +35,20 @@ export declare class HtmlToUSMService {
|
|
|
35
35
|
private _styleRules;
|
|
36
36
|
private _afterProcessRules;
|
|
37
37
|
private _dom;
|
|
38
|
+
private _msoNumfmtMap;
|
|
38
39
|
private _getCurrentSkeleton;
|
|
39
40
|
constructor(props: IHtmlToUSMServiceProps);
|
|
40
41
|
convert(html: string): IUniverSheetCopyDataModel;
|
|
42
|
+
/**
|
|
43
|
+
* Parse mso-number-format from raw CSS text before the browser drops proprietary properties.
|
|
44
|
+
* Must be called with style.textContent BEFORE the style element is moved into a shadow DOM.
|
|
45
|
+
*/
|
|
46
|
+
private _parseMsoNumfmtFromCssText;
|
|
47
|
+
/**
|
|
48
|
+
* Get the mso-number-format value for a given DOM node,
|
|
49
|
+
* following the same priority as _getStyle: class > id > tag.
|
|
50
|
+
*/
|
|
51
|
+
private _getMsoNumfmtForNode;
|
|
41
52
|
private _getStyleBySelectorText;
|
|
42
53
|
private _getStyle;
|
|
43
54
|
private _parseTable;
|
|
@@ -53,4 +53,4 @@ export declare class CellEditorManagerService implements ICellEditorManagerServi
|
|
|
53
53
|
setFocus(param?: boolean): void;
|
|
54
54
|
private _refresh;
|
|
55
55
|
}
|
|
56
|
-
export declare const ICellEditorManagerService: import("@wendellhu/redi").IdentifierDecorator<
|
|
56
|
+
export declare const ICellEditorManagerService: import("@wendellhu/redi").IdentifierDecorator<ICellEditorManagerService>;
|
|
@@ -13,19 +13,21 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { Nullable } from '@univerjs/core';
|
|
17
17
|
import type { Observable } from 'rxjs';
|
|
18
|
+
import { Disposable } from '@univerjs/core';
|
|
18
19
|
export interface IFormulaEditorManagerService {
|
|
19
20
|
position$: Observable<Nullable<DOMRect>>;
|
|
20
21
|
focus$: Observable<boolean>;
|
|
21
22
|
fxBtnClick$: Observable<boolean>;
|
|
22
23
|
foldBtnStatus$: Observable<boolean>;
|
|
23
|
-
dispose(): void;
|
|
24
24
|
setPosition(param: DOMRect): void;
|
|
25
25
|
getPosition(): Readonly<Nullable<DOMRect>>;
|
|
26
26
|
setFocus(param: boolean): void;
|
|
27
|
+
handleFxBtnClick(params: boolean): void;
|
|
28
|
+
handleFoldBtnClick(params: boolean): void;
|
|
27
29
|
}
|
|
28
|
-
export declare class FormulaEditorManagerService implements
|
|
30
|
+
export declare class FormulaEditorManagerService extends Disposable implements IFormulaEditorManagerService {
|
|
29
31
|
private _position;
|
|
30
32
|
private readonly _position$;
|
|
31
33
|
readonly position$: Observable<Nullable<DOMRect>>;
|
|
@@ -44,4 +46,4 @@ export declare class FormulaEditorManagerService implements IDisposable {
|
|
|
44
46
|
handleFoldBtnClick(params: boolean): void;
|
|
45
47
|
private _refresh;
|
|
46
48
|
}
|
|
47
|
-
export declare const IFormulaEditorManagerService: import("@wendellhu/redi").IdentifierDecorator<
|
|
49
|
+
export declare const IFormulaEditorManagerService: import("@wendellhu/redi").IdentifierDecorator<IFormulaEditorManagerService>;
|
|
@@ -80,7 +80,7 @@ export interface IEditorBridgeService {
|
|
|
80
80
|
enableForceKeepVisible(): void;
|
|
81
81
|
disableForceKeepVisible(): void;
|
|
82
82
|
isForceKeepVisible(): boolean;
|
|
83
|
-
getCurrentEditorId():
|
|
83
|
+
getCurrentEditorId(): string;
|
|
84
84
|
helpFunctionVisible$: BehaviorSubject<boolean>;
|
|
85
85
|
}
|
|
86
86
|
export declare class EditorBridgeService extends Disposable implements IEditorBridgeService, IDisposable {
|
|
@@ -163,4 +163,4 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
|
|
|
163
163
|
changeEditorDirty(dirtyStatus: boolean): void;
|
|
164
164
|
getEditorDirty(): boolean;
|
|
165
165
|
}
|
|
166
|
-
export declare const IEditorBridgeService: import("@wendellhu/redi").IdentifierDecorator<
|
|
166
|
+
export declare const IEditorBridgeService: import("@wendellhu/redi").IdentifierDecorator<IEditorBridgeService>;
|
|
@@ -44,4 +44,4 @@ export declare class StatusBarService implements IStatusBarService, IDisposable
|
|
|
44
44
|
getFunctions(): Readonly<IStatusBarFunction[]>;
|
|
45
45
|
addFunctions(functions: IStatusBarFunction[]): void;
|
|
46
46
|
}
|
|
47
|
-
export declare const IStatusBarService: import("@wendellhu/redi").IdentifierDecorator<
|
|
47
|
+
export declare const IStatusBarService: import("@wendellhu/redi").IdentifierDecorator<IStatusBarService>;
|