@a3s-lab/office 0.29.0 → 0.31.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 +117 -3
- package/dist/{0~7043.js → 0~4808.js} +347 -2
- package/dist/0~5050.js +10 -1
- package/dist/{0~5093.js → 0~7240.js} +465 -55
- package/dist/0~document-editor.js +1694 -187
- package/dist/0~spreadsheet-editor.js +183 -34
- package/dist/0~work-docx-export.js +507 -31
- package/dist/0~work-docx-import.js +41 -7
- package/dist/0~work-office-diagnostics.js +146 -5
- package/dist/1544.js +13 -1
- package/dist/4104.js +29 -6
- package/dist/4121.js +2340 -1
- package/dist/6282.js +1072 -1148
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +45 -0
- package/dist/internal/features/work/editors/document-dom-selection.d.ts +7 -0
- package/dist/internal/features/work/editors/document-editor-support.d.ts +1 -0
- package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +5 -2
- package/dist/internal/features/work/editors/document-font-dialog-run-shading-model.d.ts +23 -0
- package/dist/internal/features/work/editors/document-font-dialog-run-shading-section.d.ts +8 -0
- package/dist/internal/features/work/editors/document-index-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-index-entry-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-proofing-dialog-model.d.ts +22 -0
- package/dist/internal/features/work/editors/document-proofing-dialog.d.ts +7 -0
- package/dist/internal/features/work/editors/document-references-ribbon.d.ts +19 -0
- package/dist/internal/features/work/editors/document-table-of-contents-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +6 -1
- package/dist/internal/features/work/editors/spreadsheet-data-validation.d.ts +7 -1
- package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +5 -0
- package/dist/internal/features/work/work-document-character-formatting.d.ts +8 -0
- package/dist/internal/features/work/work-document-format-changes.d.ts +6 -0
- package/dist/internal/features/work/work-document-highlight.d.ts +9 -0
- package/dist/internal/features/work/work-document-index-fields.d.ts +19 -0
- package/dist/internal/features/work/work-document-index-nodes.d.ts +32 -0
- package/dist/internal/features/work/work-document-index.d.ts +63 -0
- package/dist/internal/features/work/work-document-outline.d.ts +1 -0
- package/dist/internal/features/work/work-document-paragraph-shading.d.ts +6 -0
- package/dist/internal/features/work/work-document-proofing.d.ts +19 -0
- package/dist/internal/features/work/work-document-run-shading.d.ts +12 -0
- package/dist/internal/features/work/work-document-table-of-contents-node.d.ts +18 -0
- package/dist/internal/features/work/work-document-table-of-contents.d.ts +51 -0
- package/dist/internal/features/work/work-document-word-line-metrics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-field-instructions.d.ts +1 -1
- package/dist/internal/features/work/work-docx-import.d.ts +5 -1
- package/dist/internal/features/work/work-docx-index-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-index-import.d.ts +23 -0
- package/dist/internal/features/work/work-docx-proofing-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-proofing.d.ts +38 -0
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +7 -0
- package/dist/internal/features/work/work-docx-run-shading-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-run-shading-export.d.ts +17 -0
- package/dist/internal/features/work/work-docx-run-shading.d.ts +20 -0
- package/dist/internal/features/work/work-docx-table-of-contents-export.d.ts +11 -0
- package/dist/internal/features/work/work-docx-table-of-contents-import.d.ts +15 -0
- package/dist/internal/features/work/work-spreadsheet-data-validation.d.ts +7 -0
- package/dist/internal/features/work/work-types.d.ts +9 -0
- package/dist/internal/kernel/office-kernel-protocol.d.ts +1 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +607 -4
- package/docs/latest/en/browser-editor-architecture.md +64 -1
- package/package.json +15 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __webpack_require__ } from "./0~rslib-runtime.js";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Workbook } from "@fortune-sheet/react";
|
|
4
|
-
import { AArrowDown, AArrowUp, AlignCenter, AlignLeft, AlignRight, AlignVerticalJustifyCenter, AlignVerticalJustifyEnd, AlignVerticalJustifyStart, ArrowDown, ArrowDownToLine, ArrowLeft, ArrowLeftToLine, ArrowRight, ArrowRightToLine, ArrowUp, ArrowUpToLine, BadgeJapaneseYen, BarChart3, BetweenHorizontalEnd, BetweenHorizontalStart, BetweenVerticalEnd, BetweenVerticalStart, Bold, Bookmark, Calculator, CalendarClock, CalendarDays, Check, ChevronDown, ChevronLeft, ChevronRight, ClipboardPaste, Clock, Cloud, Columns3, Copy, CopyPlus, DecimalsArrowLeft, DecimalsArrowRight, Eraser, Eye, EyeOff, FileX2, Globe2, Grid2X2, Grid3X3, Hash, Italic, KeyRound, Layers2, Link2, Link2Off, ListChecks, ListFilter, LocateFixed, Merge, MessageSquareX, MoveHorizontal, MoveVertical, Paintbrush, Palette, PanelLeft, PanelTop, PanelsTopLeft, Pencil, Percent, Plus, Printer, Redo2, RefreshCw, Rows3, Save, Scissors, Search, Settings2, ShieldCheck, Sigma, SortAsc, SortDesc, Strikethrough, SwatchBook, Table2, TableProperties, Trash2, Underline, Undo2, WrapText, X } from "lucide-react";
|
|
4
|
+
import { AArrowDown, AArrowUp, AlignCenter, AlignLeft, AlignRight, AlignVerticalJustifyCenter, AlignVerticalJustifyEnd, AlignVerticalJustifyStart, ArrowDown, ArrowDownToLine, ArrowLeft, ArrowLeftToLine, ArrowRight, ArrowRightToLine, ArrowUp, ArrowUpToLine, BadgeJapaneseYen, BarChart3, BetweenHorizontalEnd, BetweenHorizontalStart, BetweenVerticalEnd, BetweenVerticalStart, Bold, Bookmark, Calculator, CalendarClock, CalendarDays, Check, ChevronDown, ChevronLeft, ChevronRight, ClipboardPaste, Clock, Cloud, Columns3, Copy, CopyPlus, DecimalsArrowLeft, DecimalsArrowRight, Eraser, Eye, EyeOff, FileX2, Globe2, Grid2X2, Grid3X3, Hash, Info, Italic, KeyRound, Layers2, Link2, Link2Off, ListChecks, ListFilter, LocateFixed, Merge, MessageSquareX, MoveHorizontal, MoveVertical, Paintbrush, Palette, PanelLeft, PanelTop, PanelsTopLeft, Pencil, Percent, Plus, Printer, Redo2, RefreshCw, Rows3, Save, Scissors, Search, Settings2, ShieldCheck, Sigma, SortAsc, SortDesc, Strikethrough, SwatchBook, Table2, TableProperties, Trash2, TriangleAlert, Underline, Undo2, WrapText, X } from "lucide-react";
|
|
5
5
|
import { Fragment as external_react_Fragment, cloneElement, memo, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { convertSpanToShareString, genarate, indexToColumnChar, update as core_update } from "@fortune-sheet/core";
|
|
7
|
-
import { freezeImportedSpreadsheetCell, withXlsxPatternFill, spreadsheetMatrixProfile, xlsxRichTextCellText, spreadsheetTextOrientationFromAngle, spreadsheetCellValueWithDiagonalBorder, xlsxSemanticColorMatchesValue, spreadsheetUnderlineCellValue, normalizeXlsxRichTextEditSource, attachSpreadsheetShownCommentCells, sameSpreadsheetHistoryValue, isSpreadsheetConditionalComparisonOperator, defaultSpreadsheetConditionalIconThresholds, normalizeXlsxRichTextCell, activeXlsxNativeFill, xlsxPatternFillTypes, normalizeSpreadsheetDateValidationBoundary, unlockedCellCount, editableRangeRequiresCredentials, spreadsheetTextOrientationChoiceFromCell, spreadsheetConditionalThresholdValue, withSheetProtection, defaultSpreadsheetColorScaleThresholds, protectedSheetCount, sameXlsxRichTextRunStyle, withSheetSelectionPermissions, spreadsheetTextOrientationFromCell, patchSpreadsheetRichTextFontRuns, readOfficeSpreadsheetCollaboration as readWorkOfficeSpreadsheetCollaboration, spreadsheetConditionalThresholdsEqual, spreadsheetVisibleTextRotationFromCell, spreadsheetTextOrientationFromChoice, normalizeXlsxSemanticColorOrigin, withoutEditableRange, isSpreadsheetTextOrientationId, normalizeSpreadsheetConditionalVisualOptions, withXlsxGradientFill, effectiveSpreadsheetPageSetup, normalizeXlsxPatternFill, normalizeXlsxRichTextColor, isHighSurrogate, xlsxNativeFillCellKeys, withEditableRange, createOfficeSpreadsheetCollaborationBinding as createWorkOfficeSpreadsheetCollaborationBinding, spreadsheetConditionalIconForValue, spreadsheetUnderlineStyle, sheetProtectionAuthority, normalizeXlsxGradientFill, xlsxGradientFillFallbackColor, editableRangeCellCount, registerDerivedSpreadsheetMatrix, deleteXlsxNativeFills, spreadsheetTextOrientationCellStyle, normalizeSpreadsheetConditionalIconSetFormat, defaultSpreadsheetDataBarOptions, normalizeSheetProtectionAuthority, spreadsheetProtectionKey, SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS, normalizeXlsxRichTextRun, spreadsheetDiagonalBorderFromCellValue, SPREADSHEET_CONDITIONAL_ICON_SETS, isLowSurrogate, spreadsheetConditionalComparisonNeedsUpperValue, drawSpreadsheetConditionalIcon, coalesceXlsxRichTextRuns, replaceOfficeSpreadsheetCollaboration as replaceWorkOfficeSpreadsheetCollaboration, validXlsxRichText, isSpreadsheetUnderlineStyle } from "./1544.js";
|
|
7
|
+
import { freezeImportedSpreadsheetCell, withXlsxPatternFill, spreadsheetMatrixProfile, xlsxRichTextCellText, spreadsheetTextOrientationFromAngle, spreadsheetCellValueWithDiagonalBorder, xlsxSemanticColorMatchesValue, spreadsheetUnderlineCellValue, normalizeXlsxRichTextEditSource, attachSpreadsheetShownCommentCells, sameSpreadsheetHistoryValue, isSpreadsheetConditionalComparisonOperator, defaultSpreadsheetConditionalIconThresholds, normalizeXlsxRichTextCell, activeXlsxNativeFill, xlsxPatternFillTypes, normalizeSpreadsheetDateValidationBoundary, unlockedCellCount, editableRangeRequiresCredentials, spreadsheetTextOrientationChoiceFromCell, spreadsheetConditionalThresholdValue, withSheetProtection, defaultSpreadsheetColorScaleThresholds, protectedSheetCount, sameXlsxRichTextRunStyle, withSheetSelectionPermissions, spreadsheetTextOrientationFromCell, patchSpreadsheetRichTextFontRuns, readOfficeSpreadsheetCollaboration as readWorkOfficeSpreadsheetCollaboration, spreadsheetConditionalThresholdsEqual, spreadsheetVisibleTextRotationFromCell, spreadsheetTextOrientationFromChoice, normalizeXlsxSemanticColorOrigin, withoutEditableRange, isSpreadsheetTextOrientationId, normalizeSpreadsheetConditionalVisualOptions, normalizeSpreadsheetDataValidationErrorStyle, withXlsxGradientFill, effectiveSpreadsheetPageSetup, normalizeXlsxPatternFill, normalizeXlsxRichTextColor, isHighSurrogate, xlsxNativeFillCellKeys, withEditableRange, createOfficeSpreadsheetCollaborationBinding as createWorkOfficeSpreadsheetCollaborationBinding, spreadsheetConditionalIconForValue, boundedSpreadsheetDataValidationText, spreadsheetUnderlineStyle, sheetProtectionAuthority, normalizeXlsxGradientFill, xlsxGradientFillFallbackColor, editableRangeCellCount, registerDerivedSpreadsheetMatrix, deleteXlsxNativeFills, spreadsheetTextOrientationCellStyle, normalizeSpreadsheetConditionalIconSetFormat, defaultSpreadsheetDataBarOptions, normalizeSheetProtectionAuthority, spreadsheetProtectionKey, SPREADSHEET_CONDITIONAL_COMPARISON_OPERATORS, normalizeXlsxRichTextRun, spreadsheetDiagonalBorderFromCellValue, SPREADSHEET_CONDITIONAL_ICON_SETS, isLowSurrogate, spreadsheetConditionalComparisonNeedsUpperValue, drawSpreadsheetConditionalIcon, coalesceXlsxRichTextRuns, replaceOfficeSpreadsheetCollaboration as replaceWorkOfficeSpreadsheetCollaboration, validXlsxRichText, isSpreadsheetUnderlineStyle } from "./1544.js";
|
|
8
8
|
import { workSpreadsheetChartSupportsGrouping, spreadsheetFormulaRangesForSelection, createSpreadsheetChartFromSelection, normalizeWorkSpreadsheetDataLabelPosition, normalizeSpreadsheetPrintTitleColumns, normalizeSpreadsheetPrintTitleRows, formulaHasStructuredReference, normalizeWorkSpreadsheetErrorBars, defaultPivotValueCaption, workSpreadsheetChartSupportsBarSpacing, normalizeWorkSpreadsheetChartGrouping, spreadsheetGridSize, normalizeWorkSpreadsheetChartAxisGroup, normalizeWorkSpreadsheetScatterStyle, cloneSparseMatrix, spreadsheetPivotAggregationLabel, workSpreadsheetChartAxisIsCategoryAxis, reconcileSpreadsheetChartPreviews, normalizeWorkSpreadsheetChartAxes, normalizeWorkSpreadsheetDoughnutHoleSize, normalizeWorkSpreadsheetChartLegendPosition, spreadsheetChartCount, workSpreadsheetChartTypeLabel, sparseArrayEntries, normalizeWorkSpreadsheetTrendline, effectiveSpreadsheetCalculationSettings, spreadsheetPivotIntersects, normalizeWorkSpreadsheetDataLabels, spreadsheetPivotOutputContains, normalizeSpreadsheetPrintArea, spreadsheetCellAddress, formatSpreadsheetCellRanges, normalizeWorkSpreadsheetChartLayout, spreadsheetFormulaRangeForCell, workSpreadsheetChartAxisIsValueAxis, normalizeWorkSpreadsheetChartSmoothLines, spreadsheetPivotFilterValueKey, normalizeWorkSpreadsheetBubbleScale, normalizeWorkSpreadsheetChartSeriesStyle, volatileSpreadsheetFormulaFunctions, sparseArrayIndexes, normalizeWorkSpreadsheetBubbleSizeRepresents, workSpreadsheetChartSupportsTrendlines, normalizeWorkSpreadsheetChartLegendOverlay, parseSpreadsheetChartReference, workSpreadsheetChartGroupingIsStacked, normalizeWorkSpreadsheetChartGapWidth, workSpreadsheetChartSupportsSmoothLines, refreshSpreadsheetPivotTables, createSpreadsheetPivotFromSelection, reconcileSpreadsheetPivots, spreadsheetPivotCount, sparseMatrixColumnCount, workSpreadsheetChartSupportsErrorBars, formulaHasExternalReference, isValidSpreadsheetDefinedName, spreadsheetPivotValidation, deleteSpreadsheetPivotTable, workSpreadsheetChartAxisDefaultLabelPosition, workSpreadsheetChartSupportsSeriesAnalysis, parseSpreadsheetCellRanges, spreadsheetPivotFilterItems, spreadsheetPivotFields, normalizeWorkSpreadsheetChartOverlap, spreadsheetFormulaRangeConflict, spreadsheetSheetsWithChartPreviews, workSpreadsheetChartUsesNumericXAxis, workSpreadsheetChartAxisShowsMajorGridlinesByDefault, workSpreadsheetChartSupportsAxes, normalizeWorkSpreadsheetCombinationSeriesType, normalizeWorkSpreadsheetRadarStyle } from "./8715.js";
|
|
9
9
|
import { moveOfficeMenuFocus, stepOfficeZoom, useOfficeRemoteParticipants, Popover, officePresenceColor, useOfficePublishPresenceLocation, button_Button, icon_button_IconButton, moveOfficeGridMenuFocus, office_text_field_OfficeTextField, useDialogFocusScope, useOfficeEditorWheelZoom } from "./0~6090.js";
|
|
10
10
|
import { isOfficeKernelSpreadsheetError, normalizeCssColor, OFFICE_KERNEL_SPREADSHEET_MAX_ROWS, createOfficeId as createWorkId } from "./4121.js";
|
|
@@ -6717,9 +6717,15 @@ function quoteSpreadsheetSheetName(name) {
|
|
|
6717
6717
|
}
|
|
6718
6718
|
const MAX_SPREADSHEET_DATA_VALIDATION_CELLS = 10000;
|
|
6719
6719
|
const defaultSpreadsheetDataValidationValue = {
|
|
6720
|
+
allowBlank: true,
|
|
6721
|
+
errorMessage: '',
|
|
6722
|
+
errorStyle: 'stop',
|
|
6723
|
+
errorTitle: '',
|
|
6720
6724
|
hintShow: false,
|
|
6725
|
+
hintTitle: '',
|
|
6721
6726
|
hintValue: '',
|
|
6722
6727
|
prohibitInput: true,
|
|
6728
|
+
showDropdownArrow: true,
|
|
6723
6729
|
type: 'dropdown',
|
|
6724
6730
|
type2: '',
|
|
6725
6731
|
value1: '',
|
|
@@ -6845,9 +6851,15 @@ function normalizeSpreadsheetDataValidationItem(content, sheet, ranges, value) {
|
|
|
6845
6851
|
value2: normalizedValues.value2,
|
|
6846
6852
|
validity: '',
|
|
6847
6853
|
remote: false,
|
|
6854
|
+
allowBlank: Boolean(value.allowBlank),
|
|
6855
|
+
showDropdownArrow: 'dropdown' === value.type ? Boolean(value.showDropdownArrow) : true,
|
|
6848
6856
|
prohibitInput: Boolean(value.prohibitInput),
|
|
6857
|
+
errorStyle: normalizeSpreadsheetDataValidationErrorStyle(value.errorStyle),
|
|
6858
|
+
errorTitle: boundedSpreadsheetDataValidationText(value.errorTitle, 32),
|
|
6859
|
+
errorMessage: boundedSpreadsheetDataValidationText(value.errorMessage, 225),
|
|
6849
6860
|
hintShow: Boolean(value.hintShow),
|
|
6850
|
-
|
|
6861
|
+
hintTitle: boundedSpreadsheetDataValidationText(value.hintTitle, 32),
|
|
6862
|
+
hintValue: boundedSpreadsheetDataValidationText(value.hintValue, 255),
|
|
6851
6863
|
checked: false
|
|
6852
6864
|
}
|
|
6853
6865
|
};
|
|
@@ -6948,7 +6960,13 @@ function spreadsheetDataValidationDialogValue(value) {
|
|
|
6948
6960
|
value1: 'date' === type ? normalizeSpreadsheetDateValidationBoundary(item.value1) ?? item.value1 : item.value1,
|
|
6949
6961
|
value2: 'date' === type && item.value2 ? normalizeSpreadsheetDateValidationBoundary(item.value2) ?? item.value2 : item.value2,
|
|
6950
6962
|
prohibitInput: item.prohibitInput,
|
|
6963
|
+
allowBlank: item.allowBlank ?? true,
|
|
6964
|
+
showDropdownArrow: item.showDropdownArrow ?? true,
|
|
6965
|
+
errorStyle: item.errorStyle ?? 'stop',
|
|
6966
|
+
errorTitle: item.errorTitle ?? '',
|
|
6967
|
+
errorMessage: item.errorMessage ?? '',
|
|
6951
6968
|
hintShow: item.hintShow,
|
|
6969
|
+
hintTitle: item.hintTitle ?? '',
|
|
6952
6970
|
hintValue: item.hintValue
|
|
6953
6971
|
};
|
|
6954
6972
|
}
|
|
@@ -6971,9 +6989,15 @@ function spreadsheetDataValidationItem(value) {
|
|
|
6971
6989
|
value2: 'string' == typeof value.value2 ? value.value2 : String(value.value2 ?? ''),
|
|
6972
6990
|
validity: 'string' == typeof value.validity ? value.validity : '',
|
|
6973
6991
|
remote: Boolean(value.remote),
|
|
6992
|
+
allowBlank: 'boolean' == typeof value.allowBlank ? value.allowBlank : true,
|
|
6993
|
+
showDropdownArrow: 'boolean' == typeof value.showDropdownArrow ? value.showDropdownArrow : true,
|
|
6974
6994
|
prohibitInput: Boolean(value.prohibitInput),
|
|
6995
|
+
errorStyle: normalizeSpreadsheetDataValidationErrorStyle(value.errorStyle),
|
|
6996
|
+
errorTitle: boundedSpreadsheetDataValidationText(value.errorTitle, 32),
|
|
6997
|
+
errorMessage: boundedSpreadsheetDataValidationText(value.errorMessage, 225),
|
|
6975
6998
|
hintShow: Boolean(value.hintShow),
|
|
6976
|
-
|
|
6999
|
+
hintTitle: boundedSpreadsheetDataValidationText(value.hintTitle, 32),
|
|
7000
|
+
hintValue: boundedSpreadsheetDataValidationText(value.hintValue, 255),
|
|
6977
7001
|
checked: Boolean(value.checked)
|
|
6978
7002
|
};
|
|
6979
7003
|
}
|
|
@@ -7106,8 +7130,14 @@ function spreadsheetDataValidationSignature(value) {
|
|
|
7106
7130
|
type2: item.type2,
|
|
7107
7131
|
value1: item.value1,
|
|
7108
7132
|
value2: item.value2,
|
|
7133
|
+
allowBlank: item.allowBlank,
|
|
7134
|
+
showDropdownArrow: item.showDropdownArrow,
|
|
7109
7135
|
prohibitInput: item.prohibitInput,
|
|
7136
|
+
errorStyle: item.errorStyle,
|
|
7137
|
+
errorTitle: item.errorTitle,
|
|
7138
|
+
errorMessage: item.errorMessage,
|
|
7110
7139
|
hintShow: item.hintShow,
|
|
7140
|
+
hintTitle: item.hintTitle,
|
|
7111
7141
|
hintValue: item.hintValue
|
|
7112
7142
|
}) : 'invalid';
|
|
7113
7143
|
}
|
|
@@ -24020,6 +24050,27 @@ function SpreadsheetDataValidationDialog({ source, restoreFocusTarget, onApply,
|
|
|
24020
24050
|
})
|
|
24021
24051
|
]
|
|
24022
24052
|
}),
|
|
24053
|
+
/*#__PURE__*/ jsxs("div", {
|
|
24054
|
+
className: "work-spreadsheet-data-validation-behavior",
|
|
24055
|
+
children: [
|
|
24056
|
+
/*#__PURE__*/ jsx(OfficeCheckbox, {
|
|
24057
|
+
ariaLabel: "忽略空值",
|
|
24058
|
+
checked: value.allowBlank,
|
|
24059
|
+
onCheckedChange: (allowBlank)=>update({
|
|
24060
|
+
allowBlank
|
|
24061
|
+
}),
|
|
24062
|
+
children: "忽略空值"
|
|
24063
|
+
}),
|
|
24064
|
+
'dropdown' === value.type && /*#__PURE__*/ jsx(OfficeCheckbox, {
|
|
24065
|
+
ariaLabel: "在单元格内显示下拉箭头",
|
|
24066
|
+
checked: value.showDropdownArrow,
|
|
24067
|
+
onCheckedChange: (showDropdownArrow)=>update({
|
|
24068
|
+
showDropdownArrow
|
|
24069
|
+
}),
|
|
24070
|
+
children: "在单元格内显示下拉箭头"
|
|
24071
|
+
})
|
|
24072
|
+
]
|
|
24073
|
+
}),
|
|
24023
24074
|
'dropdown' === value.type ? /*#__PURE__*/ jsx(field_Field, {
|
|
24024
24075
|
label: "来源",
|
|
24025
24076
|
required: true,
|
|
@@ -24027,6 +24078,7 @@ function SpreadsheetDataValidationDialog({ source, restoreFocusTarget, onApply,
|
|
|
24027
24078
|
error: visibleError ?? void 0,
|
|
24028
24079
|
children: /*#__PURE__*/ jsx("input", {
|
|
24029
24080
|
type: "text",
|
|
24081
|
+
"aria-label": "来源",
|
|
24030
24082
|
autoCapitalize: "none",
|
|
24031
24083
|
spellCheck: false,
|
|
24032
24084
|
value: value.value1,
|
|
@@ -24050,44 +24102,141 @@ function SpreadsheetDataValidationDialog({ source, restoreFocusTarget, onApply,
|
|
|
24050
24102
|
]
|
|
24051
24103
|
}),
|
|
24052
24104
|
/*#__PURE__*/ jsxs("section", {
|
|
24053
|
-
"aria-labelledby": `${formId}-
|
|
24105
|
+
"aria-labelledby": `${formId}-input-message`,
|
|
24054
24106
|
children: [
|
|
24055
|
-
/*#__PURE__*/
|
|
24056
|
-
|
|
24057
|
-
children:
|
|
24107
|
+
/*#__PURE__*/ jsxs("div", {
|
|
24108
|
+
className: "work-spreadsheet-data-validation-section-heading",
|
|
24109
|
+
children: [
|
|
24110
|
+
/*#__PURE__*/ jsx(Info, {
|
|
24111
|
+
size: 16,
|
|
24112
|
+
"aria-hidden": "true"
|
|
24113
|
+
}),
|
|
24114
|
+
/*#__PURE__*/ jsx("h3", {
|
|
24115
|
+
id: `${formId}-input-message`,
|
|
24116
|
+
children: "输入信息"
|
|
24117
|
+
})
|
|
24118
|
+
]
|
|
24058
24119
|
}),
|
|
24120
|
+
/*#__PURE__*/ jsx(OfficeCheckbox, {
|
|
24121
|
+
ariaLabel: "选中单元格时显示输入信息",
|
|
24122
|
+
checked: value.hintShow,
|
|
24123
|
+
onCheckedChange: (hintShow)=>update({
|
|
24124
|
+
hintShow
|
|
24125
|
+
}),
|
|
24126
|
+
children: "选中单元格时显示输入信息"
|
|
24127
|
+
}),
|
|
24128
|
+
value.hintShow && /*#__PURE__*/ jsxs("div", {
|
|
24129
|
+
className: "work-spreadsheet-data-validation-message-grid",
|
|
24130
|
+
children: [
|
|
24131
|
+
/*#__PURE__*/ jsx(field_Field, {
|
|
24132
|
+
label: "输入信息标题",
|
|
24133
|
+
children: /*#__PURE__*/ jsx("input", {
|
|
24134
|
+
type: "text",
|
|
24135
|
+
"aria-label": "输入信息标题",
|
|
24136
|
+
maxLength: 32,
|
|
24137
|
+
value: value.hintTitle,
|
|
24138
|
+
onChange: (event)=>update({
|
|
24139
|
+
hintTitle: event.currentTarget.value
|
|
24140
|
+
})
|
|
24141
|
+
})
|
|
24142
|
+
}),
|
|
24143
|
+
/*#__PURE__*/ jsx(field_Field, {
|
|
24144
|
+
label: "输入信息",
|
|
24145
|
+
className: "message",
|
|
24146
|
+
description: "最多 255 个字符,将在用户选中受验证单元格时显示。",
|
|
24147
|
+
children: /*#__PURE__*/ jsx("textarea", {
|
|
24148
|
+
"aria-label": "输入信息",
|
|
24149
|
+
rows: 3,
|
|
24150
|
+
maxLength: 255,
|
|
24151
|
+
value: value.hintValue,
|
|
24152
|
+
onChange: (event)=>update({
|
|
24153
|
+
hintValue: event.currentTarget.value
|
|
24154
|
+
})
|
|
24155
|
+
})
|
|
24156
|
+
})
|
|
24157
|
+
]
|
|
24158
|
+
})
|
|
24159
|
+
]
|
|
24160
|
+
}),
|
|
24161
|
+
/*#__PURE__*/ jsxs("section", {
|
|
24162
|
+
"aria-labelledby": `${formId}-error-alert`,
|
|
24163
|
+
children: [
|
|
24059
24164
|
/*#__PURE__*/ jsxs("div", {
|
|
24060
|
-
className: "work-spreadsheet-data-validation-
|
|
24165
|
+
className: "work-spreadsheet-data-validation-section-heading",
|
|
24061
24166
|
children: [
|
|
24062
|
-
/*#__PURE__*/ jsx(
|
|
24063
|
-
|
|
24064
|
-
|
|
24065
|
-
onCheckedChange: (prohibitInput)=>update({
|
|
24066
|
-
prohibitInput
|
|
24067
|
-
}),
|
|
24068
|
-
children: "输入无效数据时阻止提交"
|
|
24167
|
+
/*#__PURE__*/ jsx(TriangleAlert, {
|
|
24168
|
+
size: 16,
|
|
24169
|
+
"aria-hidden": "true"
|
|
24069
24170
|
}),
|
|
24070
|
-
/*#__PURE__*/ jsx(
|
|
24071
|
-
|
|
24072
|
-
|
|
24073
|
-
onCheckedChange: (hintShow)=>update({
|
|
24074
|
-
hintShow
|
|
24075
|
-
}),
|
|
24076
|
-
children: "选中单元格时显示输入信息"
|
|
24171
|
+
/*#__PURE__*/ jsx("h3", {
|
|
24172
|
+
id: `${formId}-error-alert`,
|
|
24173
|
+
children: "错误警告"
|
|
24077
24174
|
})
|
|
24078
24175
|
]
|
|
24079
24176
|
}),
|
|
24080
|
-
|
|
24081
|
-
|
|
24082
|
-
|
|
24083
|
-
|
|
24084
|
-
|
|
24085
|
-
|
|
24086
|
-
|
|
24087
|
-
|
|
24088
|
-
|
|
24177
|
+
/*#__PURE__*/ jsx(OfficeCheckbox, {
|
|
24178
|
+
ariaLabel: "输入无效数据时显示错误警告",
|
|
24179
|
+
checked: value.prohibitInput,
|
|
24180
|
+
onCheckedChange: (prohibitInput)=>update({
|
|
24181
|
+
prohibitInput
|
|
24182
|
+
}),
|
|
24183
|
+
children: "输入无效数据时显示错误警告"
|
|
24184
|
+
}),
|
|
24185
|
+
value.prohibitInput && /*#__PURE__*/ jsxs("div", {
|
|
24186
|
+
className: "work-spreadsheet-data-validation-message-grid",
|
|
24187
|
+
children: [
|
|
24188
|
+
/*#__PURE__*/ jsx(field_Field, {
|
|
24189
|
+
label: "错误警告样式",
|
|
24190
|
+
description: "三种样式会写入原生文件;当前浏览器网格统一阻止无效值。",
|
|
24191
|
+
children: /*#__PURE__*/ jsxs("select", {
|
|
24192
|
+
"aria-label": "错误警告样式",
|
|
24193
|
+
value: value.errorStyle,
|
|
24194
|
+
onChange: (event)=>update({
|
|
24195
|
+
errorStyle: event.currentTarget.value
|
|
24196
|
+
}),
|
|
24197
|
+
children: [
|
|
24198
|
+
/*#__PURE__*/ jsx("option", {
|
|
24199
|
+
value: "stop",
|
|
24200
|
+
children: "停止"
|
|
24201
|
+
}),
|
|
24202
|
+
/*#__PURE__*/ jsx("option", {
|
|
24203
|
+
value: "warning",
|
|
24204
|
+
children: "警告"
|
|
24205
|
+
}),
|
|
24206
|
+
/*#__PURE__*/ jsx("option", {
|
|
24207
|
+
value: "information",
|
|
24208
|
+
children: "信息"
|
|
24209
|
+
})
|
|
24210
|
+
]
|
|
24089
24211
|
})
|
|
24090
|
-
|
|
24212
|
+
}),
|
|
24213
|
+
/*#__PURE__*/ jsx(field_Field, {
|
|
24214
|
+
label: "错误警告标题",
|
|
24215
|
+
children: /*#__PURE__*/ jsx("input", {
|
|
24216
|
+
type: "text",
|
|
24217
|
+
"aria-label": "错误警告标题",
|
|
24218
|
+
maxLength: 32,
|
|
24219
|
+
value: value.errorTitle,
|
|
24220
|
+
onChange: (event)=>update({
|
|
24221
|
+
errorTitle: event.currentTarget.value
|
|
24222
|
+
})
|
|
24223
|
+
})
|
|
24224
|
+
}),
|
|
24225
|
+
/*#__PURE__*/ jsx(field_Field, {
|
|
24226
|
+
label: "错误警告消息",
|
|
24227
|
+
className: "message",
|
|
24228
|
+
description: "最多 225 个字符。",
|
|
24229
|
+
children: /*#__PURE__*/ jsx("textarea", {
|
|
24230
|
+
"aria-label": "错误警告消息",
|
|
24231
|
+
rows: 3,
|
|
24232
|
+
maxLength: 225,
|
|
24233
|
+
value: value.errorMessage,
|
|
24234
|
+
onChange: (event)=>update({
|
|
24235
|
+
errorMessage: event.currentTarget.value
|
|
24236
|
+
})
|
|
24237
|
+
})
|
|
24238
|
+
})
|
|
24239
|
+
]
|
|
24091
24240
|
})
|
|
24092
24241
|
]
|
|
24093
24242
|
}),
|
|
@@ -24152,7 +24301,7 @@ function spreadsheetDataValidationNeedsSecondValue(type2) {
|
|
|
24152
24301
|
return 'between' === type2 || 'notBetween' === type2;
|
|
24153
24302
|
}
|
|
24154
24303
|
function sameSpreadsheetDataValidationValue(left, right) {
|
|
24155
|
-
return left.type === right.type && left.type2 === right.type2 && left.value1 === right.value1 && left.value2 === right.value2 && left.prohibitInput === right.prohibitInput && left.hintShow === right.hintShow && left.hintValue === right.hintValue;
|
|
24304
|
+
return left.type === right.type && left.type2 === right.type2 && left.value1 === right.value1 && left.value2 === right.value2 && left.allowBlank === right.allowBlank && left.showDropdownArrow === right.showDropdownArrow && left.prohibitInput === right.prohibitInput && left.errorStyle === right.errorStyle && left.errorTitle === right.errorTitle && left.errorMessage === right.errorMessage && left.hintShow === right.hintShow && left.hintTitle === right.hintTitle && left.hintValue === right.hintValue;
|
|
24156
24305
|
}
|
|
24157
24306
|
function useSpreadsheetDataValidation({ commandsRef, contentRef, focusGrid, getGridFocusTarget, getLiveSelections, preview }) {
|
|
24158
24307
|
const [source, setSource] = useState(null);
|