@univerjs/sheets-source-binding 0.5.5-nightly.202501210604 → 0.5.5-nightly.202501210734
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/es/facade.js +7 -4
- package/lib/types/controllers/binding-manager.d.ts +1 -2
- package/lib/types/facade/f-workbook.d.ts +3 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/source-binding-service.d.ts +45 -0
- package/lib/umd/facade.js +1 -1
- package/package.json +3 -3
package/lib/cjs/facade.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";const d=require("@univerjs/core"),n=require("@univerjs/sheets-source-binding"),c=require("@univerjs/sheets/facade");class S extends d.FEnum{get DataBindingNodeTypeEnum(){return n.DataBindingNodeTypeEnum}get BindModeEnum(){return n.BindModeEnum}}d.FEnum.extend(S);class u extends c.FWorkbook{createSource(e,t,i){return this._injector.get(n.SheetsSourceBindService).createSource(this.getId(),e,t,i)}getSource(e){return this._injector.get(n.SheetsSourceBindService).getSource(this.getId(),e)}setSourceData(e,t){this._injector.get(n.SheetsSourceManager).updateSourceData(this.getId(),e,t)}usePathMode(){this._injector.get(n.SheetsSourceBindService).usePathMode()}useValueMode(){this._injector.get(n.SheetsSourceBindService).useValueMode()}loadSourceBindingPathInfo(e){this._injector.get(n.SheetsSourceBindService).loadSourceBindingPathInfo(this.getId(),e)}saveSourceBindingPathInfo(){return this._injector.get(n.SheetsSourceBindService).getSourceBindingPathInfo(this.getId())}}c.FWorkbook.extend(u);class h extends c.FWorksheet{setBindingNode(e){const i=this._injector.get(n.SheetsSourceBindService),o=this._workbook.getUnitId();i.setBindingNode(o,this.getSheetId(),e)}removeBindingNode(e,t){const o=this._injector.get(n.SheetsSourceBindService),r=this._workbook.getUnitId();o.removeBindingNode(r,this.getSheetId(),e,t)}getBindingNode(e,t){const o=this._injector.get(n.SheetsSourceBindService),r=this._workbook.getUnitId();return o.getBindingNode(r,this.getSheetId(),e,t)}}c.FWorksheet.extend(h);
|
1
|
+
"use strict";const d=require("@univerjs/core"),n=require("@univerjs/sheets-source-binding"),c=require("@univerjs/sheets/facade");class S extends d.FEnum{get DataBindingNodeTypeEnum(){return n.DataBindingNodeTypeEnum}get BindModeEnum(){return n.BindModeEnum}}d.FEnum.extend(S);class u extends c.FWorkbook{createSource(e,t,i){return this._injector.get(n.SheetsSourceBindService).createSource(this.getId(),e,t,i)}getSource(e){return this._injector.get(n.SheetsSourceBindService).getSource(this.getId(),e)}setSourceData(e,t){this._injector.get(n.SheetsSourceManager).updateSourceData(this.getId(),e,t)}usePathMode(){this._injector.get(n.SheetsSourceBindService).usePathMode()}useValueMode(){this._injector.get(n.SheetsSourceBindService).useValueMode()}loadSourceBindingPathInfo(e){this._injector.get(n.SheetsSourceBindService).loadSourceBindingPathInfo(this.getId(),e)}saveSourceBindingPathInfo(){return this._injector.get(n.SheetsSourceBindService).getSourceBindingPathInfo(this.getId())}getBindingModelBySourceId(e){return this._injector.get(n.SheetsSourceBindService).getBindingModelBySourceId(e)}}c.FWorkbook.extend(u);class h extends c.FWorksheet{setBindingNode(e){const i=this._injector.get(n.SheetsSourceBindService),o=this._workbook.getUnitId();i.setBindingNode(o,this.getSheetId(),e)}removeBindingNode(e,t){const o=this._injector.get(n.SheetsSourceBindService),r=this._workbook.getUnitId();o.removeBindingNode(r,this.getSheetId(),e,t)}getBindingNode(e,t){const o=this._injector.get(n.SheetsSourceBindService),r=this._workbook.getUnitId();return o.getBindingNode(r,this.getSheetId(),e,t)}}c.FWorksheet.extend(h);
|
package/lib/es/facade.js
CHANGED
@@ -10,7 +10,7 @@ class B extends s {
|
|
10
10
|
}
|
11
11
|
}
|
12
12
|
s.extend(B);
|
13
|
-
class
|
13
|
+
class j extends d {
|
14
14
|
createSource(e, t, o) {
|
15
15
|
return this._injector.get(n).createSource(this.getId(), e, t, o);
|
16
16
|
}
|
@@ -32,9 +32,12 @@ class a extends d {
|
|
32
32
|
saveSourceBindingPathInfo() {
|
33
33
|
return this._injector.get(n).getSourceBindingPathInfo(this.getId());
|
34
34
|
}
|
35
|
+
getBindingModelBySourceId(e) {
|
36
|
+
return this._injector.get(n).getBindingModelBySourceId(e);
|
37
|
+
}
|
35
38
|
}
|
36
|
-
d.extend(
|
37
|
-
class
|
39
|
+
d.extend(j);
|
40
|
+
class a extends u {
|
38
41
|
setBindingNode(e) {
|
39
42
|
const o = this._injector.get(n), i = this._workbook.getUnitId();
|
40
43
|
o.setBindingNode(i, this.getSheetId(), e);
|
@@ -48,4 +51,4 @@ class j extends u {
|
|
48
51
|
return i.getBindingNode(r, this.getSheetId(), e, t);
|
49
52
|
}
|
50
53
|
}
|
51
|
-
u.extend(
|
54
|
+
u.extend(a);
|
@@ -2,7 +2,7 @@ import { ICellBindingJSON, ICellBindingNode, ICellBindingNodeParam, BindingSourc
|
|
2
2
|
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
3
3
|
import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
|
4
4
|
import { SheetBindingModel } from '../model/binding-model';
|
5
|
-
interface IBindingNodeInfo {
|
5
|
+
export interface IBindingNodeInfo {
|
6
6
|
unitId: string;
|
7
7
|
subunitId: string;
|
8
8
|
sourceId: string;
|
@@ -36,4 +36,3 @@ export declare class SheetsBindingManager extends Disposable {
|
|
36
36
|
fromJSON(unitId: string, json: ICellBindingJSON): void;
|
37
37
|
dispose(): void;
|
38
38
|
}
|
39
|
-
export {};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DataBindingNodeTypeEnum, ISourceBindingInfo, SourceModelBase } from '@univerjs/sheets-source-binding';
|
1
|
+
import { DataBindingNodeTypeEnum, IBindingNodeInfo, ISourceBindingInfo, SourceModelBase } from '@univerjs/sheets-source-binding';
|
2
2
|
import { FWorkbook } from '@univerjs/sheets/facade';
|
3
3
|
export interface IFWorkbookSourceBindingMixin {
|
4
4
|
/**
|
@@ -44,6 +44,7 @@ export interface IFWorkbookSourceBindingMixin {
|
|
44
44
|
setSourceData(sourceId: string, data: any): void;
|
45
45
|
loadSourceBindingPathInfo(obj: ISourceBindingInfo): void;
|
46
46
|
saveSourceBindingPathInfo(): ISourceBindingInfo;
|
47
|
+
getBindingModelBySourceId(sourceId: string): IBindingNodeInfo[];
|
47
48
|
}
|
48
49
|
export declare class FWorkbookSourceBinding extends FWorkbook implements IFWorkbookSourceBindingMixin {
|
49
50
|
createSource(type: DataBindingNodeTypeEnum, isListObject?: boolean, id?: string | undefined): SourceModelBase;
|
@@ -53,6 +54,7 @@ export declare class FWorkbookSourceBinding extends FWorkbook implements IFWorkb
|
|
53
54
|
useValueMode(): void;
|
54
55
|
loadSourceBindingPathInfo(obj: ISourceBindingInfo): void;
|
55
56
|
saveSourceBindingPathInfo(): ISourceBindingInfo;
|
57
|
+
getBindingModelBySourceId(sourceId: string): IBindingNodeInfo[];
|
56
58
|
}
|
57
59
|
declare module '@univerjs/sheets/facade' {
|
58
60
|
interface FWorkbook extends IFWorkbookSourceBindingMixin {
|
package/lib/types/index.d.ts
CHANGED
@@ -20,3 +20,4 @@ export { BindModeEnum, DataBindingNodeTypeEnum } from './types';
|
|
20
20
|
export { SheetsSourceBindService } from './services/source-binding-service';
|
21
21
|
export { SheetsSourceManager } from './controllers/source-manager';
|
22
22
|
export type { ICellBindingNode, ICellBindingNodeParam, ISourceBindingInfo } from './types';
|
23
|
+
export type { IBindingNodeInfo } from './controllers/binding-manager';
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { ICellBindingNodeParam, ISourceBindingInfo, BindModeEnum, DataBindingNodeTypeEnum } from '../types';
|
2
|
+
import { Disposable } from '@univerjs/core';
|
3
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
4
|
+
import { SheetsBindingManager } from '../controllers/binding-manager';
|
5
|
+
import { SheetsSourceManager } from '../controllers/source-manager';
|
6
|
+
export declare class SheetsSourceBindService extends Disposable {
|
7
|
+
private _sheetInterceptorService;
|
8
|
+
private _sheetsBindingManager;
|
9
|
+
private _sheetsSourceManager;
|
10
|
+
private _bindingModel;
|
11
|
+
private _bindModelRTreeCollection;
|
12
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _sheetsBindingManager: SheetsBindingManager, _sheetsSourceManager: SheetsSourceManager);
|
13
|
+
/**
|
14
|
+
* Set the binding model to path mode, in this mode, the binding path will show in the cell.
|
15
|
+
*/
|
16
|
+
usePathMode(): void;
|
17
|
+
/**
|
18
|
+
* Set the binding model to value mode, in this mode, the value of source will show in the cell.
|
19
|
+
*/
|
20
|
+
useValueMode(): void;
|
21
|
+
/**
|
22
|
+
* Get the current binding model.
|
23
|
+
* @returns the current binding model
|
24
|
+
*/
|
25
|
+
getBindingModel(): BindModeEnum;
|
26
|
+
createBindModel(unitId: string, subUnitId: string): import('..').BindingModel;
|
27
|
+
setBindingNode(unitId: string, subUnitId: string, node: ICellBindingNodeParam): void;
|
28
|
+
removeBindingNode(unitId: string, subUnitId: string, row: number, column: number): void;
|
29
|
+
getBindingNode(unitId: string, subUnitId: string, row: number, column: number): import('..').ICellBindingNode | undefined;
|
30
|
+
getSource(unitId: string, id: string): import('..').SourceModelBase | undefined;
|
31
|
+
createSource(unitId: string, type: DataBindingNodeTypeEnum, isListObject?: boolean, id?: string): import('..').SourceModelBase;
|
32
|
+
getSourceBindingPathInfo(unitId: string): {
|
33
|
+
source: import('../types').ISourceJSON[];
|
34
|
+
cellBinding: import('../types').ICellBindingJSON;
|
35
|
+
};
|
36
|
+
loadSourceBindingPathInfo(unitId: string, obj: ISourceBindingInfo): void;
|
37
|
+
private _ensureRTreeCollection;
|
38
|
+
private _getRTeeCollection;
|
39
|
+
private _registerSourceChange;
|
40
|
+
private _getPathModeCellValue;
|
41
|
+
private _getValueModeCellValue;
|
42
|
+
getBindingModelBySourceId(sourceId: string): import('..').IBindingNodeInfo[];
|
43
|
+
private _registerInterceptor;
|
44
|
+
dispose(): void;
|
45
|
+
}
|
package/lib/umd/facade.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(o,t){typeof exports=="object"&&typeof module<"u"?t(require("@univerjs/core"),require("@univerjs/sheets-source-binding"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/sheets-source-binding","@univerjs/sheets/facade"],t):(o=typeof globalThis<"u"?globalThis:o||self,t(o.UniverCore,o.UniverSheetsSourceBinding,o.UniverSheetsFacade))})(this,function(o,t,c){"use strict";class S extends o.FEnum{get DataBindingNodeTypeEnum(){return t.DataBindingNodeTypeEnum}get BindModeEnum(){return t.BindModeEnum}}o.FEnum.extend(S);class u extends c.FWorkbook{createSource(e,n,i){return this._injector.get(t.SheetsSourceBindService).createSource(this.getId(),e,n,i)}getSource(e){return this._injector.get(t.SheetsSourceBindService).getSource(this.getId(),e)}setSourceData(e,n){this._injector.get(t.SheetsSourceManager).updateSourceData(this.getId(),e,n)}usePathMode(){this._injector.get(t.SheetsSourceBindService).usePathMode()}useValueMode(){this._injector.get(t.SheetsSourceBindService).useValueMode()}loadSourceBindingPathInfo(e){this._injector.get(t.SheetsSourceBindService).loadSourceBindingPathInfo(this.getId(),e)}saveSourceBindingPathInfo(){return this._injector.get(t.SheetsSourceBindService).getSourceBindingPathInfo(this.getId())}getBindingModelBySourceId(e){return this._injector.get(t.SheetsSourceBindService).getBindingModelBySourceId(e)}}c.FWorkbook.extend(u);class h extends c.FWorksheet{setBindingNode(e){const i=this._injector.get(t.SheetsSourceBindService),r=this._workbook.getUnitId();i.setBindingNode(r,this.getSheetId(),e)}removeBindingNode(e,n){const r=this._injector.get(t.SheetsSourceBindService),s=this._workbook.getUnitId();r.removeBindingNode(s,this.getSheetId(),e,n)}getBindingNode(e,n){const r=this._injector.get(t.SheetsSourceBindService),s=this._workbook.getUnitId();return r.getBindingNode(s,this.getSheetId(),e,n)}}c.FWorksheet.extend(h)});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@univerjs/sheets-source-binding",
|
3
|
-
"version": "0.5.5-nightly.
|
3
|
+
"version": "0.5.5-nightly.202501210734",
|
4
4
|
"private": false,
|
5
5
|
"description": "A library for connect and bind data from other sources to Univer Sheets",
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
@@ -51,8 +51,8 @@
|
|
51
51
|
"rxjs": ">=7.0.0"
|
52
52
|
},
|
53
53
|
"dependencies": {
|
54
|
-
"@univerjs/
|
55
|
-
"@univerjs/
|
54
|
+
"@univerjs/sheets": "0.5.5-nightly.202501210734",
|
55
|
+
"@univerjs/core": "0.5.5-nightly.202501210734"
|
56
56
|
},
|
57
57
|
"devDependencies": {
|
58
58
|
"rxjs": "^7.8.1",
|