@univerjs/sheets 0.4.0 → 0.4.1-experimental.20241023-bbb123f
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/es/index.js +149 -71
- package/lib/types/commands/commands/set-style.command.d.ts +1 -1
- package/lib/types/commands/mutations/add-range-protection.mutation.d.ts +2 -2
- package/lib/types/commands/mutations/delete-range-protection.mutation.d.ts +3 -3
- package/lib/types/commands/mutations/set-frozen.mutation.d.ts +8 -0
- package/lib/types/index.d.ts +7 -2
- package/lib/types/model/range-protection.cache.d.ts +5 -2
- package/lib/types/services/permission/permission-point/index.d.ts +2 -0
- package/lib/types/services/permission/permission-point/range/delete-protection.d.ts +13 -0
- package/lib/types/services/permission/permission-point/range/manage-collaborator.d.ts +13 -0
- package/lib/types/services/permission/permission-point/workbook/create-permission.d.ts +11 -0
- package/lib/types/services/permission/permission-point/worksheet/delete-protection.d.ts +12 -0
- package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +3 -3
- package/lib/types/services/permission/range-permission/range-protection.service.d.ts +3 -2
- package/lib/types/services/permission/range-permission/util.d.ts +1 -0
- package/lib/types/services/permission/type.d.ts +1 -1
- package/lib/types/services/permission/workbook-permission/workbook-permission.service.d.ts +4 -1
- package/lib/types/services/permission/worksheet-permission/utils.d.ts +2 -2
- package/lib/types/services/selections/selection-manager.service.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1265,7 +1265,7 @@ function getMoveRangeUndoRedoMutations(accessor, from, to, ignoreMerge = !1) {
|
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
1267
1267
|
__name(getMoveRangeUndoRedoMutations, "getMoveRangeUndoRedoMutations");
|
|
1268
|
-
var R = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNIVER_PROJECT = 4] = "UNIVER_PROJECT", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(R || {}), D = /* @__PURE__ */ ((E) => (E[E.View = 0] = "View", E[E.Edit = 1] = "Edit", E[E.ManageCollaborator = 2] = "ManageCollaborator", E[E.Print = 3] = "Print", E[E.Duplicate = 4] = "Duplicate", E[E.Comment = 5] = "Comment", E[E.Copy = 6] = "Copy", E[E.Share = 7] = "Share", E[E.Export = 8] = "Export", E[E.MoveWorksheet = 9] = "MoveWorksheet", E[E.DeleteWorksheet = 10] = "DeleteWorksheet", E[E.HideWorksheet = 11] = "HideWorksheet", E[E.RenameWorksheet = 12] = "RenameWorksheet", E[E.CreateWorksheet = 13] = "CreateWorksheet", E[E.SetWorksheetStyle = 14] = "SetWorksheetStyle", E[E.EditWorksheetCell = 15] = "EditWorksheetCell", E[E.InsertHyperlink = 16] = "InsertHyperlink", E[E.Sort = 17] = "Sort", E[E.Filter = 18] = "Filter", E[E.PivotTable = 19] = "PivotTable", E[E.FloatImg = 20] = "FloatImg", E[E.History = 21] = "History", E[E.RwHgtClWdt = 22] = "RwHgtClWdt", E[E.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", E[E.ViewFilter = 24] = "ViewFilter", E[E.MoveSheet = 25] = "MoveSheet", E[E.DeleteSheet = 26] = "DeleteSheet", E[E.HideSheet = 27] = "HideSheet", E[E.CopySheet = 28] = "CopySheet", E[E.RenameSheet = 29] = "RenameSheet", E[E.CreateSheet = 30] = "CreateSheet", E[E.SelectProtectedCells = 31] = "SelectProtectedCells", E[E.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", E[E.SetCellStyle = 33] = "SetCellStyle", E[E.SetCellValue = 34] = "SetCellValue", E[E.SetRowStyle = 35] = "SetRowStyle", E[E.SetColumnStyle = 36] = "SetColumnStyle", E[E.InsertRow = 37] = "InsertRow", E[E.InsertColumn = 38] = "InsertColumn", E[E.DeleteRow = 39] = "DeleteRow", E[E.DeleteColumn = 40] = "DeleteColumn", E[E.EditExtraObject = 41] = "EditExtraObject", E[E.Delete = 42] = "Delete", E[E.RecoverHistory = 43] = "RecoverHistory", E[E.ViewHistory = 44] = "ViewHistory", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(D || {}), L = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(L || {});
|
|
1268
|
+
var R = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNIVER_PROJECT = 4] = "UNIVER_PROJECT", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(R || {}), D = /* @__PURE__ */ ((E) => (E[E.View = 0] = "View", E[E.Edit = 1] = "Edit", E[E.ManageCollaborator = 2] = "ManageCollaborator", E[E.Print = 3] = "Print", E[E.Duplicate = 4] = "Duplicate", E[E.Comment = 5] = "Comment", E[E.Copy = 6] = "Copy", E[E.Share = 7] = "Share", E[E.Export = 8] = "Export", E[E.MoveWorksheet = 9] = "MoveWorksheet", E[E.DeleteWorksheet = 10] = "DeleteWorksheet", E[E.HideWorksheet = 11] = "HideWorksheet", E[E.RenameWorksheet = 12] = "RenameWorksheet", E[E.CreateWorksheet = 13] = "CreateWorksheet", E[E.SetWorksheetStyle = 14] = "SetWorksheetStyle", E[E.EditWorksheetCell = 15] = "EditWorksheetCell", E[E.InsertHyperlink = 16] = "InsertHyperlink", E[E.Sort = 17] = "Sort", E[E.Filter = 18] = "Filter", E[E.PivotTable = 19] = "PivotTable", E[E.FloatImg = 20] = "FloatImg", E[E.History = 21] = "History", E[E.RwHgtClWdt = 22] = "RwHgtClWdt", E[E.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", E[E.ViewFilter = 24] = "ViewFilter", E[E.MoveSheet = 25] = "MoveSheet", E[E.DeleteSheet = 26] = "DeleteSheet", E[E.HideSheet = 27] = "HideSheet", E[E.CopySheet = 28] = "CopySheet", E[E.RenameSheet = 29] = "RenameSheet", E[E.CreateSheet = 30] = "CreateSheet", E[E.SelectProtectedCells = 31] = "SelectProtectedCells", E[E.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", E[E.SetCellStyle = 33] = "SetCellStyle", E[E.SetCellValue = 34] = "SetCellValue", E[E.SetRowStyle = 35] = "SetRowStyle", E[E.SetColumnStyle = 36] = "SetColumnStyle", E[E.InsertRow = 37] = "InsertRow", E[E.InsertColumn = 38] = "InsertColumn", E[E.DeleteRow = 39] = "DeleteRow", E[E.DeleteColumn = 40] = "DeleteColumn", E[E.EditExtraObject = 41] = "EditExtraObject", E[E.Delete = 42] = "Delete", E[E.RecoverHistory = 43] = "RecoverHistory", E[E.ViewHistory = 44] = "ViewHistory", E[E.CreatePermissionObject = 45] = "CreatePermissionObject", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(D || {}), L = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(L || {});
|
|
1269
1269
|
const _RangeProtectionPermissionEditPoint = class _RangeProtectionPermissionEditPoint {
|
|
1270
1270
|
constructor(unitId, subUnitId, permissionId) {
|
|
1271
1271
|
__publicField(this, "type", L.SelectRange);
|
|
@@ -1332,6 +1332,18 @@ const _WorkbookCopySheetPermission = class _WorkbookCopySheetPermission {
|
|
|
1332
1332
|
};
|
|
1333
1333
|
__name(_WorkbookCopySheetPermission, "WorkbookCopySheetPermission");
|
|
1334
1334
|
let WorkbookCopySheetPermission = _WorkbookCopySheetPermission;
|
|
1335
|
+
const _WorkbookCreateProtectPermission = class _WorkbookCreateProtectPermission {
|
|
1336
|
+
constructor(unitId) {
|
|
1337
|
+
__publicField(this, "id");
|
|
1338
|
+
__publicField(this, "value", !0);
|
|
1339
|
+
__publicField(this, "type", L.Workbook);
|
|
1340
|
+
__publicField(this, "status", PermissionStatus.INIT);
|
|
1341
|
+
__publicField(this, "subType", D.CreatePermissionObject);
|
|
1342
|
+
this.unitId = unitId, this.unitId = unitId, this.id = `${this.type}.${D.CreatePermissionObject}_${unitId}`;
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
__name(_WorkbookCreateProtectPermission, "WorkbookCreateProtectPermission");
|
|
1346
|
+
let WorkbookCreateProtectPermission = _WorkbookCreateProtectPermission;
|
|
1335
1347
|
const _WorkbookCreateSheetPermission = class _WorkbookCreateSheetPermission {
|
|
1336
1348
|
constructor(unitId) {
|
|
1337
1349
|
__publicField(this, "id");
|
|
@@ -1536,6 +1548,18 @@ const _WorksheetDeleteColumnPermission = class _WorksheetDeleteColumnPermission
|
|
|
1536
1548
|
};
|
|
1537
1549
|
__name(_WorksheetDeleteColumnPermission, "WorksheetDeleteColumnPermission");
|
|
1538
1550
|
let WorksheetDeleteColumnPermission = _WorksheetDeleteColumnPermission;
|
|
1551
|
+
const _WorksheetDeleteProtectionPermission = class _WorksheetDeleteProtectionPermission {
|
|
1552
|
+
constructor(unitId, subUnitId) {
|
|
1553
|
+
__publicField(this, "value", !0);
|
|
1554
|
+
__publicField(this, "type", L.Worksheet);
|
|
1555
|
+
__publicField(this, "status", PermissionStatus.INIT);
|
|
1556
|
+
__publicField(this, "id");
|
|
1557
|
+
__publicField(this, "subType", D.Delete);
|
|
1558
|
+
this.unitId = unitId, this.subUnitId = subUnitId, this.id = `${this.type}.${D.Delete}_${unitId}_${subUnitId}`;
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
__name(_WorksheetDeleteProtectionPermission, "WorksheetDeleteProtectionPermission");
|
|
1562
|
+
let WorksheetDeleteProtectionPermission = _WorksheetDeleteProtectionPermission;
|
|
1539
1563
|
const _WorksheetDeleteRowPermission = class _WorksheetDeleteRowPermission {
|
|
1540
1564
|
constructor(unitId, subUnitId) {
|
|
1541
1565
|
__publicField(this, "value", !0);
|
|
@@ -4682,9 +4706,82 @@ const SetStyleCommand = {
|
|
|
4682
4706
|
redoMutations: [{ id: SetWorksheetOrderMutation.id, params: setWorksheetOrderMutationParams }]
|
|
4683
4707
|
}), !0) : !1;
|
|
4684
4708
|
}, "handler")
|
|
4685
|
-
},
|
|
4709
|
+
}, _RangeProtectionPermissionDeleteProtectionPoint = class _RangeProtectionPermissionDeleteProtectionPoint {
|
|
4710
|
+
constructor(unitId, subUnitId, permissionId) {
|
|
4711
|
+
__publicField(this, "type", L.SelectRange);
|
|
4712
|
+
__publicField(this, "subType", D.Delete);
|
|
4713
|
+
__publicField(this, "status", PermissionStatus.INIT);
|
|
4714
|
+
__publicField(this, "value", !0);
|
|
4715
|
+
__publicField(this, "id");
|
|
4716
|
+
__publicField(this, "unitId");
|
|
4717
|
+
__publicField(this, "subUnitId");
|
|
4718
|
+
__publicField(this, "permissionId");
|
|
4719
|
+
this.unitId = unitId, this.subUnitId = subUnitId, this.permissionId = permissionId, this.id = `${L.SelectRange}.${D.Delete}.${permissionId}`;
|
|
4720
|
+
}
|
|
4721
|
+
};
|
|
4722
|
+
__name(_RangeProtectionPermissionDeleteProtectionPoint, "RangeProtectionPermissionDeleteProtectionPoint");
|
|
4723
|
+
let RangeProtectionPermissionDeleteProtectionPoint = _RangeProtectionPermissionDeleteProtectionPoint;
|
|
4724
|
+
const _RangeProtectionPermissionManageCollaPoint = class _RangeProtectionPermissionManageCollaPoint {
|
|
4725
|
+
constructor(unitId, subUnitId, permissionId) {
|
|
4726
|
+
__publicField(this, "type", L.SelectRange);
|
|
4727
|
+
__publicField(this, "subType", D.ManageCollaborator);
|
|
4728
|
+
__publicField(this, "status", PermissionStatus.INIT);
|
|
4729
|
+
__publicField(this, "value", !0);
|
|
4730
|
+
__publicField(this, "id");
|
|
4731
|
+
__publicField(this, "unitId");
|
|
4732
|
+
__publicField(this, "subUnitId");
|
|
4733
|
+
__publicField(this, "permissionId");
|
|
4734
|
+
this.unitId = unitId, this.subUnitId = subUnitId, this.permissionId = permissionId, this.id = `${L.SelectRange}.${D.ManageCollaborator}.${permissionId}`;
|
|
4735
|
+
}
|
|
4736
|
+
};
|
|
4737
|
+
__name(_RangeProtectionPermissionManageCollaPoint, "RangeProtectionPermissionManageCollaPoint");
|
|
4738
|
+
let RangeProtectionPermissionManageCollaPoint = _RangeProtectionPermissionManageCollaPoint;
|
|
4739
|
+
const getAllRangePermissionPoint = /* @__PURE__ */ __name(() => [RangeProtectionPermissionViewPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionDeleteProtectionPoint], "getAllRangePermissionPoint"), baseProtectionActions = [D.Edit, D.View, D.ManageCollaborator, D.Delete], getDefaultRangePermission = /* @__PURE__ */ __name((unitId = "unitId", subUnitId = "subUnitId", permissionId = "permissionId") => getAllRangePermissionPoint().reduce((r, F) => {
|
|
4740
|
+
const i = new F(unitId, subUnitId, permissionId);
|
|
4741
|
+
return r[i.subType] = i.value, r;
|
|
4742
|
+
}, {}), "getDefaultRangePermission"), getAllWorkbookPermissionPoint = /* @__PURE__ */ __name(() => [
|
|
4743
|
+
WorkbookEditablePermission,
|
|
4744
|
+
WorkbookPrintPermission,
|
|
4745
|
+
WorkbookCommentPermission,
|
|
4746
|
+
WorkbookViewPermission,
|
|
4747
|
+
WorkbookCopyPermission,
|
|
4748
|
+
WorkbookExportPermission,
|
|
4749
|
+
WorkbookManageCollaboratorPermission,
|
|
4750
|
+
WorkbookCreateSheetPermission,
|
|
4751
|
+
WorkbookDeleteSheetPermission,
|
|
4752
|
+
WorkbookRenameSheetPermission,
|
|
4753
|
+
WorkbookHideSheetPermission,
|
|
4754
|
+
WorkbookDuplicatePermission,
|
|
4755
|
+
WorkbookSharePermission,
|
|
4756
|
+
WorkbookMoveSheetPermission,
|
|
4757
|
+
WorkbookCopySheetPermission,
|
|
4758
|
+
WorkbookViewHistoryPermission,
|
|
4759
|
+
WorkbookRecoverHistoryPermission,
|
|
4760
|
+
WorkbookCreateProtectPermission
|
|
4761
|
+
], "getAllWorkbookPermissionPoint"), defaultWorkbookPermissionPoints = [
|
|
4762
|
+
D.Edit,
|
|
4763
|
+
D.Print,
|
|
4764
|
+
D.Comment,
|
|
4765
|
+
D.View,
|
|
4766
|
+
D.Copy,
|
|
4767
|
+
D.Export,
|
|
4768
|
+
D.ManageCollaborator,
|
|
4769
|
+
D.CreateSheet,
|
|
4770
|
+
D.DeleteSheet,
|
|
4771
|
+
D.RenameSheet,
|
|
4772
|
+
D.HideSheet,
|
|
4773
|
+
D.Duplicate,
|
|
4774
|
+
D.Share,
|
|
4775
|
+
D.MoveSheet,
|
|
4776
|
+
D.CopySheet,
|
|
4777
|
+
D.RecoverHistory,
|
|
4778
|
+
D.ViewHistory,
|
|
4779
|
+
D.CreatePermissionObject
|
|
4780
|
+
], getAllWorksheetPermissionPoint = /* @__PURE__ */ __name(() => [
|
|
4686
4781
|
WorksheetEditPermission,
|
|
4687
|
-
WorksheetViewPermission
|
|
4782
|
+
WorksheetViewPermission,
|
|
4783
|
+
WorksheetManageCollaboratorPermission,
|
|
4784
|
+
WorksheetDeleteProtectionPermission
|
|
4688
4785
|
], "getAllWorksheetPermissionPoint"), getAllWorksheetPermissionPointByPointPanel = /* @__PURE__ */ __name(() => [
|
|
4689
4786
|
WorksheetCopyPermission,
|
|
4690
4787
|
WorksheetDeleteColumnPermission,
|
|
@@ -4883,7 +4980,7 @@ let WorksheetPermissionService = (_a4 = class extends RxDisposable {
|
|
|
4883
4980
|
}), workbook.sheetDisposed$.subscribe((worksheet) => {
|
|
4884
4981
|
const subUnitId = worksheet.getSheetId();
|
|
4885
4982
|
this._rangeProtectionRuleModel.getSubunitRuleList(unitId, subUnitId).forEach((rule) => {
|
|
4886
|
-
[
|
|
4983
|
+
[...getAllRangePermissionPoint()].forEach((F) => {
|
|
4887
4984
|
const instance = new F(unitId, subUnitId, rule.permissionId);
|
|
4888
4985
|
this._permissionService.deletePermissionPoint(instance.id);
|
|
4889
4986
|
});
|
|
@@ -4957,7 +5054,17 @@ let WorksheetPermissionService = (_a4 = class extends RxDisposable {
|
|
|
4957
5054
|
}), this._worksheetProtectionRuleModel.changeRuleInitState(!0);
|
|
4958
5055
|
}, "onLoad"),
|
|
4959
5056
|
onUnLoad: /* @__PURE__ */ __name((unitId) => {
|
|
4960
|
-
this.
|
|
5057
|
+
const workbook = this._univerInstanceService.getUnit(unitId);
|
|
5058
|
+
workbook && (workbook.getSheets().forEach((worksheet) => {
|
|
5059
|
+
const subUnitId = worksheet.getSheetId();
|
|
5060
|
+
[...getAllWorksheetPermissionPoint(), ...getAllWorksheetPermissionPointByPointPanel()].forEach((F) => {
|
|
5061
|
+
const instance = new F(unitId, subUnitId);
|
|
5062
|
+
this._permissionService.deletePermissionPoint(instance.id);
|
|
5063
|
+
});
|
|
5064
|
+
}), getAllWorkbookPermissionPoint().forEach((F) => {
|
|
5065
|
+
const instance = new F(unitId);
|
|
5066
|
+
this._permissionService.deletePermissionPoint(instance.id);
|
|
5067
|
+
})), this._worksheetProtectionRuleModel.deleteUnitModel(unitId);
|
|
4961
5068
|
}, "onUnLoad")
|
|
4962
5069
|
})
|
|
4963
5070
|
);
|
|
@@ -7768,15 +7875,23 @@ let RangeProtectionCache = (_a11 = class extends Disposable {
|
|
|
7768
7875
|
cellMap.delete(`${i}-${j}`), cellInfoMap.delete(`${i}-${j}`);
|
|
7769
7876
|
}), this._permissionIdCache.delete(rule.permissionId);
|
|
7770
7877
|
}
|
|
7878
|
+
_getSelectionActions(unitId, subUnitId, rule) {
|
|
7879
|
+
var _a18, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
7880
|
+
const edit = (_c = (_b = this._permissionService.getPermissionPoint((_a18 = new RangeProtectionPermissionEditPoint(unitId, subUnitId, rule.permissionId)) == null ? void 0 : _a18.id)) == null ? void 0 : _b.value) != null ? _c : !0, view = (_f = (_e = this._permissionService.getPermissionPoint((_d = new RangeProtectionPermissionViewPoint(unitId, subUnitId, rule.permissionId)) == null ? void 0 : _d.id)) == null ? void 0 : _e.value) != null ? _f : !0, manageProtection = (_i = (_h = this._permissionService.getPermissionPoint((_g = new RangeProtectionPermissionManageCollaPoint(unitId, subUnitId, rule.permissionId)) == null ? void 0 : _g.id)) == null ? void 0 : _h.value) != null ? _i : !1, deleteProtection = (_l = (_k = this._permissionService.getPermissionPoint((_j = new RangeProtectionPermissionDeleteProtectionPoint(unitId, subUnitId, rule.permissionId)) == null ? void 0 : _j.id)) == null ? void 0 : _k.value) != null ? _l : !1;
|
|
7881
|
+
return {
|
|
7882
|
+
[D.Edit]: edit,
|
|
7883
|
+
[D.View]: view,
|
|
7884
|
+
[D.ManageCollaborator]: manageProtection,
|
|
7885
|
+
[D.Delete]: deleteProtection
|
|
7886
|
+
};
|
|
7887
|
+
}
|
|
7771
7888
|
reBuildCache(unitId, subUnitId) {
|
|
7772
7889
|
const cellRuleMap = this._ensureRuleMap(unitId, subUnitId), cellInfoMap = this._ensureCellInfoMap(unitId, subUnitId);
|
|
7773
7890
|
cellRuleMap.clear(), cellInfoMap.clear();
|
|
7774
7891
|
const rowInfoMap = this._ensureRowColInfoMap(unitId, subUnitId, "row"), colInfoMap = this._ensureRowColInfoMap(unitId, subUnitId, "col");
|
|
7775
7892
|
rowInfoMap.clear(), colInfoMap.clear(), this._ruleModel.getSubunitRuleList(unitId, subUnitId).forEach((rule) => {
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
[D.Edit]: edit,
|
|
7779
|
-
[D.View]: view,
|
|
7893
|
+
const selectionActions = this._getSelectionActions(unitId, subUnitId, rule), selectionProtection = {
|
|
7894
|
+
...selectionActions,
|
|
7780
7895
|
ruleId: rule.id,
|
|
7781
7896
|
ranges: rule.ranges
|
|
7782
7897
|
};
|
|
@@ -7784,11 +7899,11 @@ let RangeProtectionCache = (_a11 = class extends Disposable {
|
|
|
7784
7899
|
const { startRow, endRow, startColumn, endColumn } = range;
|
|
7785
7900
|
for (let i = startRow; i <= endRow; i++) {
|
|
7786
7901
|
const rowInfo = rowInfoMap.get(`${i}`);
|
|
7787
|
-
rowInfo ? rowInfo.set(rule.id,
|
|
7902
|
+
rowInfo ? rowInfo.set(rule.id, selectionActions) : rowInfoMap.set(`${i}`, /* @__PURE__ */ new Map([[rule.id, selectionActions]]));
|
|
7788
7903
|
for (let j = startColumn; j <= endColumn; j++) {
|
|
7789
7904
|
cellRuleMap.set(`${i}-${j}`, rule.id), cellInfoMap.set(`${i}-${j}`, selectionProtection);
|
|
7790
7905
|
const colInfo = colInfoMap.get(`${j}`);
|
|
7791
|
-
colInfo ? colInfo.set(rule.id,
|
|
7906
|
+
colInfo ? colInfo.set(rule.id, selectionActions) : colInfoMap.set(`${j}`, /* @__PURE__ */ new Map([[rule.id, selectionActions]]));
|
|
7792
7907
|
}
|
|
7793
7908
|
}
|
|
7794
7909
|
}), this._permissionIdCache.set(rule.permissionId, rule.id);
|
|
@@ -7826,22 +7941,21 @@ let RangeProtectionCache = (_a11 = class extends Disposable {
|
|
|
7826
7941
|
map((permission) => permission)
|
|
7827
7942
|
).subscribe({
|
|
7828
7943
|
next: /* @__PURE__ */ __name((permission) => {
|
|
7829
|
-
var _a18, _b, _c, _d, _e, _f;
|
|
7830
7944
|
const { subUnitId, unitId, permissionId } = permission, ruleId = this._permissionIdCache.get(permissionId);
|
|
7831
7945
|
if (!ruleId)
|
|
7832
7946
|
return;
|
|
7833
7947
|
const ruleInstance = this._ruleModel.getRule(unitId, subUnitId, ruleId);
|
|
7834
7948
|
if (!ruleInstance)
|
|
7835
7949
|
return;
|
|
7836
|
-
const rowInfoMap = this._ensureRowColInfoMap(unitId, subUnitId, "row"), colInfoMap = this._ensureRowColInfoMap(unitId, subUnitId, "col"),
|
|
7950
|
+
const rowInfoMap = this._ensureRowColInfoMap(unitId, subUnitId, "row"), colInfoMap = this._ensureRowColInfoMap(unitId, subUnitId, "col"), selectionActions = this._getSelectionActions(unitId, subUnitId, ruleInstance);
|
|
7837
7951
|
ruleInstance.ranges.forEach((range) => {
|
|
7838
7952
|
const { startRow, endRow, startColumn, endColumn } = range;
|
|
7839
7953
|
for (let i = startRow; i <= endRow; i++) {
|
|
7840
7954
|
const rowInfo = rowInfoMap.get(`${i}`);
|
|
7841
|
-
rowInfo ? rowInfo.set(ruleId,
|
|
7955
|
+
rowInfo ? rowInfo.set(ruleId, selectionActions) : rowInfoMap.set(`${i}`, /* @__PURE__ */ new Map([[ruleId, selectionActions]]));
|
|
7842
7956
|
for (let j = startColumn; j <= endColumn; j++) {
|
|
7843
7957
|
const colInfo = colInfoMap.get(`${j}`);
|
|
7844
|
-
colInfo ? colInfo.set(ruleId,
|
|
7958
|
+
colInfo ? colInfo.set(ruleId, selectionActions) : colInfoMap.set(`${j}`, /* @__PURE__ */ new Map([[ruleId, selectionActions]]));
|
|
7845
7959
|
}
|
|
7846
7960
|
}
|
|
7847
7961
|
});
|
|
@@ -7864,20 +7978,17 @@ let RangeProtectionCache = (_a11 = class extends Disposable {
|
|
|
7864
7978
|
});
|
|
7865
7979
|
}
|
|
7866
7980
|
getCellInfo(unitId, subUnitId, row, col) {
|
|
7867
|
-
var _a18, _b
|
|
7981
|
+
var _a18, _b;
|
|
7868
7982
|
const cellMap = this._ensureCellInfoMap(unitId, subUnitId), cacheValue = cellMap.get(`${row}-${col}`);
|
|
7869
7983
|
if (cacheValue)
|
|
7870
7984
|
return cacheValue;
|
|
7871
|
-
let view = !0, edit = !0;
|
|
7872
7985
|
const ruleId = (_b = (_a18 = this._cellRuleCache.get(unitId)) == null ? void 0 : _a18.get(subUnitId)) == null ? void 0 : _b.get(`${row}-${col}`);
|
|
7873
7986
|
if (!ruleId)
|
|
7874
7987
|
return;
|
|
7875
7988
|
const rule = this._ruleModel.getRule(unitId, subUnitId, ruleId);
|
|
7876
7989
|
if (rule) {
|
|
7877
|
-
view = (_e = (_d = this._permissionService.getPermissionPoint((_c = new RangeProtectionPermissionViewPoint(unitId, subUnitId, rule.permissionId)) == null ? void 0 : _c.id)) == null ? void 0 : _d.value) != null ? _e : !0, edit = (_h = (_g = this._permissionService.getPermissionPoint((_f = new RangeProtectionPermissionEditPoint(unitId, subUnitId, rule.permissionId)) == null ? void 0 : _f.id)) == null ? void 0 : _g.value) != null ? _h : !0;
|
|
7878
7990
|
const selectionProtection = {
|
|
7879
|
-
|
|
7880
|
-
[D.View]: view,
|
|
7991
|
+
...this._getSelectionActions(unitId, subUnitId, rule),
|
|
7881
7992
|
ruleId,
|
|
7882
7993
|
ranges: rule.ranges
|
|
7883
7994
|
};
|
|
@@ -7900,10 +8011,6 @@ RangeProtectionCache = __decorateClass$6([
|
|
|
7900
8011
|
__decorateParam$6(1, Inject(IPermissionService)),
|
|
7901
8012
|
__decorateParam$6(2, Inject(IUniverInstanceService))
|
|
7902
8013
|
], RangeProtectionCache);
|
|
7903
|
-
const getAllRangePermissionPoint = /* @__PURE__ */ __name(() => [RangeProtectionPermissionViewPoint, RangeProtectionPermissionEditPoint], "getAllRangePermissionPoint"), getDefaultRangePermission = /* @__PURE__ */ __name((unitId = "unitId", subUnitId = "subUnitId", permissionId = "permissionId") => getAllRangePermissionPoint().reduce((r, F) => {
|
|
7904
|
-
const i = new F(unitId, subUnitId, permissionId);
|
|
7905
|
-
return r[i.subType] = i.value, r;
|
|
7906
|
-
}, {}), "getDefaultRangePermission");
|
|
7907
8014
|
var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
7908
8015
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7909
8016
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
@@ -8357,8 +8464,8 @@ var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPrope
|
|
|
8357
8464
|
const PLUGIN_NAME$1 = "SHEET_RANGE_PROTECTION_PLUGIN";
|
|
8358
8465
|
var _a15;
|
|
8359
8466
|
let RangeProtectionService = (_a15 = class extends Disposable {
|
|
8360
|
-
constructor(_selectionProtectionRuleModel, _permissionService, _resourceManagerService, _selectionProtectionCache) {
|
|
8361
|
-
super(), this._selectionProtectionRuleModel = _selectionProtectionRuleModel, this._permissionService = _permissionService, this._resourceManagerService = _resourceManagerService, this._selectionProtectionCache = _selectionProtectionCache, this._initSnapshot(), this._initRuleChange();
|
|
8467
|
+
constructor(_selectionProtectionRuleModel, _permissionService, _resourceManagerService, _selectionProtectionCache, _univerInstanceService) {
|
|
8468
|
+
super(), this._selectionProtectionRuleModel = _selectionProtectionRuleModel, this._permissionService = _permissionService, this._resourceManagerService = _resourceManagerService, this._selectionProtectionCache = _selectionProtectionCache, this._univerInstanceService = _univerInstanceService, this._initSnapshot(), this._initRuleChange();
|
|
8362
8469
|
}
|
|
8363
8470
|
_initRuleChange() {
|
|
8364
8471
|
this.disposeWithMe(
|
|
@@ -8421,7 +8528,7 @@ let RangeProtectionService = (_a15 = class extends Disposable {
|
|
|
8421
8528
|
objectID: rule.permissionId,
|
|
8422
8529
|
unitID: unitId,
|
|
8423
8530
|
objectType: L.SelectRange,
|
|
8424
|
-
actions:
|
|
8531
|
+
actions: baseProtectionActions
|
|
8425
8532
|
});
|
|
8426
8533
|
}), list.forEach((rule) => {
|
|
8427
8534
|
getAllRangePermissionPoint().forEach((Factor) => {
|
|
@@ -8432,7 +8539,7 @@ let RangeProtectionService = (_a15 = class extends Disposable {
|
|
|
8432
8539
|
});
|
|
8433
8540
|
}, "onLoad"),
|
|
8434
8541
|
onUnLoad: /* @__PURE__ */ __name((unitId) => {
|
|
8435
|
-
this.
|
|
8542
|
+
this._selectionProtectionCache.deleteUnit(unitId);
|
|
8436
8543
|
}, "onUnLoad")
|
|
8437
8544
|
})
|
|
8438
8545
|
);
|
|
@@ -8442,53 +8549,17 @@ RangeProtectionService = __decorateClass$2([
|
|
|
8442
8549
|
__decorateParam$2(0, Inject(RangeProtectionRuleModel)),
|
|
8443
8550
|
__decorateParam$2(1, Inject(IPermissionService)),
|
|
8444
8551
|
__decorateParam$2(2, Inject(IResourceManagerService)),
|
|
8445
|
-
__decorateParam$2(3, Inject(RangeProtectionCache))
|
|
8552
|
+
__decorateParam$2(3, Inject(RangeProtectionCache)),
|
|
8553
|
+
__decorateParam$2(4, Inject(IUniverInstanceService))
|
|
8446
8554
|
], RangeProtectionService);
|
|
8447
|
-
const getAllWorkbookPermissionPoint = /* @__PURE__ */ __name(() => [
|
|
8448
|
-
WorkbookEditablePermission,
|
|
8449
|
-
WorkbookPrintPermission,
|
|
8450
|
-
WorkbookCommentPermission,
|
|
8451
|
-
WorkbookViewPermission,
|
|
8452
|
-
WorkbookCopyPermission,
|
|
8453
|
-
WorkbookExportPermission,
|
|
8454
|
-
WorkbookManageCollaboratorPermission,
|
|
8455
|
-
WorkbookCreateSheetPermission,
|
|
8456
|
-
WorkbookDeleteSheetPermission,
|
|
8457
|
-
WorkbookRenameSheetPermission,
|
|
8458
|
-
WorkbookHideSheetPermission,
|
|
8459
|
-
WorkbookDuplicatePermission,
|
|
8460
|
-
WorkbookSharePermission,
|
|
8461
|
-
WorkbookMoveSheetPermission,
|
|
8462
|
-
WorkbookCopySheetPermission,
|
|
8463
|
-
WorkbookViewHistoryPermission,
|
|
8464
|
-
WorkbookRecoverHistoryPermission
|
|
8465
|
-
], "getAllWorkbookPermissionPoint"), defaultWorkbookPermissionPoints = [
|
|
8466
|
-
D.Edit,
|
|
8467
|
-
D.Print,
|
|
8468
|
-
D.Comment,
|
|
8469
|
-
D.View,
|
|
8470
|
-
D.Copy,
|
|
8471
|
-
D.Export,
|
|
8472
|
-
D.ManageCollaborator,
|
|
8473
|
-
D.CreateSheet,
|
|
8474
|
-
D.DeleteSheet,
|
|
8475
|
-
D.RenameSheet,
|
|
8476
|
-
D.HideSheet,
|
|
8477
|
-
D.Duplicate,
|
|
8478
|
-
D.Share,
|
|
8479
|
-
D.MoveSheet,
|
|
8480
|
-
D.CopySheet,
|
|
8481
|
-
D.RecoverHistory,
|
|
8482
|
-
D.ViewHistory
|
|
8483
|
-
];
|
|
8484
8555
|
var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
8485
8556
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8486
8557
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
8487
8558
|
return kind && result && __defProp$1(target, key, result), result;
|
|
8488
8559
|
}, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a16;
|
|
8489
8560
|
let WorkbookPermissionService = (_a16 = class extends Disposable {
|
|
8490
|
-
constructor(_permissionService, _univerInstanceService, _rangeProtectionRuleModel) {
|
|
8491
|
-
super(), this._permissionService = _permissionService, this._univerInstanceService = _univerInstanceService, this._rangeProtectionRuleModel = _rangeProtectionRuleModel, this._init();
|
|
8561
|
+
constructor(_permissionService, _univerInstanceService, _rangeProtectionRuleModel, _worksheetProtectionRuleModel, _worksheetProtectionPointModel) {
|
|
8562
|
+
super(), this._permissionService = _permissionService, this._univerInstanceService = _univerInstanceService, this._rangeProtectionRuleModel = _rangeProtectionRuleModel, this._worksheetProtectionRuleModel = _worksheetProtectionRuleModel, this._worksheetProtectionPointModel = _worksheetProtectionPointModel, this._init();
|
|
8492
8563
|
}
|
|
8493
8564
|
_init() {
|
|
8494
8565
|
const handleWorkbook = /* @__PURE__ */ __name((workbook) => {
|
|
@@ -8507,7 +8578,7 @@ let WorkbookPermissionService = (_a16 = class extends Disposable {
|
|
|
8507
8578
|
workbook.getSheets().forEach((worksheet) => {
|
|
8508
8579
|
const subUnitId = worksheet.getSheetId();
|
|
8509
8580
|
this._rangeProtectionRuleModel.getSubunitRuleList(unitId, subUnitId).forEach((rule) => {
|
|
8510
|
-
[
|
|
8581
|
+
[...getAllRangePermissionPoint()].forEach((F) => {
|
|
8511
8582
|
const instance = new F(unitId, subUnitId, rule.permissionId);
|
|
8512
8583
|
this._permissionService.deletePermissionPoint(instance.id);
|
|
8513
8584
|
});
|
|
@@ -8518,14 +8589,16 @@ let WorkbookPermissionService = (_a16 = class extends Disposable {
|
|
|
8518
8589
|
}), getAllWorkbookPermissionPoint().forEach((F) => {
|
|
8519
8590
|
const instance = new F(unitId);
|
|
8520
8591
|
this._permissionService.deletePermissionPoint(instance.id);
|
|
8521
|
-
});
|
|
8592
|
+
}), this._rangeProtectionRuleModel.deleteUnitModel(unitId), this._worksheetProtectionPointModel.deleteUnitModel(unitId), this._worksheetProtectionRuleModel.deleteUnitModel(unitId);
|
|
8522
8593
|
}));
|
|
8523
8594
|
}
|
|
8524
8595
|
}, __name(_a16, "WorkbookPermissionService"), _a16);
|
|
8525
8596
|
WorkbookPermissionService = __decorateClass$1([
|
|
8526
8597
|
__decorateParam$1(0, Inject(IPermissionService)),
|
|
8527
8598
|
__decorateParam$1(1, Inject(IUniverInstanceService)),
|
|
8528
|
-
__decorateParam$1(2, Inject(RangeProtectionRuleModel))
|
|
8599
|
+
__decorateParam$1(2, Inject(RangeProtectionRuleModel)),
|
|
8600
|
+
__decorateParam$1(3, Inject(WorksheetProtectionRuleModel)),
|
|
8601
|
+
__decorateParam$1(4, Inject(WorksheetProtectionPointModel))
|
|
8529
8602
|
], WorkbookPermissionService);
|
|
8530
8603
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __defNormalProp2 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp"), __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
8531
8604
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
@@ -9246,7 +9319,9 @@ export {
|
|
|
9246
9319
|
OperatorType,
|
|
9247
9320
|
RangeMergeUtil,
|
|
9248
9321
|
RangeProtectionCache,
|
|
9322
|
+
RangeProtectionPermissionDeleteProtectionPoint,
|
|
9249
9323
|
RangeProtectionPermissionEditPoint,
|
|
9324
|
+
RangeProtectionPermissionManageCollaPoint,
|
|
9250
9325
|
RangeProtectionPermissionViewPoint,
|
|
9251
9326
|
RangeProtectionRefRangeService,
|
|
9252
9327
|
RangeProtectionRenderModel,
|
|
@@ -9354,6 +9429,7 @@ export {
|
|
|
9354
9429
|
WorkbookCommentPermission,
|
|
9355
9430
|
WorkbookCopyPermission,
|
|
9356
9431
|
WorkbookCopySheetPermission,
|
|
9432
|
+
WorkbookCreateProtectPermission,
|
|
9357
9433
|
WorkbookCreateSheetPermission,
|
|
9358
9434
|
WorkbookDeleteSheetPermission,
|
|
9359
9435
|
WorkbookDuplicatePermission,
|
|
@@ -9373,6 +9449,7 @@ export {
|
|
|
9373
9449
|
WorkbookViewPermission,
|
|
9374
9450
|
WorksheetCopyPermission,
|
|
9375
9451
|
WorksheetDeleteColumnPermission,
|
|
9452
|
+
WorksheetDeleteProtectionPermission,
|
|
9376
9453
|
WorksheetDeleteRowPermission,
|
|
9377
9454
|
WorksheetEditExtraObjectPermission,
|
|
9378
9455
|
WorksheetEditPermission,
|
|
@@ -9395,6 +9472,7 @@ export {
|
|
|
9395
9472
|
WorksheetViewPermission,
|
|
9396
9473
|
addMergeCellsUtil,
|
|
9397
9474
|
alignToMergedCellsBorders,
|
|
9475
|
+
baseProtectionActions,
|
|
9398
9476
|
checkRangesEditablePermission,
|
|
9399
9477
|
convertPrimaryWithCoordToPrimary,
|
|
9400
9478
|
convertSelectionDataToRange,
|
|
@@ -46,7 +46,7 @@ export interface ISetFontSizeCommandParams {
|
|
|
46
46
|
}
|
|
47
47
|
export declare const SetFontSizeCommand: ICommand<ISetFontSizeCommandParams>;
|
|
48
48
|
export interface ISetColorCommandParams {
|
|
49
|
-
value: string;
|
|
49
|
+
value: string | null;
|
|
50
50
|
}
|
|
51
51
|
export declare const SetTextColorCommand: ICommand<ISetColorCommandParams>;
|
|
52
52
|
export declare const ResetTextColorCommand: ICommand;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMutation, IMutationInfo } from '@univerjs/core';
|
|
2
2
|
import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
|
|
3
|
-
import {
|
|
3
|
+
import { IDeleteRangeProtectionMutationParams } from './delete-range-protection.mutation';
|
|
4
4
|
export interface IAddRangeProtectionMutationParams {
|
|
5
5
|
rules: IRangeProtectionRule[];
|
|
6
6
|
unitId: string;
|
|
@@ -8,5 +8,5 @@ export interface IAddRangeProtectionMutationParams {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const FactoryAddRangeProtectionMutation: (param: IAddRangeProtectionMutationParams) => IMutationInfo<
|
|
11
|
+
export declare const FactoryAddRangeProtectionMutation: (param: IAddRangeProtectionMutationParams) => IMutationInfo<IDeleteRangeProtectionMutationParams>;
|
|
12
12
|
export declare const AddRangeProtectionMutation: IMutation<IAddRangeProtectionMutationParams>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IAccessor, IMutation, IMutationInfo } from '@univerjs/core';
|
|
2
2
|
import { IAddRangeProtectionMutationParams } from './add-range-protection.mutation';
|
|
3
|
-
export interface
|
|
3
|
+
export interface IDeleteRangeProtectionMutationParams {
|
|
4
4
|
ruleIds: string[];
|
|
5
5
|
unitId: string;
|
|
6
6
|
subUnitId: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const FactoryDeleteRangeProtectionMutation: (accessor: IAccessor, param:
|
|
9
|
-
export declare const DeleteRangeProtectionMutation: IMutation<
|
|
8
|
+
export declare const FactoryDeleteRangeProtectionMutation: (accessor: IAccessor, param: IDeleteRangeProtectionMutationParams) => IMutationInfo<Omit<IAddRangeProtectionMutationParams, "name">>;
|
|
9
|
+
export declare const DeleteRangeProtectionMutation: IMutation<IDeleteRangeProtectionMutationParams>;
|
|
@@ -4,7 +4,15 @@ export interface ISetFrozenMutationParams {
|
|
|
4
4
|
subUnitId: string;
|
|
5
5
|
startRow: number;
|
|
6
6
|
startColumn: number;
|
|
7
|
+
/**
|
|
8
|
+
* Number of frozen rows.
|
|
9
|
+
* if row freeze start at 7, end at 10, then ySplit is 3
|
|
10
|
+
*/
|
|
7
11
|
ySplit: number;
|
|
12
|
+
/**
|
|
13
|
+
* Number of frozen columns.
|
|
14
|
+
* if column freeze start at 7, end at 10, then xSplit is 3
|
|
15
|
+
*/
|
|
8
16
|
xSplit: number;
|
|
9
17
|
resetScroll?: boolean;
|
|
10
18
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export { defaultWorksheetPermissionPoint, getAllWorksheetPermissionPoint, getAll
|
|
|
46
46
|
export type { IWorksheetProtectionRule } from './services/permission/type';
|
|
47
47
|
export { WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from './services/permission/worksheet-permission';
|
|
48
48
|
export { defaultWorkbookPermissionPoints, getAllWorkbookPermissionPoint } from './services/permission/workbook-permission';
|
|
49
|
-
export { WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCreateSheetPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookHistoryPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPivotTablePermission, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, } from './services/permission/permission-point';
|
|
49
|
+
export { WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookHistoryPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPivotTablePermission, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, } from './services/permission/permission-point';
|
|
50
50
|
export { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
51
51
|
export { checkRangesEditablePermission } from './services/permission/util';
|
|
52
52
|
export { type ICellPermission, RangeProtectionRenderModel } from './model/range-protection-render.model';
|
|
@@ -58,6 +58,9 @@ export { RangeProtectionService } from './services/permission/range-permission/r
|
|
|
58
58
|
export { getAllRangePermissionPoint, getDefaultRangePermission, type IRangePermissionPoint, } from './services/permission/range-permission/util';
|
|
59
59
|
export { RangeProtectionPermissionEditPoint } from './services/permission/permission-point/range/edit';
|
|
60
60
|
export { RangeProtectionPermissionViewPoint } from './services/permission/permission-point/range/view';
|
|
61
|
+
export { RangeProtectionPermissionManageCollaPoint } from './services/permission/permission-point/range/manage-collaborator';
|
|
62
|
+
export { RangeProtectionPermissionDeleteProtectionPoint } from './services/permission/permission-point/range/delete-protection';
|
|
63
|
+
export { baseProtectionActions } from './services/permission/range-permission/util';
|
|
61
64
|
export { generateNullCell, generateNullCellValue } from './basics/utils';
|
|
62
65
|
export { getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget } from './commands/commands/utils/target-util';
|
|
63
66
|
export { alignToMergedCellsBorders, getCellAtRowCol, isSingleCellSelection, setEndForRange } from './commands/commands/utils/selection-utils';
|
|
@@ -115,8 +118,9 @@ export type { ISetWorksheetShowCommandParams } from './commands/commands/set-wor
|
|
|
115
118
|
export { AddRangeProtectionMutation, FactoryAddRangeProtectionMutation, type IAddRangeProtectionMutationParams } from './commands/mutations/add-range-protection.mutation';
|
|
116
119
|
export { AddMergeUndoMutationFactory, AddWorksheetMergeMutation } from './commands/mutations/add-worksheet-merge.mutation';
|
|
117
120
|
export { AddWorksheetProtectionMutation, type IAddWorksheetProtectionParams } from './commands/mutations/add-worksheet-protection.mutation';
|
|
118
|
-
export { DeleteRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, type
|
|
121
|
+
export { DeleteRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, type IDeleteRangeProtectionMutationParams } from './commands/mutations/delete-range-protection.mutation';
|
|
119
122
|
export { DeleteWorksheetProtectionMutation } from './commands/mutations/delete-worksheet-protection.mutation';
|
|
123
|
+
export type { IDeleteWorksheetProtectionParams } from './commands/mutations/delete-worksheet-protection.mutation';
|
|
120
124
|
export { EmptyMutation } from './commands/mutations/empty.mutation';
|
|
121
125
|
export { InsertColMutation, InsertColMutationUndoFactory, InsertRowMutation, InsertRowMutationUndoFactory, } from './commands/mutations/insert-row-col.mutation';
|
|
122
126
|
export { InsertSheetMutation, InsertSheetUndoMutationFactory } from './commands/mutations/insert-sheet.mutation';
|
|
@@ -142,6 +146,7 @@ export { type ISetWorksheetOrderMutationParams, SetWorksheetOrderMutation } from
|
|
|
142
146
|
export { SetWorksheetPermissionPointsMutation } from './commands/mutations/set-worksheet-permission-points.mutation';
|
|
143
147
|
export type { ISetWorksheetPermissionPointsMutationParams } from './commands/mutations/set-worksheet-permission-points.mutation';
|
|
144
148
|
export { SetWorksheetProtectionMutation } from './commands/mutations/set-worksheet-protection.mutation';
|
|
149
|
+
export type { ISetWorksheetProtectionParams } from './commands/mutations/set-worksheet-protection.mutation';
|
|
145
150
|
export { SetWorksheetRightToLeftMutation } from './commands/mutations/set-worksheet-right-to-left.mutation';
|
|
146
151
|
export { type ISetWorksheetRowAutoHeightMutationParams, type ISetWorksheetRowHeightMutationParams, type ISetWorksheetRowIsAutoHeightMutationParams, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowIsAutoHeightMutation, } from './commands/mutations/set-worksheet-row-height.mutation';
|
|
147
152
|
export { ScrollToCellOperation } from './commands/operations/scroll-to-cell.operation';
|
|
@@ -19,6 +19,7 @@ export declare class RangeProtectionCache extends Disposable {
|
|
|
19
19
|
private _ensureRowColInfoMap;
|
|
20
20
|
private _addCellRuleCache;
|
|
21
21
|
private _deleteCellRuleCache;
|
|
22
|
+
private _getSelectionActions;
|
|
22
23
|
reBuildCache(unitId: string, subUnitId: string): void;
|
|
23
24
|
getRowPermissionInfo(unitId: string, subUnitId: string, row: number, types: UnitAction[]): boolean;
|
|
24
25
|
getColPermissionInfo(unitId: string, subUnitId: string, col: number, types: UnitAction[]): boolean;
|
|
@@ -27,10 +28,12 @@ export declare class RangeProtectionCache extends Disposable {
|
|
|
27
28
|
ruleId?: string;
|
|
28
29
|
ranges?: IRange[];
|
|
29
30
|
}) | {
|
|
30
|
-
1: boolean;
|
|
31
|
-
0: boolean;
|
|
32
31
|
ruleId: string;
|
|
33
32
|
ranges: IRange[];
|
|
33
|
+
1: boolean;
|
|
34
|
+
0: boolean;
|
|
35
|
+
2: boolean;
|
|
36
|
+
42: boolean;
|
|
34
37
|
} | undefined;
|
|
35
38
|
deleteUnit(unitId: string): void;
|
|
36
39
|
}
|
|
@@ -18,6 +18,7 @@ export { RangeProtectionPermissionViewPoint } from './range/view';
|
|
|
18
18
|
export { WorkbookCommentPermission } from './workbook/comment';
|
|
19
19
|
export { WorkbookCopyPermission } from './workbook/copy';
|
|
20
20
|
export { WorkbookCopySheetPermission } from './workbook/copy-sheet';
|
|
21
|
+
export { WorkbookCreateProtectPermission } from './workbook/create-permission';
|
|
21
22
|
export { WorkbookCreateSheetPermission } from './workbook/create-sheet';
|
|
22
23
|
export { WorkbookDeleteSheetPermission } from './workbook/delete-sheet';
|
|
23
24
|
export { WorkbookDuplicatePermission } from './workbook/duplicate';
|
|
@@ -35,6 +36,7 @@ export { WorkbookViewPermission } from './workbook/view';
|
|
|
35
36
|
export { WorkbookViewHistoryPermission } from './workbook/view-history';
|
|
36
37
|
export { WorksheetCopyPermission } from './worksheet/copy';
|
|
37
38
|
export { WorksheetDeleteColumnPermission } from './worksheet/delete-column';
|
|
39
|
+
export { WorksheetDeleteProtectionPermission } from './worksheet/delete-protection';
|
|
38
40
|
export { WorksheetDeleteRowPermission } from './worksheet/delete-row';
|
|
39
41
|
export { WorksheetEditPermission } from './worksheet/edit';
|
|
40
42
|
export { WorksheetEditExtraObjectPermission } from './worksheet/edit-extra-object';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare class RangeProtectionPermissionDeleteProtectionPoint implements IPermissionPoint {
|
|
4
|
+
type: UnitObject;
|
|
5
|
+
subType: UnitAction;
|
|
6
|
+
status: PermissionStatus;
|
|
7
|
+
value: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
unitId: string;
|
|
10
|
+
subUnitId: string;
|
|
11
|
+
permissionId: string;
|
|
12
|
+
constructor(unitId: string, subUnitId: string, permissionId: string);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare class RangeProtectionPermissionManageCollaPoint implements IPermissionPoint {
|
|
4
|
+
type: UnitObject;
|
|
5
|
+
subType: UnitAction;
|
|
6
|
+
status: PermissionStatus;
|
|
7
|
+
value: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
unitId: string;
|
|
10
|
+
subUnitId: string;
|
|
11
|
+
permissionId: string;
|
|
12
|
+
constructor(unitId: string, subUnitId: string, permissionId: string);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare class WorkbookCreateProtectPermission implements IPermissionPoint {
|
|
4
|
+
unitId: string;
|
|
5
|
+
id: string;
|
|
6
|
+
value: boolean;
|
|
7
|
+
type: UnitObject;
|
|
8
|
+
status: PermissionStatus;
|
|
9
|
+
subType: UnitAction;
|
|
10
|
+
constructor(unitId: string);
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare class WorksheetDeleteProtectionPermission implements IPermissionPoint {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
value: boolean;
|
|
7
|
+
type: UnitObject;
|
|
8
|
+
status: PermissionStatus;
|
|
9
|
+
id: string;
|
|
10
|
+
subType: UnitAction;
|
|
11
|
+
constructor(unitId: string, subUnitId: string);
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMutationInfo, Disposable, DisposableCollection, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IAddRangeProtectionMutationParams } from '../../../commands/mutations/add-range-protection.mutation';
|
|
3
|
-
import {
|
|
3
|
+
import { IDeleteRangeProtectionMutationParams } from '../../../commands/mutations/delete-range-protection.mutation';
|
|
4
4
|
import { ISetRangeProtectionMutationParams } from '../../../commands/mutations/set-range-protection.mutation';
|
|
5
5
|
import { EffectRefRangeParams } from '../../../services/ref-range/type';
|
|
6
6
|
import { RangeProtectionCache } from '../../../model/range-protection.cache';
|
|
@@ -30,8 +30,8 @@ export declare class RangeProtectionRefRangeService extends Disposable {
|
|
|
30
30
|
params: ISetRangeProtectionMutationParams;
|
|
31
31
|
}[];
|
|
32
32
|
} | {
|
|
33
|
-
redos: IMutationInfo<
|
|
34
|
-
undos: IMutationInfo<
|
|
33
|
+
redos: IMutationInfo<IDeleteRangeProtectionMutationParams | IAddRangeProtectionMutationParams | ISetRangeProtectionMutationParams>[];
|
|
34
|
+
undos: IMutationInfo<IDeleteRangeProtectionMutationParams | IAddRangeProtectionMutationParams | ISetRangeProtectionMutationParams>[];
|
|
35
35
|
};
|
|
36
36
|
private _getRefRangeMutationsByDeleteCols;
|
|
37
37
|
private _getRefRangeMutationsByDeleteRows;
|