@a3s-lab/office 0.17.0 → 0.19.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.
- package/README.md +14 -3
- package/dist/0~spreadsheet-editor.js +4567 -4014
- package/dist/0~work-office-diagnostics.js +1 -1
- package/dist/4104.js +27 -19
- package/dist/{2180.js → 6164.js} +165 -1
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/features/work/editors/spreadsheet-alignment-ribbon.d.ts +7 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-format.d.ts +4 -1
- package/dist/internal/features/work/editors/spreadsheet-clipboard-ribbon.d.ts +7 -0
- package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +110 -0
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +4 -2
- package/dist/internal/features/work/editors/spreadsheet-command-selection.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-editing-ribbon.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-model.d.ts +3 -2
- package/dist/internal/features/work/editors/spreadsheet-keyboard-shortcut-runners.d.ts +16 -0
- package/dist/internal/features/work/editors/spreadsheet-keyboard-shortcuts.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-rows-columns-ribbon.d.ts +5 -0
- package/dist/internal/features/work/editors/spreadsheet-selection-navigation-command.d.ts +3 -0
- package/dist/internal/features/work/editors/spreadsheet-structure-command.d.ts +5 -0
- package/dist/internal/features/work/editors/spreadsheet-text-orientation-command.d.ts +18 -0
- package/dist/internal/features/work/editors/spreadsheet-underline-ribbon.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-view-ribbon.d.ts +8 -0
- package/dist/internal/features/work/editors/spreadsheet-visibility-shortcuts.d.ts +3 -0
- package/dist/internal/features/work/work-spreadsheet-text-orientation.d.ts +21 -0
- package/dist/internal/features/work/work-spreadsheet-underline.d.ts +8 -0
- package/dist/internal/features/work/work-xlsx-cell-style-xml.d.ts +2 -1
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +161 -1
- package/package.json +6 -1
|
@@ -5,7 +5,7 @@ import { markDocxParagraphShading, inspectDocxPageSize, docxCaptionBookmark, has
|
|
|
5
5
|
import { normalizeDocumentHref } from "./0~work-document-links.js";
|
|
6
6
|
import { xmlAttributeLocalName, parseDocxParagraphDefaultCollapsed, readDocxBibliography, DOCX_WORDPROCESSING_NAMESPACES, xmlAttributeNamespace, createDocxThemeResolver } from "./0~2805.js";
|
|
7
7
|
import { updateSpreadsheetWorksheetCompatibilitySummary, inspectXlsxPivotTables, isSupportedXlsxChartLegend, isSupportedXlsxChartPlotLayout, xlsxChartNodeUsesStackedGrouping, isSupportedXlsxChartSeriesFormatting, readXlsxFormulaFeaturesFromPackage, inspectXlsxHeaderFooterText, emptySpreadsheetWorksheetCompatibilitySummary, xlsxChartSeriesFormattingShapeProperties, MAX_XLSX_WORKSHEET_IMAGE_BYTES, isSupportedXlsxWorksheetImageContentType, xlsxWorksheetCellEntries, diagnoseXlsxProtection, isEditableXlsxPaperSizeCode, isSupportedXlsxCombinationChartNodes } from "./4104.js";
|
|
8
|
-
import { spreadsheetConditionalComparisonNeedsUpperValue, isSpreadsheetConditionalIconSetName, isSpreadsheetConditionalComparisonOperator, spreadsheetConditionalIconSetCount } from "./
|
|
8
|
+
import { spreadsheetConditionalComparisonNeedsUpperValue, isSpreadsheetConditionalIconSetName, isSpreadsheetConditionalComparisonOperator, spreadsheetConditionalIconSetCount } from "./6164.js";
|
|
9
9
|
import { formulaHasStructuredReference, formulaHasExternalReference, parseSpreadsheetPrintTitles, volatileSpreadsheetFormulaFunctions, stripSpreadsheetSheetQualifier } from "./8715.js";
|
|
10
10
|
import { unsupportedSpreadsheetFormulaFunctions } from "./0~work-spreadsheet-formula-support.js";
|
|
11
11
|
var work_office_diagnostics_namespaceObject = {};
|
package/dist/4104.js
CHANGED
|
@@ -5,7 +5,7 @@ import { OFFICE_COLLABORATION_PROTOCOL as WORK_OFFICE_COLLABORATION_PROTOCOL, Of
|
|
|
5
5
|
import { contentTypeForPart, directChildren, bytesToDataUrl, OoxmlPackage as work_ooxml_package_OoxmlPackage, parseXml, firstDescendant, xmlNamespacePrefix, descendants, directChild, createArtifact as createWorkArtifact, xmlContainsAnyElement, createOfficeId as createWorkId, attribute as work_ooxml_package_attribute } from "./5184.js";
|
|
6
6
|
import { mountWorkLiveDocumentCapture, materializeWorkDocumentContent as work_document_model_codec_materializeWorkDocumentContent, documentPageSurfaceGeometryForElement, createWorkDocumentModel, documentContentLayoutProperties, documentModelForContent, createWorkDocumentExtensions, positionWorkLiveDocumentCapture } from "./6282.js";
|
|
7
7
|
import { normalizeWorkSpreadsheetDataLabels, workSpreadsheetChartSupportsGrouping, normalizeSpreadsheetPrintArea, normalizeWorkSpreadsheetChartLegendPosition, formatSpreadsheetCellRanges, spreadsheetCellAddress, normalizeWorkSpreadsheetChartSmoothLines, spreadsheetFormulaRangeForCell, normalizeWorkSpreadsheetChartColor, readXlsxDrawingAnchor, sparseArrayEntries, qualifySpreadsheetRange, normalizeWorkSpreadsheetBubbleScale, normalizeWorkSpreadsheetChartSeriesStyle, normalizeSpreadsheetPrintTitleRows, normalizeSpreadsheetPrintTitleColumns, spreadsheetPivotFilterValueKey, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetBubbleSizeRepresents, workSpreadsheetChartSupportsTrendlines, stripSpreadsheetSheetQualifier, normalizeWorkSpreadsheetChartLegendOverlay, normalizeWorkSpreadsheetChartGapWidth, normalizeWorkSpreadsheetChartGrouping, workSpreadsheetChartSupportsBarSpacing, workSpreadsheetChartSupportsSmoothLines, workSpreadsheetChartGroupingIsStacked, xlsxDrawingAnchorToBounds, xlsxTwoCellAnchorMarkers, workSpreadsheetChartSupportsErrorBars, sparseMatrixColumnCount, refreshSpreadsheetPivotTables, normalizeWorkSpreadsheetChartAxisGroup, isValidSpreadsheetDefinedName, normalizeWorkSpreadsheetScatterStyle, workSpreadsheetChartAxisDefaultLabelPosition, spreadsheetPivotValidation, resolveSpreadsheetChart, parseSpreadsheetCellRanges, workSpreadsheetChartAxisIsCategoryAxis, spreadsheetPivotFields, normalizeWorkSpreadsheetDoughnutHoleSize, normalizeWorkSpreadsheetChartAxes, parseSpreadsheetPrintTitles, spreadsheetFormulaRangeConflict, spreadsheetFormulaForXlsx, editableSpreadsheetFormula, workSpreadsheetChartUsesNumericXAxis, normalizeWorkSpreadsheetChartOverlap, workSpreadsheetChartSupportsAxes, workSpreadsheetChartAxisShowsMajorGridlinesByDefault, normalizeWorkSpreadsheetCombinationSeriesType, effectiveSpreadsheetCalculationSettings, normalizeWorkSpreadsheetTrendline, normalizeWorkSpreadsheetRadarStyle } from "./8715.js";
|
|
8
|
-
import { freezeImportedSpreadsheetCell, editableRangeRequiresCredentials,
|
|
8
|
+
import { normalizeSpreadsheetDateValidationBoundary, freezeImportedSpreadsheetCell, editableRangeRequiresCredentials, spreadsheetTextOrientationCellStyle, normalizeSpreadsheetConditionalIconSetFormat, defaultSpreadsheetDataBarOptions, normalizeSpreadsheetConditionalVisualOptions, normalizeSpreadsheetPaperSize, spreadsheetTextOrientationXlsxValueFromCell, normalizeSheetProtectionAuthority, defaultSpreadsheetColorScaleThresholds, importedSheetProtectionAuthority, spreadsheetDateValidationFormula, spreadsheetUnderlineCellValueFromXlsx, sheetHasProtectionState, spreadsheetTextOrientationFromXlsx, spreadsheetConditionalComparisonNeedsUpperValue, isSpreadsheetConditionalComparisonOperator, registerImportedSpreadsheetMatrix, spreadsheetExplicitTextOrientationFromCell, spreadsheetUnderlineStyle, defaultSpreadsheetConditionalIconThresholds, isSpreadsheetConditionalIconSetName, DEFAULT_PROTECTION_HINT, spreadsheetConditionalThresholdsEqual, spreadsheetUnderlineCellValueFromSheetJs, spreadsheetConditionalIconSetCount } from "./6164.js";
|
|
9
9
|
import { WorkFileImportController, materializeWorkFileSource } from "./9356.js";
|
|
10
10
|
import "./2591.js";
|
|
11
11
|
import "./3818.js";
|
|
@@ -3364,7 +3364,7 @@ function writeXlsxAlignment(document1, xf, style) {
|
|
|
3364
3364
|
if (void 0 !== style.horizontal) alignment.setAttribute('horizontal', style.horizontal);
|
|
3365
3365
|
if (void 0 !== style.vertical) alignment.setAttribute('vertical', style.vertical);
|
|
3366
3366
|
if (void 0 !== style.wrapText) alignment.setAttribute('wrapText', style.wrapText ? '1' : '0');
|
|
3367
|
-
if (void 0 !== style.textRotation) alignment.setAttribute('textRotation', String(style.textRotation));
|
|
3367
|
+
if (void 0 !== style.textRotation && Number.isInteger(style.textRotation) && (style.textRotation >= 0 && style.textRotation <= 180 || 255 === style.textRotation)) alignment.setAttribute('textRotation', String(style.textRotation));
|
|
3368
3368
|
}
|
|
3369
3369
|
function setXlsxValueChild(document1, parent, name, value, order) {
|
|
3370
3370
|
removeXlsxChildren(parent, name);
|
|
@@ -3385,11 +3385,11 @@ function setXlsxToggleChild(document1, parent, name, enabled, order) {
|
|
|
3385
3385
|
child.setAttribute('val', '1');
|
|
3386
3386
|
insertXlsxOrderedChild(parent, child, order);
|
|
3387
3387
|
}
|
|
3388
|
-
function setXlsxUnderlineChild(document1, parent,
|
|
3388
|
+
function setXlsxUnderlineChild(document1, parent, style, order) {
|
|
3389
3389
|
removeXlsxChildren(parent, 'u');
|
|
3390
|
-
if (
|
|
3390
|
+
if ('none' === style) return;
|
|
3391
3391
|
const child = document1.createElementNS(document1.documentElement.namespaceURI, 'u');
|
|
3392
|
-
child.setAttribute('val',
|
|
3392
|
+
child.setAttribute('val', style);
|
|
3393
3393
|
insertXlsxOrderedChild(parent, child, order);
|
|
3394
3394
|
}
|
|
3395
3395
|
function xlsxRgbColor(value) {
|
|
@@ -3624,7 +3624,7 @@ class XlsxDirectCellStyleWriter {
|
|
|
3624
3624
|
}
|
|
3625
3625
|
}
|
|
3626
3626
|
function hasXlsxDirectCellStyle(cell) {
|
|
3627
|
-
return Boolean(hasXlsxDirectFontStyle(cell) || void 0 !== cell.bg || void 0 !== cell.ht || void 0 !== cell.vt || void 0 !== cell.tb || void 0 !== cell.tr);
|
|
3627
|
+
return Boolean(hasXlsxDirectFontStyle(cell) || void 0 !== cell.bg || void 0 !== cell.ht || void 0 !== cell.vt || void 0 !== cell.tb || void 0 !== cell.rt || void 0 !== cell.tr);
|
|
3628
3628
|
}
|
|
3629
3629
|
function hasXlsxDirectFontStyle(cell) {
|
|
3630
3630
|
return Boolean(void 0 !== cell.bl || void 0 !== cell.it || void 0 !== cell.un || void 0 !== cell.cl || void 0 !== cell.ff || void 0 !== cell.fs || void 0 !== cell.fc);
|
|
@@ -3651,7 +3651,7 @@ function directFontStyle(cell) {
|
|
|
3651
3651
|
strike: 1 === Number(cell.cl)
|
|
3652
3652
|
} : {},
|
|
3653
3653
|
...void 0 !== cell.un ? {
|
|
3654
|
-
underline:
|
|
3654
|
+
underline: spreadsheetUnderlineStyle(cell.un)
|
|
3655
3655
|
} : {}
|
|
3656
3656
|
};
|
|
3657
3657
|
}
|
|
@@ -3660,10 +3660,8 @@ function directAlignment(cell) {
|
|
|
3660
3660
|
if (void 0 !== cell.ht) alignment.horizontal = 0 === Number(cell.ht) ? 'center' : 2 === Number(cell.ht) ? 'right' : 'left';
|
|
3661
3661
|
if (void 0 !== cell.vt) alignment.vertical = 0 === Number(cell.vt) ? 'center' : 1 === Number(cell.vt) ? 'top' : 'bottom';
|
|
3662
3662
|
if (void 0 !== cell.tb) alignment.wrapText = '2' === cell.tb;
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
if (Number.isFinite(rotation) && rotation >= 0 && rotation <= 180) alignment.textRotation = Math.round(rotation);
|
|
3666
|
-
}
|
|
3663
|
+
const rotation = spreadsheetTextOrientationXlsxValueFromCell(cell);
|
|
3664
|
+
if (null !== rotation) alignment.textRotation = rotation;
|
|
3667
3665
|
return Object.keys(alignment).length ? alignment : null;
|
|
3668
3666
|
}
|
|
3669
3667
|
function work_xlsx_cell_style_writer_nonNegativeInteger(value) {
|
|
@@ -3971,7 +3969,10 @@ function readDirectFontStyle(style, font, colors) {
|
|
|
3971
3969
|
const strike = directChild(font, 'strike');
|
|
3972
3970
|
if (strike && toggleEnabled(strike)) style.cl = 1;
|
|
3973
3971
|
const underline = directChild(font, 'u');
|
|
3974
|
-
if (underline
|
|
3972
|
+
if (underline) {
|
|
3973
|
+
const value = spreadsheetUnderlineCellValueFromXlsx(work_ooxml_package_attribute(underline, 'val'));
|
|
3974
|
+
if (value) style.un = value;
|
|
3975
|
+
}
|
|
3975
3976
|
const name = work_ooxml_package_attribute(directChild(font, 'name') ?? font, 'val')?.trim();
|
|
3976
3977
|
if (name) style.ff = name;
|
|
3977
3978
|
const size = Number(work_ooxml_package_attribute(directChild(font, 'sz') ?? font, 'val'));
|
|
@@ -3996,7 +3997,9 @@ function readDirectAlignmentStyle(style, alignment) {
|
|
|
3996
3997
|
else if ('bottom' === vertical) style.vt = 2;
|
|
3997
3998
|
if (work_xlsx_cell_styles_booleanAttribute(alignment, 'wrapText')) style.tb = '2';
|
|
3998
3999
|
const rotation = work_xlsx_cell_styles_nonNegativeInteger(work_ooxml_package_attribute(alignment, 'textRotation'));
|
|
3999
|
-
|
|
4000
|
+
const orientation = spreadsheetTextOrientationFromXlsx(rotation);
|
|
4001
|
+
const orientationStyle = spreadsheetTextOrientationCellStyle(orientation);
|
|
4002
|
+
if (orientationStyle) Object.assign(style, orientationStyle);
|
|
4000
4003
|
}
|
|
4001
4004
|
function readDirectCellBorder(xf, borders, colors) {
|
|
4002
4005
|
const borderId = work_xlsx_cell_styles_nonNegativeInteger(work_ooxml_package_attribute(xf, 'borderId')) ?? 0;
|
|
@@ -4027,10 +4030,6 @@ function toggleEnabled(element) {
|
|
|
4027
4030
|
const value = work_ooxml_package_attribute(element, 'val')?.trim().toLowerCase();
|
|
4028
4031
|
return '0' !== value && 'false' !== value && 'off' !== value;
|
|
4029
4032
|
}
|
|
4030
|
-
function underlineEnabled(element) {
|
|
4031
|
-
const value = work_ooxml_package_attribute(element, 'val')?.trim().toLowerCase();
|
|
4032
|
-
return '0' !== value && 'false' !== value && 'none' !== value;
|
|
4033
|
-
}
|
|
4034
4033
|
function work_xlsx_cell_styles_booleanAttribute(element, name) {
|
|
4035
4034
|
const value = work_ooxml_package_attribute(element, name)?.trim().toLowerCase();
|
|
4036
4035
|
return '1' === value || 'true' === value || 'on' === value;
|
|
@@ -8538,6 +8537,13 @@ function fortuneCellFromXlsx(source, row, column, sheetId, hyperlink, comment, X
|
|
|
8538
8537
|
...fortuneCellStyle(source),
|
|
8539
8538
|
...directStyle
|
|
8540
8539
|
};
|
|
8540
|
+
const orientation = spreadsheetExplicitTextOrientationFromCell(cell);
|
|
8541
|
+
if (orientation) {
|
|
8542
|
+
const orientationStyle = spreadsheetTextOrientationCellStyle(orientation);
|
|
8543
|
+
delete cell.rt;
|
|
8544
|
+
delete cell.tr;
|
|
8545
|
+
if (orientationStyle) Object.assign(cell, orientationStyle);
|
|
8546
|
+
}
|
|
8541
8547
|
if (void 0 !== source.v) cell.v = source.v;
|
|
8542
8548
|
const displayText = fortuneCellDisplayText(source, XLSX);
|
|
8543
8549
|
if (void 0 !== displayText) cell.m = displayText;
|
|
@@ -8566,7 +8572,7 @@ function fortuneCellStyle(source) {
|
|
|
8566
8572
|
if (font?.bold) target.bl = 1;
|
|
8567
8573
|
if (font?.italic) target.it = 1;
|
|
8568
8574
|
if (font?.strike) target.cl = 1;
|
|
8569
|
-
if (font?.underline) target.un =
|
|
8575
|
+
if (font?.underline) target.un = spreadsheetUnderlineCellValueFromSheetJs(font.underline);
|
|
8570
8576
|
if (font?.name) target.ff = font.name;
|
|
8571
8577
|
if (font?.sz !== void 0) target.fs = font.sz;
|
|
8572
8578
|
const fontColor = spreadsheetColor(font?.color?.rgb);
|
|
@@ -8580,7 +8586,9 @@ function fortuneCellStyle(source) {
|
|
|
8580
8586
|
else if (alignment?.vertical === 'top') target.vt = 1;
|
|
8581
8587
|
else if (alignment?.vertical === 'bottom') target.vt = 2;
|
|
8582
8588
|
if (alignment?.wrapText) target.tb = '2';
|
|
8583
|
-
|
|
8589
|
+
const orientation = spreadsheetTextOrientationFromXlsx(alignment?.textRotation);
|
|
8590
|
+
const orientationStyle = spreadsheetTextOrientationCellStyle(orientation);
|
|
8591
|
+
if (orientationStyle) Object.assign(target, orientationStyle);
|
|
8584
8592
|
if (source.z && 'General' !== source.z || 'e' === source.t) target.ct = {
|
|
8585
8593
|
fa: source.z && 'General' !== source.z ? String(source.z) : void 0,
|
|
8586
8594
|
t: source.t
|
package/dist/{2180.js → 6164.js}
RENAMED
|
@@ -2092,6 +2092,170 @@ function isoDateFromTimestamp(timestamp) {
|
|
|
2092
2092
|
if (!Number.isFinite(timestamp) || year < 1900 || year > 9999) return null;
|
|
2093
2093
|
return `${String(year).padStart(4, '0')}-${String(date.getUTCMonth() + 1).padStart(2, '0')}-${String(date.getUTCDate()).padStart(2, '0')}`;
|
|
2094
2094
|
}
|
|
2095
|
+
const spreadsheetUnderlineStyles = [
|
|
2096
|
+
'none',
|
|
2097
|
+
'single',
|
|
2098
|
+
'double',
|
|
2099
|
+
'singleAccounting',
|
|
2100
|
+
'doubleAccounting'
|
|
2101
|
+
];
|
|
2102
|
+
const underlineCellValues = {
|
|
2103
|
+
none: 0,
|
|
2104
|
+
single: 1,
|
|
2105
|
+
double: 2,
|
|
2106
|
+
singleAccounting: 3,
|
|
2107
|
+
doubleAccounting: 4
|
|
2108
|
+
};
|
|
2109
|
+
function isSpreadsheetUnderlineStyle(value) {
|
|
2110
|
+
return 'string' == typeof value && spreadsheetUnderlineStyles.includes(value);
|
|
2111
|
+
}
|
|
2112
|
+
function spreadsheetUnderlineCellValue(style) {
|
|
2113
|
+
return underlineCellValues[style];
|
|
2114
|
+
}
|
|
2115
|
+
function spreadsheetUnderlineStyle(value) {
|
|
2116
|
+
switch(Number(value)){
|
|
2117
|
+
case 1:
|
|
2118
|
+
return 'single';
|
|
2119
|
+
case 2:
|
|
2120
|
+
return 'double';
|
|
2121
|
+
case 3:
|
|
2122
|
+
case 0x21:
|
|
2123
|
+
return 'singleAccounting';
|
|
2124
|
+
case 4:
|
|
2125
|
+
case 0x22:
|
|
2126
|
+
return 'doubleAccounting';
|
|
2127
|
+
default:
|
|
2128
|
+
return 'none';
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
function spreadsheetUnderlineCellValueFromXlsx(value) {
|
|
2132
|
+
switch(value?.trim()){
|
|
2133
|
+
case null:
|
|
2134
|
+
case void 0:
|
|
2135
|
+
case '':
|
|
2136
|
+
case 'single':
|
|
2137
|
+
return 1;
|
|
2138
|
+
case 'double':
|
|
2139
|
+
return 2;
|
|
2140
|
+
case 'singleAccounting':
|
|
2141
|
+
return 3;
|
|
2142
|
+
case 'doubleAccounting':
|
|
2143
|
+
return 4;
|
|
2144
|
+
default:
|
|
2145
|
+
return 0;
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
function spreadsheetUnderlineCellValueFromSheetJs(value) {
|
|
2149
|
+
if (true === value) return 1;
|
|
2150
|
+
if (isSpreadsheetUnderlineStyle(value)) return spreadsheetUnderlineCellValue(value);
|
|
2151
|
+
return spreadsheetUnderlineCellValue(spreadsheetUnderlineStyle(value));
|
|
2152
|
+
}
|
|
2153
|
+
const spreadsheetTextOrientationIds = [
|
|
2154
|
+
'horizontal',
|
|
2155
|
+
'angleCounterclockwise',
|
|
2156
|
+
'angleClockwise',
|
|
2157
|
+
'vertical',
|
|
2158
|
+
'rotateUp',
|
|
2159
|
+
'rotateDown'
|
|
2160
|
+
];
|
|
2161
|
+
const presetAngles = {
|
|
2162
|
+
horizontal: 0,
|
|
2163
|
+
angleCounterclockwise: 45,
|
|
2164
|
+
angleClockwise: -45,
|
|
2165
|
+
rotateUp: 90,
|
|
2166
|
+
rotateDown: -90
|
|
2167
|
+
};
|
|
2168
|
+
const legacyFortunePresetAngles = {
|
|
2169
|
+
0: 0,
|
|
2170
|
+
1: 45,
|
|
2171
|
+
2: -45,
|
|
2172
|
+
4: 90,
|
|
2173
|
+
5: -90
|
|
2174
|
+
};
|
|
2175
|
+
function isSpreadsheetTextOrientationId(value) {
|
|
2176
|
+
return spreadsheetTextOrientationIds.includes(value);
|
|
2177
|
+
}
|
|
2178
|
+
function spreadsheetTextOrientationFromChoice(choice) {
|
|
2179
|
+
return 'vertical' === choice ? {
|
|
2180
|
+
kind: 'stacked'
|
|
2181
|
+
} : {
|
|
2182
|
+
kind: 'rotation',
|
|
2183
|
+
angle: presetAngles[choice]
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
function spreadsheetTextOrientationFromAngle(value) {
|
|
2187
|
+
const angle = integer(value);
|
|
2188
|
+
return null !== angle && angle >= -90 && angle <= 90 ? {
|
|
2189
|
+
kind: 'rotation',
|
|
2190
|
+
angle
|
|
2191
|
+
} : null;
|
|
2192
|
+
}
|
|
2193
|
+
function spreadsheetTextOrientationFromXlsx(value) {
|
|
2194
|
+
const rotation = integer(value);
|
|
2195
|
+
if (255 === rotation) return {
|
|
2196
|
+
kind: 'stacked'
|
|
2197
|
+
};
|
|
2198
|
+
if (null === rotation || rotation < 0 || rotation > 180) return null;
|
|
2199
|
+
return {
|
|
2200
|
+
kind: 'rotation',
|
|
2201
|
+
angle: rotation <= 90 ? rotation : 90 - rotation
|
|
2202
|
+
};
|
|
2203
|
+
}
|
|
2204
|
+
function spreadsheetExplicitTextOrientationFromCell(cell) {
|
|
2205
|
+
if (cell?.rt !== void 0 && null !== cell.rt) {
|
|
2206
|
+
const direct = spreadsheetTextOrientationFromXlsx(cell.rt);
|
|
2207
|
+
if (direct) return direct;
|
|
2208
|
+
}
|
|
2209
|
+
const legacy = String(cell?.tr ?? '').trim();
|
|
2210
|
+
if (!legacy) return null;
|
|
2211
|
+
if ('3' === legacy || '255' === legacy) return {
|
|
2212
|
+
kind: 'stacked'
|
|
2213
|
+
};
|
|
2214
|
+
const presetAngle = legacyFortunePresetAngles[legacy];
|
|
2215
|
+
if (void 0 !== presetAngle) return {
|
|
2216
|
+
kind: 'rotation',
|
|
2217
|
+
angle: presetAngle
|
|
2218
|
+
};
|
|
2219
|
+
const raw = integer(legacy);
|
|
2220
|
+
return null !== raw && raw >= 6 ? spreadsheetTextOrientationFromXlsx(raw) : null;
|
|
2221
|
+
}
|
|
2222
|
+
function spreadsheetTextOrientationFromCell(cell) {
|
|
2223
|
+
return spreadsheetExplicitTextOrientationFromCell(cell) ?? {
|
|
2224
|
+
kind: 'rotation',
|
|
2225
|
+
angle: 0
|
|
2226
|
+
};
|
|
2227
|
+
}
|
|
2228
|
+
function spreadsheetTextOrientationCellStyle(orientation) {
|
|
2229
|
+
if (!orientation) return null;
|
|
2230
|
+
if ('stacked' === orientation.kind) return {
|
|
2231
|
+
tr: '3'
|
|
2232
|
+
};
|
|
2233
|
+
return {
|
|
2234
|
+
rt: orientation.angle < 0 ? 90 - orientation.angle : orientation.angle
|
|
2235
|
+
};
|
|
2236
|
+
}
|
|
2237
|
+
function spreadsheetTextOrientationXlsxValue(orientation) {
|
|
2238
|
+
if (!orientation) return null;
|
|
2239
|
+
if ('stacked' === orientation.kind) return 255;
|
|
2240
|
+
return orientation.angle < 0 ? 90 - orientation.angle : orientation.angle;
|
|
2241
|
+
}
|
|
2242
|
+
function spreadsheetTextOrientationXlsxValueFromCell(cell) {
|
|
2243
|
+
return spreadsheetTextOrientationXlsxValue(spreadsheetExplicitTextOrientationFromCell(cell));
|
|
2244
|
+
}
|
|
2245
|
+
function spreadsheetVisibleTextRotationFromCell(cell) {
|
|
2246
|
+
const orientation = spreadsheetTextOrientationFromCell(cell);
|
|
2247
|
+
return 'rotation' === orientation.kind ? orientation.angle : 0;
|
|
2248
|
+
}
|
|
2249
|
+
function spreadsheetTextOrientationChoiceFromCell(cell) {
|
|
2250
|
+
const orientation = spreadsheetTextOrientationFromCell(cell);
|
|
2251
|
+
if ('stacked' === orientation.kind) return 'vertical';
|
|
2252
|
+
return Object.entries(presetAngles).find(([, angle])=>angle === orientation.angle)?.[0] ?? null;
|
|
2253
|
+
}
|
|
2254
|
+
function integer(value) {
|
|
2255
|
+
if ('string' == typeof value && !/^-?\d+$/.test(value.trim())) return null;
|
|
2256
|
+
const parsed = 'number' == typeof value ? value : Number(value);
|
|
2257
|
+
return Number.isSafeInteger(parsed) ? parsed : null;
|
|
2258
|
+
}
|
|
2095
2259
|
const SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS = [
|
|
2096
2260
|
'greaterThan',
|
|
2097
2261
|
'greaterThanOrEqual',
|
|
@@ -2585,4 +2749,4 @@ function boundedInteger(value, minimum, maximum, fallback) {
|
|
|
2585
2749
|
function boundedNumber(value, minimum, maximum, fallback) {
|
|
2586
2750
|
return 'number' == typeof value && Number.isFinite(value) && value >= minimum && value <= maximum ? value : fallback;
|
|
2587
2751
|
}
|
|
2588
|
-
export { DEFAULT_PROTECTION_HINT, SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS, SPREADSHEET_CONDITIONAL_ICON_SETS, attachSpreadsheetShownCommentCells, createWorkOfficeSpreadsheetCollaborationBinding as createOfficeSpreadsheetCollaborationBinding, defaultSpreadsheetColorScaleThresholds, defaultSpreadsheetConditionalIconThresholds, defaultSpreadsheetDataBarOptions, drawSpreadsheetConditionalIcon, editableRangeCellCount, editableRangeRequiresCredentials, effectiveSpreadsheetPageSetup, freezeImportedSpreadsheetCell, importedSheetProtectionAuthority, initializeWorkOfficeSpreadsheetCollaboration as initializeOfficeSpreadsheetCollaboration, isSpreadsheetConditionalComparisonOperator, isSpreadsheetConditionalIconSetName, normalizeSheetProtectionAuthority, normalizeSpreadsheetConditionalIconSetFormat, normalizeSpreadsheetConditionalVisualOptions, normalizeSpreadsheetDateValidationBoundary, normalizeSpreadsheetPaperSize, protectedSheetCount, readWorkOfficeSpreadsheetCollaboration as readOfficeSpreadsheetCollaboration, registerDerivedSpreadsheetMatrix, registerImportedSpreadsheetMatrix, replaceWorkOfficeSpreadsheetCollaboration as replaceOfficeSpreadsheetCollaboration, sameSpreadsheetHistoryValue, sheetHasProtectionState, sheetProtectionAuthority, spreadsheetConditionalComparisonNeedsUpperValue, spreadsheetConditionalIconForValue, spreadsheetConditionalIconSetCount, spreadsheetConditionalThresholdValue, spreadsheetConditionalThresholdsEqual, spreadsheetDateValidationFormula, spreadsheetMatrixProfile, spreadsheetProtectionKey, unlockedCellCount, withEditableRange, withSheetProtection, withSheetSelectionPermissions, withoutEditableRange };
|
|
2752
|
+
export { DEFAULT_PROTECTION_HINT, SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS, SPREADSHEET_CONDITIONAL_ICON_SETS, attachSpreadsheetShownCommentCells, createWorkOfficeSpreadsheetCollaborationBinding as createOfficeSpreadsheetCollaborationBinding, defaultSpreadsheetColorScaleThresholds, defaultSpreadsheetConditionalIconThresholds, defaultSpreadsheetDataBarOptions, drawSpreadsheetConditionalIcon, editableRangeCellCount, editableRangeRequiresCredentials, effectiveSpreadsheetPageSetup, freezeImportedSpreadsheetCell, importedSheetProtectionAuthority, initializeWorkOfficeSpreadsheetCollaboration as initializeOfficeSpreadsheetCollaboration, isSpreadsheetConditionalComparisonOperator, isSpreadsheetConditionalIconSetName, isSpreadsheetTextOrientationId, isSpreadsheetUnderlineStyle, normalizeSheetProtectionAuthority, normalizeSpreadsheetConditionalIconSetFormat, normalizeSpreadsheetConditionalVisualOptions, normalizeSpreadsheetDateValidationBoundary, normalizeSpreadsheetPaperSize, protectedSheetCount, readWorkOfficeSpreadsheetCollaboration as readOfficeSpreadsheetCollaboration, registerDerivedSpreadsheetMatrix, registerImportedSpreadsheetMatrix, replaceWorkOfficeSpreadsheetCollaboration as replaceOfficeSpreadsheetCollaboration, sameSpreadsheetHistoryValue, sheetHasProtectionState, sheetProtectionAuthority, spreadsheetConditionalComparisonNeedsUpperValue, spreadsheetConditionalIconForValue, spreadsheetConditionalIconSetCount, spreadsheetConditionalThresholdValue, spreadsheetConditionalThresholdsEqual, spreadsheetDateValidationFormula, spreadsheetExplicitTextOrientationFromCell, spreadsheetMatrixProfile, spreadsheetProtectionKey, spreadsheetTextOrientationCellStyle, spreadsheetTextOrientationChoiceFromCell, spreadsheetTextOrientationFromAngle, spreadsheetTextOrientationFromCell, spreadsheetTextOrientationFromChoice, spreadsheetTextOrientationFromXlsx, spreadsheetTextOrientationXlsxValueFromCell, spreadsheetUnderlineCellValue, spreadsheetUnderlineCellValueFromSheetJs, spreadsheetUnderlineCellValueFromXlsx, spreadsheetUnderlineStyle, spreadsheetVisibleTextRotationFromCell, unlockedCellCount, withEditableRange, withSheetProtection, withSheetSelectionPermissions, withoutEditableRange };
|
package/dist/core.js
CHANGED
|
@@ -7,6 +7,6 @@ export { createArtifact, createOfficeId, officeTemplates } from "./5184.js";
|
|
|
7
7
|
export { createOfficeDocumentCollaborationBinding, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration } from "./6282.js";
|
|
8
8
|
export { createOfficeMarkdownCollaborationBinding, initializeOfficeMarkdownCollaboration, readOfficeMarkdownCollaboration, replaceOfficeMarkdownCollaboration } from "./2591.js";
|
|
9
9
|
export { createOfficePresentationCollaborationBinding, initializeOfficePresentationCollaboration, readOfficePresentationCollaboration, replaceOfficePresentationCollaboration } from "./4560.js";
|
|
10
|
-
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./
|
|
10
|
+
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./6164.js";
|
|
11
11
|
export { normalizeWorkSpreadsheetBubbleScale, normalizeWorkSpreadsheetBubbleSizeRepresents, normalizeWorkSpreadsheetChartAxisGroup, normalizeWorkSpreadsheetCombinationSeriesType, normalizeWorkSpreadsheetDataLabelPosition, normalizeWorkSpreadsheetDataLabels, normalizeWorkSpreadsheetDoughnutHoleSize, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetRadarStyle, normalizeWorkSpreadsheetScatterStyle, normalizeWorkSpreadsheetTrendline, normalizeWorkSpreadsheetTrendlineType, workSpreadsheetChartSupportsAxes, workSpreadsheetChartSupportsErrorBars, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartTypeLabel, workSpreadsheetChartUsesNumericXAxis, workSpreadsheetCombinationSeriesTypeLabel, workSpreadsheetDataLabelPositionLabel, workSpreadsheetErrorBarTypeLabel, workSpreadsheetErrorBarValueTypeLabel, workSpreadsheetTrendlineTypeLabel } from "./8715.js";
|
|
12
12
|
export { core_OFFICE_COLLABORATION_VERSION as OFFICE_COLLABORATION_VERSION };
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,6 @@ export { createArtifact, createOfficeId, officeTemplates } from "./5184.js";
|
|
|
10
10
|
export { createOfficeDocumentCollaborationBinding, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration } from "./6282.js";
|
|
11
11
|
export { createOfficeMarkdownCollaborationBinding, initializeOfficeMarkdownCollaboration, readOfficeMarkdownCollaboration, replaceOfficeMarkdownCollaboration } from "./2591.js";
|
|
12
12
|
export { createOfficePresentationCollaborationBinding, initializeOfficePresentationCollaboration, readOfficePresentationCollaboration, replaceOfficePresentationCollaboration } from "./4560.js";
|
|
13
|
-
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./
|
|
13
|
+
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./6164.js";
|
|
14
14
|
export { normalizeWorkSpreadsheetBubbleScale, normalizeWorkSpreadsheetBubbleSizeRepresents, normalizeWorkSpreadsheetChartAxisGroup, normalizeWorkSpreadsheetCombinationSeriesType, normalizeWorkSpreadsheetDataLabelPosition, normalizeWorkSpreadsheetDataLabels, normalizeWorkSpreadsheetDoughnutHoleSize, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetRadarStyle, normalizeWorkSpreadsheetScatterStyle, normalizeWorkSpreadsheetTrendline, normalizeWorkSpreadsheetTrendlineType, workSpreadsheetChartSupportsAxes, workSpreadsheetChartSupportsErrorBars, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartTypeLabel, workSpreadsheetChartUsesNumericXAxis, workSpreadsheetCombinationSeriesTypeLabel, workSpreadsheetDataLabelPositionLabel, workSpreadsheetErrorBarTypeLabel, workSpreadsheetErrorBarValueTypeLabel, workSpreadsheetTrendlineTypeLabel } from "./8715.js";
|
|
15
15
|
export { src_DOCUMENT_SNAPSHOT_VERSION as DOCUMENT_SNAPSHOT_VERSION, src_DOCUMENT_SOURCE_VERSION as DOCUMENT_SOURCE_VERSION, src_OFFICE_COLLABORATION_VERSION as OFFICE_COLLABORATION_VERSION };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Cell } from '@fortune-sheet/core';
|
|
2
|
+
import type { SpreadsheetEditorCanCommands, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
3
|
+
export declare function SpreadsheetAlignmentRibbonGroup({ can, commands, toolbarCell, }: {
|
|
4
|
+
can: SpreadsheetEditorCanCommands;
|
|
5
|
+
commands: SpreadsheetEditorCommands;
|
|
6
|
+
toolbarCell: Cell | null | undefined;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Cell } from '@fortune-sheet/core';
|
|
2
2
|
import type { WorkSpreadsheetContent, WorkSpreadsheetSheet } from '../work-types';
|
|
3
|
+
import { type SpreadsheetUnderlineStyle } from '../work-spreadsheet-underline';
|
|
4
|
+
import { type SpreadsheetTextOrientationId } from '../work-spreadsheet-text-orientation';
|
|
3
5
|
import { type SpreadsheetCellBorderFormat } from './spreadsheet-cell-border';
|
|
4
6
|
import { type SpreadsheetCellRange } from './spreadsheet-cell-range';
|
|
5
7
|
export declare const MAX_SPREADSHEET_CELL_FORMAT_CELLS = 10000;
|
|
@@ -11,12 +13,13 @@ export interface SpreadsheetCellFormatPatch {
|
|
|
11
13
|
verticalAlignment?: SpreadsheetVerticalAlignment;
|
|
12
14
|
wrapText?: boolean;
|
|
13
15
|
rotation?: number;
|
|
16
|
+
textOrientation?: SpreadsheetTextOrientationId;
|
|
14
17
|
fontFamily?: string;
|
|
15
18
|
fontSize?: number;
|
|
16
19
|
fontColor?: string;
|
|
17
20
|
bold?: boolean;
|
|
18
21
|
italic?: boolean;
|
|
19
|
-
underline?:
|
|
22
|
+
underline?: SpreadsheetUnderlineStyle;
|
|
20
23
|
strike?: boolean;
|
|
21
24
|
fillColor?: string | null;
|
|
22
25
|
borders?: readonly SpreadsheetCellBorderFormat[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SpreadsheetEditorCanCommands, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
2
|
+
import type { SpreadsheetFormatPainterMode } from './spreadsheet-format-painter';
|
|
3
|
+
export declare function SpreadsheetClipboardRibbonGroup({ can, commands, formatPainterMode, }: {
|
|
4
|
+
can: SpreadsheetEditorCanCommands;
|
|
5
|
+
commands: SpreadsheetEditorCommands;
|
|
6
|
+
formatPainterMode: SpreadsheetFormatPainterMode | null;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -487,6 +487,60 @@ export declare const spreadsheetCommandCatalog: {
|
|
|
487
487
|
readonly group: "font";
|
|
488
488
|
};
|
|
489
489
|
};
|
|
490
|
+
readonly textOrientationHorizontal: {
|
|
491
|
+
readonly id: "alignment.textOrientation.horizontal";
|
|
492
|
+
readonly label: "横排文字";
|
|
493
|
+
readonly location: {
|
|
494
|
+
readonly area: "ribbon";
|
|
495
|
+
readonly tab: "home";
|
|
496
|
+
readonly group: "alignment";
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
readonly textOrientationAngleCounterclockwise: {
|
|
500
|
+
readonly id: "alignment.textOrientation.angleCounterclockwise";
|
|
501
|
+
readonly label: "逆时针倾斜";
|
|
502
|
+
readonly location: {
|
|
503
|
+
readonly area: "ribbon";
|
|
504
|
+
readonly tab: "home";
|
|
505
|
+
readonly group: "alignment";
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
readonly textOrientationAngleClockwise: {
|
|
509
|
+
readonly id: "alignment.textOrientation.angleClockwise";
|
|
510
|
+
readonly label: "顺时针倾斜";
|
|
511
|
+
readonly location: {
|
|
512
|
+
readonly area: "ribbon";
|
|
513
|
+
readonly tab: "home";
|
|
514
|
+
readonly group: "alignment";
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
readonly textOrientationVertical: {
|
|
518
|
+
readonly id: "alignment.textOrientation.vertical";
|
|
519
|
+
readonly label: "竖排文字";
|
|
520
|
+
readonly location: {
|
|
521
|
+
readonly area: "ribbon";
|
|
522
|
+
readonly tab: "home";
|
|
523
|
+
readonly group: "alignment";
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
readonly textOrientationRotateUp: {
|
|
527
|
+
readonly id: "alignment.textOrientation.rotateUp";
|
|
528
|
+
readonly label: "向上旋转文字";
|
|
529
|
+
readonly location: {
|
|
530
|
+
readonly area: "ribbon";
|
|
531
|
+
readonly tab: "home";
|
|
532
|
+
readonly group: "alignment";
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
readonly textOrientationRotateDown: {
|
|
536
|
+
readonly id: "alignment.textOrientation.rotateDown";
|
|
537
|
+
readonly label: "向下旋转文字";
|
|
538
|
+
readonly location: {
|
|
539
|
+
readonly area: "ribbon";
|
|
540
|
+
readonly tab: "home";
|
|
541
|
+
readonly group: "alignment";
|
|
542
|
+
};
|
|
543
|
+
};
|
|
490
544
|
readonly mergeAndCenter: {
|
|
491
545
|
readonly id: "alignment.mergeAndCenter";
|
|
492
546
|
readonly label: "合并居中";
|
|
@@ -609,6 +663,62 @@ export declare const spreadsheetCommandCatalog: {
|
|
|
609
663
|
readonly group: "cells";
|
|
610
664
|
};
|
|
611
665
|
};
|
|
666
|
+
readonly hideRows: {
|
|
667
|
+
readonly id: "cells.hideRows";
|
|
668
|
+
readonly label: "隐藏所选行";
|
|
669
|
+
readonly location: {
|
|
670
|
+
readonly area: "ribbon";
|
|
671
|
+
readonly tab: "home";
|
|
672
|
+
readonly group: "cells";
|
|
673
|
+
};
|
|
674
|
+
readonly shortcut: {
|
|
675
|
+
readonly label: "Cmd/Ctrl+9";
|
|
676
|
+
readonly aria: "Control+9 Meta+9";
|
|
677
|
+
readonly editor: readonly ["Mod-9"];
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
readonly hideColumns: {
|
|
681
|
+
readonly id: "cells.hideColumns";
|
|
682
|
+
readonly label: "隐藏所选列";
|
|
683
|
+
readonly location: {
|
|
684
|
+
readonly area: "ribbon";
|
|
685
|
+
readonly tab: "home";
|
|
686
|
+
readonly group: "cells";
|
|
687
|
+
};
|
|
688
|
+
readonly shortcut: {
|
|
689
|
+
readonly label: "Cmd/Ctrl+0";
|
|
690
|
+
readonly aria: "Control+0 Meta+0";
|
|
691
|
+
readonly editor: readonly ["Mod-0"];
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
readonly unhideRows: {
|
|
695
|
+
readonly id: "cells.unhideRows";
|
|
696
|
+
readonly label: "取消隐藏所选行";
|
|
697
|
+
readonly location: {
|
|
698
|
+
readonly area: "ribbon";
|
|
699
|
+
readonly tab: "home";
|
|
700
|
+
readonly group: "cells";
|
|
701
|
+
};
|
|
702
|
+
readonly shortcut: {
|
|
703
|
+
readonly label: "Cmd/Ctrl+Shift+9";
|
|
704
|
+
readonly aria: "Control+Shift+9 Meta+Shift+9";
|
|
705
|
+
readonly editor: readonly ["Mod-Shift-9"];
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
readonly unhideColumns: {
|
|
709
|
+
readonly id: "cells.unhideColumns";
|
|
710
|
+
readonly label: "取消隐藏所选列";
|
|
711
|
+
readonly location: {
|
|
712
|
+
readonly area: "ribbon";
|
|
713
|
+
readonly tab: "home";
|
|
714
|
+
readonly group: "cells";
|
|
715
|
+
};
|
|
716
|
+
readonly shortcut: {
|
|
717
|
+
readonly label: "Cmd/Ctrl+Shift+0";
|
|
718
|
+
readonly aria: "Control+Shift+0 Meta+Shift+0";
|
|
719
|
+
readonly editor: readonly ["Mod-Shift-0"];
|
|
720
|
+
};
|
|
721
|
+
};
|
|
612
722
|
readonly autoSum: {
|
|
613
723
|
readonly id: "editing.autoSum";
|
|
614
724
|
readonly label: "自动求和";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Cell, Selection, Sheet } from '@fortune-sheet/core';
|
|
2
|
-
import {
|
|
2
|
+
import type { SpreadsheetGridSize } from '../spreadsheet-sparse';
|
|
3
3
|
import type { WorkSpreadsheetContent } from '../work-types';
|
|
4
|
+
import type { SpreadsheetTextOrientationId } from '../work-spreadsheet-text-orientation';
|
|
4
5
|
import { type OfficeEditorCanCommands, type OfficeEditorExtension } from './office-editor-extension';
|
|
5
6
|
import type { SpreadsheetAutoSumFunction } from './spreadsheet-auto-sum';
|
|
6
7
|
import { type SpreadsheetCellClearMode } from './spreadsheet-cell-clear';
|
|
@@ -15,7 +16,7 @@ import { type SpreadsheetCellMergeCommand } from './spreadsheet-cell-merge';
|
|
|
15
16
|
import type { SpreadsheetFormatPainterMode } from './spreadsheet-format-painter';
|
|
16
17
|
import type { SpreadsheetHyperlinkCell, SpreadsheetHyperlinkRequest } from './spreadsheet-hyperlink';
|
|
17
18
|
import { type SpreadsheetFreezePanePreset } from './spreadsheet-freeze-panes';
|
|
18
|
-
import {
|
|
19
|
+
import type { SpreadsheetKeyboardSelection, SpreadsheetSelectionMove, SpreadsheetSelectionScope } from './spreadsheet-keyboard-navigation';
|
|
19
20
|
import type { SpreadsheetPasteContent } from './spreadsheet-paste-special';
|
|
20
21
|
import { type SpreadsheetDecimalPlacesDirection } from './spreadsheet-number-format-command';
|
|
21
22
|
import { type SpreadsheetSheetMoveDirection } from './spreadsheet-sheet-model';
|
|
@@ -188,6 +189,7 @@ export interface SpreadsheetEditorCommands {
|
|
|
188
189
|
renameSheet: (sheetId: string, name: string) => boolean;
|
|
189
190
|
redo: () => boolean;
|
|
190
191
|
setCellFormat: (attribute: keyof Cell, value: unknown) => boolean;
|
|
192
|
+
setTextOrientation: (orientation: SpreadsheetTextOrientationId) => boolean;
|
|
191
193
|
setSelectedCellBorders: (format: SpreadsheetCellBorderFormat) => boolean;
|
|
192
194
|
setFreezePanes: (preset: SpreadsheetFreezePanePreset) => boolean;
|
|
193
195
|
setGridLines: (visible: boolean) => boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SpreadsheetCommandContext, SpreadsheetCommandRange } from './spreadsheet-command-controller';
|
|
2
|
+
export declare function canEditSpreadsheetSelection(context: SpreadsheetCommandContext): boolean;
|
|
3
|
+
export declare function spreadsheetLiveCommandRange(context: SpreadsheetCommandContext): SpreadsheetCommandRange;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SpreadsheetEditorCanCommands, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
2
|
+
export declare function SpreadsheetEditingRibbonGroup({ can, commands, findOpen, }: {
|
|
3
|
+
can: SpreadsheetEditorCanCommands;
|
|
4
|
+
commands: SpreadsheetEditorCommands;
|
|
5
|
+
findOpen: boolean;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Cell } from '@fortune-sheet/core';
|
|
2
2
|
import type { WorkSpreadsheetContent } from '../work-types';
|
|
3
|
+
import { type SpreadsheetUnderlineStyle } from '../work-spreadsheet-underline';
|
|
3
4
|
import { type SpreadsheetCellBorderFormat, type SpreadsheetCellBorderStyle } from './spreadsheet-cell-border';
|
|
4
5
|
import { type SpreadsheetCellFormatPatch, type SpreadsheetHorizontalAlignment, type SpreadsheetVerticalAlignment } from './spreadsheet-cell-format';
|
|
5
6
|
import { type SpreadsheetCellRange } from './spreadsheet-cell-range';
|
|
@@ -38,7 +39,7 @@ export interface SpreadsheetFormatCellsFields {
|
|
|
38
39
|
fontColor: SpreadsheetFormatCellsField<string>;
|
|
39
40
|
bold: SpreadsheetFormatCellsField<boolean>;
|
|
40
41
|
italic: SpreadsheetFormatCellsField<boolean>;
|
|
41
|
-
underline: SpreadsheetFormatCellsField<
|
|
42
|
+
underline: SpreadsheetFormatCellsField<SpreadsheetUnderlineStyle>;
|
|
42
43
|
strike: SpreadsheetFormatCellsField<boolean>;
|
|
43
44
|
fillColor: SpreadsheetFormatCellsField<string | null>;
|
|
44
45
|
borders: SpreadsheetFormatCellsField<readonly SpreadsheetCellBorderFormat[]>;
|
|
@@ -62,7 +63,7 @@ export interface SpreadsheetFormatCellsDraft {
|
|
|
62
63
|
fontColor: string;
|
|
63
64
|
bold: boolean;
|
|
64
65
|
italic: boolean;
|
|
65
|
-
underline:
|
|
66
|
+
underline: SpreadsheetUnderlineStyle;
|
|
66
67
|
strike: boolean;
|
|
67
68
|
fillColor: string | null;
|
|
68
69
|
borders: SpreadsheetCellBorderFormat[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Cell } from '@fortune-sheet/core';
|
|
2
|
+
import type { SpreadsheetCellFillDirection } from './spreadsheet-cell-fill';
|
|
3
|
+
import type { SpreadsheetCommandContext, SpreadsheetEditorCanCommands, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
4
|
+
import { type SpreadsheetNumberFormatChoice } from './spreadsheet-number-format';
|
|
5
|
+
import { type SpreadsheetSheetMoveDirection } from './spreadsheet-sheet-model';
|
|
6
|
+
export declare function runSpreadsheetHistoryShortcut(event: KeyboardEvent, canExecute: () => boolean, execute: () => boolean): boolean;
|
|
7
|
+
export declare function runSpreadsheetCellFormatShortcut(event: KeyboardEvent, context: SpreadsheetCommandContext, canExecute: SpreadsheetEditorCanCommands['setCellFormat'], execute: SpreadsheetEditorCommands['setCellFormat'], attribute: Extract<keyof Cell, 'bl' | 'cl' | 'it' | 'un'>): boolean;
|
|
8
|
+
export declare function runSpreadsheetNumberFormatShortcut(event: KeyboardEvent, context: SpreadsheetCommandContext, canExecute: SpreadsheetEditorCanCommands['setCellFormat'], execute: SpreadsheetEditorCommands['setCellFormat'], preset: SpreadsheetNumberFormatChoice): boolean;
|
|
9
|
+
export declare function runSpreadsheetMergeShortcut(event: KeyboardEvent, canExecute: SpreadsheetEditorCanCommands['mergeSelectedCells'], execute: SpreadsheetEditorCommands['mergeSelectedCells']): boolean;
|
|
10
|
+
export declare function runSpreadsheetClearShortcut(event: KeyboardEvent, canExecute: SpreadsheetEditorCanCommands['clearSelectedCells'], execute: SpreadsheetEditorCommands['clearSelectedCells']): boolean;
|
|
11
|
+
export declare function runSpreadsheetFillShortcut(event: KeyboardEvent, canExecute: SpreadsheetEditorCanCommands['fillSelectedCells'], execute: SpreadsheetEditorCommands['fillSelectedCells'], direction: SpreadsheetCellFillDirection): boolean;
|
|
12
|
+
export declare function runSpreadsheetAutoFilterShortcut(event: KeyboardEvent, canExecute: () => boolean, execute: () => boolean): boolean;
|
|
13
|
+
export declare function runSpreadsheetFormatPainterEscape(event: KeyboardEvent, canExecute: SpreadsheetEditorCanCommands['cancelFormatPainter'], execute: SpreadsheetEditorCommands['cancelFormatPainter']): boolean;
|
|
14
|
+
export declare function runSpreadsheetSheetNavigationShortcut(event: KeyboardEvent, context: SpreadsheetCommandContext, activateSheet: SpreadsheetEditorCommands['activateSheet'], direction: SpreadsheetSheetMoveDirection): boolean;
|
|
15
|
+
export declare function runSpreadsheetAddSheetShortcut(event: KeyboardEvent, canExecute: SpreadsheetEditorCanCommands['addSheet'], execute: SpreadsheetEditorCommands['addSheet']): boolean;
|
|
16
|
+
export declare function runSpreadsheetRecalculationShortcut(event: KeyboardEvent, canExecute: SpreadsheetEditorCanCommands['recalculateFormula'], execute: SpreadsheetEditorCommands['recalculateFormula']): boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type OfficeEditorExtension } from './office-editor-extension';
|
|
2
|
+
import type { SpreadsheetCommandContext, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
3
|
+
export declare function createSpreadsheetKeyboardShortcutExtension(): OfficeEditorExtension<SpreadsheetCommandContext, SpreadsheetEditorCommands>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SpreadsheetEditorCanCommands, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
2
|
+
export declare function SpreadsheetRowsAndColumnsMenu({ can, commands, }: {
|
|
3
|
+
can: SpreadsheetEditorCanCommands;
|
|
4
|
+
commands: SpreadsheetEditorCommands;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type OfficeEditorExtension } from './office-editor-extension';
|
|
2
|
+
import type { SpreadsheetCommandContext, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
3
|
+
export declare function createSpreadsheetSelectionNavigationExtension(): OfficeEditorExtension<SpreadsheetCommandContext, SpreadsheetEditorCommands>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type OfficeEditorExtension } from './office-editor-extension';
|
|
2
|
+
import type { SpreadsheetCommandContext, SpreadsheetEditorCommands } from './spreadsheet-command-controller';
|
|
3
|
+
export declare const MAX_SPREADSHEET_VISIBILITY_ROWS = 10000;
|
|
4
|
+
export declare const MAX_SPREADSHEET_VISIBILITY_COLUMNS = 1000;
|
|
5
|
+
export declare function createSpreadsheetStructureExtension(): OfficeEditorExtension<SpreadsheetCommandContext, SpreadsheetEditorCommands>;
|