@a3s-lab/office 0.28.0 → 0.30.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 (69) hide show
  1. package/README.md +126 -3
  2. package/dist/0~1403.js +1 -1
  3. package/dist/0~4980.js +1 -1
  4. package/dist/0~7048.js +1 -1
  5. package/dist/{0~7043.js → 0~7231.js} +400 -242
  6. package/dist/{0~5093.js → 0~7360.js} +293 -53
  7. package/dist/0~7614.js +1 -1
  8. package/dist/0~document-editor.js +1535 -102
  9. package/dist/0~presentation-editor.js +1 -1
  10. package/dist/0~spreadsheet-editor.js +184 -36
  11. package/dist/0~work-docx-export.js +437 -11
  12. package/dist/0~work-docx-import.js +32 -7
  13. package/dist/0~work-office-diagnostics.js +170 -7
  14. package/dist/0~work-pptx-export.js +1 -1
  15. package/dist/0~work-pptx-import.js +1 -1
  16. package/dist/0~work-presentation-charts.js +1 -1
  17. package/dist/1544.js +14 -2
  18. package/dist/4104.js +31 -8
  19. package/dist/4121.js +3448 -0
  20. package/dist/6282.js +558 -1688
  21. package/dist/8715.js +1 -1
  22. package/dist/core.js +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/internal/features/work/editors/document-command-catalog.d.ts +27 -0
  25. package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +8 -2
  26. package/dist/internal/features/work/editors/document-font-dialog-run-border-model.d.ts +24 -0
  27. package/dist/internal/features/work/editors/document-font-dialog-run-border-section.d.ts +10 -0
  28. package/dist/internal/features/work/editors/document-font-dialog-run-shading-model.d.ts +23 -0
  29. package/dist/internal/features/work/editors/document-font-dialog-run-shading-section.d.ts +8 -0
  30. package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
  31. package/dist/internal/features/work/editors/document-proofing-dialog-model.d.ts +22 -0
  32. package/dist/internal/features/work/editors/document-proofing-dialog.d.ts +7 -0
  33. package/dist/internal/features/work/editors/document-table-of-contents-dialog.d.ts +10 -0
  34. package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -1
  35. package/dist/internal/features/work/editors/spreadsheet-data-validation.d.ts +7 -1
  36. package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +2 -0
  37. package/dist/internal/features/work/work-document-character-formatting.d.ts +12 -0
  38. package/dist/internal/features/work/work-document-format-changes.d.ts +7 -0
  39. package/dist/internal/features/work/work-document-highlight.d.ts +9 -0
  40. package/dist/internal/features/work/work-document-outline.d.ts +1 -0
  41. package/dist/internal/features/work/work-document-paragraph-shading.d.ts +6 -0
  42. package/dist/internal/features/work/work-document-proofing.d.ts +19 -0
  43. package/dist/internal/features/work/work-document-run-border.d.ts +11 -0
  44. package/dist/internal/features/work/work-document-run-shading.d.ts +12 -0
  45. package/dist/internal/features/work/work-document-table-of-contents-node.d.ts +18 -0
  46. package/dist/internal/features/work/work-document-table-of-contents.d.ts +51 -0
  47. package/dist/internal/features/work/work-document-word-line-metrics.d.ts +4 -0
  48. package/dist/internal/features/work/work-docx-field-instructions.d.ts +1 -1
  49. package/dist/internal/features/work/work-docx-import.d.ts +3 -1
  50. package/dist/internal/features/work/work-docx-proofing-diagnostics.d.ts +3 -0
  51. package/dist/internal/features/work/work-docx-proofing.d.ts +38 -0
  52. package/dist/internal/features/work/work-docx-run-border-diagnostics.d.ts +3 -0
  53. package/dist/internal/features/work/work-docx-run-border-export.d.ts +17 -0
  54. package/dist/internal/features/work/work-docx-run-border.d.ts +20 -0
  55. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +9 -0
  56. package/dist/internal/features/work/work-docx-run-shading-diagnostics.d.ts +3 -0
  57. package/dist/internal/features/work/work-docx-run-shading-export.d.ts +17 -0
  58. package/dist/internal/features/work/work-docx-run-shading.d.ts +20 -0
  59. package/dist/internal/features/work/work-docx-table-of-contents-export.d.ts +11 -0
  60. package/dist/internal/features/work/work-docx-table-of-contents-import.d.ts +15 -0
  61. package/dist/internal/features/work/work-spreadsheet-data-validation.d.ts +7 -0
  62. package/dist/internal/features/work/work-types.d.ts +9 -0
  63. package/dist/internal/kernel/office-kernel-protocol.d.ts +1 -0
  64. package/dist/office-kernel.wasm +0 -0
  65. package/dist/styles.css +339 -1
  66. package/docs/latest/en/browser-editor-architecture.md +72 -1
  67. package/package.json +15 -2
  68. package/dist/5184.js +0 -662
  69. package/dist/9424.js +0 -16
@@ -11,7 +11,7 @@ import extension_underline from "@tiptap/extension-underline";
11
11
  import { EditorContent, useEditor } from "@tiptap/react";
12
12
  import starter_kit from "@tiptap/starter-kit";
13
13
  import { canUngroupPresentationElements, withPresentationDesign, withPresentationDesignMetadata, groupPresentationElements, expandPresentationGroupSelection, ungroupPresentationElements, presentationSlideViewFromDesign, canGroupPresentationElements, presentationSlideView, applyPresentationLayout, presentationSelectionUnits, remapPresentationGroupPaths } from "./0~1403.js";
14
- import { createOfficeId as createWorkId } from "./5184.js";
14
+ import { createOfficeId as createWorkId } from "./4121.js";
15
15
  import { OfficeTableInsertPopover, readOfficeFileAsDataUrl } from "./0~9445.js";
16
16
  import { normalizePresentationChartLegendPosition, presentationChartDataLabelPositions, presentationChartDataLabelText, normalizePresentationBubbleSizeRepresents, parsePresentationChartCategories, presentationChartXValues, withPresentationChartLayout, presentationChartTypeLabel, presentationChartAxes, withPresentationChartSeriesAnalysis, presentationChartUsesNumericXAxis, presentationChartSupportsSeriesMarkers, presentationChartBubbleSizes, createPresentationChartElement, parsePresentationChartValueDraft, normalizePresentationChartDataLabelPosition, presentationChartSupportsAxisTitles, withPresentationChartDataLabels, withPresentationChartType, createPresentationChartSeries, presentationChartErrorBarCount, normalizePresentationScatterStyle, withPresentationChartSeriesStyle, normalizePresentationBubbleScale, presentationChartDataLabelPositionLabel, presentationChartShowsLegend, presentationChartTrendlineCount, presentationChartHasDataLabels, normalizeDoughnutHoleSize, withPresentationChartAxes } from "./0~work-presentation-charts.js";
17
17
  import { spreadsheetChartSeriesLayout, workSpreadsheetChartSupportsGrouping, normalizeWorkSpreadsheetChartSmoothLines, workSpreadsheetChartAxisIsValueAxis, fitSpreadsheetTrendline, spreadsheetChartSeriesLegendColor, normalizeWorkSpreadsheetChartSeriesStyle, spreadsheetChartCategoryVisualIndex, errorBarSourceValues, normalizeWorkSpreadsheetErrorBars, workSpreadsheetChartSupportsTrendlines, normalizeWorkSpreadsheetChartLegendOverlay, normalizeWorkSpreadsheetChartGapWidth, spreadsheetChartCategoryLabelVisible, spreadsheetChartAxisLabelLayout, workSpreadsheetChartSupportsSmoothLines, workSpreadsheetChartGroupingIsStacked, normalizeWorkSpreadsheetChartGrouping, workSpreadsheetChartSupportsBarSpacing, workSpreadsheetChartSupportsErrorBars, spreadsheetChartSeriesLineStyle, workSpreadsheetChartAxisDefaultLabelPosition, workSpreadsheetChartSupportsSeriesAnalysis, workSpreadsheetChartAxisIsCategoryAxis, spreadsheetErrorBarAmounts, spreadsheetChartAxisValueRatio, spreadsheetChartAxisScale, normalizeWorkSpreadsheetChartOverlap, spreadsheetChartBarGeometry, workSpreadsheetChartAxisShowsMajorGridlinesByDefault, spreadsheetChartAxisGridlinesVisible, normalizeWorkSpreadsheetTrendline, roundChartNumber, formatSpreadsheetChartAxisNumber, spreadsheetChartSeriesFillStyle } from "./8715.js";
@@ -1,17 +1,16 @@
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
- import { normalizeCssColor } from "./9424.js";
10
+ import { isOfficeKernelSpreadsheetError, normalizeCssColor, OFFICE_KERNEL_SPREADSHEET_MAX_ROWS, createOfficeId as createWorkId } from "./4121.js";
11
11
  import { useOfficeTaskPaneEscape, OfficeCheckbox, CommittedOfficeNumberField, useOfficeDialog, useOfficeTaskPaneModal, createOfficeKernelClient, officeFontFamilies, CollectionState, OfficeNumberField, handleOfficeTaskPaneKeyDown } from "./0~7048.js";
12
12
  import { isOfficeShortcutBlocked, OfficeColorPicker } from "./0~3635.js";
13
13
  import { createOfficeEditorExtension, useOfficeEditorRuntime, useOfficeEditorKeyboardShortcuts } from "./0~3557.js";
14
- import { OFFICE_KERNEL_SPREADSHEET_MAX_ROWS, createOfficeId as createWorkId, isOfficeKernelSpreadsheetError } from "./5184.js";
15
14
  import { showToast } from "./6489.js";
16
15
  import { unsupportedSpreadsheetFormulaFunctions } from "./0~work-spreadsheet-formula-support.js";
17
16
  import { WorkspaceContextMenu, isWorkspaceContextMenuKeyboardEvent, WorkOfficeZoomControls, Tabs, WorkOfficeStatusBar, Dialog, WorkOfficeRibbon, workspaceContextMenuPosition, OfficeSelect, WorkOfficeRibbonGroup, WorkOfficeRibbonButton, WorkOfficePreviewBar } from "./0~4595.js";
@@ -6718,9 +6717,15 @@ function quoteSpreadsheetSheetName(name) {
6718
6717
  }
6719
6718
  const MAX_SPREADSHEET_DATA_VALIDATION_CELLS = 10000;
6720
6719
  const defaultSpreadsheetDataValidationValue = {
6720
+ allowBlank: true,
6721
+ errorMessage: '',
6722
+ errorStyle: 'stop',
6723
+ errorTitle: '',
6721
6724
  hintShow: false,
6725
+ hintTitle: '',
6722
6726
  hintValue: '',
6723
6727
  prohibitInput: true,
6728
+ showDropdownArrow: true,
6724
6729
  type: 'dropdown',
6725
6730
  type2: '',
6726
6731
  value1: '',
@@ -6846,9 +6851,15 @@ function normalizeSpreadsheetDataValidationItem(content, sheet, ranges, value) {
6846
6851
  value2: normalizedValues.value2,
6847
6852
  validity: '',
6848
6853
  remote: false,
6854
+ allowBlank: Boolean(value.allowBlank),
6855
+ showDropdownArrow: 'dropdown' === value.type ? Boolean(value.showDropdownArrow) : true,
6849
6856
  prohibitInput: Boolean(value.prohibitInput),
6857
+ errorStyle: normalizeSpreadsheetDataValidationErrorStyle(value.errorStyle),
6858
+ errorTitle: boundedSpreadsheetDataValidationText(value.errorTitle, 32),
6859
+ errorMessage: boundedSpreadsheetDataValidationText(value.errorMessage, 225),
6850
6860
  hintShow: Boolean(value.hintShow),
6851
- hintValue: value.hintShow ? value.hintValue.trim().slice(0, 255) : '',
6861
+ hintTitle: boundedSpreadsheetDataValidationText(value.hintTitle, 32),
6862
+ hintValue: boundedSpreadsheetDataValidationText(value.hintValue, 255),
6852
6863
  checked: false
6853
6864
  }
6854
6865
  };
@@ -6949,7 +6960,13 @@ function spreadsheetDataValidationDialogValue(value) {
6949
6960
  value1: 'date' === type ? normalizeSpreadsheetDateValidationBoundary(item.value1) ?? item.value1 : item.value1,
6950
6961
  value2: 'date' === type && item.value2 ? normalizeSpreadsheetDateValidationBoundary(item.value2) ?? item.value2 : item.value2,
6951
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 ?? '',
6952
6968
  hintShow: item.hintShow,
6969
+ hintTitle: item.hintTitle ?? '',
6953
6970
  hintValue: item.hintValue
6954
6971
  };
6955
6972
  }
@@ -6972,9 +6989,15 @@ function spreadsheetDataValidationItem(value) {
6972
6989
  value2: 'string' == typeof value.value2 ? value.value2 : String(value.value2 ?? ''),
6973
6990
  validity: 'string' == typeof value.validity ? value.validity : '',
6974
6991
  remote: Boolean(value.remote),
6992
+ allowBlank: 'boolean' == typeof value.allowBlank ? value.allowBlank : true,
6993
+ showDropdownArrow: 'boolean' == typeof value.showDropdownArrow ? value.showDropdownArrow : true,
6975
6994
  prohibitInput: Boolean(value.prohibitInput),
6995
+ errorStyle: normalizeSpreadsheetDataValidationErrorStyle(value.errorStyle),
6996
+ errorTitle: boundedSpreadsheetDataValidationText(value.errorTitle, 32),
6997
+ errorMessage: boundedSpreadsheetDataValidationText(value.errorMessage, 225),
6976
6998
  hintShow: Boolean(value.hintShow),
6977
- hintValue: 'string' == typeof value.hintValue ? value.hintValue : '',
6999
+ hintTitle: boundedSpreadsheetDataValidationText(value.hintTitle, 32),
7000
+ hintValue: boundedSpreadsheetDataValidationText(value.hintValue, 255),
6978
7001
  checked: Boolean(value.checked)
6979
7002
  };
6980
7003
  }
@@ -7107,8 +7130,14 @@ function spreadsheetDataValidationSignature(value) {
7107
7130
  type2: item.type2,
7108
7131
  value1: item.value1,
7109
7132
  value2: item.value2,
7133
+ allowBlank: item.allowBlank,
7134
+ showDropdownArrow: item.showDropdownArrow,
7110
7135
  prohibitInput: item.prohibitInput,
7136
+ errorStyle: item.errorStyle,
7137
+ errorTitle: item.errorTitle,
7138
+ errorMessage: item.errorMessage,
7111
7139
  hintShow: item.hintShow,
7140
+ hintTitle: item.hintTitle,
7112
7141
  hintValue: item.hintValue
7113
7142
  }) : 'invalid';
7114
7143
  }
@@ -24021,6 +24050,27 @@ function SpreadsheetDataValidationDialog({ source, restoreFocusTarget, onApply,
24021
24050
  })
24022
24051
  ]
24023
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
+ }),
24024
24074
  'dropdown' === value.type ? /*#__PURE__*/ jsx(field_Field, {
24025
24075
  label: "来源",
24026
24076
  required: true,
@@ -24028,6 +24078,7 @@ function SpreadsheetDataValidationDialog({ source, restoreFocusTarget, onApply,
24028
24078
  error: visibleError ?? void 0,
24029
24079
  children: /*#__PURE__*/ jsx("input", {
24030
24080
  type: "text",
24081
+ "aria-label": "来源",
24031
24082
  autoCapitalize: "none",
24032
24083
  spellCheck: false,
24033
24084
  value: value.value1,
@@ -24051,44 +24102,141 @@ function SpreadsheetDataValidationDialog({ source, restoreFocusTarget, onApply,
24051
24102
  ]
24052
24103
  }),
24053
24104
  /*#__PURE__*/ jsxs("section", {
24054
- "aria-labelledby": `${formId}-behavior`,
24105
+ "aria-labelledby": `${formId}-input-message`,
24055
24106
  children: [
24056
- /*#__PURE__*/ jsx("h3", {
24057
- id: `${formId}-behavior`,
24058
- 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
+ ]
24059
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: [
24060
24164
  /*#__PURE__*/ jsxs("div", {
24061
- className: "work-spreadsheet-data-validation-behavior",
24165
+ className: "work-spreadsheet-data-validation-section-heading",
24062
24166
  children: [
24063
- /*#__PURE__*/ jsx(OfficeCheckbox, {
24064
- ariaLabel: "输入无效数据时阻止提交",
24065
- checked: value.prohibitInput,
24066
- onCheckedChange: (prohibitInput)=>update({
24067
- prohibitInput
24068
- }),
24069
- children: "输入无效数据时阻止提交"
24167
+ /*#__PURE__*/ jsx(TriangleAlert, {
24168
+ size: 16,
24169
+ "aria-hidden": "true"
24070
24170
  }),
24071
- /*#__PURE__*/ jsx(OfficeCheckbox, {
24072
- ariaLabel: "选中单元格时显示输入信息",
24073
- checked: value.hintShow,
24074
- onCheckedChange: (hintShow)=>update({
24075
- hintShow
24076
- }),
24077
- children: "选中单元格时显示输入信息"
24171
+ /*#__PURE__*/ jsx("h3", {
24172
+ id: `${formId}-error-alert`,
24173
+ children: "错误警告"
24078
24174
  })
24079
24175
  ]
24080
24176
  }),
24081
- value.hintShow && /*#__PURE__*/ jsx(field_Field, {
24082
- label: "输入信息",
24083
- description: "最多 255 个字符,将在用户选中受验证单元格时显示。",
24084
- children: /*#__PURE__*/ jsx("textarea", {
24085
- rows: 3,
24086
- maxLength: 255,
24087
- value: value.hintValue,
24088
- onChange: (event)=>update({
24089
- hintValue: event.currentTarget.value
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
+ ]
24090
24211
  })
24091
- })
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
+ ]
24092
24240
  })
24093
24241
  ]
24094
24242
  }),
@@ -24153,7 +24301,7 @@ function spreadsheetDataValidationNeedsSecondValue(type2) {
24153
24301
  return 'between' === type2 || 'notBetween' === type2;
24154
24302
  }
24155
24303
  function sameSpreadsheetDataValidationValue(left, right) {
24156
- 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;
24157
24305
  }
24158
24306
  function useSpreadsheetDataValidation({ commandsRef, contentRef, focusGrid, getGridFocusTarget, getLiveSelections, preview }) {
24159
24307
  const [source, setSource] = useState(null);