@univerjs/sheets-ui 0.24.0 → 0.25.0

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.
Files changed (98) hide show
  1. package/lib/cjs/facade.js +3 -2
  2. package/lib/cjs/index.js +435 -379
  3. package/lib/cjs/locale/ar-SA.js +424 -0
  4. package/lib/cjs/locale/ca-ES.js +51 -91
  5. package/lib/cjs/locale/de-DE.js +424 -0
  6. package/lib/cjs/locale/en-US.js +51 -91
  7. package/lib/cjs/locale/es-ES.js +51 -91
  8. package/lib/cjs/locale/fa-IR.js +51 -91
  9. package/lib/cjs/locale/fr-FR.js +52 -92
  10. package/lib/cjs/locale/id-ID.js +424 -0
  11. package/lib/cjs/locale/it-IT.js +424 -0
  12. package/lib/cjs/locale/ja-JP.js +51 -91
  13. package/lib/cjs/locale/ko-KR.js +51 -91
  14. package/lib/cjs/locale/pl-PL.js +424 -0
  15. package/lib/cjs/locale/pt-BR.js +424 -0
  16. package/lib/cjs/locale/ru-RU.js +52 -92
  17. package/lib/cjs/locale/sk-SK.js +51 -91
  18. package/lib/cjs/locale/vi-VN.js +53 -93
  19. package/lib/cjs/locale/zh-CN.js +53 -93
  20. package/lib/cjs/locale/zh-HK.js +424 -0
  21. package/lib/cjs/locale/zh-TW.js +53 -93
  22. package/lib/es/facade.js +3 -2
  23. package/lib/es/index.js +438 -382
  24. package/lib/es/locale/ar-SA.js +423 -0
  25. package/lib/es/locale/ca-ES.js +51 -91
  26. package/lib/es/locale/de-DE.js +423 -0
  27. package/lib/es/locale/en-US.js +51 -91
  28. package/lib/es/locale/es-ES.js +51 -91
  29. package/lib/es/locale/fa-IR.js +51 -91
  30. package/lib/es/locale/fr-FR.js +52 -92
  31. package/lib/es/locale/id-ID.js +423 -0
  32. package/lib/es/locale/it-IT.js +423 -0
  33. package/lib/es/locale/ja-JP.js +51 -91
  34. package/lib/es/locale/ko-KR.js +51 -91
  35. package/lib/es/locale/pl-PL.js +423 -0
  36. package/lib/es/locale/pt-BR.js +423 -0
  37. package/lib/es/locale/ru-RU.js +52 -92
  38. package/lib/es/locale/sk-SK.js +51 -91
  39. package/lib/es/locale/vi-VN.js +53 -93
  40. package/lib/es/locale/zh-CN.js +53 -93
  41. package/lib/es/locale/zh-HK.js +423 -0
  42. package/lib/es/locale/zh-TW.js +53 -93
  43. package/lib/facade.js +3 -2
  44. package/lib/index.css +0 -5
  45. package/lib/index.js +438 -382
  46. package/lib/locale/ar-SA.js +423 -0
  47. package/lib/locale/ca-ES.js +51 -91
  48. package/lib/locale/de-DE.js +423 -0
  49. package/lib/locale/en-US.js +51 -91
  50. package/lib/locale/es-ES.js +51 -91
  51. package/lib/locale/fa-IR.js +51 -91
  52. package/lib/locale/fr-FR.js +52 -92
  53. package/lib/locale/id-ID.js +423 -0
  54. package/lib/locale/it-IT.js +423 -0
  55. package/lib/locale/ja-JP.js +51 -91
  56. package/lib/locale/ko-KR.js +51 -91
  57. package/lib/locale/pl-PL.js +423 -0
  58. package/lib/locale/pt-BR.js +423 -0
  59. package/lib/locale/ru-RU.js +52 -92
  60. package/lib/locale/sk-SK.js +51 -91
  61. package/lib/locale/vi-VN.js +53 -93
  62. package/lib/locale/zh-CN.js +53 -93
  63. package/lib/locale/zh-HK.js +423 -0
  64. package/lib/locale/zh-TW.js +53 -93
  65. package/lib/types/facade/f-range.d.ts +16 -8
  66. package/lib/types/facade/f-workbook.d.ts +2 -1
  67. package/lib/types/facade/f-worksheet.d.ts +32 -16
  68. package/lib/types/locale/ar-SA.d.ts +18 -0
  69. package/lib/types/locale/de-DE.d.ts +18 -0
  70. package/lib/types/locale/en-US.d.ts +406 -442
  71. package/lib/types/locale/id-ID.d.ts +18 -0
  72. package/lib/types/locale/it-IT.d.ts +18 -0
  73. package/lib/types/locale/pl-PL.d.ts +18 -0
  74. package/lib/types/locale/pt-BR.d.ts +18 -0
  75. package/lib/types/locale/zh-HK.d.ts +18 -0
  76. package/lib/types/views/dropdown/list-dropdown/utils.d.ts +16 -0
  77. package/lib/umd/facade.js +1 -1
  78. package/lib/umd/index.js +10 -7
  79. package/lib/umd/locale/ar-SA.js +1 -0
  80. package/lib/umd/locale/ca-ES.js +1 -1
  81. package/lib/umd/locale/de-DE.js +1 -0
  82. package/lib/umd/locale/en-US.js +1 -1
  83. package/lib/umd/locale/es-ES.js +1 -1
  84. package/lib/umd/locale/fa-IR.js +1 -1
  85. package/lib/umd/locale/fr-FR.js +1 -1
  86. package/lib/umd/locale/id-ID.js +1 -0
  87. package/lib/umd/locale/it-IT.js +1 -0
  88. package/lib/umd/locale/ja-JP.js +1 -1
  89. package/lib/umd/locale/ko-KR.js +1 -1
  90. package/lib/umd/locale/pl-PL.js +1 -0
  91. package/lib/umd/locale/pt-BR.js +1 -0
  92. package/lib/umd/locale/ru-RU.js +1 -1
  93. package/lib/umd/locale/sk-SK.js +1 -1
  94. package/lib/umd/locale/vi-VN.js +1 -1
  95. package/lib/umd/locale/zh-CN.js +1 -1
  96. package/lib/umd/locale/zh-HK.js +1 -0
  97. package/lib/umd/locale/zh-TW.js +1 -1
  98. package/package.json +15 -15
@@ -44,7 +44,8 @@ interface IFRangeSheetsUIMixin {
44
44
  * @example
45
45
  * ```ts
46
46
  * const fWorkbook = univerAPI.getActiveWorkbook();
47
- * const fWorksheet = fWorkbook.getActiveSheet();
47
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
48
+ * if (!fWorksheet) return;
48
49
  * const fRange = fWorksheet.getRange('H6');
49
50
  * console.log(fRange.getCell());
50
51
  * ```
@@ -56,7 +57,8 @@ interface IFRangeSheetsUIMixin {
56
57
  * @example
57
58
  * ```ts
58
59
  * const fWorkbook = univerAPI.getActiveWorkbook();
59
- * const fWorksheet = fWorkbook.getActiveSheet();
60
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
61
+ * if (!fWorksheet) return;
60
62
  * const fRange = fWorksheet.getRange('H6');
61
63
  * console.log(fRange.getCellRect());
62
64
  * ```
@@ -68,7 +70,8 @@ interface IFRangeSheetsUIMixin {
68
70
  * @example
69
71
  * ```ts
70
72
  * const fWorkbook = univerAPI.getActiveWorkbook();
71
- * const fWorksheet = fWorkbook.getActiveSheet();
73
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
74
+ * if (!fWorksheet) return;
72
75
  * const fRange = fWorksheet.getRange('A1:B2');
73
76
  * fRange.setValues([
74
77
  * [1, 2],
@@ -99,7 +102,8 @@ interface IFRangeSheetsUIMixin {
99
102
  *
100
103
  * // Attach the popup to the start cell of range C3:E5
101
104
  * const fWorkbook = univerAPI.getActiveWorkbook();
102
- * const fWorksheet = fWorkbook.getActiveSheet();
105
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
106
+ * if (!fWorksheet) return;
103
107
  * const fRange = fWorksheet.getRange('C3:E5');
104
108
  * const disposable = fRange.attachPopup({
105
109
  * componentKey: 'myPopup'
@@ -120,7 +124,8 @@ interface IFRangeSheetsUIMixin {
120
124
  * ```ts
121
125
  * // Attach an alert popup to the start cell of range C3:E5
122
126
  * const fWorkbook = univerAPI.getActiveWorkbook();
123
- * const fWorksheet = fWorkbook.getActiveSheet();
127
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
128
+ * if (!fWorksheet) return;
124
129
  * const fRange = fWorksheet.getRange('C3:E5');
125
130
  *
126
131
  * const disposable = fRange.attachAlertPopup({
@@ -155,7 +160,8 @@ interface IFRangeSheetsUIMixin {
155
160
  *
156
161
  * // Attach the popup to the range C3:E5
157
162
  * const fWorkbook = univerAPI.getActiveWorkbook();
158
- * const fWorksheet = fWorkbook.getActiveSheet();
163
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
164
+ * if (!fWorksheet) return;
159
165
  * const fRange = fWorksheet.getRange('C3:E5');
160
166
  * const disposable = fRange.attachRangePopup({
161
167
  * componentKey: 'myPopup',
@@ -172,7 +178,8 @@ interface IFRangeSheetsUIMixin {
172
178
  * @example
173
179
  * ```ts
174
180
  * const fWorkbook = univerAPI.getActiveWorkbook();
175
- * const fWorksheet = fWorkbook.getActiveSheet();
181
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
182
+ * if (!fWorksheet) return;
176
183
  *
177
184
  * // Highlight the range C3:E5 with default style
178
185
  * const fRange = fWorksheet.getRange('C3:E5');
@@ -207,7 +214,8 @@ interface IFRangeSheetsUIMixin {
207
214
  * @example
208
215
  * ```ts
209
216
  * const fWorkbook = univerAPI.getActiveWorkbook();
210
- * const fWorksheet = fWorkbook.getActiveSheet();
217
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
218
+ * if (!fWorksheet) return;
211
219
  * const fRange = fWorksheet.getRange('C3:E5');
212
220
  * fRange.showDropdown({ type: 'list', props: { options: [{ label: 'Option 1', value: 'option1' }, { label: 'Option 2', value: 'option2' }] } });
213
221
  * ```
@@ -214,7 +214,8 @@ export interface IFWorkbookSheetsUIMixin {
214
214
  * @example
215
215
  * ``` ts
216
216
  * const fWorkbook = univerAPI.getActiveWorkbook();
217
- * const fWorksheet = fWorkbook.getActiveSheet();
217
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
218
+ * if (!fWorksheet) return;
218
219
  *
219
220
  * // scroll to cell D10
220
221
  * fWorksheet.scrollToCell(9, 3);
@@ -30,7 +30,8 @@ export interface IFWorksheetUIMixin {
30
30
  * @example
31
31
  * ```ts
32
32
  * const fWorkbook = univerAPI.getActiveWorkbook();
33
- * const fWorksheet = fWorkbook.getActiveSheet();
33
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
34
+ * if (!fWorksheet) return;
34
35
  * fWorksheet.refreshCanvas();
35
36
  * ```
36
37
  */
@@ -44,7 +45,8 @@ export interface IFWorksheetUIMixin {
44
45
  * @example
45
46
  * ```ts
46
47
  * const fWorkbook = univerAPI.getActiveWorkbook();
47
- * const fWorksheet = fWorkbook.getActiveSheet();
48
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
49
+ * if (!fWorksheet) return;
48
50
  * const ranges = [fWorksheet.getRange('A1:B2'), fWorksheet.getRange('D4:E5')];
49
51
  * const disposable = fWorksheet.highlightRanges(ranges, { fill: 'yellow' });
50
52
  *
@@ -60,7 +62,8 @@ export interface IFWorksheetUIMixin {
60
62
  * @example
61
63
  * ```ts
62
64
  * const fWorkbook = univerAPI.getActiveWorkbook();
63
- * const fWorksheet = fWorkbook.getActiveSheet();
65
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
66
+ * if (!fWorksheet) return;
64
67
  *
65
68
  * // Set zoom ratio to 200%
66
69
  * fWorksheet.zoom(2);
@@ -75,7 +78,8 @@ export interface IFWorksheetUIMixin {
75
78
  * @example
76
79
  * ```ts
77
80
  * const fWorkbook = univerAPI.getActiveWorkbook();
78
- * const fWorksheet = fWorkbook.getActiveSheet();
81
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
82
+ * if (!fWorksheet) return;
79
83
  * const zoomRatio = fWorksheet.getZoom();
80
84
  * console.log(zoomRatio);
81
85
  * ```
@@ -87,7 +91,8 @@ export interface IFWorksheetUIMixin {
87
91
  * @example
88
92
  * ```ts
89
93
  * const fWorkbook = univerAPI.getActiveWorkbook();
90
- * const fWorksheet = fWorkbook.getActiveSheet();
94
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
95
+ * if (!fWorksheet) return;
91
96
  * const visibleRange = fWorksheet.getVisibleRange();
92
97
  * console.log(visibleRange);
93
98
  * console.log(fWorksheet.getRange(visibleRange).getA1Notation());
@@ -100,7 +105,8 @@ export interface IFWorksheetUIMixin {
100
105
  * @example
101
106
  * ```ts
102
107
  * const fWorkbook = univerAPI.getActiveWorkbook();
103
- * const fWorksheet = fWorkbook.getActiveSheet();
108
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
109
+ * if (!fWorksheet) return;
104
110
  * const visibleRanges = fWorksheet.getVisibleRangesOfAllViewports();
105
111
  * console.log(visibleRanges);
106
112
  * const mainLeftTopViewportRange = visibleRanges?.get(univerAPI.Enum.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP);
@@ -118,7 +124,8 @@ export interface IFWorksheetUIMixin {
118
124
  * @example
119
125
  * ```ts
120
126
  * const fWorkbook = univerAPI.getActiveWorkbook();
121
- * const fWorksheet = fWorkbook.getActiveSheet();
127
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
128
+ * if (!fWorksheet) return;
122
129
  *
123
130
  * // Scroll to cell D10
124
131
  * const fRange = fWorksheet.getRange('D10');
@@ -134,7 +141,8 @@ export interface IFWorksheetUIMixin {
134
141
  * @example
135
142
  * ```ts
136
143
  * const fWorkbook = univerAPI.getActiveWorkbook();
137
- * const fWorksheet = fWorkbook.getActiveSheet();
144
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
145
+ * if (!fWorksheet) return;
138
146
  *
139
147
  * // Scroll to cell D10
140
148
  * const fRange = fWorksheet.getRange('D10');
@@ -155,7 +163,8 @@ export interface IFWorksheetUIMixin {
155
163
  * @example
156
164
  * ```ts
157
165
  * const fWorkbook = univerAPI.getActiveWorkbook();
158
- * const fWorksheet = fWorkbook.getActiveSheet();
166
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
167
+ * if (!fWorksheet) return;
159
168
  * const skeleton = fWorksheet.getSkeleton();
160
169
  * console.log(skeleton);
161
170
  * ```
@@ -168,7 +177,8 @@ export interface IFWorksheetUIMixin {
168
177
  * @example
169
178
  * ```ts
170
179
  * const fWorkbook = univerAPI.getActiveWorkbook();
171
- * const fWorksheet = fWorkbook.getActiveSheet();
180
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
181
+ * if (!fWorksheet) return;
172
182
  *
173
183
  * // Set the long text value in cell A1
174
184
  * const fRange = fWorksheet.getRange('A1');
@@ -187,7 +197,8 @@ export interface IFWorksheetUIMixin {
187
197
  * @example
188
198
  * ```ts
189
199
  * const fWorkbook = univerAPI.getActiveWorkbook();
190
- * const fWorksheet = fWorkbook.getActiveSheet();
200
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
201
+ * if (!fWorksheet) return;
191
202
  *
192
203
  * // Set the A:C columns to a width that fits their text.
193
204
  * fWorksheet.autoResizeColumns(0, 3);
@@ -210,7 +221,8 @@ export interface IFWorksheetUIMixin {
210
221
  * @example
211
222
  * ```ts
212
223
  * const fWorkbook = univerAPI.getActiveWorkbook();
213
- * const fWorksheet = fWorkbook.getActiveSheet();
224
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
225
+ * if (!fWorksheet) return;
214
226
  *
215
227
  * // Set the first 3 rows to a height that fits their text.
216
228
  * fWorksheet.autoResizeRows(0, 3);
@@ -223,7 +235,8 @@ export interface IFWorksheetUIMixin {
223
235
  * @example
224
236
  * ```typescript
225
237
  * const fWorkbook = univerAPI.getActiveWorkbook();
226
- * const fWorksheet = fWorkbook.getActiveSheet();
238
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
239
+ * if (!fWorksheet) return;
227
240
  * fWorksheet.customizeColumnHeader({
228
241
  * headerStyle: {
229
242
  * fontColor: '#fff',
@@ -252,7 +265,8 @@ export interface IFWorksheetUIMixin {
252
265
  * @example
253
266
  * ```typescript
254
267
  * const fWorkbook = univerAPI.getActiveWorkbook();
255
- * const fWorksheet = fWorkbook.getActiveSheet();
268
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
269
+ * if (!fWorksheet) return;
256
270
  * fWorksheet.customizeRowHeader({
257
271
  * headerStyle: {
258
272
  * backgroundColor: 'pink',
@@ -276,7 +290,8 @@ export interface IFWorksheetUIMixin {
276
290
  * @example
277
291
  * ```ts
278
292
  * const fWorkbook = univerAPI.getActiveWorkbook();
279
- * const fWorksheet = fWorkbook.getActiveSheet();
293
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
294
+ * if (!fWorksheet) return;
280
295
  * fWorksheet.setColumnHeaderHeight(100);
281
296
  * ```
282
297
  */
@@ -288,7 +303,8 @@ export interface IFWorksheetUIMixin {
288
303
  * @example
289
304
  * ```ts
290
305
  * const fWorkbook = univerAPI.getActiveWorkbook();
291
- * const fWorksheet = fWorkbook.getActiveSheet();
306
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
307
+ * if (!fWorksheet) return;
292
308
  * fWorksheet.setRowHeaderWidth(100);
293
309
  * ```
294
310
  */
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;