@univerjs/core 0.1.0-alpha.3 → 0.1.0-beta.1

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.
@@ -30,7 +30,7 @@ export { ContextService, IContextService } from './services/context/context.serv
30
30
  export { ErrorService, type IError } from './services/error/error.service';
31
31
  export type { IOffset, IScale, ISize, ITransformState } from './services/floating-object/floating-object-interfaces';
32
32
  export { DEFAULT_DOCUMENT_SUB_COMPONENT_ID, FloatingObjectManagerService, type IFloatingObjectManagerParam, type IFloatingObjectManagerSearchItemParam, IFloatingObjectManagerService, } from './services/floating-object/floating-object-manager.service';
33
- export { DocumentType, IUniverInstanceService } from './services/instance/instance.service';
33
+ export { IUniverInstanceService, UniverInstanceType } from './services/instance/instance.service';
34
34
  export { LifecycleStages, OnLifecycle, runOnLifecycle } from './services/lifecycle/lifecycle';
35
35
  export { LifecycleService } from './services/lifecycle/lifecycle.service';
36
36
  export { ILocalStorageService } from './services/local-storage/local-storage.service';
@@ -21,7 +21,7 @@ import { Workbook } from '../../sheets/workbook';
21
21
  import { Slide } from '../../slides/domain/slide-model';
22
22
  import type { IDocumentData, ISlideData, IWorkbookData } from '../../types/interfaces';
23
23
  import { IContextService } from '../context/context.service';
24
- export declare const enum DocumentType {
24
+ export declare const enum UniverInstanceType {
25
25
  UNKNOWN = 0,
26
26
  DOC = 1,
27
27
  SHEET = 2,
@@ -68,15 +68,15 @@ export interface IUniverInstanceService {
68
68
  getAllUniverSheetsInstance(): Workbook[];
69
69
  getAllUniverDocsInstance(): DocumentDataModel[];
70
70
  getAllUniverSlidesInstance(): Slide[];
71
- getDocumentType(unitID: string): DocumentType;
71
+ getDocumentType(unitId: string): UniverInstanceType;
72
72
  disposeDocument(unitId: string): boolean;
73
73
  }
74
74
  export declare const IUniverInstanceService: import("@wendellhu/redi").IdentifierDecorator<IUniverInstanceService>;
75
75
  export declare class UniverInstanceService extends Disposable implements IUniverInstanceService {
76
76
  private readonly _handler;
77
77
  private readonly _contextService;
78
- private readonly _focused$;
79
78
  private _focused;
79
+ private readonly _focused$;
80
80
  readonly focused$: Observable<Nullable<string>>;
81
81
  private readonly _currentSheet$;
82
82
  readonly currentSheet$: Observable<Nullable<Workbook>>;
@@ -122,6 +122,6 @@ export declare class UniverInstanceService extends Disposable implements IUniver
122
122
  getCurrentUniverSlideInstance(): Slide;
123
123
  focusUniverInstance(id: string | null): void;
124
124
  getFocusedUniverInstance(): Workbook | DocumentDataModel | Slide | null;
125
- getDocumentType(unitID: string): DocumentType;
125
+ getDocumentType(unitId: string): UniverInstanceType;
126
126
  disposeDocument(unitId: string): boolean;
127
127
  }
@@ -21,7 +21,6 @@ export * from './command-enum';
21
21
  export * from './common';
22
22
  export * from './compare';
23
23
  export * from './doc-tool';
24
- export * from './gen-name';
25
24
  export * from './generate';
26
25
  export * from './hash-algorithm';
27
26
  export * from './lifecycle';
@@ -26,6 +26,7 @@ export interface IObjectArrayPrimitiveType<T> {
26
26
  }
27
27
  export declare function getArrayLength<T>(o: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): number;
28
28
  export declare function insertMatrixArray<T>(index: number, value: T, o: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): void;
29
+ export declare function spliceArray<T>(start: number, count: number, o: IObjectArrayPrimitiveType<T>): void;
29
30
  export declare function concatMatrixArray<T>(source: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>, target: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>;
30
31
  export declare function sliceMatrixArray<T>(start: number, end: number, matrixArray: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>;
31
32
  export declare function moveMatrixArray<T>(fromIndex: number, count: number, toIndex: number, o: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): void;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Injector } from '@wendellhu/redi';
16
+ import { ILogService } from '../services/log/log.service';
17
17
  import type { Nullable } from '../shared';
18
18
  import { Disposable } from '../shared/lifecycle';
19
19
  import type { IGridRange, IRangeType, IWorkbookData, IWorksheetData } from '../types/interfaces';
@@ -24,12 +24,11 @@ export declare function getWorksheetUID(workbook: Workbook, worksheet: Worksheet
24
24
  * Access and create Univer Sheets files
25
25
  */
26
26
  export declare class Workbook extends Disposable {
27
- readonly _injector: Injector;
27
+ private readonly _log;
28
28
  private readonly _sheetCreated$;
29
29
  readonly sheetCreated$: import("rxjs").Observable<Worksheet>;
30
30
  private readonly _sheetDisposed$;
31
31
  readonly sheetDisposed$: import("rxjs").Observable<Worksheet>;
32
- private readonly _genName;
33
32
  private readonly _activeSheet$;
34
33
  readonly activeSheet$: import("rxjs").Observable<Nullable<Worksheet>>;
35
34
  /**
@@ -48,7 +47,8 @@ export declare class Workbook extends Disposable {
48
47
  */
49
48
  private _snapshot;
50
49
  private _unitId;
51
- constructor(workbookData: Partial<IWorkbookData> | undefined, _injector: Injector);
50
+ private _count;
51
+ constructor(workbookData: Partial<IWorkbookData> | undefined, _log: ILogService);
52
52
  dispose(): void;
53
53
  save(): IWorkbookData;
54
54
  static isIRangeType(range: IRangeType | IRangeType[]): Boolean;
@@ -80,14 +80,12 @@ export declare class Workbook extends Disposable {
80
80
  */
81
81
  flush(): void;
82
82
  getSheets(): Worksheet[];
83
+ getSheetsName(): string[];
83
84
  getSheetIndex(sheet: Worksheet): number;
84
85
  getSheetBySheetName(name: string): Nullable<Worksheet>;
85
86
  getSheetBySheetId(sheetId: string): Nullable<Worksheet>;
86
87
  getSheetByIndex(index: number): Nullable<Worksheet>;
87
88
  getHiddenWorksheets(): string[];
88
- /**
89
- * Creates a builder for a conditional formatting rule.
90
- */
91
89
  /**
92
90
  * transform any range type to range data
93
91
  *
@@ -128,21 +126,17 @@ export declare class Workbook extends Disposable {
128
126
  */
129
127
  transformRangeType(range: IRangeType | IRangeType[]): IGridRange;
130
128
  load(config: IWorkbookData): void;
129
+ checkSheetName(name: string): boolean;
130
+ uniqueSheetName(name?: string): string;
131
131
  /**
132
132
  * Get the range array based on the range string and sheet id
133
133
  *
134
- * @privateRemarks
135
- * zh: 根据范围字符串和sheet id取得范围数组
136
- *
137
134
  * @param txt - range string
138
135
  * @returns
139
- *
140
- * @internal
141
136
  */
142
137
  private _getCellRange;
143
138
  /**
144
139
  * Get Default Sheet
145
- * @private
146
140
  */
147
141
  private _getDefaultWorkSheet;
148
142
  }
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export * from './action-names';
17
16
  export * from './const';
18
17
  export * from './extension-names';
19
18
  export * from './theme-color-map';
@@ -39,5 +39,10 @@ export declare enum BorderType {
39
39
  OUTSIDE = "outside",
40
40
  INSIDE = "inside",
41
41
  HORIZONTAL = "horizontal",
42
- VERTICAL = "vertical"
42
+ VERTICAL = "vertical",
43
+ TLBR = "tlbr",
44
+ TLBC_TLMR = "tlbc_tlmr",
45
+ TLBR_TLBC_TLMR = "tlbr_tlbc_tlmr",
46
+ BLTR = "bl_tr",
47
+ MLTR_BCTR = "mltr_bctr"
43
48
  }
@@ -50,12 +50,29 @@ export interface IBorderStyleData {
50
50
  }
51
51
  /**
52
52
  * Style properties of top, bottom, left and right border
53
+ *
54
+ * TLBR = 'tlbr', //START_TOP_LEFT_END_BOTTOM_RIGHT
55
+ * TLBC = 'tlbc', // START_TOP_LEFT_END_BOTTOM_CENTER
56
+
57
+ * TLMR = 'tlmr', // START_TOP_LEFT_END_MIDDLE_RIGHT
58
+
59
+ * BLTR = 'bltr', // START_BOTTOM_LEFT_END_TOP_RIGHT
60
+
61
+ * MLTR = 'mltr', // START_MIDDLE_LEFT_END_TOP_RIGHT
62
+
63
+ * BCTR = 'bctr', // START_BOTTOM_CENTER_END_TOP_RIGHT
53
64
  */
54
65
  export interface IBorderData {
55
66
  t?: Nullable<IBorderStyleData>;
56
67
  r?: Nullable<IBorderStyleData>;
57
68
  b?: Nullable<IBorderStyleData>;
58
69
  l?: Nullable<IBorderStyleData>;
70
+ tl_br?: Nullable<IBorderStyleData>;
71
+ tl_bc?: Nullable<IBorderStyleData>;
72
+ tl_mr?: Nullable<IBorderStyleData>;
73
+ bl_tr?: Nullable<IBorderStyleData>;
74
+ ml_tr?: Nullable<IBorderStyleData>;
75
+ bc_tr?: Nullable<IBorderStyleData>;
59
76
  }
60
77
  export interface ITextRotation {
61
78
  /**
@@ -22,12 +22,21 @@ import type { IWorksheetData } from './i-worksheet-data';
22
22
  * Properties of a workbook's configuration
23
23
  */
24
24
  export interface IWorkbookData extends IExtraModelData {
25
- /** unit id */
25
+ /**
26
+ * unit id
27
+ */
26
28
  id: string;
27
- /** Revision of this document. Would be used in collaborated editing. Starts from one. */
29
+ /**
30
+ * Revision of this spreadsheet. Would be used in collaborated editing. Starts from one.
31
+ */
28
32
  rev?: number;
33
+ /**
34
+ * Name of the spreadsheet.
35
+ */
29
36
  name: string;
30
- /** Version of Univer model definition. */
37
+ /**
38
+ * Version of Univer model definition.
39
+ */
31
40
  appVersion: string;
32
41
  locale: LocaleType;
33
42
  /** Style reference. */