@univerjs/sheets-ui 0.15.4 → 0.15.5

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.
Files changed (29) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +16 -16
  3. package/lib/es/facade.js +84 -103
  4. package/lib/es/index.js +13265 -14584
  5. package/lib/facade.js +84 -103
  6. package/lib/index.js +13265 -14584
  7. package/lib/types/controllers/{auto-fill.controller.d.ts → auto-fill-ui.controller.d.ts} +5 -17
  8. package/lib/types/controllers/auto-height.controller.d.ts +0 -1
  9. package/lib/types/controllers/auto-width.controller.d.ts +0 -1
  10. package/lib/types/controllers/clipboard/utils.d.ts +1 -1
  11. package/lib/types/controllers/permission/sheet-permission-check-ui.controller.d.ts +1 -4
  12. package/lib/types/controllers/utils/range-tools.d.ts +2 -7
  13. package/lib/types/facade/f-range.d.ts +1 -40
  14. package/lib/types/index.d.ts +3 -10
  15. package/lib/types/services/clipboard/clipboard.service.d.ts +1 -2
  16. package/lib/types/services/clipboard/copy-content-cache.d.ts +1 -1
  17. package/lib/types/services/clipboard/type.d.ts +1 -1
  18. package/lib/types/services/clipboard/usm-to-html/convertor.d.ts +1 -1
  19. package/lib/types/services/clipboard/utils.d.ts +1 -2
  20. package/lib/types/views/auto-fill-popup-menu/AutoFillPopupMenu.d.ts +2 -2
  21. package/lib/umd/facade.js +1 -1
  22. package/lib/umd/index.js +15 -15
  23. package/package.json +12 -12
  24. package/lib/types/commands/commands/auto-fill.command.d.ts +0 -15
  25. package/lib/types/commands/commands/refill.command.d.ts +0 -2
  26. package/lib/types/services/auto-fill/auto-fill.service.d.ts +0 -76
  27. package/lib/types/services/auto-fill/rules.d.ts +0 -10
  28. package/lib/types/services/auto-fill/tools.d.ts +0 -115
  29. package/lib/types/services/auto-fill/type.d.ts +0 -70
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-ui",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "private": false,
5
5
  "description": "UniverSheet normal ui-plugin-sheets",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -66,15 +66,15 @@
66
66
  "dependencies": {
67
67
  "@univerjs/icons": "^1.1.1",
68
68
  "@univerjs/protocol": "0.1.48",
69
- "@univerjs/core": "0.15.4",
70
- "@univerjs/design": "0.15.4",
71
- "@univerjs/docs": "0.15.4",
72
- "@univerjs/docs-ui": "0.15.4",
73
- "@univerjs/engine-render": "0.15.4",
74
- "@univerjs/sheets": "0.15.4",
75
- "@univerjs/telemetry": "0.15.4",
76
- "@univerjs/ui": "0.15.4",
77
- "@univerjs/engine-formula": "0.15.4"
69
+ "@univerjs/core": "0.15.5",
70
+ "@univerjs/docs": "0.15.5",
71
+ "@univerjs/docs-ui": "0.15.5",
72
+ "@univerjs/engine-formula": "0.15.5",
73
+ "@univerjs/sheets": "0.15.5",
74
+ "@univerjs/telemetry": "0.15.5",
75
+ "@univerjs/ui": "0.15.5",
76
+ "@univerjs/engine-render": "0.15.5",
77
+ "@univerjs/design": "0.15.5"
78
78
  },
79
79
  "devDependencies": {
80
80
  "postcss": "^8.5.6",
@@ -84,8 +84,8 @@
84
84
  "typescript": "^5.9.3",
85
85
  "vite": "^7.3.1",
86
86
  "vitest": "^4.0.18",
87
- "@univerjs-infra/shared": "0.15.4",
88
- "@univerjs/themes": "0.15.4"
87
+ "@univerjs-infra/shared": "0.15.5",
88
+ "@univerjs/themes": "0.15.5"
89
89
  },
90
90
  "scripts": {
91
91
  "test": "vitest run",
@@ -1,15 +0,0 @@
1
- import { ICommand, IRange } from '@univerjs/core';
2
- import { APPLY_TYPE } from '../../services/auto-fill/type';
3
- export interface IAutoFillCommandParams {
4
- sourceRange: IRange;
5
- targetRange: IRange;
6
- unitId?: string;
7
- subUnitId?: string;
8
- applyType?: APPLY_TYPE;
9
- }
10
- export declare const AutoFillCommand: ICommand;
11
- export interface IAutoClearContentCommand {
12
- clearRange: IRange;
13
- selectionRange: IRange;
14
- }
15
- export declare const AutoClearContentCommand: ICommand;
@@ -1,2 +0,0 @@
1
- import { ICommand } from '@univerjs/core';
2
- export declare const RefillCommand: ICommand;
@@ -1,76 +0,0 @@
1
- import { IDisposable, IRange, Nullable, Direction, Disposable, ICommandService, Injector, IUndoRedoService, IUniverInstanceService } from '@univerjs/core';
2
- import { RenderManagerService } from '@univerjs/engine-render';
3
- import { Observable } from 'rxjs';
4
- import { IAutoFillLocation, IAutoFillRule, ISheetAutoFillHook, APPLY_TYPE } from './type';
5
- import { SheetsSelectionsService } from '@univerjs/sheets';
6
- export interface IAutoFillService {
7
- applyType$: Observable<APPLY_TYPE>;
8
- applyType: APPLY_TYPE;
9
- direction: Direction;
10
- menu$: Observable<IApplyMenuItem[]>;
11
- menu: IApplyMenuItem[];
12
- showMenu$: Observable<boolean>;
13
- setShowMenu: (show: boolean) => void;
14
- setDisableApplyType: (type: APPLY_TYPE, disable: boolean) => void;
15
- getRules(): IAutoFillRule[];
16
- isFillingStyle(): boolean;
17
- autoFillLocation$: Observable<Nullable<IAutoFillLocation>>;
18
- autoFillLocation: Nullable<IAutoFillLocation>;
19
- setFillingStyle(isFillingStyle: boolean): void;
20
- registerRule(rule: IAutoFillRule): void;
21
- getAllHooks(): ISheetAutoFillHook[];
22
- getActiveHooks(): ISheetAutoFillHook[];
23
- addHook(hook: ISheetAutoFillHook): IDisposable;
24
- fillData(applyType: APPLY_TYPE): boolean;
25
- triggerAutoFill(unitId: string, subUnitId: string, source: IRange, target: IRange, manualApplyType?: APPLY_TYPE): Promise<boolean>;
26
- }
27
- export interface IApplyMenuItem {
28
- label: string;
29
- value: APPLY_TYPE;
30
- disable: boolean;
31
- }
32
- export declare class AutoFillService extends Disposable implements IAutoFillService {
33
- private _commandService;
34
- private _undoRedoService;
35
- private readonly _renderManagerService;
36
- private _univerInstanceService;
37
- private _selectionManagerService;
38
- private readonly _injector;
39
- private _rules;
40
- private _hooks;
41
- private readonly _applyType$;
42
- private _isFillingStyle;
43
- private _prevUndos;
44
- private readonly _autoFillLocation$;
45
- readonly autoFillLocation$: Observable<Nullable<IAutoFillLocation>>;
46
- private readonly _showMenu$;
47
- readonly showMenu$: Observable<boolean>;
48
- private _direction;
49
- readonly applyType$: Observable<APPLY_TYPE>;
50
- private readonly _menu$;
51
- readonly menu$: Observable<IApplyMenuItem[]>;
52
- constructor(_commandService: ICommandService, _undoRedoService: IUndoRedoService, _renderManagerService: RenderManagerService, _univerInstanceService: IUniverInstanceService, _selectionManagerService: SheetsSelectionsService, _injector: Injector);
53
- private _init;
54
- private _getOneByPriority;
55
- private _initPrevUndo;
56
- triggerAutoFill(unitId: string, subUnitId: string, source: IRange, selection: IRange, manualApplyType?: APPLY_TYPE): Promise<boolean>;
57
- addHook(hook: ISheetAutoFillHook): IDisposable;
58
- registerRule(rule: IAutoFillRule): void;
59
- getRules(): IAutoFillRule[];
60
- getAllHooks(): ISheetAutoFillHook[];
61
- getActiveHooks(): ISheetAutoFillHook[];
62
- get applyType(): APPLY_TYPE;
63
- set applyType(type: APPLY_TYPE);
64
- get menu(): IApplyMenuItem[];
65
- get direction(): Direction;
66
- set direction(direction: Direction);
67
- isFillingStyle(): boolean;
68
- setFillingStyle(isFillingStyle: boolean): void;
69
- get autoFillLocation(): Nullable<IAutoFillLocation>;
70
- set autoFillLocation(location: Nullable<IAutoFillLocation>);
71
- setDisableApplyType(type: APPLY_TYPE, disable: boolean): void;
72
- setShowMenu(show: boolean): void;
73
- fillData(applyType: APPLY_TYPE): boolean;
74
- private _getAutoHeightUndoRedos;
75
- }
76
- export declare const IAutoFillService: import('@wendellhu/redi').IdentifierDecorator<IAutoFillService>;
@@ -1,10 +0,0 @@
1
- import { IAutoFillRule } from './type';
2
- export declare const dateRule: IAutoFillRule;
3
- export declare const numberRule: IAutoFillRule;
4
- export declare const otherRule: IAutoFillRule;
5
- export declare const extendNumberRule: IAutoFillRule;
6
- export declare const chnNumberRule: IAutoFillRule;
7
- export declare const chnWeek2Rule: IAutoFillRule;
8
- export declare const chnWeek3Rule: IAutoFillRule;
9
- export declare const loopSeriesRule: IAutoFillRule;
10
- export declare function reverseIfNeed<T>(data: T[], reverse: boolean): T[];
@@ -1,115 +0,0 @@
1
- import { ICellData, IRange, Nullable, CellValueType, Direction } from '@univerjs/core';
2
- export declare const chnNumChar: {
3
- 零: number;
4
- 一: number;
5
- 二: number;
6
- 三: number;
7
- 四: number;
8
- 五: number;
9
- 六: number;
10
- 七: number;
11
- 八: number;
12
- 九: number;
13
- };
14
- export declare const chnNumChar2: string[];
15
- export declare const chnUnitSection: string[];
16
- export declare const chnUnitChar: string[];
17
- export interface ICopyDataInType {
18
- data: Array<Nullable<ICellData>>;
19
- index: ICopyDataInTypeIndexInfo;
20
- }
21
- export type ICopyDataInTypeIndexInfo = number[];
22
- export declare const chnNameValue: {
23
- 十: {
24
- value: number;
25
- secUnit: boolean;
26
- };
27
- 百: {
28
- value: number;
29
- secUnit: boolean;
30
- };
31
- 千: {
32
- value: number;
33
- secUnit: boolean;
34
- };
35
- 万: {
36
- value: number;
37
- secUnit: boolean;
38
- };
39
- 亿: {
40
- value: number;
41
- secUnit: boolean;
42
- };
43
- };
44
- export declare function chineseToNumber(chnStr?: Nullable<string>): number;
45
- export declare function sectionToChinese(section: number): string;
46
- export declare function numberToChinese(num: number): string;
47
- export declare function isChnNumber(txt?: string): boolean;
48
- export declare function matchExtendNumber(txt?: string): {
49
- isExtendNumber: boolean;
50
- matchTxt?: undefined;
51
- beforeTxt?: undefined;
52
- afterTxt?: undefined;
53
- } | {
54
- isExtendNumber: boolean;
55
- matchTxt: number;
56
- beforeTxt: string;
57
- afterTxt: string;
58
- };
59
- export declare function isChnWeek1(txt: string): boolean;
60
- export declare function isChnWeek2(txt: string): boolean;
61
- export declare function isChnWeek3(txt: string): boolean;
62
- export declare function getLenS(indexArr: any[], rsd: number): number;
63
- /**
64
- * equal diff
65
- * @param arr
66
- * @returns
67
- */
68
- export declare function isEqualDiff(arr: number[]): boolean;
69
- export declare function getDataIndex(csLen: number, asLen: number, indexArr: number[]): ICopyDataInTypeIndexInfo;
70
- export declare function fillCopy(data: Array<Nullable<ICellData>>, len: number): {
71
- p: import('@univerjs/core').IDocumentData | null;
72
- s: string | import('@univerjs/core').IStyleData | null;
73
- v: import('@univerjs/core').CellValue | null;
74
- t: CellValueType | null;
75
- f: string | null;
76
- ref?: Nullable<string>;
77
- xf?: Nullable<string>;
78
- si: string | null;
79
- custom?: import('@univerjs/core').CustomData;
80
- }[];
81
- export declare function fillCopyStyles(data: Array<Nullable<ICellData>>, len: number): {
82
- s: Nullable<string | import('@univerjs/core').IStyleData>;
83
- }[];
84
- export declare function isEqualRatio(arr: number[]): boolean;
85
- export declare function getXArr(len: number): number[];
86
- export declare function fillSeries(data: Array<Nullable<ICellData>>, len: number, direction: Direction): ICellData[];
87
- export declare function forecast(x: number, yArr: number[], xArr: number[], forward?: boolean): number;
88
- export declare function fillExtendNumber(data: Array<Nullable<ICellData>>, len: number, step: number): ICellData[];
89
- export declare function fillOnlyFormat(data: Array<Nullable<ICellData>>, len: number): ICellData[];
90
- export declare function fillChnWeek(data: Array<Nullable<ICellData>>, len: number, step: number, weekType?: number): ICellData[];
91
- export declare function fillChnNumber(data: Array<Nullable<ICellData>>, len: number, step: number): ICellData[];
92
- export declare function isLoopSeries(txt: string): boolean;
93
- export declare function getLoopSeriesInfo(txt: string): {
94
- name: string;
95
- series: string[];
96
- };
97
- export declare function fillLoopSeries(data: Array<Nullable<ICellData>>, len: number, step: number, series: string[]): ICellData[];
98
- export declare function getAutoFillRepeatRange(sourceRange: IRange, targetRange: IRange): {
99
- repeatStartCell: {
100
- col: number;
101
- row: number;
102
- };
103
- relativeRange: IRange;
104
- }[];
105
- /**
106
- * Formulas or Boolean values do not need to update cell.v
107
- * @param cell
108
- * @returns
109
- */
110
- export declare function needsUpdateCellValue(cell: ICellData): boolean;
111
- /**
112
- * Remove cell.custom
113
- * @param cell
114
- */
115
- export declare function removeCellCustom(cell: Nullable<ICellData>): void;
@@ -1,70 +0,0 @@
1
- import { Direction, IAccessor, ICellData, IMutationInfo, IObjectMatrixPrimitiveType, Nullable } from '@univerjs/core';
2
- import { IDiscreteRange } from '../../controllers/utils/range-tools';
3
- export declare enum AutoFillHookType {
4
- Append = "APPEND",
5
- Default = "DEFAULT",
6
- Only = "ONLY"
7
- }
8
- export interface IAutoFillLocation {
9
- source: IDiscreteRange;
10
- target: IDiscreteRange;
11
- unitId: string;
12
- subUnitId: string;
13
- }
14
- export interface ISheetAutoFillHook {
15
- id: string;
16
- priority?: number;
17
- type?: AutoFillHookType;
18
- bindUnit?: string;
19
- disable?: (location: IAutoFillLocation, direction: Direction, applyType: APPLY_TYPE) => boolean;
20
- onBeforeFillData?(location: IAutoFillLocation, direction: Direction): APPLY_TYPE | void;
21
- onFillData?(location: IAutoFillLocation, direction: Direction, applyType: APPLY_TYPE): {
22
- undos: IMutationInfo[];
23
- redos: IMutationInfo[];
24
- };
25
- onAfterFillData?(location: IAutoFillLocation, direction: Direction, applyType: APPLY_TYPE): boolean | void;
26
- onBeforeSubmit?: (location: IAutoFillLocation, direction: Direction, applyType: APPLY_TYPE, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>) => void;
27
- }
28
- export declare enum DATA_TYPE {
29
- NUMBER = "number",
30
- DATE = "date",
31
- EXTEND_NUMBER = "extendNumber",
32
- CHN_NUMBER = "chnNumber",
33
- CHN_WEEK2 = "chnWeek2",
34
- CHN_WEEK3 = "chnWeek3",
35
- LOOP_SERIES = "loopSeries",
36
- FORMULA = "formula",
37
- OTHER = "other"
38
- }
39
- export interface ICopyDataPiece {
40
- [key: string]: ICopyDataInType[];
41
- }
42
- export interface ICopyDataInType {
43
- data: Array<Nullable<ICellData>>;
44
- index: ICopyDataInTypeIndexInfo;
45
- }
46
- export type ICopyDataInTypeIndexInfo = number[];
47
- export interface IAutoFillRule {
48
- type: string;
49
- match: (cellData: Nullable<ICellData>, accessor: IAccessor) => boolean;
50
- isContinue: (prev: IRuleConfirmedData, cur: Nullable<ICellData>) => boolean;
51
- applyFunctions?: APPLY_FUNCTIONS;
52
- priority: number;
53
- }
54
- export interface IMutations {
55
- redos: IMutationInfo[];
56
- undos: IMutationInfo[];
57
- }
58
- export interface IRuleConfirmedData {
59
- type?: string;
60
- cellData: Nullable<ICellData>;
61
- }
62
- export type APPLY_FUNCTIONS = {
63
- [key in APPLY_TYPE]?: (dataWithIndex: ICopyDataInType, len: number, direction: Direction, copyDataPiece: ICopyDataPiece, location?: IAutoFillLocation) => Array<Nullable<ICellData>>;
64
- };
65
- export declare enum APPLY_TYPE {
66
- COPY = "COPY",
67
- SERIES = "SERIES",
68
- ONLY_FORMAT = "ONLY_FORMAT",
69
- NO_FORMAT = "NO_FORMAT"
70
- }