Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

xiugai

tonytonychopper123310e8583fb25
diff --git a/packages/base-sheets/src/Locale/en.ts b/packages/base-sheets/src/Locale/en.ts
index f23a5a60df..ff8b4c5632 100644
--- a/packages/base-sheets/src/Locale/en.ts
+++ b/packages/base-sheets/src/Locale/en.ts
@@ -1,514 +1 @@
-export default {
- spreadsheetLabel: 'Spreadsheet',
- spreadsheetRightLabel: 'more Sheets',
- spreadsheet: {
- one: 'one',
- two: 'two',
- three: 'three',
- },
-
- toolbar: {
- undo: 'Undo',
- redo: 'Redo',
- paintFormat: 'Paint format',
- currencyFormat: 'Format as currency',
- percentageFormat: 'Format as percent',
- numberDecrease: 'Decrease decimal places',
- numberIncrease: 'Increase decimal places',
- moreFormats: 'More formats',
- font: 'Font',
- fontSize: 'Font size',
- bold: 'Bold (Ctrl+B)',
- italic: 'Italic (Ctrl+I)',
- strikethrough: 'Strikethrough (Alt+Shift+5)',
- underline: 'Underline',
- textColor: {
- main: 'Text color',
- right: 'Choose color',
- },
- resetColor: 'Reset',
- customColor: 'CUSTOM',
- alternatingColors: 'Alternating colors',
- confirmColor: 'OK',
- cancelColor: 'Cancel',
- collapse: 'Collapse',
- fillColor: {
- main: 'Fill color',
- right: 'Choose color',
- },
- border: {
- main: 'Border',
- right: 'Border style',
- },
- mergeCell: {
- main: 'Merge cells',
- right: 'Choose merge type',
- },
- horizontalAlignMode: {
- main: 'Horizontal align',
- right: 'Alignment',
- },
- verticalAlignMode: {
- main: 'Vertical align',
- right: 'Alignment',
- },
- textWrapMode: {
- main: 'Text wrap',
- right: 'Text wrap mode',
- },
- textRotateMode: {
- main: 'Text rotate',
- right: 'Text rotate mode',
- },
- freezeTopRow: 'Freeze top row',
- sortAndFilter: 'Sort and filter',
- findAndReplace: 'Find and replace',
- sum: 'SUM',
- autoSum: 'Auto SUM',
- moreFunction: 'More functions',
- conditionalFormat: 'Conditional format',
- comment: 'Comment',
- pivotTable: 'Pivot Table',
- chart: 'Chart',
- screenshot: 'Screenshot',
- splitColumn: 'Split text',
- insertImage: 'Insert image',
- insertLink: 'Insert link',
- dataValidation: 'Data validation',
- protection: 'Protect the sheet',
-
- clearText: 'Clear color',
- noColorSelectedText: 'No color is selected',
-
- toolMore: 'More',
- toolLess: 'Less',
- toolClose: 'Close',
- toolMoreTip: 'More features',
- moreOptions: 'More options',
-
- cellFormat: 'Cell format config',
- print: 'Print',
- borderMethod: {
- top: 'Upper frame line',
- bottom: 'Lower frame line',
- left: 'Left frame line',
- right: 'Right frame line',
- },
- more: 'More',
- },
- defaultFmt: {
- Automatic: {
- text: 'Automatic',
- value: 'General',
- example: '',
- },
- Number: {
- text: 'Number',
- value: '##0.00',
- example: '1000.12',
- },
- Percent: {
- text: 'Percent',
- value: '#0.00%',
- example: '12.21%',
- },
- PlainText: {
- text: 'Plain text',
- value: '@',
- example: '',
- },
- Scientific: {
- text: 'Scientific',
- value: '0.00E+00',
- example: '1.01E+5',
- },
- Accounting: {
- text: 'Accounting',
- value: '¥(0.00)',
- example: '¥(1200.09)',
- },
- Thousand: {
- text: 'Ten Thousand',
- value: 'w',
- example: '1亿2000万2500',
- },
- Currency: {
- text: 'Currency',
- value: '¥0.00',
- example: '¥1200.09',
- },
- Digit: {
- text: '万元2位小数',
- value: 'w0.00',
- example: '2万2500.55',
- },
- Date: {
- text: 'Date',
- value: 'yyyy-MM-dd',
- example: '2017-11-29',
- },
- Time: { text: 'Time', value: 'hh:mm AM/PM', example: '3:00 PM' },
- Time24H: { text: 'Time 24H', value: 'hh:mm', example: '15:00' },
- DateTime: { text: 'Date time', value: 'yyyy-MM-dd hh:mm AM/PM', example: '2017-11-29 3:00 PM' },
- DateTime24H: { text: 'Date time 24H', value: 'yyyy-MM-dd hh:mm', example: '2017-11-29 15:00' },
- CustomFormats: { text: 'Custom Formats', value: 'fmtOtherSelf', example: '' },
- },
- format: {
- moreCurrency: 'More currency formats',
- moreDateTime: 'More date and time formats',
- moreNumber: 'More number formats',
-
- titleCurrency: 'Currency formats',
- decimalPlaces: 'Decimal places',
- titleDateTime: 'Date and time formats',
- titleNumber: 'Number formats',
- },
- fontFamily: {
- TimesNewRoman: 'Times New Roman',
- Arial: 'Arial',
- Tahoma: 'Tahoma',
- Verdana: 'Verdana',
- MicrosoftAccorblack: 'Microsoft Accor black ',
- SimSun: 'SimSun',
- SimHei: 'SimHei',
- Kaiti: 'Kaiti',
- FangSong: 'FangSong',
- NSimSun: 'NSimSun',
- STXinwei: 'STXinwei',
- STXingkai: 'STXingkai',
- STLiti: 'STLiti',
- HanaleiFill: 'HanaleiFill',
- Anton: 'Anton',
- Pacifico: 'Pacifico',
- },
- print: {
- normalBtn: 'Normal',
- layoutBtn: 'Page Layout',
- pageBtn: 'Page break preview',
-
- menuItemPrint: 'Print (Ctrl+P)',
- menuItemAreas: 'Print areas',
- menuItemRows: 'Print title rows',
- menuItemColumns: 'Print title columns',
- },
- align: {
- left: 'left',
- center: 'center',
- right: 'right',
-
- top: 'top',
- middle: 'middle',
- bottom: 'bottom',
- },
-
- dateFmtList: [
- {
- name: '1930-08-05',
- value: 'yyyy-MM-dd',
- },
- {
- name: '1930/8/5',
- value: 'yyyy/MM/dd',
- },
- {
- name: '08-05',
- value: 'MM-dd',
- },
- {
- name: '8-5',
- value: 'M-d',
- },
- {
- name: '13:30:30',
- value: 'h:mm:ss',
- },
- {
- name: '13:30',
- value: 'h:mm',
- },
- {
- name: 'PM 01:30',
- value: 'AM/PM hh:mm',
- },
- {
- name: 'PM 1:30',
- value: 'AM/PM h:mm',
- },
- {
- name: 'PM 1:30:30',
- value: 'AM/PM h:mm:ss',
- },
- {
- name: '08-05 PM 01:30',
- value: 'MM-dd AM/PM hh:mm',
- },
- ],
- numFmtList: [
- {
- name: '1235',
- value: '0',
- },
- {
- name: '1234.56',
- value: '0.00',
- },
- {
- name: '1,235',
- value: '#,##0',
- },
- {
- name: '1,234.56',
- value: '#,##0.00',
- },
- {
- name: '1,235',
- value: '#,##0_);(#,##0)',
- },
- {
- name: '1,235',
- value: '#,##0_);[Red](#,##0)',
- },
- {
- name: '1,234.56',
- value: '#,##0.00_);(#,##0.00)',
- },
- {
- name: '1,234.56',
- value: '#,##0.00_);[Red](#,##0.00)',
- },
- {
- name: '$1,235',
- value: '$#,##0_);($#,##0)',
- },
- {
- name: '$1,235',
- value: '$#,##0_);[Red]($#,##0)',
- },
- {
- name: '$1,234.56',
- value: '$#,##0.00_);($#,##0.00)',
- },
- {
- name: '$1,234.56',
- value: '$#,##0.00_);[Red]($#,##0.00)',
- },
- {
- name: '1234.56',
- value: '@',
- },
- {
- name: '123456%',
- value: '0%',
- },
- {
- name: '123456.00%',
- value: '0.00%',
- },
- {
- name: '1.23E+03',
- value: '0.00E+00',
- },
- {
- name: '1.2E+3',
- value: '##0.0E+0',
- },
- {
- name: '1234 5/9',
- value: '# ?/?',
- },
- {
- name: '1234 14/25',
- value: '# ??/??',
- },
- {
- name: '$ 1,235',
- value: '_($* #,##0_);_(...($* "-"_);_(@_)',
- },
- {
- name: '1,235',
- value: '_(* #,##0_);_(*..._(* "-"_);_(@_)',
- },
- {
- name: '$ 1,234.56',
- // "value": '_($* #,##0.00_)...* "-"??_);_(@_)'
- value: '_($* #,##0.00_);_(...($* "-"_);_(@_)',
- },
- {
- name: '1,234.56',
- value: '_(* #,##0.00_);...* "-"??_);_(@_)',
- },
- ],
- button: {
- confirm: 'OK',
- cancel: 'Cancel',
- close: 'Close',
- update: 'Update',
- delete: 'Delete',
- insert: 'Insert',
- prevPage: 'Previous',
- nextPage: 'Next',
- total: 'total:',
- },
- punctuation: {
- tab: 'Tab',
- semicolon: 'semicolond',
- comma: 'comma',
- space: 'space',
- },
- colorPicker: {
- collapse: 'Collapse',
- customColor: 'CUSTOM',
- change: 'Change',
- confirmColor: 'OK',
- cancelColor: 'Cancel',
- },
- borderLine: {
- borderTop: 'borderTop',
- borderBottom: 'borderBottom',
- borderLeft: 'borderLeft',
- borderRight: 'borderRight',
- borderNone: 'borderNone',
- borderAll: 'borderAll',
- borderOutside: 'borderOutside',
- borderInside: 'borderInside',
- borderHorizontal: 'borderHorizontal',
- borderVertical: 'borderVertical',
- borderColor: 'borderColor',
- borderSize: 'borderSize',
- },
- merge: {
- all: 'Merge all',
- vertical: 'Vertical merge',
- horizontal: 'Horizontal merger',
- cancel: 'Cancel merge',
- overlappingError: 'Cannot merge overlapping areas',
- partiallyError: 'Cannot perform this operation on partially merged cells',
- },
- textWrap: {
- overflow: 'Overflow',
- wrap: 'Wrap',
- clip: 'Clip',
- },
- textRotate: {
- none: 'None',
- angleUp: 'Tilt Up',
- angleDown: 'Tilt Down',
- vertical: 'Stack Vertically',
- rotationUp: 'Rotate Up',
- rotationDown: 'Rotate Down',
- },
- sheetConfig: {
- delete: 'Delete',
- copy: 'Copy',
- rename: 'Rename',
- changeColor: 'Change color',
- hide: 'Hide',
- unhide: 'Unhide',
- moveLeft: 'Move left',
- moveRight: 'Move right',
- resetColor: 'Reset color',
- cancelText: 'Cancel',
- chooseText: 'Confirm color',
-
- tipNameRepeat: 'The name of the tab page cannot be repeated! Please revise',
- noMoreSheet: 'The workbook contains at least one visual worksheet. To delete the selected worksheet, please insert a new worksheet or show a hidden worksheet.',
- confirmDelete: 'Are you sure to delete',
- redoDelete: 'Can be undo by Ctrl+Z',
- noHide: "Can't hide, at least keep one sheet tag",
- chartEditNoOpt: 'This operation is not allowed in chart editing mode!',
- sheetNameSpecCharError: 'The name cannot contain:[ ] : ? * / \' "',
- sheetNameCannotIsEmptyError: 'Sheet name cannot be empty',
- },
- rightClick: {
- copy: 'Copy',
- copyAs: 'Copy as',
- cut: 'Cut',
- paste: 'Paste',
- insert: 'Insert',
- delete: 'Delete',
- deleteCell: 'Delete cell',
- deleteSelected: 'Delete selected ',
- hide: 'Hide',
- hideSelected: 'Hide selected ',
- showHide: 'Show hidden ',
- to: 'Towards',
- left: 'Left',
- right: 'Right',
- top: 'Top',
- bottom: 'Bottom',
- moveLeft: 'Move left',
- moveUp: 'Move up',
- add: 'Add',
- row: 'Row',
- column: 'Column',
- width: 'Width',
- height: 'Height',
- number: 'Number',
- confirm: 'Confirm',
- orderAZ: 'A-Z order',
- orderZA: 'Z-A order',
- clearContent: 'Clear content',
- matrix: 'Matrix operation',
- sortSelection: 'Sort',
- filterSelection: 'Filter',
- chartGeneration: 'Create chart',
- firstLineTitle: 'first line title',
- untitled: 'untitled',
- array1: 'One-dimensional array',
- array2: 'Two-dimensional array',
- array3: 'Multidimensional Arrays',
- diagonal: 'Diagonal',
- antiDiagonal: 'Anti-diagonal',
- diagonalOffset: 'Diagonal offset',
- offset: 'Offset',
- boolean: 'Boolean',
- flip: 'Flip',
- upAndDown: 'Up and down',
- leftAndRight: 'Left and right',
- clockwise: 'Clockwise',
- counterclockwise: 'Counterclockwise',
- transpose: 'Transpose',
- matrixCalculation: 'Matrix calculation',
- plus: 'Plus',
- minus: 'Minus',
- multiply: 'Multiply',
- divided: 'Divided',
- power: 'Power',
- root: 'Root',
- log: 'Log',
- delete0: 'Delete 0 values at both ends',
- removeDuplicate: 'Remove duplicate values',
- byRow: 'By row',
- byCol: 'By column',
- generateNewMatrix: 'Generate new matrix',
- },
- info: {
- detailUpdate: 'New opened',
- detailSave: 'Local cache restored',
- row: '',
- column: '',
- loading: 'Loading...',
-
- copy: 'Copy',
- return: 'Exit',
- rename: 'Rename',
- tips: 'Rename',
- noName: 'Untitled spreadsheet',
- wait: 'waiting for update',
-
- add: 'Add',
- addLast: 'more rows at bottom',
- backTop: 'Back to the top',
- // eslint-disable-next-line no-template-curly-in-string
- pageInfo: 'Total ${total},${totalPage} page,current ${currentPage}',
- nextPage: 'Next',
-
- tipInputNumber: 'Please enter the number',
- tipInputNumberLimit: 'The increase range is limited to 1-100',
-
- tipRowHeightLimit: 'Row height must be between 0 ~ 545',
- tipColumnWidthLimit: 'The column width must be between 0 ~ 2038',
- // eslint-disable-next-line no-template-curly-in-string
- pageInfoFull: 'Total ${total},${totalPage} page,All data displayed',
- },
-};
+export default {};
diff --git a/packages/base-sheets/src/Locale/zh.ts b/packages/base-sheets/src/Locale/zh.ts
index ac0a278601..ff8b4c5632 100644
--- a/packages/base-sheets/src/Locale/zh.ts
+++ b/packages/base-sheets/src/Locale/zh.ts
@@ -1,377 +1 @@
-export default {
- spreadsheetLabel: '插件',
- spreadsheetRightLabel: '更多 Sheets',
- spreadsheet: {
- one: '一',
- two: '二',
- three: '三',
- },
- // toolbar.undo
- toolbar: {
- undo: '撤销',
- redo: '重做',
- paintFormat: '格式刷',
- currencyFormat: '货币格式',
- percentageFormat: '百分比格式',
- numberDecrease: '减少小数位数',
- numberIncrease: '增加小数位数',
- moreFormats: '更多格式',
- font: '字体',
- fontSize: '字号大小',
- bold: '粗体 (Ctrl+B)',
- italic: '斜体 (Ctrl+I)',
- strikethrough: '删除线 (Alt+Shift+5)',
- underline: '下划线',
- textColor: {
- main: '文本颜色',
- right: '颜色选择',
- },
- resetColor: '重置颜色',
- customColor: '自定义',
- alternatingColors: '交替颜色',
- confirmColor: '确定颜色',
- cancelColor: '取消',
- collapse: '收起',
- fillColor: {
- main: '单元格颜色',
- right: '颜色选择',
- },
- border: {
- main: '边框',
- right: '边框类型',
- },
- mergeCell: {
- main: '合并单元格',
- right: '选择合并类型',
- },
- horizontalAlignMode: {
- main: '水平对齐',
- right: '对齐方式',
- },
- verticalAlignMode: {
- main: '垂直对齐',
- right: '对齐方式',
- },
- textWrapMode: {
- main: '文本换行',
- right: '换行方式',
- },
- textRotateMode: {
- main: '文本旋转',
- right: '旋转方式',
- },
- freezeTopRow: '冻结首行',
- sortAndFilter: '排序和筛选',
- findAndReplace: '查找替换',
- sum: '求和',
- autoSum: '自动求和',
- moreFunction: '更多函数',
- conditionalalFormat: '条件格式',
- comment: '批注',
- pivotTable: '数据透视表',
- chart: '图表',
- screenshot: '截图',
- splitColumn: '分列',
- insertImage: '插入图片',
- insertLink: '插入链接',
- dataValidation: '数据验证',
- protection: '保护工作表内容',
-
- clearText: '清除颜色选择',
- noColorSelectedText: '没有颜色被选择',
-
- toolMore: '更多',
- toolLess: '少于',
- toolClose: '收起',
- toolMoreTip: '更多功能',
- moreOptions: '更多选项',
-
- cellFormat: '设置单元格格式',
- print: '打印',
- borderMethod: {
- top: '上框线',
- bottom: '下框线',
- left: '左框线',
- right: '右框线',
- },
- more: '更多',
- },
- defaultFmt: {
- Automatic: {
- text: '自动',
- value: 'General',
- example: '',
- },
- Number: {
- text: '数字',
- value: '##0.00',
- example: '1000.12',
- },
- Percent: {
- text: '百分比',
- value: '#0.00%',
- example: '12.21%',
- },
- PlainText: {
- text: '纯文本',
- value: '@',
- example: '',
- },
- Scientific: {
- text: '科学计数',
- value: '0.00E+00',
- example: '1.01E+5',
- },
- Accounting: {
- text: '会计',
- value: '¥(0.00)',
- example: '¥(1200.09)',
- },
- Thousand: {
- text: '万元',
- value: 'w',
- example: '1亿2000万2500',
- },
- Currency: {
- text: '货币',
- value: '¥0.00',
- example: '¥1200.09',
- },
- Digit: {
- text: '万元2位小数',
- value: 'w0.00',
- example: '2万2500.55',
- },
- Date: {
- text: '日期',
- value: 'yyyy-MM-dd',
- example: '2017-11-29',
- },
- Time: { text: '时间', value: 'hh:mm AM/PM', example: '3:00 PM' },
- Time24H: { text: '时间24H', value: 'hh:mm', example: '15:00' },
- DateTime: { text: '日期时间', value: 'yyyy-MM-dd hh:mm AM/PM', example: '2017-11-29 3:00 PM' },
- DateTime24H: { text: '日期时间24H', value: 'yyyy-MM-dd hh:mm', example: '2017-11-29 15:00' },
- CustomFormats: { text: '自定义格式', value: 'fmtOtherSelf', example: '' },
- },
- format: {
- moreCurrency: '更多货币格式',
- moreDateTime: '更多日期与时间格式',
- moreNumber: '更多数字格式',
-
- titleCurrency: '货币格式',
- decimalPlaces: '小数位数',
- titleDateTime: '日期与时间格式',
- titleNumber: '数字格式',
- },
- fontFamily: {
- TimesNewRoman: 'Times New Roman',
- Arial: 'Arial',
- Tahoma: 'Tahoma',
- Verdana: 'Verdana',
- MicrosoftAccorblack: '微软雅黑',
- SimSun: '宋体',
- SimHei: '黑体',
- Kaiti: '楷体',
- FangSong: '仿宋',
- NSimSun: '新宋体',
- STXinwei: '华文新魏',
- STXingkai: '华文行楷',
- STLiti: '华文隶书',
- HanaleiFill: 'HanaleiFill',
- Anton: 'Anton',
- Pacifico: 'Pacifico',
- },
- print: {
- normalBtn: '常规视图',
- layoutBtn: '页面布局',
- pageBtn: '分页预览',
-
- menuItemPrint: '打印(Ctrl+P)',
- menuItemAreas: '打印区域',
- menuItemRows: '打印标题行',
- menuItemColumns: '打印标题列',
- },
- 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: '边框粗细',
- },
- merge: {
- all: '全部合并',
- vertical: '垂直合并',
- horizontal: '水平合并',
- cancel: '取消合并',
- overlappingError: '不能合并重叠区域',
- partiallyError: '无法对部分合并单元格执行此操作',
- },
- 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: '不能隐藏, 至少保留一个sheet标签',
- chartEditNoOpt: '图表编辑模式下不允许该操作!',
- sheetNameSpecCharError: "名称不能超过31个字符,首尾不能是' 且名称不能包含:\r\n[ ] : \\ ? * /",
- sheetNameCannotIsEmptyError: '名称不能为空!',
- },
- rightClick: {
- copy: '复制',
- copyAs: '复制为',
- cut: '剪切',
- paste: '粘贴',
- insert: '插入',
- delete: '删除',
- deleteCell: '删除单元格',
- deleteSelected: '删除选中',
- hide: '隐藏',
- hideSelected: '隐藏选中',
- showHide: '显示隐藏',
- to: '向',
- left: '左',
- right: '右',
- top: '上',
- bottom: '下',
- moveLeft: '左移',
- moveUp: '上移',
- add: '增加',
- row: '行',
- column: '列',
- width: '宽',
- height: '高',
- number: '数字',
- confirm: '确认',
- orderAZ: 'A-Z顺序排列',
- orderZA: 'Z-A降序排列',
- clearContent: '清除内容',
- matrix: '矩阵操作选区',
- sortSelection: '排序选区',
- filterSelection: '筛选选区',
- chartGeneration: '图表生成',
- firstLineTitle: '首行为标题',
- untitled: '无标题',
- array1: '一维数组',
- array2: '二维数组',
- array3: '多维数组',
- diagonal: '对角线',
- antiDiagonal: '反对角线',
- diagonalOffset: '对角偏移',
- offset: '偏移量',
- boolean: '布尔值',
- flip: '翻转',
- upAndDown: '上下',
- leftAndRight: '左右',
- clockwise: '顺时针',
- counterclockwise: '逆时针',
- transpose: '转置',
- matrixCalculation: '矩阵计算',
- plus: '加',
- minus: '减',
- multiply: '乘',
- divided: '除',
- power: '次方',
- root: '次方根',
- log: 'log',
- delete0: '删除两端0值',
- removeDuplicate: '删除重复值',
- byRow: '按行',
- byCol: '按列',
- generateNewMatrix: '生成新矩阵',
- },
- info: {
- detailUpdate: '新打开',
- detailSave: '已恢复本地缓存',
- row: '行',
- column: '列',
- loading: '渲染中···',
-
- copy: '副本',
- return: '返回',
- rename: '重命名',
- tips: '重命名',
- noName: '无标题的电子表格',
- wait: '待更新',
-
- add: '添加',
- addLast: '在底部添加',
- backTop: '回到顶部',
- // eslint-disable-next-line no-template-curly-in-string
- pageInfo: '共${total}条,${totalPage}页,当前已显示${currentPage}页',
- nextPage: '下一页',
-
- tipInputNumber: '请输入数字',
- tipInputNumberLimit: '增加范围限制在1-100',
-
- tipRowHeightLimit: '行高必须在0 ~ 545之间',
- tipColumnWidthLimit: '列宽必须在0 ~ 2038之间',
- // eslint-disable-next-line no-template-curly-in-string
- pageInfoFull: '共${total}条,${totalPage}页,已显示全部数据',
- },
-};
+export default {};
diff --git a/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx b/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
index 59a787c5df..0acecb68de 100644
--- a/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
+++ b/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
@@ -130,14 +130,6 @@ class ColorPicker extends Component<BaseColorPickerProps, IState> {
render() {
const obj = Object.assign(this.state.styles || {}, this.props.style);
- this.props.lang = this.props.lang ?? {
- collapse: '',
- customColor: '',
- confirmColor: '',
- cancelColor: '',
- change: '',
- };
-
return (
<div className={`${styles.colorPickerOuter} ${this.props.className}`} ref={this.ulRef} style={{ ...obj }}>
<div
@@ -169,7 +161,7 @@ class ColorPicker extends Component<BaseColorPickerProps, IState> {
))}
</div>
<div>
- <Button onClick={this.onSwitch}>{this.state.setting ? this.props.lang.collapse : this.props.lang.customColor}</Button>
+ <Button onClick={this.onSwitch}>{this.state.setting ? this.getLocale('colorPicker.collapse') : this.getLocale('colorPicker.customColor')}</Button>
</div>
</div>
@@ -185,7 +177,7 @@ class ColorPicker extends Component<BaseColorPickerProps, IState> {
// this.hideSelect();
}}
>
- {this.props.lang.confirmColor}
+ {this.getLocale('colorPicker.confirmColor')}
</Button>
<Button
danger
@@ -193,7 +185,7 @@ class ColorPicker extends Component<BaseColorPickerProps, IState> {
this.onCancel();
}}
>
- {this.props.lang.cancelColor}
+ {this.getLocale('colorPicker.cancelColor')}
</Button>
<Button
onClick={(e: MouseEvent) => {
@@ -203,7 +195,7 @@ class ColorPicker extends Component<BaseColorPickerProps, IState> {
});
}}
>
- {this.props.lang.change}
+ {this.getLocale('colorPicker.change')}
</Button>
</div>
</div>
diff --git a/packages/base-ui/src/Components/Item/Item.tsx b/packages/base-ui/src/Components/Item/Item.tsx
index 5c9095e1e2..cff02ef109 100644
--- a/packages/base-ui/src/Components/Item/Item.tsx
+++ b/packages/base-ui/src/Components/Item/Item.tsx
@@ -1,5 +1,4 @@
import { ComponentChildren, Component } from '../../Framework';
-import { BaseComponentRender } from '../../BaseComponent';
import { BaseMenuItem } from '../../Interfaces';
import { joinClassNames } from '../../Utils';
import styles from './index.module.less';
@@ -12,7 +11,11 @@ export interface BaseItemProps extends BaseMenuItem {
}
export class Item extends Component<BaseItemProps> {
- private _render: BaseComponentRender;
+ getLabelLocale(label: ComponentChildren) {
+ if (typeof label === 'string') {
+ return this.getLocale(label);
+ }
+ }
render() {
const { selected, label, suffix, disabled } = this.props;
@@ -25,7 +28,7 @@ export class Item extends Component<BaseItemProps> {
) : (
''
)}
- <span className={styles.selectItemContent}>{label}</span>
+ <span className={styles.selectItemContent}>{this.getLabelLocale(label)}</span>
{suffix ? <span className={styles.selectItemSuffix}>{suffix}</span> : ''}
</div>
);
diff --git a/packages/base-ui/src/Framework/Preact.ts b/packages/base-ui/src/Framework/Preact.ts
index f2ad8ca081..70ccc13817 100644
--- a/packages/base-ui/src/Framework/Preact.ts
+++ b/packages/base-ui/src/Framework/Preact.ts
@@ -15,13 +15,14 @@ abstract class Component<P = {}, S = {}> extends PreactComponent<P, S> {
this.initialize(props);
}
- protected initialize(props?: P): void {}
+ protected initialize(props?: P): void { }
getContext(): Context {
return this.context.context;
}
- getLocale(name: string) {
+ getLocale(name?: string) {
+ if (!name) return;
return this.getContext().getLocale().get(name);
}
}
@@ -36,7 +37,7 @@ abstract class PureComponent<P = {}, S = {}> extends PreactPureComponent<P, S> {
this.initialize(props);
}
- protected initialize(props?: P): void {}
+ protected initialize(props?: P): void { }
getContext(): Context {
return this.context.context;
diff --git a/packages/core/src/Shared/Locale.ts b/packages/core/src/Shared/Locale.ts
index 0464434556..dd7ca2b469 100644
--- a/packages/core/src/Shared/Locale.ts
+++ b/packages/core/src/Shared/Locale.ts
@@ -63,7 +63,6 @@ export class Locale {
: LocaleType.EN,
locales: { zh, en },
};
- console.dir(this.options);
}
/**
@@ -81,7 +80,7 @@ export class Locale {
if (key) {
// const { locales, currentLocale } = this.options;
const { locales, currentLocale } = this.options;
- return (Locale.getValue(locales[currentLocale], key) as string) || '';
+ return (Locale.getValue(locales[currentLocale], key) as string) || key;
}
return String();
}
diff --git a/packages/ui-plugin-sheets/src/Controller/RightMenuUIController.ts b/packages/ui-plugin-sheets/src/Controller/RightMenuUIController.ts
index 4dcfdb4d8e..1b6243524a 100644
--- a/packages/ui-plugin-sheets/src/Controller/RightMenuUIController.ts
+++ b/packages/ui-plugin-sheets/src/Controller/RightMenuUIController.ts
@@ -1,5 +1,7 @@
+import { IMouseEvent, IPointerEvent } from '@univerjs/base-render';
+import { SheetPlugin } from '@univerjs/base-sheets';
import { BaseMenuItem, BaseSelectChildrenProps, resetDataLabel } from '@univerjs/base-ui';
-import { Tools } from '@univerjs/core';
+import { PLUGIN_NAMES, Tools } from '@univerjs/core';
import { SheetUIPlugin } from '..';
import { DefaultRightMenuConfig, SheetRightMenuConfig } from '../Basics';
import { RightMenu } from '../View';
@@ -14,14 +16,12 @@ interface CustomLabelProps {
prefixLocale?: string[] | string;
suffixLocale?: string[] | string;
options?: CustomLabelOptions[];
- locale?: string;
label?: string;
children?: CustomLabelProps[];
onKeyUp?: (e: Event) => void;
}
export interface RightMenuProps extends BaseMenuItem {
- locale?: string[];
customLabel?: {
name: string;
props?: CustomLabelProps;
@@ -29,11 +29,14 @@ export interface RightMenuProps extends BaseMenuItem {
children?: RightMenuProps[];
suffix?: string;
border?: boolean;
+ locale?: string
}
export class RightMenuUIController {
private _plugin: SheetUIPlugin;
+ private _sheetPlugin: SheetPlugin
+
private _rightMenu: RightMenu;
private _menuList: RightMenuProps[];
@@ -43,12 +46,15 @@ export class RightMenuUIController {
constructor(plugin: SheetUIPlugin, config?: SheetRightMenuConfig) {
this._plugin = plugin;
+ this._sheetPlugin = plugin.getContext().getUniver().getCurrentUniverSheetInstance().context.getPluginManager().getPluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)!;
+
this._config = Tools.deepMerge({}, DefaultRightMenuConfig, config);
+
this._menuList = [
{
- locale: ['rightClick.insert', 'rightClick.row'],
- onClick: () => {},
+ locale: 'rightClick.insertRow',
+ onClick: () => { },
show: this._config.InsertRow,
},
];
@@ -57,14 +63,11 @@ export class RightMenuUIController {
}
private _initialize() {
- setTimeout(() => {
- // this._plugin
- // .getSheetContainerController()
- // .getContentRef()
- // .current?.addEventListener('click', (e) => {
- // this._rightMenu.handleContextMenu(e as any);
- // });
- }, 1000);
+ this._sheetPlugin.getMainComponent().onPointerDownObserver.add((evt: IPointerEvent | IMouseEvent) => {
+ if (evt.button === 2) {
+ this._rightMenu.handleContextMenu(evt);
+ }
+ });
}
// 获取RightMenu组件
diff --git a/packages/ui-plugin-sheets/src/Controller/SheetContainerUIController.ts b/packages/ui-plugin-sheets/src/Controller/SheetContainerUIController.ts
index 89d3ff50fc..f183ff183c 100644
--- a/packages/ui-plugin-sheets/src/Controller/SheetContainerUIController.ts
+++ b/packages/ui-plugin-sheets/src/Controller/SheetContainerUIController.ts
@@ -125,7 +125,7 @@ export class SheetContainerUIController {
// renameSheet: this._infoBarController.renameSheet,
},
rightMenu: {
- // getComponent: this._rightMenuController.getComponent,
+ getComponent: this._rightMenuController.getComponent,
},
countBar: {
// getComponent: this._countBarController.getComponent,
diff --git a/packages/ui-plugin-sheets/src/Controller/ToolbarUIController.ts b/packages/ui-plugin-sheets/src/Controller/ToolbarUIController.ts
index 3907e2c107..b88485ba7d 100644
--- a/packages/ui-plugin-sheets/src/Controller/ToolbarUIController.ts
+++ b/packages/ui-plugin-sheets/src/Controller/ToolbarUIController.ts
@@ -1,20 +1,18 @@
-import { BaseSelectChildrenProps, BaseSelectProps, BaseTextButtonProps, resetDataLabel } from '@univerjs/base-ui';
-import { DEFAULT_STYLES, Tools, UIObserver } from '@univerjs/core';
+import { BaseSelectChildrenProps, BaseSelectProps, BaseTextButtonProps, ColorPicker } from '@univerjs/base-ui';
+import { DEFAULT_STYLES, HorizontalAlign, Tools, UIObserver, VerticalAlign, WrapStrategy } from '@univerjs/core';
import { SheetUIPlugin } from '..';
-import { DefaultToolbarConfig, SheetToolbarConfig } from '../Basics';
+import { DefaultToolbarConfig, SheetToolbarConfig, SHEET_UI_PLUGIN_NAME } from '../Basics';
import { ColorSelect, LineBold, LineColor, Toolbar } from '../View';
-import { FONT_FAMILY_CHILDREN, FONT_SIZE_CHILDREN } from '../View/ToolBar/Const';
+import { BORDER_LINE_CHILDREN, BORDER_SIZE_CHILDREN, FONT_FAMILY_CHILDREN, FONT_SIZE_CHILDREN, HORIZONTAL_ALIGN_CHILDREN, MERGE_CHILDREN, TEXT_ROTATE_CHILDREN, TEXT_WRAP_CHILDREN, VERTICAL_ALIGN_CHILDREN } from '../View/ToolBar/Const';
import styles from '../View/ToolBar/index.module.less';
// 继承基础下拉属性,添加国际化
export interface BaseToolbarSelectChildrenProps extends BaseSelectChildrenProps {
- locale?: string;
suffixLocale?: string;
children?: BaseToolbarSelectChildrenProps[];
}
export interface BaseToolbarSelectProps extends BaseSelectProps {
- locale?: string;
suffixLocale?: string;
children?: BaseToolbarSelectChildrenProps[];
}
@@ -27,8 +25,6 @@ enum ToolbarType {
export interface IToolbarItemProps extends BaseToolbarSelectProps, BaseTextButtonProps {
show?: boolean; //是否显示按钮
toolbarType?: ToolbarType;
- locale?: string; //label国际化
- tooltipLocale?: string; //tooltip国际化 TODO: need right label
tooltip?: string; //tooltip文字
border?: boolean;
}
@@ -47,8 +43,6 @@ export class ToolbarUIController {
private _config: SheetToolbarConfig;
- private _moreText: Record<string, string>;
-
private _lineColor: LineColor;
private _lineBold: LineBold;
@@ -65,7 +59,7 @@ export class ToolbarUIController {
this._toolList = [
{
toolbarType: 1,
- tooltipLocale: 'toolbar.undo',
+ tooltip: 'toolbar.undo',
name: 'undo',
customLabel: {
name: 'ForwardIcon',
@@ -75,7 +69,7 @@ export class ToolbarUIController {
},
{
toolbarType: 1,
- tooltipLocale: 'toolbar.redo',
+ tooltip: 'toolbar.redo',
customLabel: {
name: 'BackIcon',
},
@@ -115,7 +109,7 @@ export class ToolbarUIController {
// },
{
type: 0,
- tooltipLocale: 'toolbar.font',
+ tooltip: 'toolbar.font',
className: styles.selectLabelString,
name: 'font',
show: this._config.font,
@@ -127,7 +121,7 @@ export class ToolbarUIController {
},
{
type: 1,
- tooltipLocale: 'toolbar.fontSize',
+ tooltip: 'toolbar.fontSize',
label: String(DEFAULT_STYLES.fs),
name: 'fontSize',
show: this._config.fontSize,
@@ -139,253 +133,251 @@ export class ToolbarUIController {
},
children: FONT_SIZE_CHILDREN,
},
- // {
- // toolbarType: 1,
- // tooltipLocale: 'toolbar.bold',
- // customLabel: {
- // name: 'BoldIcon',
- // },
- // active: false,
- // name: 'bold',
- // show: this._config.bold,
- // onClick: (isBold: boolean) => {
- // this._plugin.getObserver('onAfterChangeFontWeightObservable')?.notifyObservers(isBold);
- // },
- // },
- // {
- // toolbarType: 1,
- // tooltipLocale: 'toolbar.italic',
- // customLabel: {
- // name: 'ItalicIcon',
- // },
- // name: 'italic',
- // show: this._config.italic,
- // onClick: (isItalic: boolean) => {
- // this._plugin.getObserver('onAfterChangeFontItalicObservable')?.notifyObservers(isItalic);
- // },
- // },
- // {
- // toolbarType: 1,
- // tooltipLocale: 'toolbar.strikethrough',
- // customLabel: {
- // name: 'DeleteLineIcon',
- // },
- // name: 'strikethrough',
- // show: this._config.strikethrough,
- // onClick: (isStrikethrough: boolean) => {
- // this._plugin.getObserver('onAfterChangeFontStrikethroughObservable')?.notifyObservers(isStrikethrough);
- // },
- // },
- // {
- // toolbarType: 1,
- // tooltipLocale: 'toolbar.underline',
- // customLabel: {
- // name: 'UnderLineIcon',
- // },
- // name: 'underline',
- // show: this._config.underline,
- // onClick: (isItalic: boolean) => {
- // this._plugin.getObserver('onAfterChangeFontUnderlineObservable')?.notifyObservers(isItalic);
- // },
- // },
- // {
- // type: 5,
- // tooltipLocale: 'toolbar.textColor.main',
- // customLabel: {
- // name: pluginName + ColorSelect.name,
- // props: {
- // customLabel: {
- // name: 'TextColorIcon',
- // },
- // id: 'textColor',
- // },
- // },
- // hideSelectedIcon: true,
- // className: styles.selectColorPickerParent,
- // children: [
- // {
- // customLabel: {
- // name: pluginName + ColorPicker.name,
- // props: {
- // onClick: (color: string, e: MouseEvent) => {
- // const colorSelect = this._colorSelect.find((item) => item.getId() === 'textColor');
- // colorSelect?.setColor(color);
- // this._plugin.getObserver('onAfterChangeFontColorObservable')?.notifyObservers(color);
- // },
- // lang: {
- // collapseLocale: 'colorPicker.collapse',
- // customColorLocale: 'colorPicker.customColor',
- // confirmColorLocale: 'colorPicker.confirmColor',
- // cancelColorLocale: 'colorPicker.cancelColor',
- // changeLocale: 'colorPicker.change',
- // },
- // },
- // },
- // className: styles.selectColorPicker,
- // },
- // ],
- // name: 'textColor',
- // show: this._config.textColor,
- // },
- // {
- // type: 5,
- // tooltipLocale: 'toolbar.fillColor.main',
- // customLabel: {
- // name: pluginName + ColorSelect.name,
- // props: {
- // customLabel: {
- // name: 'FillColorIcon',
- // },
- // id: 'fillColor',
- // },
- // },
- // hideSelectedIcon: true,
- // className: styles.selectColorPickerParent,
- // children: [
- // {
- // customLabel: {
- // name: pluginName + ColorPicker.name,
- // props: {
- // onClick: (color: string, e: MouseEvent) => {
- // const colorSelect = this._colorSelect.find((item) => item.getId() === 'fillColor');
- // colorSelect?.setColor(color);
- // this._plugin.getObserver('onAfterChangeFontBackgroundObservable')?.notifyObservers(color);
- // },
- // lang: {
- // collapseLocale: 'colorPicker.collapse',
- // customColorLocale: 'colorPicker.customColor',
- // confirmColorLocale: 'colorPicker.confirmColor',
- // cancelColorLocale: 'colorPicker.cancelColor',
- // changeLocale: 'colorPicker.change',
- // },
- // },
- // },
- // className: styles.selectColorPicker,
- // },
- // ],
- // name: 'fillColor',
- // show: this._config.fillColor,
- // },
- // {
- // type: 3,
- // display: 1,
- // show: this._config.border,
- // tooltipLocale: 'toolbar.border.main',
- // className: styles.selectDoubleString,
- // onClick: (value) => {
- // if (value) {
- // this.setBorder(value);
- // }
- // },
- // name: 'border',
- // children: [
- // ...BORDER_LINE_CHILDREN,
- // {
- // customLabel: {
- // name: pluginName + LineColor.name,
- // props: {
- // locale: 'borderLine.borderColor',
- // },
- // },
- // unSelectable: true,
- // className: styles.selectColorPickerParent,
- // children: [
- // {
- // customLabel: {
- // name: pluginName + ColorPicker.name,
- // props: {
- // onClick: (color: string, e: MouseEvent) => this.handleLineColor(color, e),
- // lang: {
- // collapseLocale: 'colorPicker.collapse',
- // customColorLocale: 'colorPicker.customColor',
- // confirmColorLocale: 'colorPicker.confirmColor',
- // cancelColorLocale: 'colorPicker.cancelColor',
- // changeLocale: 'colorPicker.change',
- // },
- // },
- // },
- // className: styles.selectColorPicker,
- // onClick: this.handleLineColor,
- // },
- // ],
- // },
- // {
- // customLabel: {
- // name: pluginName + LineBold.name,
- // props: {
- // locale: 'borderLine.borderSize',
- // },
- // },
- // onClick: (...arg) => this.handleLineBold(arg[1], arg[2], arg[0]),
- // className: styles.selectLineBoldParent,
- // unSelectable: true,
- // children: BORDER_SIZE_CHILDREN,
- // },
- // ],
- // },
- // {
- // type: 5,
- // tooltipLocale: 'toolbar.mergeCell.main',
- // customLabel: {
- // name: 'MergeIcon',
- // },
- // show: this._config.mergeCell,
- // onClick: (value: string) => {
- // this.setMerge(value);
- // },
- // name: 'mergeCell',
- // children: MERGE_CHILDREN,
- // },
- // {
- // type: 3,
- // tooltipLocale: 'toolbar.horizontalAlignMode.main',
- // className: styles.selectDoubleString,
- // display: 1,
- // name: 'horizontalAlignMode',
- // show: this._config.horizontalAlignMode,
- // onClick: (value: HorizontalAlign) => {
- // this.setHorizontalAlignment(value);
- // },
- // children: HORIZONTAL_ALIGN_CHILDREN,
- // },
- // {
- // type: 3,
- // tooltipLocale: 'toolbar.verticalAlignMode.main',
- // className: styles.selectDoubleString,
- // display: 1,
- // name: 'verticalAlignMode',
- // show: this._config.verticalAlignMode,
- // onClick: (value: VerticalAlign) => {
- // this.setVerticalAlignment(value);
- // },
- // children: VERTICAL_ALIGN_CHILDREN,
- // },
- // {
- // type: 3,
- // className: styles.selectDoubleString,
- // tooltipLocale: 'toolbar.textWrapMode.main',
- // display: 1,
- // name: 'textWrapMode',
- // show: this._config.textWrapMode,
- // onClick: (value: WrapStrategy) => {
- // this.setWrapStrategy(value);
- // },
- // children: TEXT_WRAP_CHILDREN,
- // },
- // {
- // type: 3,
- // className: styles.selectDoubleString,
- // name: 'textRotateMode',
- // tooltipLocale: 'toolbar.textRotateMode.main',
- // display: 1,
- // show: this._config.textRotateMode,
- // onClick: (value: number | string) => {
- // this.setTextRotation(value);
- // },
- // children: TEXT_ROTATE_CHILDREN,
- // },
+ {
+ toolbarType: 1,
+ tooltip: 'toolbar.bold',
+ customLabel: {
+ name: 'BoldIcon',
+ },
+ active: false,
+ name: 'bold',
+ show: this._config.bold,
+ onClick: (isBold: boolean) => {
+ // this._plugin.getObserver('onAfterChangeFontWeightObservable')?.notifyObservers(isBold);
+ },
+ },
+ {
+ toolbarType: 1,
+ tooltip: 'toolbar.italic',
+ customLabel: {
+ name: 'ItalicIcon',
+ },
+ name: 'italic',
+ show: this._config.italic,
+ onClick: (isItalic: boolean) => {
+ // this._plugin.getObserver('onAfterChangeFontItalicObservable')?.notifyObservers(isItalic);
+ },
+ },
+ {
+ toolbarType: 1,
+ tooltip: 'toolbar.strikethrough',
+ customLabel: {
+ name: 'DeleteLineIcon',
+ },
+ name: 'strikethrough',
+ show: this._config.strikethrough,
+ onClick: (isStrikethrough: boolean) => {
+ // this._plugin.getObserver('onAfterChangeFontStrikethroughObservable')?.notifyObservers(isStrikethrough);
+ },
+ },
+ {
+ toolbarType: 1,
+ tooltip: 'toolbar.underline',
+ customLabel: {
+ name: 'UnderLineIcon',
+ },
+ name: 'underline',
+ show: this._config.underline,
+ onClick: (isItalic: boolean) => {
+ // this._plugin.getObserver('onAfterChangeFontUnderlineObservable')?.notifyObservers(isItalic);
+ },
+ },
+ {
+ type: 5,
+ tooltip: 'toolbar.textColor.main',
+ customLabel: {
+ name: SHEET_UI_PLUGIN_NAME + ColorSelect.name,
+ props: {
+ customLabel: {
+ name: 'TextColorIcon',
+ },
+ id: 'textColor',
+ },
+ },
+ hideSelectedIcon: true,
+ className: styles.selectColorPickerParent,
+ children: [
+ {
+ customLabel: {
+ name: SHEET_UI_PLUGIN_NAME + ColorPicker.name,
+ props: {
+ onClick: (color: string, e: MouseEvent) => {
+ const colorSelect = this._colorSelect.find((item) => item.getId() === 'textColor');
+ colorSelect?.setColor(color);
+ // this._plugin.getObserver('onAfterChangeFontColorObservable')?.notifyObservers(color);
+ },
+ },
+ },
+ className: styles.selectColorPicker,
+ },
+ ],
+ name: 'textColor',
+ show: this._config.textColor,
+ },
+ {
+ type: 5,
+ tooltip: 'toolbar.fillColor.main',
+ customLabel: {
+ name: SHEET_UI_PLUGIN_NAME + ColorSelect.name,
+ props: {
+ customLabel: {
+ name: 'FillColorIcon',
+ },
+ id: 'fillColor',
+ },
+ },
+ hideSelectedIcon: true,
+ className: styles.selectColorPickerParent,
+ children: [
+ {
+ customLabel: {
+ name: SHEET_UI_PLUGIN_NAME + ColorPicker.name,
+ props: {
+ onClick: (color: string, e: MouseEvent) => {
+ const colorSelect = this._colorSelect.find((item) => item.getId() === 'fillColor');
+ colorSelect?.setColor(color);
+ // this._plugin.getObserver('onAfterChangeFontBackgroundObservable')?.notifyObservers(color);
+ }
+ },
+ },
+ className: styles.selectColorPicker,
+ },
+ ],
+ name: 'fillColor',
+ show: this._config.fillColor,
+ },
+ {
+ type: 3,
+ display: 1,
+ show: this._config.border,
+ tooltip: 'toolbar.border.main',
+ className: styles.selectDoubleString,
+ onClick: (value) => {
+ if (value) {
+ // this.setBorder(value);
+ }
+ },
+ name: 'border',
+ children: [
+ ...BORDER_LINE_CHILDREN,
+ {
+ customLabel: {
+ name: SHEET_UI_PLUGIN_NAME + LineColor.name,
+ props: {
+ label: 'borderLine.borderColor',
+ getComponent: (ref: LineColor) => this._lineColor = ref
+ },
+ },
+ unSelectable: true,
+ className: styles.selectColorPickerParent,
+ children: [
+ {
+ customLabel: {
+ name: SHEET_UI_PLUGIN_NAME + ColorPicker.name,
+ props: {
+ onClick: (color: string, e: MouseEvent) => {
+ // this.handleLineColor(color, e)
+ },
+ },
+ },
+ className: styles.selectColorPicker,
+ onClick: () => {
+ // this.handleLineColor
+ },
+ },
+ ],
+ },
+ {
+ customLabel: {
+ name: SHEET_UI_PLUGIN_NAME + LineBold.name,
+ props: {
+ label: 'borderLine.borderSize',
+ getComponent: (ref: LineBold) => this._lineBold = ref
+ },
+ },
+ onClick: () => {
+ // this.handleLineBold(arg[1], arg[2], arg[0])
+ },
+ className: styles.selectLineBoldParent,
+ unSelectable: true,
+ children: BORDER_SIZE_CHILDREN,
+ },
+ ],
+ },
+ {
+ type: 5,
+ tooltip: 'toolbar.mergeCell.main',
+ customLabel: {
+ name: 'MergeIcon',
+ },
+ show: this._config.mergeCell,
+ onClick: (value: string) => {
+ // this.setMerge(value);
+ },
+ name: 'mergeCell',
+ children: MERGE_CHILDREN,
+ },
+ {
+ type: 3,
+ tooltip: 'toolbar.horizontalAlignMode.main',
+ className: styles.selectDoubleString,
+ display: 1,
+ name: 'horizontalAlignMode',
+ show: this._config.horizontalAlignMode,
+ onClick: (value: HorizontalAlign) => {
+ // this.setHorizontalAlignment(value);
+ },
+ children: HORIZONTAL_ALIGN_CHILDREN,
+ },
+ {
+ type: 3,
+ tooltip: 'toolbar.verticalAlignMode.main',
+ className: styles.selectDoubleString,
+ display: 1,
+ name: 'verticalAlignMode',
+ show: this._config.verticalAlignMode,
+ onClick: (value: VerticalAlign) => {
+ // this.setVerticalAlignment(value);
+ },
+ children: VERTICAL_ALIGN_CHILDREN,
+ },
+ {
+ type: 3,
+ className: styles.selectDoubleString,
+ tooltip: 'toolbar.textWrapMode.main',
+ display: 1,
+ name: 'textWrapMode',
+ show: this._config.textWrapMode,
+ onClick: (value: WrapStrategy) => {
+ // this.setWrapStrategy(value);
+ },
+ children: TEXT_WRAP_CHILDREN,
+ },
+ {
+ type: 3,
+ className: styles.selectDoubleString,
+ name: 'textRotateMode',
+ tooltip: 'toolbar.textRotateMode.main',
+ display: 1,
+ show: this._config.textRotateMode,
+ onClick: (value: number | string) => {
+ // this.setTextRotation(value);
+ },
+ children: TEXT_ROTATE_CHILDREN,
+ },
];
- this._moreText = { more: 'toolbar.toolMore', tip: 'toolbar.toolMoreTip' };
+
+ this._initialize();
+ }
+
+ private _initialize() {
+ this._plugin.getComponentManager().register(SHEET_UI_PLUGIN_NAME + ColorSelect.name, ColorSelect)
+ this._plugin.getComponentManager().register(SHEET_UI_PLUGIN_NAME + ColorPicker.name, ColorPicker)
+ this._plugin.getComponentManager().register(SHEET_UI_PLUGIN_NAME + LineColor.name, LineColor)
+ this._plugin.getComponentManager().register(SHEET_UI_PLUGIN_NAME + LineBold.name, LineBold)
+
+
+
}
// 获取Toolbar组件
@@ -412,9 +404,9 @@ export class ToolbarUIController {
// 刷新toolbar
setToolbar() {
- const locale = this._plugin.getContext().getLocale();
- const toolList = resetDataLabel(this._toolList, locale);
- this._toolbar.setToolbar(toolList);
+ // const locale = this._plugin.getContext().getLocale();
+ // const toolList = resetDataLabel(this._toolList, locale);
+ this._toolbar.setToolbar(this._toolList);
}
setUIObserve<T>(msg: UIObserver<T>) {
diff --git a/packages/ui-plugin-sheets/src/Locale/en.ts b/packages/ui-plugin-sheets/src/Locale/en.ts
index a03b77ee0b..82687eea40 100644
--- a/packages/ui-plugin-sheets/src/Locale/en.ts
+++ b/packages/ui-plugin-sheets/src/Locale/en.ts
@@ -1,8 +1,516 @@
export default {
- SheetUI: {
- tooltip: 'SheetUI',
+ spreadsheetLabel: 'Spreadsheet',
+ spreadsheetRightLabel: 'more Sheets',
+ spreadsheet: {
one: 'one',
two: 'two',
three: 'three',
},
-};
\ No newline at end of file
+
+ toolbar: {
+ undo: 'Undo',
+ redo: 'Redo',
+ paintFormat: 'Paint format',
+ currencyFormat: 'Format as currency',
+ percentageFormat: 'Format as percent',
+ numberDecrease: 'Decrease decimal places',
+ numberIncrease: 'Increase decimal places',
+ moreFormats: 'More formats',
+ font: 'Font',
+ fontSize: 'Font size',
+ bold: 'Bold (Ctrl+B)',
+ italic: 'Italic (Ctrl+I)',
+ strikethrough: 'Strikethrough (Alt+Shift+5)',
+ underline: 'Underline',
+ textColor: {
+ main: 'Text color',
+ right: 'Choose color',
+ },
+ resetColor: 'Reset',
+ customColor: 'CUSTOM',
+ alternatingColors: 'Alternating colors',
+ confirmColor: 'OK',
+ cancelColor: 'Cancel',
+ collapse: 'Collapse',
+ fillColor: {
+ main: 'Fill color',
+ right: 'Choose color',
+ },
+ border: {
+ main: 'Border',
+ right: 'Border style',
+ },
+ mergeCell: {
+ main: 'Merge cells',
+ right: 'Choose merge type',
+ },
+ horizontalAlignMode: {
+ main: 'Horizontal align',
+ right: 'Alignment',
+ },
+ verticalAlignMode: {
+ main: 'Vertical align',
+ right: 'Alignment',
+ },
+ textWrapMode: {
+ main: 'Text wrap',
+ right: 'Text wrap mode',
+ },
+ textRotateMode: {
+ main: 'Text rotate',
+ right: 'Text rotate mode',
+ },
+ freezeTopRow: 'Freeze top row',
+ sortAndFilter: 'Sort and filter',
+ findAndReplace: 'Find and replace',
+ sum: 'SUM',
+ autoSum: 'Auto SUM',
+ moreFunction: 'More functions',
+ conditionalFormat: 'Conditional format',
+ comment: 'Comment',
+ pivotTable: 'Pivot Table',
+ chart: 'Chart',
+ screenshot: 'Screenshot',
+ splitColumn: 'Split text',
+ insertImage: 'Insert image',
+ insertLink: 'Insert link',
+ dataValidation: 'Data validation',
+ protection: 'Protect the sheet',
+
+ clearText: 'Clear color',
+ noColorSelectedText: 'No color is selected',
+
+ toolMore: 'More',
+ toolLess: 'Less',
+ toolClose: 'Close',
+ toolMoreTip: 'More features',
+ moreOptions: 'More options',
+
+ cellFormat: 'Cell format config',
+ print: 'Print',
+ borderMethod: {
+ top: 'Upper frame line',
+ bottom: 'Lower frame line',
+ left: 'Left frame line',
+ right: 'Right frame line',
+ },
+ more: 'More',
+ },
+ defaultFmt: {
+ Automatic: {
+ text: 'Automatic',
+ value: 'General',
+ example: '',
+ },
+ Number: {
+ text: 'Number',
+ value: '##0.00',
+ example: '1000.12',
+ },
+ Percent: {
+ text: 'Percent',
+ value: '#0.00%',
+ example: '12.21%',
+ },
+ PlainText: {
+ text: 'Plain text',
+ value: '@',
+ example: '',
+ },
+ Scientific: {
+ text: 'Scientific',
+ value: '0.00E+00',
+ example: '1.01E+5',
+ },
+ Accounting: {
+ text: 'Accounting',
+ value: '¥(0.00)',
+ example: '¥(1200.09)',
+ },
+ Thousand: {
+ text: 'Ten Thousand',
+ value: 'w',
+ example: '1亿2000万2500',
+ },
+ Currency: {
+ text: 'Currency',
+ value: '¥0.00',
+ example: '¥1200.09',
+ },
+ Digit: {
+ text: '万元2位小数',
+ value: 'w0.00',
+ example: '2万2500.55',
+ },
+ Date: {
+ text: 'Date',
+ value: 'yyyy-MM-dd',
+ example: '2017-11-29',
+ },
+ Time: { text: 'Time', value: 'hh:mm AM/PM', example: '3:00 PM' },
+ Time24H: { text: 'Time 24H', value: 'hh:mm', example: '15:00' },
+ DateTime: { text: 'Date time', value: 'yyyy-MM-dd hh:mm AM/PM', example: '2017-11-29 3:00 PM' },
+ DateTime24H: { text: 'Date time 24H', value: 'yyyy-MM-dd hh:mm', example: '2017-11-29 15:00' },
+ CustomFormats: { text: 'Custom Formats', value: 'fmtOtherSelf', example: '' },
+ },
+ format: {
+ moreCurrency: 'More currency formats',
+ moreDateTime: 'More date and time formats',
+ moreNumber: 'More number formats',
+
+ titleCurrency: 'Currency formats',
+ decimalPlaces: 'Decimal places',
+ titleDateTime: 'Date and time formats',
+ titleNumber: 'Number formats',
+ },
+ fontFamily: {
+ TimesNewRoman: 'Times New Roman',
+ Arial: 'Arial',
+ Tahoma: 'Tahoma',
+ Verdana: 'Verdana',
+ MicrosoftAccorblack: 'Microsoft Accor black ',
+ SimSun: 'SimSun',
+ SimHei: 'SimHei',
+ Kaiti: 'Kaiti',
+ FangSong: 'FangSong',
+ NSimSun: 'NSimSun',
+ STXinwei: 'STXinwei',
+ STXingkai: 'STXingkai',
+ STLiti: 'STLiti',
+ HanaleiFill: 'HanaleiFill',
+ Anton: 'Anton',
+ Pacifico: 'Pacifico',
+ },
+ print: {
+ normalBtn: 'Normal',
+ layoutBtn: 'Page Layout',
+ pageBtn: 'Page break preview',
+
+ menuItemPrint: 'Print (Ctrl+P)',
+ menuItemAreas: 'Print areas',
+ menuItemRows: 'Print title rows',
+ menuItemColumns: 'Print title columns',
+ },
+ align: {
+ left: 'left',
+ center: 'center',
+ right: 'right',
+
+ top: 'top',
+ middle: 'middle',
+ bottom: 'bottom',
+ },
+
+ dateFmtList: [
+ {
+ name: '1930-08-05',
+ value: 'yyyy-MM-dd',
+ },
+ {
+ name: '1930/8/5',
+ value: 'yyyy/MM/dd',
+ },
+ {
+ name: '08-05',
+ value: 'MM-dd',
+ },
+ {
+ name: '8-5',
+ value: 'M-d',
+ },
+ {
+ name: '13:30:30',
+ value: 'h:mm:ss',
+ },
+ {
+ name: '13:30',
+ value: 'h:mm',
+ },
+ {
+ name: 'PM 01:30',
+ value: 'AM/PM hh:mm',
+ },
+ {
+ name: 'PM 1:30',
+ value: 'AM/PM h:mm',
+ },
+ {
+ name: 'PM 1:30:30',
+ value: 'AM/PM h:mm:ss',
+ },
+ {
+ name: '08-05 PM 01:30',
+ value: 'MM-dd AM/PM hh:mm',
+ },
+ ],
+ numFmtList: [
+ {
+ name: '1235',
+ value: '0',
+ },
+ {
+ name: '1234.56',
+ value: '0.00',
+ },
+ {
+ name: '1,235',
+ value: '#,##0',
+ },
+ {
+ name: '1,234.56',
+ value: '#,##0.00',
+ },
+ {
+ name: '1,235',
+ value: '#,##0_);(#,##0)',
+ },
+ {
+ name: '1,235',
+ value: '#,##0_);[Red](#,##0)',
+ },
+ {
+ name: '1,234.56',
+ value: '#,##0.00_);(#,##0.00)',
+ },
+ {
+ name: '1,234.56',
+ value: '#,##0.00_);[Red](#,##0.00)',
+ },
+ {
+ name: '$1,235',
+ value: '$#,##0_);($#,##0)',
+ },
+ {
+ name: '$1,235',
+ value: '$#,##0_);[Red]($#,##0)',
+ },
+ {
+ name: '$1,234.56',
+ value: '$#,##0.00_);($#,##0.00)',
+ },
+ {
+ name: '$1,234.56',
+ value: '$#,##0.00_);[Red]($#,##0.00)',
+ },
+ {
+ name: '1234.56',
+ value: '@',
+ },
+ {
+ name: '123456%',
+ value: '0%',
+ },
+ {
+ name: '123456.00%',
+ value: '0.00%',
+ },
+ {
+ name: '1.23E+03',
+ value: '0.00E+00',
+ },
+ {
+ name: '1.2E+3',
+ value: '##0.0E+0',
+ },
+ {
+ name: '1234 5/9',
+ value: '# ?/?',
+ },
+ {
+ name: '1234 14/25',
+ value: '# ??/??',
+ },
+ {
+ name: '$ 1,235',
+ value: '_($* #,##0_);_(...($* "-"_);_(@_)',
+ },
+ {
+ name: '1,235',
+ value: '_(* #,##0_);_(*..._(* "-"_);_(@_)',
+ },
+ {
+ name: '$ 1,234.56',
+ // "value": '_($* #,##0.00_)...* "-"??_);_(@_)'
+ value: '_($* #,##0.00_);_(...($* "-"_);_(@_)',
+ },
+ {
+ name: '1,234.56',
+ value: '_(* #,##0.00_);...* "-"??_);_(@_)',
+ },
+ ],
+ button: {
+ confirm: 'OK',
+ cancel: 'Cancel',
+ close: 'Close',
+ update: 'Update',
+ delete: 'Delete',
+ insert: 'Insert',
+ prevPage: 'Previous',
+ nextPage: 'Next',
+ total: 'total:',
+ },
+ punctuation: {
+ tab: 'Tab',
+ semicolon: 'semicolond',
+ comma: 'comma',
+ space: 'space',
+ },
+ colorPicker: {
+ collapse: 'Collapse',
+ customColor: 'CUSTOM',
+ change: 'Change',
+ confirmColor: 'OK',
+ cancelColor: 'Cancel',
+ },
+ borderLine: {
+ borderTop: 'borderTop',
+ borderBottom: 'borderBottom',
+ borderLeft: 'borderLeft',
+ borderRight: 'borderRight',
+ borderNone: 'borderNone',
+ borderAll: 'borderAll',
+ borderOutside: 'borderOutside',
+ borderInside: 'borderInside',
+ borderHorizontal: 'borderHorizontal',
+ borderVertical: 'borderVertical',
+ borderColor: 'borderColor',
+ borderSize: 'borderSize',
+ },
+ merge: {
+ all: 'Merge all',
+ vertical: 'Vertical merge',
+ horizontal: 'Horizontal merger',
+ cancel: 'Cancel merge',
+ overlappingError: 'Cannot merge overlapping areas',
+ partiallyError: 'Cannot perform this operation on partially merged cells',
+ },
+ textWrap: {
+ overflow: 'Overflow',
+ wrap: 'Wrap',
+ clip: 'Clip',
+ },
+ textRotate: {
+ none: 'None',
+ angleUp: 'Tilt Up',
+ angleDown: 'Tilt Down',
+ vertical: 'Stack Vertically',
+ rotationUp: 'Rotate Up',
+ rotationDown: 'Rotate Down',
+ },
+ sheetConfig: {
+ delete: 'Delete',
+ copy: 'Copy',
+ rename: 'Rename',
+ changeColor: 'Change color',
+ hide: 'Hide',
+ unhide: 'Unhide',
+ moveLeft: 'Move left',
+ moveRight: 'Move right',
+ resetColor: 'Reset color',
+ cancelText: 'Cancel',
+ chooseText: 'Confirm color',
+
+ tipNameRepeat: 'The name of the tab page cannot be repeated! Please revise',
+ noMoreSheet: 'The workbook contains at least one visual worksheet. To delete the selected worksheet, please insert a new worksheet or show a hidden worksheet.',
+ confirmDelete: 'Are you sure to delete',
+ redoDelete: 'Can be undo by Ctrl+Z',
+ noHide: "Can't hide, at least keep one sheet tag",
+ chartEditNoOpt: 'This operation is not allowed in chart editing mode!',
+ sheetNameSpecCharError: 'The name cannot contain:[ ] : ? * / \' "',
+ sheetNameCannotIsEmptyError: 'Sheet name cannot be empty',
+ },
+ rightClick: {
+ copy: 'Copy',
+ copyAs: 'Copy as',
+ cut: 'Cut',
+ paste: 'Paste',
+ insert: 'Insert',
+ insertRow: 'InsertRow',
+ insertColumn: 'InsertColumn',
+ delete: 'Delete',
+ deleteCell: 'Delete cell',
+ deleteSelected: 'Delete selected ',
+ hide: 'Hide',
+ hideSelected: 'Hide selected ',
+ showHide: 'Show hidden ',
+ to: 'Towards',
+ left: 'Left',
+ right: 'Right',
+ top: 'Top',
+ bottom: 'Bottom',
+ moveLeft: 'Move left',
+ moveUp: 'Move up',
+ add: 'Add',
+ row: 'Row',
+ column: 'Column',
+ width: 'Width',
+ height: 'Height',
+ number: 'Number',
+ confirm: 'Confirm',
+ orderAZ: 'A-Z order',
+ orderZA: 'Z-A order',
+ clearContent: 'Clear content',
+ matrix: 'Matrix operation',
+ sortSelection: 'Sort',
+ filterSelection: 'Filter',
+ chartGeneration: 'Create chart',
+ firstLineTitle: 'first line title',
+ untitled: 'untitled',
+ array1: 'One-dimensional array',
+ array2: 'Two-dimensional array',
+ array3: 'Multidimensional Arrays',
+ diagonal: 'Diagonal',
+ antiDiagonal: 'Anti-diagonal',
+ diagonalOffset: 'Diagonal offset',
+ offset: 'Offset',
+ boolean: 'Boolean',
+ flip: 'Flip',
+ upAndDown: 'Up and down',
+ leftAndRight: 'Left and right',
+ clockwise: 'Clockwise',
+ counterclockwise: 'Counterclockwise',
+ transpose: 'Transpose',
+ matrixCalculation: 'Matrix calculation',
+ plus: 'Plus',
+ minus: 'Minus',
+ multiply: 'Multiply',
+ divided: 'Divided',
+ power: 'Power',
+ root: 'Root',
+ log: 'Log',
+ delete0: 'Delete 0 values at both ends',
+ removeDuplicate: 'Remove duplicate values',
+ byRow: 'By row',
+ byCol: 'By column',
+ generateNewMatrix: 'Generate new matrix',
+ },
+ info: {
+ detailUpdate: 'New opened',
+ detailSave: 'Local cache restored',
+ row: '',
+ column: '',
+ loading: 'Loading...',
+
+ copy: 'Copy',
+ return: 'Exit',
+ rename: 'Rename',
+ tips: 'Rename',
+ noName: 'Untitled spreadsheet',
+ wait: 'waiting for update',
+
+ add: 'Add',
+ addLast: 'more rows at bottom',
+ backTop: 'Back to the top',
+ // eslint-disable-next-line no-template-curly-in-string
+ pageInfo: 'Total ${total},${totalPage} page,current ${currentPage}',
+ nextPage: 'Next',
+
+ tipInputNumber: 'Please enter the number',
+ tipInputNumberLimit: 'The increase range is limited to 1-100',
+
+ tipRowHeightLimit: 'Row height must be between 0 ~ 545',
+ tipColumnWidthLimit: 'The column width must be between 0 ~ 2038',
+ // eslint-disable-next-line no-template-curly-in-string
+ pageInfoFull: 'Total ${total},${totalPage} page,All data displayed',
+ },
+};
diff --git a/packages/ui-plugin-sheets/src/Locale/zh.ts b/packages/ui-plugin-sheets/src/Locale/zh.ts
index 943ed476f8..85236ecfaf 100644
--- a/packages/ui-plugin-sheets/src/Locale/zh.ts
+++ b/packages/ui-plugin-sheets/src/Locale/zh.ts
@@ -1,8 +1,379 @@
export default {
- SheetUI: {
- tooltip: 'SheetUI',
+ spreadsheetLabel: '插件',
+ spreadsheetRightLabel: '更多 Sheets',
+ spreadsheet: {
one: '一',
two: '二',
three: '三',
},
+ // toolbar.undo
+ toolbar: {
+ undo: '撤销',
+ redo: '重做',
+ paintFormat: '格式刷',
+ currencyFormat: '货币格式',
+ percentageFormat: '百分比格式',
+ numberDecrease: '减少小数位数',
+ numberIncrease: '增加小数位数',
+ moreFormats: '更多格式',
+ font: '字体',
+ fontSize: '字号大小',
+ bold: '粗体 (Ctrl+B)',
+ italic: '斜体 (Ctrl+I)',
+ strikethrough: '删除线 (Alt+Shift+5)',
+ underline: '下划线',
+ textColor: {
+ main: '文本颜色',
+ right: '颜色选择',
+ },
+ resetColor: '重置颜色',
+ customColor: '自定义',
+ alternatingColors: '交替颜色',
+ confirmColor: '确定颜色',
+ cancelColor: '取消',
+ collapse: '收起',
+ fillColor: {
+ main: '单元格颜色',
+ right: '颜色选择',
+ },
+ border: {
+ main: '边框',
+ right: '边框类型',
+ },
+ mergeCell: {
+ main: '合并单元格',
+ right: '选择合并类型',
+ },
+ horizontalAlignMode: {
+ main: '水平对齐',
+ right: '对齐方式',
+ },
+ verticalAlignMode: {
+ main: '垂直对齐',
+ right: '对齐方式',
+ },
+ textWrapMode: {
+ main: '文本换行',
+ right: '换行方式',
+ },
+ textRotateMode: {
+ main: '文本旋转',
+ right: '旋转方式',
+ },
+ freezeTopRow: '冻结首行',
+ sortAndFilter: '排序和筛选',
+ findAndReplace: '查找替换',
+ sum: '求和',
+ autoSum: '自动求和',
+ moreFunction: '更多函数',
+ conditionalalFormat: '条件格式',
+ comment: '批注',
+ pivotTable: '数据透视表',
+ chart: '图表',
+ screenshot: '截图',
+ splitColumn: '分列',
+ insertImage: '插入图片',
+ insertLink: '插入链接',
+ dataValidation: '数据验证',
+ protection: '保护工作表内容',
+
+ clearText: '清除颜色选择',
+ noColorSelectedText: '没有颜色被选择',
+
+ toolMore: '更多',
+ toolLess: '少于',
+ toolClose: '收起',
+ toolMoreTip: '更多功能',
+ moreOptions: '更多选项',
+
+ cellFormat: '设置单元格格式',
+ print: '打印',
+ borderMethod: {
+ top: '上框线',
+ bottom: '下框线',
+ left: '左框线',
+ right: '右框线',
+ },
+ more: '更多',
+ },
+ defaultFmt: {
+ Automatic: {
+ text: '自动',
+ value: 'General',
+ example: '',
+ },
+ Number: {
+ text: '数字',
+ value: '##0.00',
+ example: '1000.12',
+ },
+ Percent: {
+ text: '百分比',
+ value: '#0.00%',
+ example: '12.21%',
+ },
+ PlainText: {
+ text: '纯文本',
+ value: '@',
+ example: '',
+ },
+ Scientific: {
+ text: '科学计数',
+ value: '0.00E+00',
+ example: '1.01E+5',
+ },
+ Accounting: {
+ text: '会计',
+ value: '¥(0.00)',
+ example: '¥(1200.09)',
+ },
+ Thousand: {
+ text: '万元',
+ value: 'w',
+ example: '1亿2000万2500',
+ },
+ Currency: {
+ text: '货币',
+ value: '¥0.00',
+ example: '¥1200.09',
+ },
+ Digit: {
+ text: '万元2位小数',
+ value: 'w0.00',
+ example: '2万2500.55',
+ },
+ Date: {
+ text: '日期',
+ value: 'yyyy-MM-dd',
+ example: '2017-11-29',
+ },
+ Time: { text: '时间', value: 'hh:mm AM/PM', example: '3:00 PM' },
+ Time24H: { text: '时间24H', value: 'hh:mm', example: '15:00' },
+ DateTime: { text: '日期时间', value: 'yyyy-MM-dd hh:mm AM/PM', example: '2017-11-29 3:00 PM' },
+ DateTime24H: { text: '日期时间24H', value: 'yyyy-MM-dd hh:mm', example: '2017-11-29 15:00' },
+ CustomFormats: { text: '自定义格式', value: 'fmtOtherSelf', example: '' },
+ },
+ format: {
+ moreCurrency: '更多货币格式',
+ moreDateTime: '更多日期与时间格式',
+ moreNumber: '更多数字格式',
+
+ titleCurrency: '货币格式',
+ decimalPlaces: '小数位数',
+ titleDateTime: '日期与时间格式',
+ titleNumber: '数字格式',
+ },
+ fontFamily: {
+ TimesNewRoman: 'Times New Roman',
+ Arial: 'Arial',
+ Tahoma: 'Tahoma',
+ Verdana: 'Verdana',
+ MicrosoftAccorblack: '微软雅黑',
+ SimSun: '宋体',
+ SimHei: '黑体',
+ Kaiti: '楷体',
+ FangSong: '仿宋',
+ NSimSun: '新宋体',
+ STXinwei: '华文新魏',
+ STXingkai: '华文行楷',
+ STLiti: '华文隶书',
+ HanaleiFill: 'HanaleiFill',
+ Anton: 'Anton',
+ Pacifico: 'Pacifico',
+ },
+ print: {
+ normalBtn: '常规视图',
+ layoutBtn: '页面布局',
+ pageBtn: '分页预览',
+
+ menuItemPrint: '打印(Ctrl+P)',
+ menuItemAreas: '打印区域',
+ menuItemRows: '打印标题行',
+ menuItemColumns: '打印标题列',
+ },
+ 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: '边框粗细',
+ },
+ merge: {
+ all: '全部合并',
+ vertical: '垂直合并',
+ horizontal: '水平合并',
+ cancel: '取消合并',
+ overlappingError: '不能合并重叠区域',
+ partiallyError: '无法对部分合并单元格执行此操作',
+ },
+ 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: '不能隐藏, 至少保留一个sheet标签',
+ chartEditNoOpt: '图表编辑模式下不允许该操作!',
+ sheetNameSpecCharError: "名称不能超过31个字符,首尾不能是' 且名称不能包含:\r\n[ ] : \\ ? * /",
+ sheetNameCannotIsEmptyError: '名称不能为空!',
+ },
+ rightClick: {
+ copy: '复制',
+ copyAs: '复制为',
+ cut: '剪切',
+ paste: '粘贴',
+ insert: '插入',
+ delete: '删除',
+ insertRow: '插入行',
+ insertColumn: '插入列',
+ deleteCell: '删除单元格',
+ deleteSelected: '删除选中',
+ hide: '隐藏',
+ hideSelected: '隐藏选中',
+ showHide: '显示隐藏',
+ to: '向',
+ left: '左',
+ right: '右',
+ top: '上',
+ bottom: '下',
+ moveLeft: '左移',
+ moveUp: '上移',
+ add: '增加',
+ row: '行',
+ column: '列',
+ width: '宽',
+ height: '高',
+ number: '数字',
+ confirm: '确认',
+ orderAZ: 'A-Z顺序排列',
+ orderZA: 'Z-A降序排列',
+ clearContent: '清除内容',
+ matrix: '矩阵操作选区',
+ sortSelection: '排序选区',
+ filterSelection: '筛选选区',
+ chartGeneration: '图表生成',
+ firstLineTitle: '首行为标题',
+ untitled: '无标题',
+ array1: '一维数组',
+ array2: '二维数组',
+ array3: '多维数组',
+ diagonal: '对角线',
+ antiDiagonal: '反对角线',
+ diagonalOffset: '对角偏移',
+ offset: '偏移量',
+ boolean: '布尔值',
+ flip: '翻转',
+ upAndDown: '上下',
+ leftAndRight: '左右',
+ clockwise: '顺时针',
+ counterclockwise: '逆时针',
+ transpose: '转置',
+ matrixCalculation: '矩阵计算',
+ plus: '加',
+ minus: '减',
+ multiply: '乘',
+ divided: '除',
+ power: '次方',
+ root: '次方根',
+ log: 'log',
+ delete0: '删除两端0值',
+ removeDuplicate: '删除重复值',
+ byRow: '按行',
+ byCol: '按列',
+ generateNewMatrix: '生成新矩阵',
+ },
+ info: {
+ detailUpdate: '新打开',
+ detailSave: '已恢复本地缓存',
+ row: '行',
+ column: '列',
+ loading: '渲染中···',
+
+ copy: '副本',
+ return: '返回',
+ rename: '重命名',
+ tips: '重命名',
+ noName: '无标题的电子表格',
+ wait: '待更新',
+
+ add: '添加',
+ addLast: '在底部添加',
+ backTop: '回到顶部',
+ // eslint-disable-next-line no-template-curly-in-string
+ pageInfo: '共${total}条,${totalPage}页,当前已显示${currentPage}页',
+ nextPage: '下一页',
+
+ tipInputNumber: '请输入数字',
+ tipInputNumberLimit: '增加范围限制在1-100',
+
+ tipRowHeightLimit: '行高必须在0 ~ 545之间',
+ tipColumnWidthLimit: '列宽必须在0 ~ 2038之间',
+ // eslint-disable-next-line no-template-curly-in-string
+ pageInfoFull: '共${total}条,${totalPage}页,已显示全部数据',
+ },
};
diff --git a/packages/ui-plugin-sheets/src/View/Common/Line/LineBold.tsx b/packages/ui-plugin-sheets/src/View/Common/Line/LineBold.tsx
index 0dd2669d04..6cec966e6f 100644
--- a/packages/ui-plugin-sheets/src/View/Common/Line/LineBold.tsx
+++ b/packages/ui-plugin-sheets/src/View/Common/Line/LineBold.tsx
@@ -1,4 +1,4 @@
-import { BaseComponentProps, BaseComponentRender, Component } from '@univerjs/base-ui';
+import { BaseComponentProps, BaseComponentRender, Component, Icon } from '@univerjs/base-ui';
interface IState {
img: string;
@@ -9,8 +9,6 @@ interface IProps extends BaseComponentProps {
}
export class LineBold extends Component<IProps, IState> {
- private _render: BaseComponentRender;
-
initialize() {
this.state = {
img: '',
@@ -28,14 +26,13 @@ export class LineBold extends Component<IProps, IState> {
}
getImg(img: string) {
- const span = document.querySelector('.base-sheets-line-bold') as HTMLDivElement;
- const props = { width: span.offsetWidth };
- const Img = this._render.renderFunction(img as any);
- return <Img {...(props as any)} />;
+ // const span = document.querySelector('.base-sheets-line-bold') as HTMLDivElement;
+ // const props = { width: span.offsetWidth };
+ // const Img = this._render.renderFunction(img as any);
+ // return <Img {...(props as any)} />;
}
render() {
- const RightIcon = this._render.renderFunction('RightIcon');
const { img } = this.state;
const { label } = this.props;
return (
@@ -44,7 +41,7 @@ export class LineBold extends Component<IProps, IState> {
{label}
<div style={{ width: '100%', height: 0, position: 'absolute', left: 0, bottom: '10px' }}>{img.length ? this.getImg(img) : ''}</div>
</span>
- <RightIcon />
+ <Icon.RightIcon />
</div>
);
}
diff --git a/packages/ui-plugin-sheets/src/View/Common/Line/LineColor.tsx b/packages/ui-plugin-sheets/src/View/Common/Line/LineColor.tsx
index 1cd4b4c045..6250e875ec 100644
--- a/packages/ui-plugin-sheets/src/View/Common/Line/LineColor.tsx
+++ b/packages/ui-plugin-sheets/src/View/Common/Line/LineColor.tsx
@@ -1,28 +1,23 @@
-import { BaseComponentRender, BaseComponentSheet, Component } from '@univerjs/base-ui';
+import { BaseComponentProps, BaseComponentRender, BaseComponentSheet, Component, Icon } from '@univerjs/base-ui';
interface IState {
color: string;
}
-interface IProps {
+interface IProps extends BaseComponentProps {
color: string;
label?: string;
}
export class LineColor extends Component<IProps, IState> {
- private _render: BaseComponentRender;
-
initialize() {
- const component = this._context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;
- this._render = component.getComponentRender();
-
this.state = {
color: 'rgb(217,217,217)',
};
}
componentDidMount() {
- this._context.getObserverManager().getObserver<LineColor>('onLineColorDidMountObservable')?.notifyObservers(this);
+ this.props.getComponent?.(this);
}
setColor(color: string) {
@@ -32,14 +27,13 @@ export class LineColor extends Component<IProps, IState> {
}
render() {
- const RightIcon = this._render.renderFunction('RightIcon');
const { color } = this.state;
const { label } = this.props;
return (
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
- <span style={{ display: 'inline-block', borderBottom: `3px solid ${color}` }}>{label}</span>
- <RightIcon />
+ <span style={{ display: 'inline-block', borderBottom: `3px solid ${color}` }}>{this.getLocale(label)}</span>
+ <Icon.RightIcon />
</div>
);
}
diff --git a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenu.tsx b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenu.tsx
index 420baeb4c1..6af61a5856 100644
--- a/packages/ui-plugin-sheets/src/View/RightMenu/RightMenu.tsx
+++ b/packages/ui-plugin-sheets/src/View/RightMenu/RightMenu.tsx
@@ -28,7 +28,7 @@ export class RightMenu extends Component<BaseRightMenuProps, IState> {
// 转换成渲染需要的数据
resetMenuList(children: RightMenuProps[]) {
- const componentManager = this._context.getPluginManager().getPluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME)?.getComponentManager();
+ const componentManager = this.getContext().getPluginManager().getPluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME)?.getComponentManager();
for (let i = 0; i < children.length; i++) {
const item = children[i];
@@ -39,7 +39,10 @@ export class RightMenu extends Component<BaseRightMenuProps, IState> {
if (Label) {
item.label = <Label {...props} />;
}
+ } else {
+ item.label = this.getLocale(item.locale);
}
+
if (item.children) {
item.children = this.resetMenuList(item.children);
}
@@ -152,7 +155,7 @@ export class RightMenu extends Component<BaseRightMenuProps, IState> {
e.preventDefault();
}}
>
- <Menu ref={this.ulRef} menu={this.state.children} onClick={this.handleClick}></Menu>
+ <Menu ref={this.ulRef} menu={this.resetMenuList(this.state.children)} onClick={this.handleClick}></Menu>
</div>
)
);
diff --git a/packages/ui-plugin-sheets/src/View/SheetBar/SheetBar.tsx b/packages/ui-plugin-sheets/src/View/SheetBar/SheetBar.tsx
index cb2a6f6aaf..58b32da06d 100644
--- a/packages/ui-plugin-sheets/src/View/SheetBar/SheetBar.tsx
+++ b/packages/ui-plugin-sheets/src/View/SheetBar/SheetBar.tsx
@@ -1,4 +1,19 @@
-import { AppContext, AppContextValues, BaseComponentPlugin, BaseComponentRender, BaseComponentSheet, BaseMenuItem, BaseSheetBarProps, Button, Component, createRef, Icon, Menu, PreactContext, RefObject } from '@univerjs/base-ui';
+import {
+ AppContext,
+ AppContextValues,
+ BaseComponentPlugin,
+ BaseComponentRender,
+ BaseComponentSheet,
+ BaseMenuItem,
+ BaseSheetBarProps,
+ Button,
+ Component,
+ createRef,
+ Icon,
+ Menu,
+ PreactContext,
+ RefObject,
+} from '@univerjs/base-ui';
import { SheetBarMenu } from './SheetBarMenu';
import { Nullable, Observer, PLUGIN_NAMES, Workbook } from '@univerjs/core';
import styles from './index.module.less';
@@ -194,7 +209,6 @@ export class SheetBar extends Component<BaseSheetBarProps, SheetState> {
if (!sheetList.length) return;
- debugger;
return (
<div className={styles.sheetBar} ref={this.slideTabRoot}>
{/* user options button */}
diff --git a/packages/ui-plugin-sheets/src/View/SheetContainer/SheetContainer.tsx b/packages/ui-plugin-sheets/src/View/SheetContainer/SheetContainer.tsx
index 0a8dd1c7bc..974674fb99 100644
--- a/packages/ui-plugin-sheets/src/View/SheetContainer/SheetContainer.tsx
+++ b/packages/ui-plugin-sheets/src/View/SheetContainer/SheetContainer.tsx
@@ -100,7 +100,6 @@ export class SheetContainer extends Component<BaseSheetContainerProps> {
// Set Provider for entire Container
return (
<Container className={style.layoutContainer}>
- {this.getLocale('toolbar.undo')}
<Layout>
<Sider style={{ display: config.outerLeft ? 'block' : 'none' }}></Sider>
<Layout className={style.mainContent} style={{ position: 'relative' }}>
@@ -126,9 +125,7 @@ export class SheetContainer extends Component<BaseSheetContainerProps> {
</Container>
)}
<Container ref={this.contentRef} className={style.contentInnerRightContainer}>
- {/* {config.rightMenu && <RightMenu {...methods.rightMenu}></RightMenu>}
- {config.cellEditor && <RichText {...methods.cellEditor}></RichText>} */}
-
+ {config.rightMenu && <RightMenu {...methods.rightMenu}></RightMenu>}
{<RichText {...methods.cellEditor}></RichText>}
</Container>
</Content>
diff --git a/packages/ui-plugin-sheets/src/View/ToolBar/Const.ts b/packages/ui-plugin-sheets/src/View/ToolBar/Const.ts
index 76d834f9a7..1259bc6028 100644
--- a/packages/ui-plugin-sheets/src/View/ToolBar/Const.ts
+++ b/packages/ui-plugin-sheets/src/View/ToolBar/Const.ts
@@ -64,83 +64,83 @@ export const FONT_SIZE_CHILDREN = [
export const FONT_FAMILY_CHILDREN = [
{
- locale: 'fontFamily.TimesNewRoman',
+ label: 'fontFamily.TimesNewRoman',
style: { 'font-family': 'Times New Roman' },
value: 'Times New Roman',
selected: true,
},
{
- locale: 'fontFamily.Arial',
+ label: 'fontFamily.Arial',
style: { 'font-family': 'Arial' },
value: 'Arial',
},
{
- locale: 'fontFamily.Tahoma',
+ label: 'fontFamily.Tahoma',
style: { 'font-family': 'Tahoma' },
value: 'Tahoma',
},
{
- locale: 'fontFamily.Verdana',
+ label: 'fontFamily.Verdana',
style: { 'font-family': 'Verdana' },
value: 'Verdana',
},
{
- locale: 'fontFamily.MicrosoftAccorblack',
+ label: 'fontFamily.MicrosoftAccorblack',
style: { 'font-family': '微软雅黑' },
value: '微软雅黑',
},
{
- locale: 'fontFamily.SimSun',
+ label: 'fontFamily.SimSun',
style: { 'font-family': '宋体' },
value: '宋体',
},
{
- locale: 'fontFamily.SimHei',
+ label: 'fontFamily.SimHei',
style: { 'font-family': '黑体' },
value: '黑体',
},
{
- locale: 'fontFamily.Kaiti',
+ label: 'fontFamily.Kaiti',
style: { 'font-family': '楷体' },
value: '楷体',
},
{
- locale: 'fontFamily.FangSong',
+ label: 'fontFamily.FangSong',
style: { 'font-family': '仿宋' },
value: '仿宋',
},
{
- locale: 'fontFamily.NSimSun',
+ label: 'fontFamily.NSimSun',
style: { 'font-family': '新宋体' },
value: '新宋体',
},
{
- locale: 'fontFamily.STXinwei',
+ label: 'fontFamily.STXinwei',
style: { 'font-family': '华文新魏' },
value: '华文新魏',
},
{
- locale: 'fontFamily.STXingkai',
+ label: 'fontFamily.STXingkai',
style: { 'font-family': '华文行楷' },
value: '华文行楷',
},
{
- locale: 'fontFamily.STLiti',
+ label: 'fontFamily.STLiti',
style: { 'font-family': '华文隶书' },
value: '华文隶书',
},
{
- locale: 'fontFamily.HanaleiFill',
+ label: 'fontFamily.HanaleiFill',
style: { 'font-family': 'HanaleiFill' },
value: 'HanaleiFill',
},
{
- locale: 'fontFamily.Anton',
+ label: 'fontFamily.Anton',
style: { 'font-family': 'Anton' },
value: 'Anton',
},
{
- locale: 'fontFamily.Pacifico',
+ label: 'fontFamily.Pacifico',
style: { 'font-family': 'Pacifico' },
value: 'Pacifico',
},
@@ -148,28 +148,28 @@ export const FONT_FAMILY_CHILDREN = [
export const BORDER_LINE_CHILDREN = [
{
- locale: 'borderLine.borderTop',
+ label: 'borderLine.borderTop',
customSuffix: {
name: 'TopBorderIcon',
},
value: 'top',
},
{
- locale: 'borderLine.borderBottom',
+ label: 'borderLine.borderBottom',
customSuffix: {
name: 'BottomBorderIcon',
},
value: 'bottom',
},
{
- locale: 'borderLine.borderLeft',
+ label: 'borderLine.borderLeft',
customSuffix: {
name: 'LeftBorderIcon',
},
value: 'left',
},
{
- locale: 'borderLine.borderRight',
+ label: 'borderLine.borderRight',
customSuffix: {
name: 'RightBorderIcon',
},
@@ -177,14 +177,14 @@ export const BORDER_LINE_CHILDREN = [
border: true,
},
{
- locale: 'borderLine.borderNone',
+ label: 'borderLine.borderNone',
customSuffix: {
name: 'NoneBorderIcon',
},
value: 'none',
},
{
- locale: 'borderLine.borderAll',
+ label: 'borderLine.borderAll',
customSuffix: {
name: 'FullBorderIcon',
},
@@ -192,28 +192,28 @@ export const BORDER_LINE_CHILDREN = [
selected: true,
},
{
- locale: 'borderLine.borderOutside',
+ label: 'borderLine.borderOutside',
customSuffix: {
name: 'OuterBorderIcon',
},
value: 'outside',
},
{
- locale: 'borderLine.borderInside',
+ label: 'borderLine.borderInside',
customSuffix: {
name: 'InnerBorderIcon',
},
value: 'inside',
},
{
- locale: 'borderLine.borderHorizontal',
+ label: 'borderLine.borderHorizontal',
customSuffix: {
name: 'StripingBorderIcon',
},
value: 'horizontal',
},
{
- locale: 'borderLine.borderVertical',
+ label: 'borderLine.borderVertical',
customSuffix: {
name: 'VerticalBorderIcon',
},
@@ -223,7 +223,7 @@ export const BORDER_LINE_CHILDREN = [
export const BORDER_SIZE_CHILDREN = [
{
- locale: 'borderLine.borderNone',
+ label: 'borderLine.borderNone',
value: '',
},
{
@@ -296,33 +296,33 @@ export const BORDER_SIZE_CHILDREN = [
export const MERGE_CHILDREN = [
{
- locale: 'merge.all',
+ label: 'merge.all',
value: 'all',
},
{
- locale: 'merge.vertical',
+ label: 'merge.vertical',
value: 'vertical',
},
{
- locale: 'merge.horizontal',
+ label: 'merge.horizontal',
value: 'horizontal',
},
{
- locale: 'merge.cancel',
+ label: 'merge.cancel',
value: 'cancel',
},
];
export const HORIZONTAL_ALIGN_CHILDREN = [
{
- locale: 'align.left',
+ label: 'align.left',
customSuffix: {
name: 'LeftAlignIcon',
},
value: 1,
},
{
- locale: 'align.center',
+ label: 'align.center',
selected: true,
customSuffix: {
name: 'CenterAlignIcon',
@@ -330,7 +330,7 @@ export const HORIZONTAL_ALIGN_CHILDREN = [
value: 2,
},
{
- locale: 'align.right',
+ label: 'align.right',
customSuffix: {
name: 'RightAlignIcon',
},
@@ -340,21 +340,21 @@ export const HORIZONTAL_ALIGN_CHILDREN = [
export const VERTICAL_ALIGN_CHILDREN = [
{
- locale: 'align.top',
+ label: 'align.top',
customSuffix: {
name: 'TopVerticalIcon',
},
value: 1,
},
{
- locale: 'align.middle',
+ label: 'align.middle',
customSuffix: {
name: 'CenterVerticalIcon',
},
value: 2,
},
{
- locale: 'align.bottom',
+ label: 'align.bottom',
customSuffix: {
name: 'BottomVerticalIcon',
},
@@ -364,21 +364,21 @@ export const VERTICAL_ALIGN_CHILDREN = [
export const TEXT_WRAP_CHILDREN = [
{
- locale: 'textWrap.overflow',
+ label: 'textWrap.overflow',
customSuffix: {
name: 'OverflowIcon',
},
value: 1,
},
{
- locale: 'textWrap.wrap',
+ label: 'textWrap.wrap',
customSuffix: {
name: 'BrIcon',
},
value: 3,
},
{
- locale: 'textWrap.clip',
+ label: 'textWrap.clip',
customSuffix: {
name: 'CutIcon',
},
@@ -388,42 +388,42 @@ export const TEXT_WRAP_CHILDREN = [
export const TEXT_ROTATE_CHILDREN = [
{
- locale: 'textRotate.none',
+ label: 'textRotate.none',
customSuffix: {
name: 'TextRotateIcon',
},
value: 0,
},
{
- locale: 'textRotate.angleUp',
+ label: 'textRotate.angleUp',
customSuffix: {
name: 'TextRotateAngleUpIcon',
},
value: -45,
},
{
- locale: 'textRotate.angleDown',
+ label: 'textRotate.angleDown',
customSuffix: {
name: 'TextRotateAngleDownIcon',
},
value: 45,
},
{
- locale: 'textRotate.vertical',
+ label: 'textRotate.vertical',
customSuffix: {
name: 'TextRotateVerticalIcon',
},
value: 'v',
},
{
- locale: 'textRotate.rotationUp',
+ label: 'textRotate.rotationUp',
customSuffix: {
name: 'TextRotateRotationUpIcon',
},
value: -90,
},
{
- locale: 'textRotate.rotationDown',
+ label: 'textRotate.rotationDown',
customSuffix: {
name: 'TextRotateRotationDownIcon',
},
diff --git a/packages/ui-plugin-sheets/src/View/ToolBar/ToolBar.tsx b/packages/ui-plugin-sheets/src/View/ToolBar/ToolBar.tsx
index 25e6f8d06f..cc4dea16bd 100644
--- a/packages/ui-plugin-sheets/src/View/ToolBar/ToolBar.tsx
+++ b/packages/ui-plugin-sheets/src/View/ToolBar/ToolBar.tsx
@@ -1,5 +1,4 @@
import { AppContext, AppContextValues, BaseComponentProps, Button, Component, Container, createRef, debounce, PreactContext, Select, TextButton, Tooltip } from '@univerjs/base-ui';
-import { PLUGIN_NAMES } from '@univerjs/core';
import { SheetUIPlugin } from '../..';
import { SHEET_UI_PLUGIN_NAME } from '../../Basics';
import { IToolbarItemProps } from '../../Controller';
@@ -176,21 +175,6 @@ export class Toolbar extends Component<IProps, IState> {
return toolList;
};
- // setToolbar = (toolList: any[], moreText: Record<string, string>) => {
- // toolList = this.resetLabel(toolList);
-
- // this.setState(
- // {
- // toolList,
- // defaultToolList: toolList,
- // moreText,
- // },
- // () => {
- // this.setToolbarListWidth();
- // }
- // );
- // };
-
setToolbar = (toolList: any[]) => {
toolList = this.resetLabel(toolList);
@@ -206,7 +190,12 @@ export class Toolbar extends Component<IProps, IState> {
};
resetUl = () => {
- const wrapper = this.getContext().getPluginManager().getPluginByName<SheetUIPlugin>(PLUGIN_NAMES.BASE_COMPONENT)?.getSheetContainerController().getContentRef().current!;
+ const wrapper = this.getContext()
+ .getPluginManager()
+ .getPluginByName<SheetUIPlugin>(SHEET_UI_PLUGIN_NAME)
+ ?.getAppUIController()
+ .getSheetContainerController()
+ .getContentRef().current!;
const height = `${(wrapper as HTMLDivElement).offsetHeight}px`;
const ul = this.toolbarRef.current.querySelectorAll('ul');
for (let i = 0; i < ul.length; i++) {
@@ -229,7 +218,7 @@ export class Toolbar extends Component<IProps, IState> {
if (item.toolbarType) {
if (item.show) {
return (
- <Tooltip title={item.tooltip} placement={'bottom'}>
+ <Tooltip title={this.getLocale(item.tooltip)} placement={'bottom'}>
<TextButton active={item.active} label={item.label} onClick={item.onClick}></TextButton>
</Tooltip>
);
@@ -238,7 +227,7 @@ export class Toolbar extends Component<IProps, IState> {
if (item.show) {
return (
<Select
- tooltip={item.tooltip}
+ tooltip={this.getLocale(item.tooltip)}
type={item.type}
display={item.display}
children={item.children}
@@ -267,9 +256,9 @@ export class Toolbar extends Component<IProps, IState> {
{this.getToolbarList(defaultToolList)}
<div ref={this.moreBtnRef} className={styles.moreButton} style={{ visibility: moreToolList.length ? 'visible' : 'hidden' }}>
- <Tooltip title={moreText.tip} placement={'bottom'}>
+ <Tooltip title={this.getLocale('toolbar.toolMoreTip')} placement={'bottom'}>
<Button type="text" onClick={this.showMore}>
- <div style={{ fontSize: '14px' }}>{moreText.more}</div>
+ <div style={{ fontSize: '14px' }}>{this.getLocale('toolbar.toolMore')}</div>
</Button>
</Tooltip>
</div>