@univerjs/sheets-ui 0.12.2 → 0.12.3-experimental.20251205-e439e48
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/cjs/index.js +14 -14
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +94 -72
- package/lib/es/index.js +8745 -8614
- package/lib/es/locale/ca-ES.js +2 -1
- package/lib/es/locale/en-US.js +2 -1
- package/lib/es/locale/es-ES.js +2 -1
- package/lib/es/locale/fa-IR.js +2 -1
- package/lib/es/locale/fr-FR.js +2 -1
- package/lib/es/locale/ja-JP.js +2 -1
- package/lib/es/locale/ko-KR.js +2 -1
- package/lib/es/locale/ru-RU.js +2 -1
- package/lib/es/locale/vi-VN.js +2 -1
- package/lib/es/locale/zh-CN.js +2 -1
- package/lib/es/locale/zh-TW.js +99 -98
- package/lib/facade.js +94 -72
- package/lib/index.js +8745 -8614
- package/lib/locale/ca-ES.js +2 -1
- package/lib/locale/en-US.js +2 -1
- package/lib/locale/es-ES.js +2 -1
- package/lib/locale/fa-IR.js +2 -1
- package/lib/locale/fr-FR.js +2 -1
- package/lib/locale/ja-JP.js +2 -1
- package/lib/locale/ko-KR.js +2 -1
- package/lib/locale/ru-RU.js +2 -1
- package/lib/locale/vi-VN.js +2 -1
- package/lib/locale/zh-CN.js +2 -1
- package/lib/locale/zh-TW.js +99 -98
- package/lib/types/commands/commands/auto-fill.command.d.ts +4 -0
- package/lib/types/components/menu-item-input/interface.d.ts +2 -0
- package/lib/types/facade/f-range.d.ts +40 -1
- package/lib/types/facade/f-univer.d.ts +11 -0
- package/lib/types/locale/en-US.d.ts +1 -0
- package/lib/types/services/auto-fill/auto-fill.service.d.ts +2 -2
- package/lib/types/services/clipboard/clipboard.service.d.ts +1 -1
- package/lib/types/services/clipboard/clone.d.ts +9 -0
- package/lib/types/services/clipboard/utils.d.ts +5 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +13 -13
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +14 -14
- package/LICENSE +0 -176
package/lib/cjs/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={spreadsheetLabel:"
|
|
1
|
+
"use strict";const e={spreadsheetLabel:"擴充功能",spreadsheetRightLabel:"更多試算表",toolbar:{undo:"復原",redo:"重做",formatPainter:"複製格式",font:"字型",fontSize:"字型大小",fontSizeIncrease:"放大字型",fontSizeDecrease:"縮小字型",bold:"粗體",italic:"斜體",strikethrough:"刪除線",subscript:"下標",superscript:"上標",underline:"底線",textColor:{main:"字型顏色",right:"顏色選擇"},resetColor:"重置顏色",fillColor:{main:"填滿色彩",right:"顏色選擇"},border:{main:"邊框",right:"邊框類型"},mergeCell:{main:"合併儲存格",right:"選擇合併類型"},horizontalAlignMode:{main:"水平對齊",right:"對齊方式"},verticalAlignMode:{main:"垂直對齊",right:"對齊方式"},textWrapMode:{main:"自動換行",right:"換行方式"},textRotateMode:{main:"文字旋轉",right:"旋轉方式"},more:"更多",toggleGridlines:"切換網格線"},align:{left:"靠左對齊",center:"置中",right:"靠右對齊",top:"靠上對齊",middle:"垂直置中",bottom:"靠下對齊"},button:{confirm:"確定",cancel:"取消",close:"關閉",update:"Update",delete:"Delete",insert:"插入",prevPage:"上一頁",nextPage:"下一頁",total:"總共:"},punctuation:{tab:"Tab 鍵",semicolon:"分號",comma:"逗號",space:"空格"},colorPicker:{collapse:"收起",customColor:"自訂",change:"切換",confirmColor:"確定",cancelColor:"取消"},borderLine:{borderTop:"上框線",borderBottom:"下框線",borderLeft:"左框線",borderRight:"右框線",borderNone:"無",borderAll:"所有",borderOutside:"外側",borderInside:"內側",borderHorizontal:"內側水平框線",borderVertical:"內側垂直框線",borderColor:"邊框顏色",borderSize:"邊框粗細",borderType:"邊框線類型"},merge:{all:"全部合併",vertical:"垂直合併",horizontal:"水平合併",cancel:"取消合併",overlappingError:"不能合併重疊區域",partiallyError:"無法對部分合併儲存格執行此操作",confirm:{title:"合併儲存格僅儲存左上角儲存格的值,是否繼續? ",cancel:"取消合併",confirm:"繼續合併",warning:"警告",dismantleMergeCellWarning:"此操作會導致一些合併儲存格被拆散,是否繼續?"}},filter:{confirm:{error:"出現了一個問題",notAllowedToInsertRange:"要移動這些儲存格,請清除該區域的篩選器"}},textWrap:{overflow:"溢出",wrap:"自動換行",clip:"截斷"},textRotate:{none:"無旋轉",angleUp:"向上傾斜",angleDown:"向下傾斜",vertical:"直排文字",rotationUp:"向上90°",rotationDown:"向下90°"},sheetConfig:{delete:"刪除",copy:"複製",rename:"重新命名",changeColor:"更改顏色",hide:"隱藏",unhide:"取消隱藏",moveLeft:"向左移動",moveRight:"向右移動",resetColor:"重置顏色",cancelText:"取消",chooseText:"確定顏色",tipNameRepeat:"工作表名稱已存在,請輸入其他名稱。",noMoreSheet:"活頁簿中至少需含有一張可見的工作表。若需刪除選定的工作表,請先插入一張新工作表或顯示隱藏的工作表。",confirmDelete:"確認刪除",redoDelete:"可以透過 Ctrl+Z 復原刪除",noHide:"不能隱藏,至少保留一個工作表",chartEditNoOpt:"圖表編輯模式下不允許該操作! ",sheetNameErrorTitle:"錯誤",sheetNameSpecCharError:"名稱不能超過 31 個字元,首尾不能是' 且名稱不能包含: [ ] : \\ ? * /",sheetNameCannotIsEmptyError:"名稱不能為空。 ",sheetNameAlreadyExistsError:"工作表已存在,請輸入其它名稱。 ",deleteSheet:"刪除工作表",deleteSheetContent:"您確定要刪除此工作表嗎?刪除後將無法復原。",deleteLargeSheetContent:"確認刪除此工作表,刪除後將不可找回,確定要刪除嗎?",addProtectSheet:"保護工作表",removeProtectSheet:"取消保護工作表",changeSheetPermission:"更改工作表權限",viewAllProtectArea:"查看所有保護範圍"},rightClick:{copy:"複製",cut:"剪下",paste:"貼上",pasteSpecial:"選擇性貼上",pasteValue:"僅貼上值",pasteFormat:"僅貼上格式",pasteColWidth:"僅貼上欄寬",pasteBesidesBorder:"僅貼上邊框以外內容",insert:"插入",delete:"刪除",insertRow:"插入列",insertRowBefore:"上方插入列",insertRowsAbove:"在上方插入",insertRowsAfter:"在下方插入",insertRowsAfterSuffix:"列",insertRowsAboveSuffix:"列",insertColumn:"插入欄",insertColumnBefore:"在左側插入欄",insertColsLeft:"在左側插入",insertColsRight:"在右側插入",insertColsLeftSuffix:"欄",insertColsRightSuffix:"欄",deleteCell:"刪除儲存格",insertCell:"插入儲存格",deleteSelected:"刪除選取",hide:"隱藏",hideSelected:"隱藏",showHide:"取消隱藏",toTopAdd:"向上增加",toBottomAdd:"向下增加",toLeftAdd:"向左增加",toRightAdd:"向右增加",deleteSelectedRow:"刪除選取列",deleteSelectedColumn:"刪除選取欄",hideSelectedRow:"隱藏選取列",showHideRow:"取消隱藏列",rowHeight:"列高",hideSelectedColumn:"隱藏選取欄",showHideColumn:"取消隱藏欄",columnWidth:"欄寬",moveLeft:"左移",moveUp:"上移",moveRight:"右移",moveDown:"下移",add:"增加",row:"列",column:"欄",confirm:"確認",clearSelection:"清除",clearContent:"清除內容",clearFormat:"清除格式",clearAll:"清除全部",root:"次方根",log:"log",delete0:"刪除兩端0值",removeDuplicate:"移除重複項",byRow:"按列",byCol:"按欄",generateNewMatrix:"產生新矩陣",fitContent:"適合數據",freeze:"凍結窗格",freezeCol:"凍結欄",freezeRow:"凍結列",cancelFreeze:"取消凍結",deleteAllRowsAlert:"您無法刪除工作表上的所有列",deleteAllColumnsAlert:"您無法刪除工作表上的所有欄",hideAllRowsAlert:"您無法隱藏工作表上的所有列",hideAllColumnsAlert:"您無法隱藏工作表上的所有欄",protectRange:"保護範圍",editProtectRange:"設定保護範圍",removeProtectRange:"移除保護範圍",turnOnProtectRange:"新增保護範圍",viewAllProtectArea:"查看所有保護範圍"},info:{tooltip:"提示",error:"錯誤",notChangeMerge:"不能對合併儲存格做部分更改",detailUpdate:"新開啟",detailSave:"已恢復本機快取",row:"列",column:"欄",loading:"渲染中···",copy:"副本",return:"返回",rename:"重新命名",tips:"重命名",noName:"未命名的試算表",wait:"待更新",add:"新增",addLast:"在底部加上",backTop:"回到頂部",pageInfo:"共 ${total} 筆,${totalPage} 頁,目前已顯示 ${currentPage} 頁",nextPage:"下一頁",tipInputNumber:"請輸入數字",tipInputNumberLimit:"增加範圍限制在1-100",tipRowHeightLimit:"列高必須在 0 ~ 545 之間",tipColumnWidthLimit:"欄寬必須在 0 ~ 2038 之間",pageInfoFull:"共 ${total} 筆,${totalPage} 頁,已顯示全部資料",problem:"出現了一個問題",forceStringInfo:"以文字形式儲存的數字"},clipboard:{paste:{exceedMaxCells:"貼上區域超出最大儲存格數",overlappingMergedCells:"貼上區域與合併儲存格重疊"},shortCutNotify:{title:"請使用快捷鍵貼上",useShortCutInstead:"偵測到 Excel 內容,請使用快速鍵貼上"}},statusbar:{sum:"求和",average:"平均值",min:"最小值",max:"最大值",count:"數值計數",countA:"計數",clickToCopy:"點選複製數值",copied:"已複製"},autoFill:{copy:"複製儲存格",series:"填滿數列",formatOnly:"僅以格式填滿",noFormat:"填滿但不填入格式"},rangeSelector:{placeholder:"選擇範圍或輸入值",tooltip:"選擇範圍"},shortcut:{sheet:{"zoom-in":"放大","zoom-out":"縮小","reset-zoom":"恢復縮放","select-below-cell":"選擇下方儲存格","select-up-cell":"選擇上方儲存格","select-left-cell":"選擇左側儲存格","select-right-cell":"選擇右側儲存格","select-next-cell":"選取後一個儲存格","select-previous-cell":"選擇前一個儲存格","select-up-value-cell":"選擇上方有值的儲存格","select-below-value-cell":"選取下方有值的儲存格","select-left-value-cell":"選擇左側有值的儲存格","select-right-value-cell":"選擇右側有值的儲存格","expand-selection-down":"向下擴展選區","expand-selection-up":"向上擴展選區","expand-selection-left":"向左擴展選取範圍","expand-selection-right":"向右擴展選區","expand-selection-to-left-gap":"向左擴展選區到下一個邊界","expand-selection-to-below-gap":"向下擴展選區到下一個邊界","expand-selection-to-right-gap":"向右擴展選區到下一個邊界","expand-selection-to-up-gap":"向上擴展選區到下一個邊界","select-all":"全選","toggle-editing":"開始 / 結束編輯","delete-and-start-editing":"清空並開始編輯","abort-editing":"放棄編輯","break-line":"強制換行","set-bold":"切換粗體","set-italic":"切換斜體","set-underline":"切換底線","set-strike-through":"切換刪除線","start-editing":"開始編輯(選取範圍切換到編輯器)"}},"sheet-view":"瀏覽表格","sheet-edit":"編輯表格",definedName:{managerTitle:"名稱管理員",managerDescription:"透過選擇儲存格或公式,並在文字方塊中輸入您想要的名稱來建立已定義名稱。",addButton:"新建名稱",featureTitle:"已定義名稱",ratioRange:"範圍",ratioFormula:"公式",confirm:"確認",cancel:"取消",scopeWorkbook:"活頁簿",inputNamePlaceholder:"請輸入名稱(必填)",inputCommentPlaceholder:"請輸入備註",inputRangePlaceholder:"請輸入範圍(必填)",inputFormulaPlaceholder:"請輸入公式(必填)",nameEmpty:"名稱不能為空",nameDuplicate:"名稱重複",formulaOrRefStringEmpty:"公式或引用字串不能為空",formulaOrRefStringInvalid:"公式或引用字串無效",defaultName:"DefinedName",updateButton:"修改",deleteButton:"刪除",deleteConfirmText:"確定刪除定義名稱? ",nameConflict:"與函數名稱衝突",nameInvalid:"名稱不包含空格或不允許的字元",nameSheetConflict:"名稱與工作表名稱衝突"},uploadLoading:{loading:"正在上傳,目前剩餘",error:"載入失敗"},permission:{toolbarMenu:"保護",panel:{title:"保護範圍",name:"名稱",protectedRange:"保護區域",permissionDirection:"權限描述",permissionDirectionPlaceholder:"請輸入權限描述",editPermission:"編輯權限",onlyICanEdit:"僅我可以編輯",designedUserCanEdit:"指定使用者可以編輯",viewPermission:"檢視權限",othersCanView:"其他人可以查看",noOneElseCanView:"其他人不可以查看",designedPerson:"指定人員",addPerson:"新增人員",canEdit:"可編輯",canView:"可查看",delete:"刪除",currentSheet:"目前工作表",allSheet:"所有工作表",edit:"編輯",Print:"列印",Comment:"註解",Copy:"複製",SetCellStyle:"設定儲存格樣式",SetCellValue:"設定儲存格值",SetHyperLink:"設定超連結",Sort:"排序",Filter:"篩選",PivotTable:"樞紐分析表",FloatImage:"浮動圖片",RowHeightColWidth:"列高欄寬",RowHeightColWidthReadonly:"只讀列高欄寬",FilterReadonly:"唯讀篩選",nameError:"名稱不能為空",created:"創建",iCanEdit:"我可以編輯",iCanNotEdit:"我不會編輯",iCanView:"我可以查看",iCanNotView:"我不可以查看",emptyRangeError:"範圍不能為空",rangeOverlapError:"範圍不能重疊",rangeOverlapOverPermissionError:"範圍不能重疊已有權限範圍",InsertHyperlink:"插入超連結",SetRowStyle:"設定列樣式",SetColumnStyle:"設定欄樣式",InsertColumn:"插入欄",InsertRow:"插入列",DeleteRow:"刪除列",DeleteColumn:"刪除欄",EditExtraObject:"編輯其他物件"},dialog:{allowUserToEdit:"允許使用者編輯",allowedPermissionType:"允許權限類型",setCellValue:"設定儲存格值",setCellStyle:"設定儲存格樣式",copy:"複製",alert:"提示",search:"搜索",alertContent:"該範圍已被保護,目前無編輯權限。如需編輯,請聯絡創建者。 ",userEmpty:"沒有指定的人員,分享連結以邀請特定的人。 ",listEmpty:"你還沒有設定任何範圍或工作表為受保護狀態。 ",commonErr:"該範圍已被保護,目前無該操作權限。如需編輯,請聯絡創建者。 ",editErr:"該範圍已被保護,目前無編輯權限。如需編輯,請聯絡創建者。 ",pasteErr:"該範圍已被保護,目前無貼上權限。如需貼上,請聯絡創作者。 ",setStyleErr:"該範圍已被保護,目前無設定樣式權限。如需設定樣式,請聯絡建立者。 ",copyErr:"該範圍已被保護,目前無複製權限。如需複製,請聯絡創建者。 ",workbookCopyErr:"該活頁簿已被保護,目前無複製權限。如需複製,請聯絡創建者。 ",setRowColStyleErr:"該範圍已被保護,目前無設定欄列樣式權限。如需設定欄列樣式,請聯絡建立者。 ",moveRowColErr:"該範圍已被保護,目前無移動欄列權限。如需行動欄列,請聯絡創作者。 ",moveRangeErr:"該範圍已被保護,目前無移動選取範圍權限。如需移動選區,請聯絡創作者。 ",autoFillErr:"範圍已被保護,目前無自動填入權限。如需自動填充,請聯絡建立者。 ",filterErr:"該範圍已被保護,目前無篩選權限。如需篩選,請聯絡創作者。 ",operatorSheetErr:"該工作表已被保護,目前無操作工作表權限。如需操作工作表,請聯絡創建者。 ",insertOrDeleteMoveRangeErr:"插入、刪除區域與保護範圍相交,暫不支援此操作。 ",printErr:"該工作表已被保護,目前無列印權限。如需列印,請聯絡創作者。 ",formulaErr:"該範圍或引用範圍已被保護,目前無編輯權限。如需編輯,請聯絡創建者。 ",hyperLinkErr:"範圍已被保護,目前無設定超連結權限。如需設定超鏈接,請聯絡建立者。 "},button:{confirm:"確認",cancel:"取消",addNewPermission:"新增權限"}}};module.exports=e;
|
package/lib/es/facade.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ICommandService as
|
|
2
|
-
import { FUniver as Q, FEventName as
|
|
3
|
-
import { RichTextEditingMutation as
|
|
4
|
-
import { IRenderManagerService as v, DeviceInputEventType as
|
|
5
|
-
import { SheetsSelectionsService as
|
|
6
|
-
import { SetCellEditVisibleOperation as k, IEditorBridgeService as p, SetZoomRatioCommand as $, HoverManagerService as f, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as T, ISheetClipboardService as ee, SheetSkeletonManagerService as _, SHEET_VIEW_KEY as w, SheetPermissionRenderManagerService as A, ISheetSelectionRenderService as y, IMarkSelectionService as te, SheetsScrollRenderController as
|
|
1
|
+
import { ICommandService as R, CanceledError as b, IUniverInstanceService as O, RichTextValue as F, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as D, LifecycleService as se, DisposableCollection as j, LifecycleStages as z, UniverInstanceType as ae, ILogService as U, toDisposable as m, IPermissionService as ce, awaitTime as de, InterceptorEffectEnum as he, Rectangle as ge, generateRandomId as le } from "@univerjs/core";
|
|
2
|
+
import { FUniver as Q, FEventName as ue } from "@univerjs/core/facade";
|
|
3
|
+
import { RichTextEditingMutation as ve } from "@univerjs/docs";
|
|
4
|
+
import { IRenderManagerService as v, DeviceInputEventType as L, SHEET_VIEWPORT_KEY as Se, sheetContentViewportKeys as me } from "@univerjs/engine-render";
|
|
5
|
+
import { SheetsSelectionsService as Ce, COMMAND_LISTENER_SKELETON_CHANGE as we, getSkeletonChangedEffectedRange as Ee, SetWorksheetRowIsAutoHeightCommand as be, InterceptCellContentPriority as pe, SheetInterceptorService as fe, INTERCEPTOR_POINT as ke } from "@univerjs/sheets";
|
|
6
|
+
import { SetCellEditVisibleOperation as k, IEditorBridgeService as p, SetZoomRatioCommand as $, HoverManagerService as f, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as T, ISheetClipboardService as ee, SheetSkeletonManagerService as _, SHEET_VIEW_KEY as w, SheetPermissionRenderManagerService as A, ISheetSelectionRenderService as y, IMarkSelectionService as te, SheetsScrollRenderController as Ie, SetWorksheetColAutoWidthCommand as _e, SetColumnHeaderHeightCommand as Re, SetRowHeaderWidthCommand as Pe, SheetCanvasPopManagerService as N, CellAlertManagerService as He, ISheetCellDropdownManagerService as Me, AutoFillCommand as ye } from "@univerjs/sheets-ui";
|
|
7
7
|
import { FSheetHooks as W, FWorkbook as re, FWorksheet as ne, FPermission as ie, FRange as oe } from "@univerjs/sheets/facade";
|
|
8
|
-
import { KeyCode as B, CutCommand as V, CopyCommand as Z, PasteCommand as K, IClipboardInterfaceService as
|
|
9
|
-
import { filter as u, combineLatest as
|
|
10
|
-
class
|
|
8
|
+
import { KeyCode as B, CutCommand as V, CopyCommand as Z, PasteCommand as K, IClipboardInterfaceService as Ue, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Y, HTML_CLIPBOARD_MIME_TYPE as X, supportClipboardAPI as J, ISidebarService as xe, IDialogService as Be, ComponentManager as G } from "@univerjs/ui";
|
|
9
|
+
import { filter as u, combineLatest as De } from "rxjs";
|
|
10
|
+
class Te extends Q {
|
|
11
11
|
// eslint-disable-next-line max-lines-per-function
|
|
12
12
|
_initSheetUIEvent(e) {
|
|
13
|
-
const r = e.get(
|
|
13
|
+
const r = e.get(R);
|
|
14
14
|
this.registerEventHandler(
|
|
15
15
|
this.Event.BeforeSheetEditStart,
|
|
16
16
|
() => r.beforeCommandExecuted((t) => {
|
|
@@ -29,7 +29,7 @@ class xe extends Q {
|
|
|
29
29
|
isZenEditor: !1
|
|
30
30
|
};
|
|
31
31
|
if (this.fireEvent(this.Event.BeforeSheetEditStart, c), c.cancel)
|
|
32
|
-
throw new
|
|
32
|
+
throw new b();
|
|
33
33
|
}
|
|
34
34
|
})
|
|
35
35
|
), this.registerEventHandler(
|
|
@@ -40,7 +40,7 @@ class xe extends Q {
|
|
|
40
40
|
if (!i) return;
|
|
41
41
|
const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(O), g = t.params, { visible: l, keycode: a, eventType: n } = g, c = d.getEditLocation();
|
|
42
42
|
if (!l) {
|
|
43
|
-
const
|
|
43
|
+
const P = {
|
|
44
44
|
row: c.row,
|
|
45
45
|
column: c.column,
|
|
46
46
|
eventType: n,
|
|
@@ -48,11 +48,11 @@ class xe extends Q {
|
|
|
48
48
|
workbook: o,
|
|
49
49
|
worksheet: s,
|
|
50
50
|
isZenEditor: !1,
|
|
51
|
-
value:
|
|
51
|
+
value: F.create(h.getUnit(D).getSnapshot()),
|
|
52
52
|
isConfirm: a !== B.ESC
|
|
53
53
|
};
|
|
54
|
-
if (this.fireEvent(this.Event.BeforeSheetEditEnd,
|
|
55
|
-
throw new
|
|
54
|
+
if (this.fireEvent(this.Event.BeforeSheetEditEnd, P), P.cancel)
|
|
55
|
+
throw new b();
|
|
56
56
|
}
|
|
57
57
|
})
|
|
58
58
|
), this.registerEventHandler(
|
|
@@ -99,7 +99,7 @@ class xe extends Q {
|
|
|
99
99
|
), this.registerEventHandler(
|
|
100
100
|
this.Event.SheetEditChanging,
|
|
101
101
|
() => r.onCommandExecuted((t) => {
|
|
102
|
-
if (t.id !==
|
|
102
|
+
if (t.id !== ve.id) return;
|
|
103
103
|
const i = this.getActiveSheet();
|
|
104
104
|
if (!i) return;
|
|
105
105
|
const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(O), g = t.params;
|
|
@@ -111,7 +111,7 @@ class xe extends Q {
|
|
|
111
111
|
worksheet: s,
|
|
112
112
|
row: a,
|
|
113
113
|
column: n,
|
|
114
|
-
value:
|
|
114
|
+
value: F.create(h.getUnit(D).getSnapshot()),
|
|
115
115
|
isZenEditor: !1
|
|
116
116
|
};
|
|
117
117
|
this.fireEvent(this.Event.SheetEditChanging, c);
|
|
@@ -129,7 +129,7 @@ class xe extends Q {
|
|
|
129
129
|
worksheet: s
|
|
130
130
|
};
|
|
131
131
|
if (this.fireEvent(this.Event.BeforeSheetZoomChange, d), d.cancel)
|
|
132
|
-
throw new
|
|
132
|
+
throw new b();
|
|
133
133
|
})
|
|
134
134
|
), this.registerEventHandler(
|
|
135
135
|
this.Event.SheetZoomChanged,
|
|
@@ -150,7 +150,7 @@ class xe extends Q {
|
|
|
150
150
|
_initObserverListener(e) {
|
|
151
151
|
const r = e.get(v), t = e.get(se), i = new j();
|
|
152
152
|
this.disposeWithMe(t.lifecycle$.subscribe((h) => {
|
|
153
|
-
if (h !==
|
|
153
|
+
if (h !== z.Rendered) return;
|
|
154
154
|
i.dispose();
|
|
155
155
|
const g = e.get(f), l = e.get(M);
|
|
156
156
|
g && (this.registerEventHandler(
|
|
@@ -351,17 +351,17 @@ class xe extends Q {
|
|
|
351
351
|
})), this.disposeWithMe(i);
|
|
352
352
|
const o = /* @__PURE__ */ new Map();
|
|
353
353
|
let s;
|
|
354
|
-
const d =
|
|
354
|
+
const d = De([
|
|
355
355
|
r.created$,
|
|
356
356
|
t.lifecycle$
|
|
357
357
|
]);
|
|
358
358
|
this.disposeWithMe(d.subscribe(([h, g]) => {
|
|
359
|
-
var
|
|
360
|
-
if (h.type === ae.UNIVER_SHEET && (s = h), g <=
|
|
359
|
+
var P;
|
|
360
|
+
if (h.type === ae.UNIVER_SHEET && (s = h), g <= z.Rendered || !s) return;
|
|
361
361
|
const l = new j(), a = this.getWorkbook(s.unitId);
|
|
362
362
|
if (!a) return;
|
|
363
|
-
o.get(s.unitId) && ((
|
|
364
|
-
const n = s.with(x), c = s.with(
|
|
363
|
+
o.get(s.unitId) && ((P = o.get(s.unitId)) == null || P.dispose()), o.set(s.unitId, l);
|
|
364
|
+
const n = s.with(x), c = s.with(Ce);
|
|
365
365
|
l.add(this.registerEventHandler(
|
|
366
366
|
this.Event.Scroll,
|
|
367
367
|
() => n.validViewportScrollInfo$.subscribe((S) => {
|
|
@@ -426,7 +426,7 @@ class xe extends Q {
|
|
|
426
426
|
*/
|
|
427
427
|
_initialize(e) {
|
|
428
428
|
this._initSheetUIEvent(e), this._initObserverListener(e);
|
|
429
|
-
const r = e.get(
|
|
429
|
+
const r = e.get(R);
|
|
430
430
|
this.registerEventHandler(
|
|
431
431
|
this.Event.BeforeClipboardChange,
|
|
432
432
|
() => r.beforeCommandExecuted((t) => {
|
|
@@ -474,10 +474,10 @@ class xe extends Q {
|
|
|
474
474
|
), this.registerEventHandler(
|
|
475
475
|
this.Event.SheetSkeletonChanged,
|
|
476
476
|
() => r.onCommandExecuted((t) => {
|
|
477
|
-
if (
|
|
477
|
+
if (we.indexOf(t.id) > -1) {
|
|
478
478
|
const i = this.getActiveSheet();
|
|
479
479
|
if (!i) return;
|
|
480
|
-
const o =
|
|
480
|
+
const o = Ee(t, i.worksheet.getMaxColumns()).map((s) => {
|
|
481
481
|
var d, h;
|
|
482
482
|
return (h = (d = this.getWorkbook(s.unitId)) == null ? void 0 : d.getSheetBySheetId(s.subUnitId)) == null ? void 0 : h.getRange(s.range);
|
|
483
483
|
}).filter(Boolean);
|
|
@@ -513,7 +513,7 @@ class xe extends Q {
|
|
|
513
513
|
_beforeClipboardChange() {
|
|
514
514
|
const e = this._generateClipboardCopyParam();
|
|
515
515
|
if (e && (this.fireEvent(this.Event.BeforeClipboardChange, e), e.cancel))
|
|
516
|
-
throw new
|
|
516
|
+
throw new b();
|
|
517
517
|
}
|
|
518
518
|
_clipboardChanged() {
|
|
519
519
|
const e = this._generateClipboardCopyParam();
|
|
@@ -534,7 +534,7 @@ class xe extends Q {
|
|
|
534
534
|
const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet();
|
|
535
535
|
if (!e || !r)
|
|
536
536
|
return;
|
|
537
|
-
const o = (await this._injector.get(
|
|
537
|
+
const o = (await this._injector.get(Ue).read())[0];
|
|
538
538
|
let s;
|
|
539
539
|
if (o) {
|
|
540
540
|
const d = o.types, h = d.indexOf(Y) !== -1 ? await o.getType(Y).then((l) => l && l.text()) : "", g = d.indexOf(X) !== -1 ? await o.getType(X).then((l) => l && l.text()) : "";
|
|
@@ -550,12 +550,12 @@ class xe extends Q {
|
|
|
550
550
|
_beforeClipboardPaste(e) {
|
|
551
551
|
const r = this._generateClipboardPasteParam(e);
|
|
552
552
|
if (r && (this.fireEvent(this.Event.BeforeClipboardPaste, r), r.cancel))
|
|
553
|
-
throw new
|
|
553
|
+
throw new b();
|
|
554
554
|
}
|
|
555
555
|
_clipboardPaste(e) {
|
|
556
556
|
const r = this._generateClipboardPasteParam(e);
|
|
557
557
|
if (r && (this.fireEvent(this.Event.ClipboardPasted, r), r.cancel))
|
|
558
|
-
throw new
|
|
558
|
+
throw new b();
|
|
559
559
|
}
|
|
560
560
|
async _beforeClipboardPasteAsync() {
|
|
561
561
|
if (!J()) {
|
|
@@ -564,7 +564,7 @@ class xe extends Q {
|
|
|
564
564
|
}
|
|
565
565
|
const e = await this._generateClipboardPasteParamAsync();
|
|
566
566
|
if (e && (this.fireEvent(this.Event.BeforeClipboardPaste, e), e.cancel))
|
|
567
|
-
throw new
|
|
567
|
+
throw new b();
|
|
568
568
|
}
|
|
569
569
|
async _clipboardPasteAsync() {
|
|
570
570
|
if (!J()) {
|
|
@@ -573,7 +573,7 @@ class xe extends Q {
|
|
|
573
573
|
}
|
|
574
574
|
const e = await this._generateClipboardPasteParamAsync();
|
|
575
575
|
if (e && (this.fireEvent(this.Event.ClipboardPasted, e), e.cancel))
|
|
576
|
-
throw new
|
|
576
|
+
throw new b();
|
|
577
577
|
}
|
|
578
578
|
customizeColumnHeader(e) {
|
|
579
579
|
var g, l;
|
|
@@ -647,15 +647,18 @@ class xe extends Q {
|
|
|
647
647
|
getProtectedRangeShadowStrategy$() {
|
|
648
648
|
return this._injector.get(A).getProtectedRangeShadowStrategy$();
|
|
649
649
|
}
|
|
650
|
+
setPermissionDialogVisible(e) {
|
|
651
|
+
this._injector.get(ce).setShowComponents(e);
|
|
652
|
+
}
|
|
650
653
|
}
|
|
651
|
-
Q.extend(
|
|
652
|
-
class
|
|
654
|
+
Q.extend(Te);
|
|
655
|
+
class Ae extends re {
|
|
653
656
|
openSiderbar(e) {
|
|
654
|
-
return this._logDeprecation("openSiderbar"), this._injector.get(
|
|
657
|
+
return this._logDeprecation("openSiderbar"), this._injector.get(xe).open(e);
|
|
655
658
|
}
|
|
656
659
|
openDialog(e) {
|
|
657
660
|
this._logDeprecation("openDialog");
|
|
658
|
-
const t = this._injector.get(
|
|
661
|
+
const t = this._injector.get(Be).open({
|
|
659
662
|
...e,
|
|
660
663
|
onClose: () => {
|
|
661
664
|
t.dispose();
|
|
@@ -750,21 +753,21 @@ class Be extends re {
|
|
|
750
753
|
);
|
|
751
754
|
}
|
|
752
755
|
startEditing() {
|
|
753
|
-
const e = this._injector.get(
|
|
756
|
+
const e = this._injector.get(R);
|
|
754
757
|
return this._injector.get(p).isVisible().visible ? !0 : e.syncExecuteCommand(k.id, {
|
|
755
|
-
eventType:
|
|
758
|
+
eventType: L.Dblclick,
|
|
756
759
|
unitId: this._workbook.getUnitId(),
|
|
757
760
|
visible: !0
|
|
758
761
|
});
|
|
759
762
|
}
|
|
760
763
|
async endEditing(e) {
|
|
761
|
-
const r = this._injector.get(
|
|
764
|
+
const r = this._injector.get(R);
|
|
762
765
|
return this._injector.get(p).isVisible().visible && r.syncExecuteCommand(k.id, {
|
|
763
|
-
eventType:
|
|
766
|
+
eventType: L.Keyboard,
|
|
764
767
|
keycode: e ? B.ENTER : B.ESC,
|
|
765
768
|
visible: !1,
|
|
766
769
|
unitId: this._workbook.getUnitId()
|
|
767
|
-
}), await
|
|
770
|
+
}), await de(0), !0;
|
|
768
771
|
}
|
|
769
772
|
endEditingAsync(e = !0) {
|
|
770
773
|
return this.endEditing(e);
|
|
@@ -805,8 +808,8 @@ class Be extends re {
|
|
|
805
808
|
return t && t.with(y).showSelection(), this;
|
|
806
809
|
}
|
|
807
810
|
}
|
|
808
|
-
re.extend(
|
|
809
|
-
class
|
|
811
|
+
re.extend(Ae);
|
|
812
|
+
class je extends ne {
|
|
810
813
|
refreshCanvas() {
|
|
811
814
|
const e = this._injector.get(v), r = this._fWorkbook.id, t = e.getRenderById(r);
|
|
812
815
|
if (!t)
|
|
@@ -832,7 +835,7 @@ class De extends ne {
|
|
|
832
835
|
});
|
|
833
836
|
}
|
|
834
837
|
zoom(e) {
|
|
835
|
-
const r = this._injector.get(
|
|
838
|
+
const r = this._injector.get(R), t = Math.min(Math.max(e, 0.1), 4);
|
|
836
839
|
return r.executeCommand($.id, {
|
|
837
840
|
unitId: this._workbook.getUnitId(),
|
|
838
841
|
subUnitId: this._worksheet.getSheetId(),
|
|
@@ -855,14 +858,14 @@ class De extends ne {
|
|
|
855
858
|
if (!s) return i;
|
|
856
859
|
const d = s == null ? void 0 : s.getVisibleRanges();
|
|
857
860
|
if (!d) return i;
|
|
858
|
-
i = s.getVisibleRangeByViewport(
|
|
861
|
+
i = s.getVisibleRangeByViewport(Se.VIEW_MAIN);
|
|
859
862
|
for (const [h, g] of d)
|
|
860
|
-
|
|
863
|
+
me.indexOf(h) !== -1 && (i.startColumn = Math.min(i.startColumn, g.startColumn), i.startRow = Math.min(i.startRow, g.startRow), i.endColumn = Math.max(i.endColumn, g.endColumn), i.endRow = Math.max(i.endRow, g.endRow));
|
|
861
864
|
return i;
|
|
862
865
|
}
|
|
863
866
|
scrollToCell(e, r, t) {
|
|
864
867
|
const i = this._workbook.getUnitId(), s = this._injector.get(v).getRenderById(i);
|
|
865
|
-
return s && (s == null ? void 0 : s.with(
|
|
868
|
+
return s && (s == null ? void 0 : s.with(Ie)).scrollToCell(e, r, t), this;
|
|
866
869
|
}
|
|
867
870
|
getScrollState() {
|
|
868
871
|
const e = {
|
|
@@ -902,7 +905,7 @@ class De extends ne {
|
|
|
902
905
|
endRow: this._worksheet.getRowCount() - 1
|
|
903
906
|
}
|
|
904
907
|
];
|
|
905
|
-
return this._commandService.syncExecuteCommand(
|
|
908
|
+
return this._commandService.syncExecuteCommand(_e.id, {
|
|
906
909
|
unitId: t,
|
|
907
910
|
subUnitId: i,
|
|
908
911
|
ranges: o
|
|
@@ -920,7 +923,7 @@ class De extends ne {
|
|
|
920
923
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
921
924
|
}
|
|
922
925
|
];
|
|
923
|
-
return this._commandService.syncExecuteCommand(
|
|
926
|
+
return this._commandService.syncExecuteCommand(be.id, {
|
|
924
927
|
unitId: t,
|
|
925
928
|
subUnitId: i,
|
|
926
929
|
ranges: o
|
|
@@ -938,7 +941,7 @@ class De extends ne {
|
|
|
938
941
|
}
|
|
939
942
|
setColumnHeaderHeight(e) {
|
|
940
943
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
|
|
941
|
-
return this._commandService.executeCommand(
|
|
944
|
+
return this._commandService.executeCommand(Re.id, {
|
|
942
945
|
unitId: r,
|
|
943
946
|
subUnitId: t,
|
|
944
947
|
size: e
|
|
@@ -946,7 +949,7 @@ class De extends ne {
|
|
|
946
949
|
}
|
|
947
950
|
setRowHeaderWidth(e) {
|
|
948
951
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
|
|
949
|
-
return this._commandService.executeCommand(
|
|
952
|
+
return this._commandService.executeCommand(Pe.id, {
|
|
950
953
|
unitId: r,
|
|
951
954
|
subUnitId: t,
|
|
952
955
|
size: e
|
|
@@ -969,14 +972,14 @@ class De extends ne {
|
|
|
969
972
|
return s;
|
|
970
973
|
}
|
|
971
974
|
}
|
|
972
|
-
ne.extend(
|
|
973
|
-
class
|
|
975
|
+
ne.extend(je);
|
|
976
|
+
class $e extends ie {
|
|
974
977
|
setPermissionDialogVisible(e) {
|
|
975
978
|
this._permissionService.setShowComponents(e);
|
|
976
979
|
}
|
|
977
980
|
}
|
|
978
|
-
ie.extend(
|
|
979
|
-
class
|
|
981
|
+
ie.extend($e);
|
|
982
|
+
class We extends W {
|
|
980
983
|
onCellPointerMove(e) {
|
|
981
984
|
return m(this._injector.get(f).currentPosition$.subscribe(e));
|
|
982
985
|
}
|
|
@@ -989,27 +992,27 @@ class Ae extends W {
|
|
|
989
992
|
onCellDrop(e) {
|
|
990
993
|
return m(this._injector.get(M).endCell$.subscribe(e));
|
|
991
994
|
}
|
|
992
|
-
onCellRender(e, r =
|
|
993
|
-
return this._injector.get(
|
|
995
|
+
onCellRender(e, r = he.Style, t = pe.DATA_VALIDATION) {
|
|
996
|
+
return this._injector.get(fe).intercept(ke.CELL_CONTENT, {
|
|
994
997
|
effect: r,
|
|
995
998
|
handler: (i, o, s) => (i && !i.customRender && e && (i.customRender = [...e]), s(i)),
|
|
996
999
|
priority: t
|
|
997
1000
|
});
|
|
998
1001
|
}
|
|
999
1002
|
onBeforeCellEdit(e) {
|
|
1000
|
-
return this._injector.get(
|
|
1003
|
+
return this._injector.get(R).beforeCommandExecuted((r) => {
|
|
1001
1004
|
const t = r.params;
|
|
1002
1005
|
r.id === k.id && t.visible && e(t);
|
|
1003
1006
|
});
|
|
1004
1007
|
}
|
|
1005
1008
|
onAfterCellEdit(e) {
|
|
1006
|
-
return this._injector.get(
|
|
1009
|
+
return this._injector.get(R).onCommandExecuted((r) => {
|
|
1007
1010
|
const t = r.params;
|
|
1008
1011
|
r.id === k.id && !t.visible && e(t);
|
|
1009
1012
|
});
|
|
1010
1013
|
}
|
|
1011
1014
|
}
|
|
1012
|
-
W.extend(
|
|
1015
|
+
W.extend(We);
|
|
1013
1016
|
const H = {
|
|
1014
1017
|
CellClicked: "CellClicked",
|
|
1015
1018
|
CellPointerDown: "CellPointerDown",
|
|
@@ -1017,7 +1020,7 @@ const H = {
|
|
|
1017
1020
|
CellPointerMove: "CellPointerMove",
|
|
1018
1021
|
CellHover: "CellHover"
|
|
1019
1022
|
};
|
|
1020
|
-
class
|
|
1023
|
+
class Oe {
|
|
1021
1024
|
get BeforeClipboardChange() {
|
|
1022
1025
|
return "BeforeClipboardChange";
|
|
1023
1026
|
}
|
|
@@ -1115,8 +1118,8 @@ class je {
|
|
|
1115
1118
|
return "SheetZoomChanged";
|
|
1116
1119
|
}
|
|
1117
1120
|
}
|
|
1118
|
-
|
|
1119
|
-
class
|
|
1121
|
+
ue.extend(Oe);
|
|
1122
|
+
class Fe extends oe {
|
|
1120
1123
|
getCell() {
|
|
1121
1124
|
var d;
|
|
1122
1125
|
const e = this._injector.get(v), r = this._injector.get(U), t = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = e.getRenderById(t), s = (d = o == null ? void 0 : o.with(_).getSkeletonParam(i)) == null ? void 0 : d.skeleton;
|
|
@@ -1140,7 +1143,7 @@ class $e extends oe {
|
|
|
1140
1143
|
attachPopup(e) {
|
|
1141
1144
|
var s, d, h;
|
|
1142
1145
|
e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
|
|
1143
|
-
const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(
|
|
1146
|
+
const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(N).attachPopupToCell(
|
|
1144
1147
|
this._range.startRow,
|
|
1145
1148
|
this._range.startColumn,
|
|
1146
1149
|
{ ...e, componentKey: r },
|
|
@@ -1150,7 +1153,7 @@ class $e extends oe {
|
|
|
1150
1153
|
return o ? (t.add(o), t) : (t.dispose(), null);
|
|
1151
1154
|
}
|
|
1152
1155
|
attachAlertPopup(e) {
|
|
1153
|
-
const r = this._injector.get(
|
|
1156
|
+
const r = this._injector.get(He), t = {
|
|
1154
1157
|
workbook: this._workbook,
|
|
1155
1158
|
worksheet: this._worksheet,
|
|
1156
1159
|
row: this._range.startRow,
|
|
@@ -1182,7 +1185,7 @@ class $e extends oe {
|
|
|
1182
1185
|
attachRangePopup(e) {
|
|
1183
1186
|
var s, d, h;
|
|
1184
1187
|
e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
|
|
1185
|
-
const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(
|
|
1188
|
+
const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(N).attachRangePopup(
|
|
1186
1189
|
this._range,
|
|
1187
1190
|
{ ...e, componentKey: r },
|
|
1188
1191
|
this.getUnitId(),
|
|
@@ -1199,15 +1202,34 @@ class $e extends oe {
|
|
|
1199
1202
|
});
|
|
1200
1203
|
}
|
|
1201
1204
|
showDropdown(e) {
|
|
1202
|
-
return this._injector.get(
|
|
1205
|
+
return this._injector.get(Me).showDropdown(e);
|
|
1206
|
+
}
|
|
1207
|
+
async autoFill(e, r) {
|
|
1208
|
+
const t = this.getRange(), i = e.getRange();
|
|
1209
|
+
if (!ge.contains(i, t))
|
|
1210
|
+
throw new Error("AutoFill target range must contain source range");
|
|
1211
|
+
const { startRow: o, startColumn: s, endRow: d, endColumn: h } = t, { startRow: g, startColumn: l, endRow: a, endColumn: n } = i;
|
|
1212
|
+
if (d - o !== a - g && h - s !== n - l)
|
|
1213
|
+
throw new Error("AutoFill can only fill in one direction");
|
|
1214
|
+
if (d - o === a - g && s !== l && h !== n)
|
|
1215
|
+
throw new Error("AutoFill can only fill in one direction");
|
|
1216
|
+
if (h - s === n - l && o !== g && d !== a)
|
|
1217
|
+
throw new Error("AutoFill can only fill in one direction");
|
|
1218
|
+
return this._commandService.executeCommand(ye.id, {
|
|
1219
|
+
sourceRange: t,
|
|
1220
|
+
targetRange: i,
|
|
1221
|
+
unitId: this.getUnitId(),
|
|
1222
|
+
subUnitId: this.getSheetId(),
|
|
1223
|
+
applyType: r
|
|
1224
|
+
});
|
|
1203
1225
|
}
|
|
1204
1226
|
}
|
|
1205
|
-
oe.extend(
|
|
1206
|
-
function q(
|
|
1207
|
-
const { componentKey: r, isVue3: t } =
|
|
1227
|
+
oe.extend(Fe);
|
|
1228
|
+
function q(E, e) {
|
|
1229
|
+
const { componentKey: r, isVue3: t } = E;
|
|
1208
1230
|
let i;
|
|
1209
1231
|
const o = new j();
|
|
1210
|
-
return typeof r == "string" ? i = r : (i = `External_${
|
|
1232
|
+
return typeof r == "string" ? i = r : (i = `External_${le(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {
|
|
1211
1233
|
key: i,
|
|
1212
1234
|
disposableCollection: o
|
|
1213
1235
|
};
|