@veltra/desktop 1.7.13 → 1.7.16

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 (89) hide show
  1. package/dist/components/batch-edit/batch-edit-form.js +9 -3
  2. package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
  3. package/dist/components/batch-edit/batch-edit-list.js +2 -1
  4. package/dist/components/batch-edit/batch-edit-list.js.map +1 -1
  5. package/dist/components/batch-edit/batch-edit.js +57 -30
  6. package/dist/components/batch-edit/batch-edit.js.map +1 -1
  7. package/dist/components/batch-edit/style.d.ts +1 -0
  8. package/dist/components/batch-edit/style.js +1 -0
  9. package/dist/components/batch-edit/style2.css +14 -0
  10. package/dist/components/batch-edit/use-dialog-effect.js +20 -0
  11. package/dist/components/batch-edit/use-dialog-effect.js.map +1 -0
  12. package/dist/components/batch-edit/use-edit-state.js +22 -3
  13. package/dist/components/batch-edit/use-edit-state.js.map +1 -1
  14. package/dist/components/batch-edit/use-handlers.js +5 -0
  15. package/dist/components/batch-edit/use-handlers.js.map +1 -1
  16. package/dist/components/batch-edit/use-shortcut-key.js +5 -2
  17. package/dist/components/batch-edit/use-shortcut-key.js.map +1 -1
  18. package/dist/components/button/button.js +2 -2
  19. package/dist/components/button/button.js.map +1 -1
  20. package/dist/components/file-viewer/file-viewer.js +21 -14
  21. package/dist/components/file-viewer/file-viewer.js.map +1 -1
  22. package/dist/components/file-viewer/helper.js +2 -0
  23. package/dist/components/file-viewer/helper.js.map +1 -1
  24. package/dist/components/file-viewer/previewers/ofd-previewer.js +196 -0
  25. package/dist/components/file-viewer/previewers/ofd-previewer.js.map +1 -0
  26. package/dist/components/file-viewer/style2.css +27 -0
  27. package/dist/components/form-item/style2.css +17 -2
  28. package/dist/components/table-editor/style2.css +48 -5
  29. package/dist/components/table-editor/table-editor.js +228 -63
  30. package/dist/components/table-editor/table-editor.js.map +1 -1
  31. package/dist/components/tip/style2.css +63 -0
  32. package/dist/components/tip/tip.js +6 -1
  33. package/dist/components/tip/tip.js.map +1 -1
  34. package/dist/index.d.ts +3 -3
  35. package/dist/packages/ofd-core/dist/color.js +69 -0
  36. package/dist/packages/ofd-core/dist/color.js.map +1 -0
  37. package/dist/packages/ofd-core/dist/ctm.js +55 -0
  38. package/dist/packages/ofd-core/dist/ctm.js.map +1 -0
  39. package/dist/packages/ofd-core/dist/error.js +14 -0
  40. package/dist/packages/ofd-core/dist/error.js.map +1 -0
  41. package/dist/packages/ofd-core/dist/font.js +384 -0
  42. package/dist/packages/ofd-core/dist/font.js.map +1 -0
  43. package/dist/packages/ofd-core/dist/index.js +6 -0
  44. package/dist/packages/ofd-core/dist/number.js +13 -0
  45. package/dist/packages/ofd-core/dist/number.js.map +1 -0
  46. package/dist/packages/ofd-core/dist/page-objects.js +181 -0
  47. package/dist/packages/ofd-core/dist/page-objects.js.map +1 -0
  48. package/dist/packages/ofd-core/dist/parse.js +65 -0
  49. package/dist/packages/ofd-core/dist/parse.js.map +1 -0
  50. package/dist/packages/ofd-core/dist/render.js +361 -0
  51. package/dist/packages/ofd-core/dist/render.js.map +1 -0
  52. package/dist/packages/ofd-core/dist/xml.js +199 -0
  53. package/dist/packages/ofd-core/dist/xml.js.map +1 -0
  54. package/dist/packages/ofd-core/dist/zip.js +93 -0
  55. package/dist/packages/ofd-core/dist/zip.js.map +1 -0
  56. package/dist/style.d.ts +1 -1
  57. package/dist/style.js +1 -1
  58. package/dist/types/batch-edit.d.ts +6 -0
  59. package/dist/types/file-viewer.d.ts +1 -1
  60. package/dist/types/index.d.ts +3 -3
  61. package/dist/types/table-editor.d.ts +28 -7
  62. package/dist/types/tip.d.ts +5 -1
  63. package/package.json +8 -7
  64. package/src/components/batch-edit/__test__/batch-edit.test.ts +191 -4
  65. package/src/components/batch-edit/batch-edit-form.vue +17 -3
  66. package/src/components/batch-edit/batch-edit-list.vue +2 -1
  67. package/src/components/batch-edit/batch-edit.vue +22 -4
  68. package/src/components/batch-edit/style.scss +20 -0
  69. package/src/components/batch-edit/style.ts +1 -0
  70. package/src/components/batch-edit/use-dialog-effect.ts +9 -3
  71. package/src/components/batch-edit/use-edit-state.ts +32 -4
  72. package/src/components/batch-edit/use-handlers.ts +10 -0
  73. package/src/components/batch-edit/use-shortcut-key.ts +6 -2
  74. package/src/components/button/button.vue +3 -2
  75. package/src/components/file-viewer/__test__/helper.test.ts +13 -0
  76. package/src/components/file-viewer/file-viewer.vue +23 -16
  77. package/src/components/file-viewer/helper.ts +2 -0
  78. package/src/components/file-viewer/previewers/ofd-previewer.vue +216 -0
  79. package/src/components/file-viewer/style.scss +33 -0
  80. package/src/components/form-item/style.scss +11 -1
  81. package/src/components/table-editor/__test__/table-editor.test.ts +479 -0
  82. package/src/components/table-editor/style.scss +57 -5
  83. package/src/components/table-editor/table-editor.vue +286 -38
  84. package/src/components/tip/style.scss +15 -0
  85. package/src/components/tip/tip.vue +1 -1
  86. package/src/types/batch-edit.ts +6 -0
  87. package/src/types/file-viewer.ts +1 -1
  88. package/src/types/table-editor.ts +29 -7
  89. package/src/types/tip.ts +6 -1
package/dist/index.d.ts CHANGED
@@ -102,7 +102,7 @@ import { ScrollEmits, ScrollExposed, ScrollPosition, ScrollProps, _ScrollExposed
102
102
  import { WatermarkEmits, WatermarkExposed, WatermarkProps, _WatermarkExposed } from "./types/watermark.js";
103
103
  import { ProgressEmits, ProgressExposed, ProgressProps, _ProgressExposed } from "./types/progress.js";
104
104
  import { ProgressNodesEmits, ProgressNodesExposed, ProgressNodesProps, _ProgressNodesExposed } from "./types/progress-nodes.js";
105
- import { TipAlign, TipDirection, TipEmits, TipExposed, TipProps, _TipExposed } from "./types/tip.js";
105
+ import { TipAlign, TipDirection, TipEmits, TipExposed, TipProps, TipType, _TipExposed } from "./types/tip.js";
106
106
  import { PopConfirmEmits, PopConfirmExposed, PopConfirmProps, _PopConfirmExposed } from "./types/pop-confirm.js";
107
107
  import { TabItem, TabsEmits, TabsExposed, TabsHorizontalEmits, TabsHorizontalExposed, TabsHorizontalProps, TabsProps, TabsVerticalEmits, TabsVerticalExposed, TabsVerticalProps, _TabsExposed, _TabsHorizontalExposed, _TabsVerticalExposed } from "./types/tabs.js";
108
108
  import { BarType, TextEditorEmits, TextEditorExposed, TextEditorProps, _TextEditorExposed } from "./types/text-editor.js";
@@ -136,7 +136,7 @@ import { MultiTreeSelectEmits, MultiTreeSelectExposed, MultiTreeSelectProps, _Mu
136
136
  import { CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, _CodeEditorExposed } from "./types/code-editor.js";
137
137
  import { TextEmits, TextExposed, TextProps, _TextExposed } from "./types/text.js";
138
138
  import { CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps } from "./types/checkbox-group.js";
139
- import { TableEditorEmits, TableEditorExposed, TableEditorProps, _TableEditorExposed } from "./types/table-editor.js";
139
+ import { TableEditorColumn, TableEditorEmits, TableEditorExposed, TableEditorProps, _TableEditorExposed } from "./types/table-editor.js";
140
140
  import { NavEmits, NavExposed, NavItem, NavProps, _NavExposed } from "./types/nav.js";
141
141
  import { DualNavEmits, DualNavExposed, DualNavProps, DualNavRailVariant, DualNavRootItem, _DualNavExposed } from "./types/dual-nav.js";
142
142
  import { GroupNavEmits, GroupNavGroup, GroupNavProps } from "./types/group-nav.js";
@@ -185,4 +185,4 @@ import { defineBatchEditColumns } from "./components/batch-edit/helper.js";
185
185
  import { defineTableColumns } from "./components/table/use-columns.js";
186
186
  import "./components/index.js";
187
187
  export * from "@veltra/utils";
188
- export { type ActionEmits, type ActionExposed, type ActionGroupExposed, type ActionGroupProps, type ActionProps, type AnimationEmits, type AnimationExposed, type AnimationProps, type AutoCompleteEmits, type AutoCompleteExposed, type AutoCompleteProps, type BadgeEmits, type BadgeExposed, type BadgeProps, type BarType, type BatchEditColumn, type BatchEditEmits, type BatchEditExposed, type BatchEditFeature, type BatchEditFormStatus, type BatchEditProps, type BatchEditSlots, type BatchEditStates, type BreadcrumbEmits, type BreadcrumbExposed, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSlotScope, type BreakCols, type Breakpoint, type ButtonEmits, type ButtonExposed, type ButtonProps, type ButtonType, type CalendarDay, type CalendarEmits, type CalendarExposed, type CalendarMonth, type CalendarProps, type CalendarYear, type CardActionProps, type CardContentProps, type CardCoverProps, type CardEmits, type CardExposed, type CardProps, type CascadeEmits, type CascadeExposed, type CascadeNode, type CascadeProps, type CheckTagEmits, type CheckTagExposed, type CheckTagProps, type CheckboxButtonEmits, type CheckboxButtonProps, type CheckboxEmits, type CheckboxExposed, type CheckboxGroupEmits, type CheckboxGroupExposed, type CheckboxGroupProps, type CheckboxProps, type CodeEditorEmits, type CodeEditorExposed, type CodeEditorLang, type CodeEditorProps, type CollapseEmits, type CollapseItemEmits, type CollapseItemProps, type CollapseModelValue, type CollapseProps, type CollapseValue, type ConditionConnector, type ConditionEditorEmits, type ConditionEditorExposed, type ConditionEditorProps, type EvaluateOptions as ConditionEvaluateOptions, type ConditionExpression, type ConditionField, type ConditionGroup, type ConditionLeaf, type ConditionNode, type ConditionValue, type ContextmenuEmits, type ContextmenuExposed, type ContextmenuItem, ContextmenuPanelDIKey, type ContextmenuProps, ContextmenuRootDIKey, type CssTransitionEmits, type CssTransitionExposed, type CssTransitionProps, type DatePanelEmits, type DatePanelProps, type DatePickerDataType, type DatePickerEmits, type DatePickerExposed, type DatePickerProps, type DateRangePickerDataType, type DateRangePickerEmits, type DateRangePickerExposed, type DateRangePickerProps, type DateRangeValue, type DialogEmits, type DialogExposed, type DialogProps, type DialogTransition, type DrawerDirection, type DrawerEmits, type DrawerExposed, type DrawerMode, type DrawerProps, type DropdownEmits, type DropdownExposed, type DropdownProps, type DualNavEmits, type DualNavExposed, type DualNavProps, type DualNavRailVariant, type DualNavRootItem, type EmptyEmits, type EmptyExposed, type EmptyProps, type ExpressionEditorEmits, type ExpressionEditorExposed, type ExpressionEditorProps, type ExpressionSelectableLevels, type FileViewerEmits, type FileViewerExposed, type FileViewerItem, type FileViewerKind, type FileViewerProps, type FloatButtonEmits, type FloatButtonExposed, type FloatButtonItem, type FloatButtonProps, type FormEmits, type FormExposed, type FormItemEmits, type FormItemExposed, type FormItemProps, type FormProps, type GanttChartEmits, type GanttChartExposed, type GanttChartProps, type GridEmits, type GridExposed, type GridInputEmits, type GridInputExposed, type GridInputProps, type GridItemProps, type GridProps, type GroupInputEmits, type GroupInputExposed, type GroupInputProps, type GroupNavEmits, type GroupNavGroup, type GroupNavProps, type IconEmits, type IconExposed, type IconProps, type ImageCropperChangePayload, type ImageCropperCropTransform, type ImageCropperEmits, type ImageCropperExposed, type ImageCropperProps, type ImageCropperResult, type ImageCropperResultOptions, type ImageCropperSelection, type InputEmits, type InputExposed, type InputProps, type LayoutEmits, type LayoutExposed, type LayoutProps, type ListEmits, type ListExposed, type ListProps, type LoadingEmits, type LoadingExposed, type LoadingProps, type LoadingType, type Message, type MessageConfirm, type MessageConfirmAction, type MessageConfirmEmits, type MessageConfirmExposed, type MessageConfirmInstance, type MessageConfirmOptions, type MessageConfirmProps, type MessageEmits, type MessageExposed, type MessageInstance, type MessageOptions, type MessageProps, type MessageType, type MultiAutoCompleteEmits, type MultiAutoCompleteExposed, type MultiAutoCompleteProps, type MultiSelectEmits, type MultiSelectExposed, type MultiSelectProps, type MultiTreeSelectEmits, type MultiTreeSelectExposed, type MultiTreeSelectProps, type NavEmits, type NavExposed, type NavItem, type NavProps, type NodeRenderExposed, type NodeRenderProps, type Notification, type NotificationEmits, type NotificationExposed, type NotificationInstance, type NotificationOptions, type NotificationPosition, type NotificationProps, type NumberEmits, type NumberExposed, type NumberInputEmits, type NumberInputExposed, type NumberInputProps, type NumberProps, type NumberRangeInputEmits, type NumberRangeInputExposed, type NumberRangeInputProps, type NumberRangeTuple, type PaginatorEmits, type PaginatorExposed, type PaginatorProps, type PaletteColorType, type PaletteEmits, type PaletteExposed, type PaletteHSV, type PaletteProps, type PaletteRGB, type PanelItem, type PanelType, type PasswordInputEmits, type PasswordInputExposed, type PasswordInputProps, type PopConfirmEmits, type PopConfirmExposed, type PopConfirmProps, type PopEmits, type PopExposed, type PopProps, type ProgressEmits, type ProgressExposed, type ProgressNodesEmits, type ProgressNodesExposed, type ProgressNodesProps, type ProgressProps, type QuickBatchEditEmits, type QuickBatchEditExposed, type QuickBatchEditProps, type RadioEmits, type RadioExposed, type RadioGroupEmits, type RadioGroupExposed, type RadioGroupProps, type RadioProps, type RichTextEditorEmits, type RichTextEditorExposed, type RichTextEditorProps, type RichTextFormat, type ScrollEmits, type ScrollExposed, type ScrollPosition, type ScrollProps, type SegmentEmits, type SegmentExposed, type SegmentItem, type SegmentProps, type SelectEmits, type SelectExposed, type SelectProps, type SliderEmits, type SliderExposed, type SliderProps, type StepsEmits, type StepsExposed, type StepsProps, type StepsSlotScope, type SwitchEmits, type SwitchExposed, type SwitchProps, type TabItem, type TableColumn, type TableColumnAlign, type TableColumnNode, type TableColumnRenderContext, type TableColumnSlotsScope, type TableColumnStyle, type TableEditorEmits, type TableEditorExposed, type TableEditorProps, type TableEmits, type TableExposed, type TableProps, type TableRow, type TableRowSlotsScope, type TableSummaryContext, type TabsEmits, type TabsExposed, type TabsHorizontalEmits, type TabsHorizontalExposed, type TabsHorizontalProps, type TabsProps, type TabsVerticalEmits, type TabsVerticalExposed, type TabsVerticalProps, type TagEmits, type TagExposed, type TagProps, type TextEditorEmits, type TextEditorExposed, type TextEditorProps, type TextEmits, type TextExposed, type TextProps, type TextareaEmits, type TextareaExposed, type TextareaProps, type ThemeExposed, type ThemeProps, type TipAlign, type TipDirection, type TipEmits, type TipExposed, type TipProps, type ToolbarItem, type TreeEmit, type TreeExposed, type TreeNode, type TreeNodeProps, type TreeProps, type TreeSelectEmits, type TreeSelectExposed, type TreeSelectProps, _sfc_main as UAction, action_group_default as UActionGroup, _sfc_main$1 as UAutoComplete, _sfc_main$2 as UBadge, _sfc_main$3 as UBatchEdit, _sfc_main$4 as UBreadcrumb, _sfc_main$5 as UButton, _sfc_main$6 as UButtonGroup, _sfc_main$7 as UCalendar, _sfc_main$8 as UCard, _sfc_main$9 as UCardAction, _sfc_main$10 as UCardContent, _sfc_main$11 as UCardCover, _sfc_main$12 as UCardHeader, _sfc_main$13 as UCascade, _sfc_main$14 as UCheckTag, _sfc_main$15 as UCheckbox, _sfc_main$16 as UCheckboxButton, _sfc_main$17 as UCheckboxGroup, _sfc_main$18 as UCodeEditor, _sfc_main$19 as UCollapse, _sfc_main$20 as UCollapseItem, _sfc_main$21 as UConditionEditor, _sfc_main$22 as UContextmenu, _sfc_main$23 as UDatePanel, _sfc_main$24 as UDatePicker, _sfc_main$25 as UDateRangePicker, _sfc_main$26 as UDialog, _sfc_main$27 as UDrawer, _sfc_main$28 as UDropdown, _sfc_main$29 as UDualNav, _sfc_main$30 as UEmpty, _sfc_main$31 as UExpressionEditor, _sfc_main$32 as UFilePicker, _sfc_main$33 as UFileViewer, _sfc_main$34 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$35 as UGanttChart, _sfc_main$36 as UGrid, _sfc_main$37 as UGridInput, _sfc_main$38 as UGridItem, _sfc_main$39 as UGroupInput, _sfc_main$40 as UGroupNav, _sfc_main$41 as UIcon, _sfc_main$42 as UImageCropper, input_default as UInput, _sfc_main$43 as UKbd, _sfc_main$44 as ULayout, _sfc_main$45 as UList, _sfc_main$46 as UListItem, _sfc_main$47 as ULoading, _sfc_main$48 as UMessage, _sfc_main$49 as UMessageConfirm, _sfc_main$50 as UMultiSelect, _sfc_main$51 as UMultiTreeSelect, _sfc_main$52 as UNav, _sfc_main$53 as UNavItem, _sfc_main$54 as UNavSub, NodeRender as UNodeRender, _sfc_main$55 as UNotification, _sfc_main$56 as UNumber, _sfc_main$57 as UNumberInput, _sfc_main$58 as UNumberRangeInput, _sfc_main$59 as UPaginator, _sfc_main$60 as UPalette, _sfc_main$61 as UPasswordInput, _sfc_main$62 as UPopConfirm, _sfc_main$63 as UProgress, _sfc_main$64 as UProgressNodes, _sfc_main$65 as URadio, _sfc_main$66 as URadioGroup, _sfc_main$67 as URichTextEditor, _sfc_main$68 as UScroll, _sfc_main$69 as USegment, _sfc_main$70 as USelect, _sfc_main$71 as USlider, _sfc_main$72 as USteps, _sfc_main$73 as USwitch, _sfc_main$74 as UTable, _sfc_main$75 as UTableEditor, _sfc_main$76 as UTabs, _sfc_main$77 as UTabsHorizontal, _sfc_main$78 as UTabsVertical, _sfc_main$79 as UTag, _sfc_main$80 as UText, _sfc_main$81 as UTextarea, _sfc_main$82 as UTheme, _sfc_main$83 as UTip, _sfc_main$84 as UTree, _sfc_main$85 as UTreeSelect, _sfc_main$86 as UWatermark, type UploaderEmits, type UploaderExposed, type UploaderProps, type VariableItem, type WatermarkEmits, type WatermarkExposed, type WatermarkProps, type _ActionExposed, type _ActionGroupExposed, type _AnimationExposed, type _AutoCompleteExposed, type _BadgeExposed, type _BatchEditExposed, type _BreadcrumbExposed, type _ButtonExposed, type _CalendarExposed, type _CardExposed, type _CascadeExposed, type _CheckTagExposed, type _CodeEditorExposed, type _ConditionEditorExposed, type _ContextmenuExposed, type _CssTransitionExposed, type _DatePickerExposed, type _DateRangePickerExposed, type _DialogExposed, type _DrawerExposed, type _DropdownExposed, type _DualNavExposed, type _EmptyExposed, type _ExpressionEditorExposed, type _FileViewerExposed, type _FloatButtonExposed, type _FormExposed, type _GanttChartExposed, type _GridExposed, type _GridInputExposed, type _GroupInputExposed, type _ImageCropperExposed, type _InputExposed, type _LayoutExposed, type _ListExposed, type _LoadingExposed, type _MessageConfirmExposed, type _MessageExposed, type _MultiAutoCompleteExposed, type _MultiSelectExposed, type _MultiTreeSelectExposed, type _NavExposed, type _NotificationExposed, type _PaginatorExposed, type _PaletteExposed, type _PasswordInputExposed, type _PopConfirmExposed, type _PopExposed, type _ProgressExposed, type _ProgressNodesExposed, type _QuickBatchEditExposed, type _RadioExposed, type _RadioGroupExposed, type _RichTextEditorExposed, type _ScrollExposed, type _SegmentExposed, type _SelectExposed, type _SliderExposed, type _StepsExposed, type _SwitchExposed, type _TableEditorExposed, type _TableExposed, type _TabsExposed, type _TabsHorizontalExposed, type _TabsVerticalExposed, type _TextEditorExposed, type _TextExposed, type _TextareaExposed, type _ThemeExposed, type _TipExposed, type _TreeExposed, type _TreeSelectExposed, type _UploaderExposed, type _WatermarkExposed, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, messageConfirm, notification, vLoading };
188
+ export { type ActionEmits, type ActionExposed, type ActionGroupExposed, type ActionGroupProps, type ActionProps, type AnimationEmits, type AnimationExposed, type AnimationProps, type AutoCompleteEmits, type AutoCompleteExposed, type AutoCompleteProps, type BadgeEmits, type BadgeExposed, type BadgeProps, type BarType, type BatchEditColumn, type BatchEditEmits, type BatchEditExposed, type BatchEditFeature, type BatchEditFormStatus, type BatchEditProps, type BatchEditSlots, type BatchEditStates, type BreadcrumbEmits, type BreadcrumbExposed, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSlotScope, type BreakCols, type Breakpoint, type ButtonEmits, type ButtonExposed, type ButtonProps, type ButtonType, type CalendarDay, type CalendarEmits, type CalendarExposed, type CalendarMonth, type CalendarProps, type CalendarYear, type CardActionProps, type CardContentProps, type CardCoverProps, type CardEmits, type CardExposed, type CardProps, type CascadeEmits, type CascadeExposed, type CascadeNode, type CascadeProps, type CheckTagEmits, type CheckTagExposed, type CheckTagProps, type CheckboxButtonEmits, type CheckboxButtonProps, type CheckboxEmits, type CheckboxExposed, type CheckboxGroupEmits, type CheckboxGroupExposed, type CheckboxGroupProps, type CheckboxProps, type CodeEditorEmits, type CodeEditorExposed, type CodeEditorLang, type CodeEditorProps, type CollapseEmits, type CollapseItemEmits, type CollapseItemProps, type CollapseModelValue, type CollapseProps, type CollapseValue, type ConditionConnector, type ConditionEditorEmits, type ConditionEditorExposed, type ConditionEditorProps, type EvaluateOptions as ConditionEvaluateOptions, type ConditionExpression, type ConditionField, type ConditionGroup, type ConditionLeaf, type ConditionNode, type ConditionValue, type ContextmenuEmits, type ContextmenuExposed, type ContextmenuItem, ContextmenuPanelDIKey, type ContextmenuProps, ContextmenuRootDIKey, type CssTransitionEmits, type CssTransitionExposed, type CssTransitionProps, type DatePanelEmits, type DatePanelProps, type DatePickerDataType, type DatePickerEmits, type DatePickerExposed, type DatePickerProps, type DateRangePickerDataType, type DateRangePickerEmits, type DateRangePickerExposed, type DateRangePickerProps, type DateRangeValue, type DialogEmits, type DialogExposed, type DialogProps, type DialogTransition, type DrawerDirection, type DrawerEmits, type DrawerExposed, type DrawerMode, type DrawerProps, type DropdownEmits, type DropdownExposed, type DropdownProps, type DualNavEmits, type DualNavExposed, type DualNavProps, type DualNavRailVariant, type DualNavRootItem, type EmptyEmits, type EmptyExposed, type EmptyProps, type ExpressionEditorEmits, type ExpressionEditorExposed, type ExpressionEditorProps, type ExpressionSelectableLevels, type FileViewerEmits, type FileViewerExposed, type FileViewerItem, type FileViewerKind, type FileViewerProps, type FloatButtonEmits, type FloatButtonExposed, type FloatButtonItem, type FloatButtonProps, type FormEmits, type FormExposed, type FormItemEmits, type FormItemExposed, type FormItemProps, type FormProps, type GanttChartEmits, type GanttChartExposed, type GanttChartProps, type GridEmits, type GridExposed, type GridInputEmits, type GridInputExposed, type GridInputProps, type GridItemProps, type GridProps, type GroupInputEmits, type GroupInputExposed, type GroupInputProps, type GroupNavEmits, type GroupNavGroup, type GroupNavProps, type IconEmits, type IconExposed, type IconProps, type ImageCropperChangePayload, type ImageCropperCropTransform, type ImageCropperEmits, type ImageCropperExposed, type ImageCropperProps, type ImageCropperResult, type ImageCropperResultOptions, type ImageCropperSelection, type InputEmits, type InputExposed, type InputProps, type LayoutEmits, type LayoutExposed, type LayoutProps, type ListEmits, type ListExposed, type ListProps, type LoadingEmits, type LoadingExposed, type LoadingProps, type LoadingType, type Message, type MessageConfirm, type MessageConfirmAction, type MessageConfirmEmits, type MessageConfirmExposed, type MessageConfirmInstance, type MessageConfirmOptions, type MessageConfirmProps, type MessageEmits, type MessageExposed, type MessageInstance, type MessageOptions, type MessageProps, type MessageType, type MultiAutoCompleteEmits, type MultiAutoCompleteExposed, type MultiAutoCompleteProps, type MultiSelectEmits, type MultiSelectExposed, type MultiSelectProps, type MultiTreeSelectEmits, type MultiTreeSelectExposed, type MultiTreeSelectProps, type NavEmits, type NavExposed, type NavItem, type NavProps, type NodeRenderExposed, type NodeRenderProps, type Notification, type NotificationEmits, type NotificationExposed, type NotificationInstance, type NotificationOptions, type NotificationPosition, type NotificationProps, type NumberEmits, type NumberExposed, type NumberInputEmits, type NumberInputExposed, type NumberInputProps, type NumberProps, type NumberRangeInputEmits, type NumberRangeInputExposed, type NumberRangeInputProps, type NumberRangeTuple, type PaginatorEmits, type PaginatorExposed, type PaginatorProps, type PaletteColorType, type PaletteEmits, type PaletteExposed, type PaletteHSV, type PaletteProps, type PaletteRGB, type PanelItem, type PanelType, type PasswordInputEmits, type PasswordInputExposed, type PasswordInputProps, type PopConfirmEmits, type PopConfirmExposed, type PopConfirmProps, type PopEmits, type PopExposed, type PopProps, type ProgressEmits, type ProgressExposed, type ProgressNodesEmits, type ProgressNodesExposed, type ProgressNodesProps, type ProgressProps, type QuickBatchEditEmits, type QuickBatchEditExposed, type QuickBatchEditProps, type RadioEmits, type RadioExposed, type RadioGroupEmits, type RadioGroupExposed, type RadioGroupProps, type RadioProps, type RichTextEditorEmits, type RichTextEditorExposed, type RichTextEditorProps, type RichTextFormat, type ScrollEmits, type ScrollExposed, type ScrollPosition, type ScrollProps, type SegmentEmits, type SegmentExposed, type SegmentItem, type SegmentProps, type SelectEmits, type SelectExposed, type SelectProps, type SliderEmits, type SliderExposed, type SliderProps, type StepsEmits, type StepsExposed, type StepsProps, type StepsSlotScope, type SwitchEmits, type SwitchExposed, type SwitchProps, type TabItem, type TableColumn, type TableColumnAlign, type TableColumnNode, type TableColumnRenderContext, type TableColumnSlotsScope, type TableColumnStyle, type TableEditorColumn, type TableEditorEmits, type TableEditorExposed, type TableEditorProps, type TableEmits, type TableExposed, type TableProps, type TableRow, type TableRowSlotsScope, type TableSummaryContext, type TabsEmits, type TabsExposed, type TabsHorizontalEmits, type TabsHorizontalExposed, type TabsHorizontalProps, type TabsProps, type TabsVerticalEmits, type TabsVerticalExposed, type TabsVerticalProps, type TagEmits, type TagExposed, type TagProps, type TextEditorEmits, type TextEditorExposed, type TextEditorProps, type TextEmits, type TextExposed, type TextProps, type TextareaEmits, type TextareaExposed, type TextareaProps, type ThemeExposed, type ThemeProps, type TipAlign, type TipDirection, type TipEmits, type TipExposed, type TipProps, type TipType, type ToolbarItem, type TreeEmit, type TreeExposed, type TreeNode, type TreeNodeProps, type TreeProps, type TreeSelectEmits, type TreeSelectExposed, type TreeSelectProps, _sfc_main as UAction, action_group_default as UActionGroup, _sfc_main$1 as UAutoComplete, _sfc_main$2 as UBadge, _sfc_main$3 as UBatchEdit, _sfc_main$4 as UBreadcrumb, _sfc_main$5 as UButton, _sfc_main$6 as UButtonGroup, _sfc_main$7 as UCalendar, _sfc_main$8 as UCard, _sfc_main$9 as UCardAction, _sfc_main$10 as UCardContent, _sfc_main$11 as UCardCover, _sfc_main$12 as UCardHeader, _sfc_main$13 as UCascade, _sfc_main$14 as UCheckTag, _sfc_main$15 as UCheckbox, _sfc_main$16 as UCheckboxButton, _sfc_main$17 as UCheckboxGroup, _sfc_main$18 as UCodeEditor, _sfc_main$19 as UCollapse, _sfc_main$20 as UCollapseItem, _sfc_main$21 as UConditionEditor, _sfc_main$22 as UContextmenu, _sfc_main$23 as UDatePanel, _sfc_main$24 as UDatePicker, _sfc_main$25 as UDateRangePicker, _sfc_main$26 as UDialog, _sfc_main$27 as UDrawer, _sfc_main$28 as UDropdown, _sfc_main$29 as UDualNav, _sfc_main$30 as UEmpty, _sfc_main$31 as UExpressionEditor, _sfc_main$32 as UFilePicker, _sfc_main$33 as UFileViewer, _sfc_main$34 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$35 as UGanttChart, _sfc_main$36 as UGrid, _sfc_main$37 as UGridInput, _sfc_main$38 as UGridItem, _sfc_main$39 as UGroupInput, _sfc_main$40 as UGroupNav, _sfc_main$41 as UIcon, _sfc_main$42 as UImageCropper, input_default as UInput, _sfc_main$43 as UKbd, _sfc_main$44 as ULayout, _sfc_main$45 as UList, _sfc_main$46 as UListItem, _sfc_main$47 as ULoading, _sfc_main$48 as UMessage, _sfc_main$49 as UMessageConfirm, _sfc_main$50 as UMultiSelect, _sfc_main$51 as UMultiTreeSelect, _sfc_main$52 as UNav, _sfc_main$53 as UNavItem, _sfc_main$54 as UNavSub, NodeRender as UNodeRender, _sfc_main$55 as UNotification, _sfc_main$56 as UNumber, _sfc_main$57 as UNumberInput, _sfc_main$58 as UNumberRangeInput, _sfc_main$59 as UPaginator, _sfc_main$60 as UPalette, _sfc_main$61 as UPasswordInput, _sfc_main$62 as UPopConfirm, _sfc_main$63 as UProgress, _sfc_main$64 as UProgressNodes, _sfc_main$65 as URadio, _sfc_main$66 as URadioGroup, _sfc_main$67 as URichTextEditor, _sfc_main$68 as UScroll, _sfc_main$69 as USegment, _sfc_main$70 as USelect, _sfc_main$71 as USlider, _sfc_main$72 as USteps, _sfc_main$73 as USwitch, _sfc_main$74 as UTable, _sfc_main$75 as UTableEditor, _sfc_main$76 as UTabs, _sfc_main$77 as UTabsHorizontal, _sfc_main$78 as UTabsVertical, _sfc_main$79 as UTag, _sfc_main$80 as UText, _sfc_main$81 as UTextarea, _sfc_main$82 as UTheme, _sfc_main$83 as UTip, _sfc_main$84 as UTree, _sfc_main$85 as UTreeSelect, _sfc_main$86 as UWatermark, type UploaderEmits, type UploaderExposed, type UploaderProps, type VariableItem, type WatermarkEmits, type WatermarkExposed, type WatermarkProps, type _ActionExposed, type _ActionGroupExposed, type _AnimationExposed, type _AutoCompleteExposed, type _BadgeExposed, type _BatchEditExposed, type _BreadcrumbExposed, type _ButtonExposed, type _CalendarExposed, type _CardExposed, type _CascadeExposed, type _CheckTagExposed, type _CodeEditorExposed, type _ConditionEditorExposed, type _ContextmenuExposed, type _CssTransitionExposed, type _DatePickerExposed, type _DateRangePickerExposed, type _DialogExposed, type _DrawerExposed, type _DropdownExposed, type _DualNavExposed, type _EmptyExposed, type _ExpressionEditorExposed, type _FileViewerExposed, type _FloatButtonExposed, type _FormExposed, type _GanttChartExposed, type _GridExposed, type _GridInputExposed, type _GroupInputExposed, type _ImageCropperExposed, type _InputExposed, type _LayoutExposed, type _ListExposed, type _LoadingExposed, type _MessageConfirmExposed, type _MessageExposed, type _MultiAutoCompleteExposed, type _MultiSelectExposed, type _MultiTreeSelectExposed, type _NavExposed, type _NotificationExposed, type _PaginatorExposed, type _PaletteExposed, type _PasswordInputExposed, type _PopConfirmExposed, type _PopExposed, type _ProgressExposed, type _ProgressNodesExposed, type _QuickBatchEditExposed, type _RadioExposed, type _RadioGroupExposed, type _RichTextEditorExposed, type _ScrollExposed, type _SegmentExposed, type _SelectExposed, type _SliderExposed, type _StepsExposed, type _SwitchExposed, type _TableEditorExposed, type _TableExposed, type _TabsExposed, type _TabsHorizontalExposed, type _TabsVerticalExposed, type _TextEditorExposed, type _TextExposed, type _TextareaExposed, type _ThemeExposed, type _TipExposed, type _TreeExposed, type _TreeSelectExposed, type _UploaderExposed, type _WatermarkExposed, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, messageConfirm, notification, vLoading };
@@ -0,0 +1,69 @@
1
+ import { parseNumberList } from "./ctm.js";
2
+ //#region ../ofd-core/dist/color.js
3
+ /**
4
+ * OFD 颜色解析(GB/T 33190 颜色描述)转 CSS 颜色。
5
+ *
6
+ * 支持的声明形式:
7
+ * - `#RRGGBB`:CSS 十六进制,原样返回
8
+ * - 灰度:`g 128` / `gray 128` / 单个数值 `128`
9
+ * - RGB:`rgb 255 0 0` / `255 0 0` / 逗号分隔 `255,0,0`
10
+ * - CMYK:`cmyk 0 255 255 0` / `0 255 255 0`,转 RGB 输出
11
+ * - 末尾可带一个透明度通道(0-255),有则输出 `rgba()`
12
+ */
13
+ /** 解析 OFD 颜色声明为 CSS 颜色;无法识别返回 null,由调用方决定默认值 */
14
+ function parseOfdColor(value) {
15
+ const text = value?.trim();
16
+ if (!text) return null;
17
+ if (text.startsWith("#")) return text;
18
+ const tokens = text.toLowerCase().split(/[\s,]+/).filter((token) => token !== "");
19
+ if (tokens.length === 0) return null;
20
+ const named = CHANNEL_COUNT_BY_NAME[tokens[0]];
21
+ if (named !== void 0) return toCssColor(tokens.slice(1), named);
22
+ const channelCount = UNNAMED_CHANNEL_COUNT[tokens.length];
23
+ return channelCount === void 0 ? null : toCssColor(tokens, channelCount);
24
+ }
25
+ const CHANNEL_COUNT_BY_NAME = {
26
+ g: 1,
27
+ gray: 1,
28
+ rgb: 3,
29
+ cmyk: 4
30
+ };
31
+ /** 无前缀时按数值个数推断通道数;末位可能是透明度通道 */
32
+ const UNNAMED_CHANNEL_COUNT = {
33
+ 1: 1,
34
+ 2: 1,
35
+ 3: 3,
36
+ 4: 4,
37
+ 5: 4
38
+ };
39
+ /** 按通道数把 0-255 通道值列表转成 CSS 颜色;末位之后的透明度通道可选 */
40
+ function toCssColor(tokens, channels) {
41
+ const values = parseNumberList(tokens.join(" "));
42
+ if (values.length < channels || values.length > channels + 1) return null;
43
+ const clamped = values.map((value) => Math.round(Math.min(255, Math.max(0, value))));
44
+ const alpha = values.length === channels + 1 ? clamped[channels] / 255 : null;
45
+ const [r, g, b] = channels === 1 ? [
46
+ clamped[0],
47
+ clamped[0],
48
+ clamped[0]
49
+ ] : toRgb(clamped, channels);
50
+ return alpha === null ? `rgb(${r} ${g} ${b})` : `rgba(${r} ${g} ${b} / ${+alpha.toFixed(3)})`;
51
+ }
52
+ /** CMYK 转 RGB:r = 255·(1−c)·(1−k);channels 为 3 时直取 RGB */
53
+ function toRgb(clamped, channels) {
54
+ if (channels === 3) return [
55
+ clamped[0],
56
+ clamped[1],
57
+ clamped[2]
58
+ ];
59
+ const [c, m, y, k] = clamped;
60
+ return [
61
+ Math.round(255 * (1 - c / 255) * (1 - k / 255)),
62
+ Math.round(255 * (1 - m / 255) * (1 - k / 255)),
63
+ Math.round(255 * (1 - y / 255) * (1 - k / 255))
64
+ ];
65
+ }
66
+ //#endregion
67
+ export { parseOfdColor };
68
+
69
+ //# sourceMappingURL=color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.js","names":[],"sources":["../../../../../ofd-core/dist/color.js"],"sourcesContent":["import { parseNumberList } from \"./ctm.js\";\n//#region src/color.ts\n/**\n* OFD 颜色解析(GB/T 33190 颜色描述)转 CSS 颜色。\n*\n* 支持的声明形式:\n* - `#RRGGBB`:CSS 十六进制,原样返回\n* - 灰度:`g 128` / `gray 128` / 单个数值 `128`\n* - RGB:`rgb 255 0 0` / `255 0 0` / 逗号分隔 `255,0,0`\n* - CMYK:`cmyk 0 255 255 0` / `0 255 255 0`,转 RGB 输出\n* - 末尾可带一个透明度通道(0-255),有则输出 `rgba()`\n*/\n/** 解析 OFD 颜色声明为 CSS 颜色;无法识别返回 null,由调用方决定默认值 */\nfunction parseOfdColor(value) {\n\tconst text = value?.trim();\n\tif (!text) return null;\n\tif (text.startsWith(\"#\")) return text;\n\tconst tokens = text.toLowerCase().split(/[\\s,]+/).filter((token) => token !== \"\");\n\tif (tokens.length === 0) return null;\n\tconst named = CHANNEL_COUNT_BY_NAME[tokens[0]];\n\tif (named !== void 0) return toCssColor(tokens.slice(1), named);\n\tconst channelCount = UNNAMED_CHANNEL_COUNT[tokens.length];\n\treturn channelCount === void 0 ? null : toCssColor(tokens, channelCount);\n}\nconst CHANNEL_COUNT_BY_NAME = {\n\tg: 1,\n\tgray: 1,\n\trgb: 3,\n\tcmyk: 4\n};\n/** 无前缀时按数值个数推断通道数;末位可能是透明度通道 */\nconst UNNAMED_CHANNEL_COUNT = {\n\t1: 1,\n\t2: 1,\n\t3: 3,\n\t4: 4,\n\t5: 4\n};\n/** 按通道数把 0-255 通道值列表转成 CSS 颜色;末位之后的透明度通道可选 */\nfunction toCssColor(tokens, channels) {\n\tconst values = parseNumberList(tokens.join(\" \"));\n\tif (values.length < channels || values.length > channels + 1) return null;\n\tconst clamped = values.map((value) => Math.round(Math.min(255, Math.max(0, value))));\n\tconst alpha = values.length === channels + 1 ? clamped[channels] / 255 : null;\n\tconst [r, g, b] = channels === 1 ? [\n\t\tclamped[0],\n\t\tclamped[0],\n\t\tclamped[0]\n\t] : toRgb(clamped, channels);\n\treturn alpha === null ? `rgb(${r} ${g} ${b})` : `rgba(${r} ${g} ${b} / ${+alpha.toFixed(3)})`;\n}\n/** CMYK 转 RGB:r = 255·(1−c)·(1−k);channels 为 3 时直取 RGB */\nfunction toRgb(clamped, channels) {\n\tif (channels === 3) return [\n\t\tclamped[0],\n\t\tclamped[1],\n\t\tclamped[2]\n\t];\n\tconst [c, m, y, k] = clamped;\n\treturn [\n\t\tMath.round(255 * (1 - c / 255) * (1 - k / 255)),\n\t\tMath.round(255 * (1 - m / 255) * (1 - k / 255)),\n\t\tMath.round(255 * (1 - y / 255) * (1 - k / 255))\n\t];\n}\n//#endregion\nexport { parseOfdColor };\n\n//# sourceMappingURL=color.js.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,cAAc,OAAO;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,IAAI,CAAC,MAAM,OAAO;CAClB,IAAI,KAAK,WAAW,GAAG,GAAG,OAAO;CACjC,MAAM,SAAS,KAAK,YAAY,CAAC,CAAC,MAAM,QAAQ,CAAC,CAAC,QAAQ,UAAU,UAAU,EAAE;CAChF,IAAI,OAAO,WAAW,GAAG,OAAO;CAChC,MAAM,QAAQ,sBAAsB,OAAO;CAC3C,IAAI,UAAU,KAAK,GAAG,OAAO,WAAW,OAAO,MAAM,CAAC,GAAG,KAAK;CAC9D,MAAM,eAAe,sBAAsB,OAAO;CAClD,OAAO,iBAAiB,KAAK,IAAI,OAAO,WAAW,QAAQ,YAAY;AACxE;AACA,MAAM,wBAAwB;CAC7B,GAAG;CACH,MAAM;CACN,KAAK;CACL,MAAM;AACP;;AAEA,MAAM,wBAAwB;CAC7B,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACJ;;AAEA,SAAS,WAAW,QAAQ,UAAU;CACrC,MAAM,SAAS,gBAAgB,OAAO,KAAK,GAAG,CAAC;CAC/C,IAAI,OAAO,SAAS,YAAY,OAAO,SAAS,WAAW,GAAG,OAAO;CACrE,MAAM,UAAU,OAAO,KAAK,UAAU,KAAK,MAAM,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;CACnF,MAAM,QAAQ,OAAO,WAAW,WAAW,IAAI,QAAQ,YAAY,MAAM;CACzE,MAAM,CAAC,GAAG,GAAG,KAAK,aAAa,IAAI;EAClC,QAAQ;EACR,QAAQ;EACR,QAAQ;CACT,IAAI,MAAM,SAAS,QAAQ;CAC3B,OAAO,UAAU,OAAO,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,QAAQ,CAAC,EAAE;AAC5F;;AAEA,SAAS,MAAM,SAAS,UAAU;CACjC,IAAI,aAAa,GAAG,OAAO;EAC1B,QAAQ;EACR,QAAQ;EACR,QAAQ;CACT;CACA,MAAM,CAAC,GAAG,GAAG,GAAG,KAAK;CACrB,OAAO;EACN,KAAK,MAAM,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,IAAI;EAC9C,KAAK,MAAM,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,IAAI;EAC9C,KAAK,MAAM,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,IAAI;CAC/C;AACD"}
@@ -0,0 +1,55 @@
1
+ //#region ../ofd-core/dist/ctm.js
2
+ /** 单位矩阵:不改变任何坐标 */
3
+ const IDENTITY_MATRIX = [
4
+ 1,
5
+ 0,
6
+ 0,
7
+ 1,
8
+ 0,
9
+ 0
10
+ ];
11
+ /** 矩阵乘法:`multiplyMatrix(outer, inner)` 等价于先 inner 后 outer */
12
+ function multiplyMatrix(outer, inner) {
13
+ const [a1, b1, c1, d1, e1, f1] = outer;
14
+ const [a2, b2, c2, d2, e2, f2] = inner;
15
+ return [
16
+ a1 * a2 + c1 * b2,
17
+ b1 * a2 + d1 * b2,
18
+ a1 * c2 + c1 * d2,
19
+ b1 * c2 + d1 * d2,
20
+ a1 * e2 + c1 * f2 + e1,
21
+ b1 * e2 + d1 * f2 + f1
22
+ ];
23
+ }
24
+ /** 解析 `CTM` 属性;缺失或不合法返回 null(渲染时按单位矩阵处理) */
25
+ function parseMatrix(value) {
26
+ const numbers = parseNumberList(value);
27
+ return numbers.length === 6 ? [
28
+ numbers[0],
29
+ numbers[1],
30
+ numbers[2],
31
+ numbers[3],
32
+ numbers[4],
33
+ numbers[5]
34
+ ] : null;
35
+ }
36
+ /** 解析 `Boundary="x y w h"` 属性;缺失或不完整返回 null */
37
+ function parseBoundary(value) {
38
+ const numbers = parseNumberList(value);
39
+ if (numbers.length !== 4) return null;
40
+ return {
41
+ x: numbers[0],
42
+ y: numbers[1],
43
+ width: numbers[2],
44
+ height: numbers[3]
45
+ };
46
+ }
47
+ /** 按空白或逗号切分数值列表(CTM / Boundary / DeltaX / DashPattern 共用) */
48
+ function parseNumberList(value) {
49
+ if (!value) return [];
50
+ return value.trim().split(/[\s,]+/).filter((token) => token !== "").map((token) => Number(token)).filter((number) => Number.isFinite(number));
51
+ }
52
+ //#endregion
53
+ export { IDENTITY_MATRIX, multiplyMatrix, parseBoundary, parseMatrix, parseNumberList };
54
+
55
+ //# sourceMappingURL=ctm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ctm.js","names":[],"sources":["../../../../../ofd-core/dist/ctm.js"],"sourcesContent":["//#region src/ctm.ts\n/** 单位矩阵:不改变任何坐标 */\nconst IDENTITY_MATRIX = [\n\t1,\n\t0,\n\t0,\n\t1,\n\t0,\n\t0\n];\n/** 矩阵乘法:`multiplyMatrix(outer, inner)` 等价于先 inner 后 outer */\nfunction multiplyMatrix(outer, inner) {\n\tconst [a1, b1, c1, d1, e1, f1] = outer;\n\tconst [a2, b2, c2, d2, e2, f2] = inner;\n\treturn [\n\t\ta1 * a2 + c1 * b2,\n\t\tb1 * a2 + d1 * b2,\n\t\ta1 * c2 + c1 * d2,\n\t\tb1 * c2 + d1 * d2,\n\t\ta1 * e2 + c1 * f2 + e1,\n\t\tb1 * e2 + d1 * f2 + f1\n\t];\n}\n/** 解析 `CTM` 属性;缺失或不合法返回 null(渲染时按单位矩阵处理) */\nfunction parseMatrix(value) {\n\tconst numbers = parseNumberList(value);\n\treturn numbers.length === 6 ? [\n\t\tnumbers[0],\n\t\tnumbers[1],\n\t\tnumbers[2],\n\t\tnumbers[3],\n\t\tnumbers[4],\n\t\tnumbers[5]\n\t] : null;\n}\n/** 解析 `Boundary=\"x y w h\"` 属性;缺失或不完整返回 null */\nfunction parseBoundary(value) {\n\tconst numbers = parseNumberList(value);\n\tif (numbers.length !== 4) return null;\n\treturn {\n\t\tx: numbers[0],\n\t\ty: numbers[1],\n\t\twidth: numbers[2],\n\t\theight: numbers[3]\n\t};\n}\n/** 按空白或逗号切分数值列表(CTM / Boundary / DeltaX / DashPattern 共用) */\nfunction parseNumberList(value) {\n\tif (!value) return [];\n\treturn value.trim().split(/[\\s,]+/).filter((token) => token !== \"\").map((token) => Number(token)).filter((number) => Number.isFinite(number));\n}\n//#endregion\nexport { IDENTITY_MATRIX, multiplyMatrix, parseBoundary, parseMatrix, parseNumberList };\n\n//# sourceMappingURL=ctm.js.map"],"mappings":";;AAEA,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,SAAS,eAAe,OAAO,OAAO;CACrC,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM;CACjC,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM;CACjC,OAAO;EACN,KAAK,KAAK,KAAK;EACf,KAAK,KAAK,KAAK;EACf,KAAK,KAAK,KAAK;EACf,KAAK,KAAK,KAAK;EACf,KAAK,KAAK,KAAK,KAAK;EACpB,KAAK,KAAK,KAAK,KAAK;CACrB;AACD;;AAEA,SAAS,YAAY,OAAO;CAC3B,MAAM,UAAU,gBAAgB,KAAK;CACrC,OAAO,QAAQ,WAAW,IAAI;EAC7B,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;CACT,IAAI;AACL;;AAEA,SAAS,cAAc,OAAO;CAC7B,MAAM,UAAU,gBAAgB,KAAK;CACrC,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,OAAO;EACN,GAAG,QAAQ;EACX,GAAG,QAAQ;EACX,OAAO,QAAQ;EACf,QAAQ,QAAQ;CACjB;AACD;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,CAAC,OAAO,OAAO,CAAC;CACpB,OAAO,MAAM,KAAK,CAAC,CAAC,MAAM,QAAQ,CAAC,CAAC,QAAQ,UAAU,UAAU,EAAE,CAAC,CAAC,KAAK,UAAU,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,WAAW,OAAO,SAAS,MAAM,CAAC;AAC7I"}
@@ -0,0 +1,14 @@
1
+ //#region ../ofd-core/dist/error.js
2
+ /** OFD 解析失败抛出的类型化错误:靠 `reason` 分类,不靠解析 message */
3
+ var OfdParseError = class extends Error {
4
+ reason;
5
+ constructor(reason, message, options) {
6
+ super(message, options);
7
+ this.name = "OfdParseError";
8
+ this.reason = reason;
9
+ }
10
+ };
11
+ //#endregion
12
+ export { OfdParseError };
13
+
14
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","names":[],"sources":["../../../../../ofd-core/dist/error.js"],"sourcesContent":["//#region src/error.ts\n/** OFD 解析失败抛出的类型化错误:靠 `reason` 分类,不靠解析 message */\nvar OfdParseError = class extends Error {\n\treason;\n\tconstructor(reason, message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"OfdParseError\";\n\t\tthis.reason = reason;\n\t}\n};\n//#endregion\nexport { OfdParseError };\n\n//# sourceMappingURL=error.js.map"],"mappings":";;AAEA,IAAI,gBAAgB,cAAc,MAAM;CACvC;CACA,YAAY,QAAQ,SAAS,SAAS;EACrC,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO;EACZ,KAAK,SAAS;CACf;AACD"}
@@ -0,0 +1,384 @@
1
+ import { OfdParseError } from "./error.js";
2
+ import { formatNumber } from "./number.js";
3
+ //#region ../ofd-core/dist/font.js
4
+ /**
5
+ * 内嵌 TTF 字体解析与 glyph 轮廓输出(OFD Font@FontFile 声明的内嵌字体)。
6
+ *
7
+ * 读取 TrueType 的 head/maxp/cmap/loca/glyf/hhea/hmtx 表:cmap 把字符码点映射到
8
+ * glyph id(可省,省略时字符映射由渲染层 CGTransform 字形序号提供),glyf 提取
9
+ * 轮廓点(on/off curve,复合 glyph 递归展开并平移/缩放)。
10
+ * 二次贝塞尔轮廓按 unitsPerEm → 字号缩放、基线定位并翻转 y 轴后转成 SVG path
11
+ * `d`。二进制结构非法时抛 OfdParseError('invalid-font')。
12
+ */
13
+ /** 解析 TTF 二进制:结构非法抛 OfdParseError('invalid-font') */
14
+ function parseEmbeddedFont(data, source) {
15
+ if (data.length < 12) throw new OfdParseError("invalid-font", `字体 ${source} 数据太短,不是 TTF 文件`);
16
+ const tables = parseTableDirectory(data, source);
17
+ for (const tag of REQUIRED_TABLES) {
18
+ const table = tables.get(tag);
19
+ if (!table) throw new OfdParseError("invalid-font", `字体 ${source} 缺少 ${tag} 表`);
20
+ if (table.offset + table.length > data.length) throw new OfdParseError("invalid-font", `字体 ${source} 的 ${tag} 表越界,数据被截断`);
21
+ }
22
+ const headOffset = tables.get("head").offset;
23
+ const unitsPerEm = new FontReader(data, source, headOffset + 18).u16();
24
+ if (unitsPerEm === 0) throw new OfdParseError("invalid-font", `字体 ${source} 的 unitsPerEm 为 0`);
25
+ const indexToLocFormat = new FontReader(data, source, headOffset + 50).i16();
26
+ if (indexToLocFormat !== 0 && indexToLocFormat !== 1) throw new OfdParseError("invalid-font", `字体 ${source} 的 indexToLocFormat 不合法:${indexToLocFormat}`);
27
+ const numGlyphs = new FontReader(data, source, tables.get("maxp").offset + 4).u16();
28
+ const cmapTable = tables.get("cmap");
29
+ const cmap = cmapTable ? parseCmap(data, cmapTable, source) : /* @__PURE__ */ new Map();
30
+ const glyfTable = tables.get("glyf");
31
+ const locaView = new FontReader(data, source, tables.get("loca").offset);
32
+ const loca = [];
33
+ for (let i = 0; i <= numGlyphs; i++) loca.push(indexToLocFormat === 0 ? locaView.u16() * 2 : locaView.u32());
34
+ for (let i = 0; i < numGlyphs; i++) if (loca[i + 1] < loca[i] || loca[i + 1] > glyfTable.length) throw new OfdParseError("invalid-font", `字体 ${source} 的 loca 表越界`);
35
+ const numberOfHMetrics = Math.min(new FontReader(data, source, tables.get("hhea").offset + 34).u16(), numGlyphs);
36
+ const hmtxView = new FontReader(data, source, tables.get("hmtx").offset);
37
+ const advances = [];
38
+ for (let i = 0; i < numberOfHMetrics; i++) {
39
+ advances.push(hmtxView.u16());
40
+ hmtxView.i16();
41
+ }
42
+ const glyf = data.subarray(glyfTable.offset, glyfTable.offset + glyfTable.length);
43
+ const outlineCache = /* @__PURE__ */ new Map();
44
+ return {
45
+ unitsPerEm,
46
+ numGlyphs,
47
+ glyphIndexOf: (codePoint) => cmap.get(codePoint) ?? null,
48
+ advanceWidth: (gid) => advances[Math.min(Math.max(gid, 0), advances.length - 1)] ?? 0,
49
+ glyphOutline: (gid) => {
50
+ const cached = outlineCache.get(gid);
51
+ if (cached) return cached;
52
+ const outline = readGlyphOutline(glyf, gid, /* @__PURE__ */ new Set([gid]), numGlyphs, loca, source);
53
+ outlineCache.set(gid, outline);
54
+ return outline;
55
+ }
56
+ };
57
+ }
58
+ /**
59
+ * glyph 轮廓转 SVG path `d`:unitsPerEm → 字号缩放,基线原点定位并翻转
60
+ * y 轴(字体坐标向上,SVG 向下)。无轮廓返回空串。
61
+ */
62
+ function glyphPathD(font, gid, fontSize, originX, originY) {
63
+ if (!(fontSize > 0)) return "";
64
+ const scale = fontSize / font.unitsPerEm;
65
+ return font.glyphOutline(gid).map((contour) => contourPathD(contour, scale, originX, originY)).filter((d) => d !== "").join(" ");
66
+ }
67
+ const REQUIRED_TABLES = [
68
+ "glyf",
69
+ "head",
70
+ "hhea",
71
+ "hmtx",
72
+ "loca",
73
+ "maxp"
74
+ ];
75
+ /** 带越界检查的大端读取器:越界抛 invalid-font */
76
+ var FontReader = class {
77
+ data;
78
+ source;
79
+ offset;
80
+ constructor(data, source, offset = 0) {
81
+ this.data = data;
82
+ this.source = source;
83
+ this.offset = offset;
84
+ }
85
+ seek(offset) {
86
+ this.offset = offset;
87
+ }
88
+ u8() {
89
+ this.take(1);
90
+ return this.data[this.offset++];
91
+ }
92
+ i8() {
93
+ return this.u8() << 24 >> 24;
94
+ }
95
+ u16() {
96
+ this.take(2);
97
+ const value = this.data[this.offset] << 8 | this.data[this.offset + 1];
98
+ this.offset += 2;
99
+ return value;
100
+ }
101
+ i16() {
102
+ return this.u16() << 16 >> 16;
103
+ }
104
+ u32() {
105
+ return (this.u16() << 16 | this.u16()) >>> 0;
106
+ }
107
+ /** 读指定绝对偏移的 u16(cmap format 4 的 glyphIdArray 寻址用) */
108
+ u16At(offset) {
109
+ if (offset < 0 || offset + 2 > this.data.length) this.overrun();
110
+ return this.data[offset] << 8 | this.data[offset + 1];
111
+ }
112
+ take(size) {
113
+ if (this.offset + size > this.data.length) this.overrun();
114
+ }
115
+ overrun() {
116
+ throw new OfdParseError("invalid-font", `字体 ${this.source} 数据被截断`);
117
+ }
118
+ };
119
+ function parseTableDirectory(data, source) {
120
+ const view = new FontReader(data, source);
121
+ view.u32();
122
+ const numTables = view.u16();
123
+ view.seek(view.offset + 6);
124
+ const tables = /* @__PURE__ */ new Map();
125
+ for (let i = 0; i < numTables; i++) {
126
+ const tag = String.fromCharCode(view.u8(), view.u8(), view.u8(), view.u8());
127
+ view.u32();
128
+ const offset = view.u32();
129
+ const length = view.u32();
130
+ tables.set(tag, {
131
+ offset,
132
+ length
133
+ });
134
+ }
135
+ return tables;
136
+ }
137
+ function parseCmap(data, table, source) {
138
+ const header = new FontReader(data, source, table.offset);
139
+ header.u16();
140
+ const recordCount = header.u16();
141
+ const records = [];
142
+ for (let i = 0; i < recordCount; i++) records.push({
143
+ platform: header.u16(),
144
+ encoding: header.u16(),
145
+ offset: table.offset + header.u32()
146
+ });
147
+ const score = (record) => record.platform === 3 && record.encoding === 10 ? 3 : record.platform === 0 ? 2 : record.platform === 3 && record.encoding === 1 ? 1 : 0;
148
+ records.sort((a, b) => score(b) - score(a));
149
+ for (const record of records) try {
150
+ return parseCmapSubtable(new FontReader(data, source, record.offset), source);
151
+ } catch {}
152
+ throw new OfdParseError("invalid-font", `字体 ${source} 没有可用的 cmap 子表`);
153
+ }
154
+ function parseCmapSubtable(view, source) {
155
+ const format = view.u16();
156
+ switch (format) {
157
+ case 4: return parseCmapFormat4(view);
158
+ case 12: return parseCmapFormat12(view);
159
+ case 0: return parseCmapFormat0(view);
160
+ case 6: return parseCmapFormat6(view);
161
+ default: throw new OfdParseError("invalid-font", `字体 ${source} 的 cmap 子表格式 ${format} 不支持`);
162
+ }
163
+ }
164
+ function parseCmapFormat4(view) {
165
+ view.u16();
166
+ view.u16();
167
+ const segCount = view.u16() / 2;
168
+ view.u16();
169
+ view.u16();
170
+ view.u16();
171
+ if (segCount === 0) throw new OfdParseError("invalid-font", "cmap format 4 段数为 0");
172
+ const ends = readU16Array(view, segCount);
173
+ view.u16();
174
+ const starts = readU16Array(view, segCount);
175
+ const deltas = readU16Array(view, segCount);
176
+ const rangeOffsetBase = view.offset;
177
+ const rangeOffsets = readU16Array(view, segCount);
178
+ const map = /* @__PURE__ */ new Map();
179
+ for (let s = 0; s < segCount; s++) for (let code = starts[s]; code <= ends[s]; code++) {
180
+ let gid;
181
+ if (rangeOffsets[s] === 0) gid = code + deltas[s] & 65535;
182
+ else {
183
+ const address = rangeOffsetBase + 2 * s + rangeOffsets[s] + 2 * (code - starts[s]);
184
+ gid = view.u16At(address);
185
+ if (gid === 0) continue;
186
+ gid = gid + deltas[s] & 65535;
187
+ }
188
+ if (gid !== 0) map.set(code, gid);
189
+ }
190
+ return map;
191
+ }
192
+ function parseCmapFormat12(view) {
193
+ view.u16();
194
+ view.u32();
195
+ view.u32();
196
+ const groupCount = view.u32();
197
+ const map = /* @__PURE__ */ new Map();
198
+ for (let g = 0; g < groupCount; g++) {
199
+ const start = view.u32();
200
+ const end = Math.min(view.u32(), 1114111);
201
+ const startGlyph = view.u32();
202
+ for (let code = start; code <= end; code++) {
203
+ const gid = startGlyph + (code - start);
204
+ if (gid !== 0) map.set(code, gid);
205
+ }
206
+ }
207
+ return map;
208
+ }
209
+ function parseCmapFormat0(view) {
210
+ view.u16();
211
+ view.u16();
212
+ const map = /* @__PURE__ */ new Map();
213
+ for (let code = 0; code < 256; code++) {
214
+ const gid = view.u8();
215
+ if (gid !== 0) map.set(code, gid);
216
+ }
217
+ return map;
218
+ }
219
+ function parseCmapFormat6(view) {
220
+ view.u16();
221
+ view.u16();
222
+ const firstCode = view.u16();
223
+ const entryCount = view.u16();
224
+ const map = /* @__PURE__ */ new Map();
225
+ for (let i = 0; i < entryCount; i++) {
226
+ const gid = view.u16();
227
+ if (gid !== 0) map.set(firstCode + i, gid);
228
+ }
229
+ return map;
230
+ }
231
+ function readU16Array(view, count) {
232
+ return Array.from({ length: count }, () => view.u16());
233
+ }
234
+ const COMPONENT_WORDS_ARGS = 1;
235
+ const COMPONENT_MORE = 32;
236
+ const COMPONENT_SCALE = 8;
237
+ const COMPONENT_XY_SCALE = 64;
238
+ const COMPONENT_TWO_BY_TWO = 128;
239
+ /** 读单个 glyph 轮廓;复合 glyph 递归展开组件(带环检测),越界/空 glyph 返回空 */
240
+ function readGlyphOutline(glyf, gid, visiting, numGlyphs, loca, source) {
241
+ if (gid < 0 || gid >= numGlyphs) return [];
242
+ const start = loca[gid];
243
+ if (start === loca[gid + 1]) return [];
244
+ const view = new FontReader(glyf, source, start);
245
+ const numberOfContours = view.i16();
246
+ view.seek(view.offset + 8);
247
+ if (numberOfContours >= 0) return readSimpleGlyph(view, numberOfContours);
248
+ return readCompositeGlyph(view, (componentGid) => {
249
+ if (visiting.has(componentGid)) return [];
250
+ const next = new Set(visiting);
251
+ next.add(componentGid);
252
+ return readGlyphOutline(glyf, componentGid, next, numGlyphs, loca, source);
253
+ });
254
+ }
255
+ /** 简单 glyph:标志位驱动的增量坐标解码 */
256
+ function readSimpleGlyph(view, numberOfContours) {
257
+ if (numberOfContours === 0) return [];
258
+ const endPoints = [];
259
+ for (let i = 0; i < numberOfContours; i++) endPoints.push(view.u16());
260
+ const pointCount = endPoints[endPoints.length - 1] + 1;
261
+ const instructionLength = view.u16();
262
+ view.seek(view.offset + instructionLength);
263
+ const flags = [];
264
+ while (flags.length < pointCount) {
265
+ const flag = view.u8();
266
+ flags.push(flag);
267
+ if (flag & 8) {
268
+ const repeat = view.u8();
269
+ for (let r = 0; r < repeat && flags.length < pointCount; r++) flags.push(flag);
270
+ }
271
+ }
272
+ const xs = readDeltaCoords(view, flags, 2, 16);
273
+ const ys = readDeltaCoords(view, flags, 4, 32);
274
+ const points = [];
275
+ for (let i = 0; i < pointCount; i++) points.push({
276
+ x: xs[i],
277
+ y: ys[i],
278
+ onCurve: (flags[i] & 1) !== 0
279
+ });
280
+ const contours = [];
281
+ let start = 0;
282
+ for (const end of endPoints) {
283
+ contours.push(points.slice(start, end + 1));
284
+ start = end + 1;
285
+ }
286
+ return contours;
287
+ }
288
+ /** x/y 增量坐标共用解码:短格式 1 字节(符号由 same 位决定),否则 0 或 i16 */
289
+ function readDeltaCoords(view, flags, shortBit, sameBit) {
290
+ const coords = [];
291
+ let value = 0;
292
+ for (const flag of flags) {
293
+ if (flag & shortBit) {
294
+ const delta = view.u8();
295
+ value += (flag & sameBit) !== 0 ? delta : -delta;
296
+ } else if ((flag & sameBit) === 0) value += view.i16();
297
+ coords.push(value);
298
+ }
299
+ return coords;
300
+ }
301
+ /**
302
+ * 复合 glyph:组件递归展开,先按组件矩阵变换再平移。
303
+ * 极少见「点对齐」组件(args 为点序号而非 XY 偏移)按偏移量处理,不做点匹配。
304
+ */
305
+ function readCompositeGlyph(view, resolve) {
306
+ const contours = [];
307
+ let flags;
308
+ do {
309
+ flags = view.u16();
310
+ const glyphIndex = view.u16();
311
+ const wide = (flags & COMPONENT_WORDS_ARGS) !== 0;
312
+ const dx = wide ? view.i16() : view.i8();
313
+ const dy = wide ? view.i16() : view.i8();
314
+ let a = 1;
315
+ let b = 0;
316
+ let c = 0;
317
+ let d = 1;
318
+ if (flags & COMPONENT_SCALE) a = d = readFixed214(view);
319
+ else if (flags & COMPONENT_XY_SCALE) {
320
+ a = readFixed214(view);
321
+ d = readFixed214(view);
322
+ } else if (flags & COMPONENT_TWO_BY_TWO) {
323
+ a = readFixed214(view);
324
+ b = readFixed214(view);
325
+ c = readFixed214(view);
326
+ d = readFixed214(view);
327
+ }
328
+ for (const contour of resolve(glyphIndex)) contours.push(contour.map((point) => ({
329
+ x: a * point.x + c * point.y + dx,
330
+ y: b * point.x + d * point.y + dy,
331
+ onCurve: point.onCurve
332
+ })));
333
+ } while (flags & COMPONENT_MORE);
334
+ return contours;
335
+ }
336
+ function readFixed214(view) {
337
+ return view.u16() / 16384;
338
+ }
339
+ /**
340
+ * TrueType 轮廓转 path:相邻 off-curve 点之间补隐式中点(on-curve),
341
+ * 旋转到 on-curve 点开头后逐段输出 L / Q,Z 闭合。
342
+ */
343
+ function contourPathD(contour, scale, originX, originY) {
344
+ const points = normalizeContour(contour);
345
+ if (points.length === 0) return "";
346
+ const count = points.length;
347
+ const at = (index) => points[index % count];
348
+ const x = (point) => formatNumber(point.x * scale + originX);
349
+ const y = (point) => formatNumber(originY - point.y * scale);
350
+ const parts = [`M ${x(points[0])} ${y(points[0])}`];
351
+ for (let i = 1; i < count; i++) {
352
+ const point = at(i);
353
+ if (point.onCurve) parts.push(`L ${x(point)} ${y(point)}`);
354
+ else {
355
+ const next = at(i + 1);
356
+ parts.push(`Q ${x(point)} ${y(point)} ${x(next)} ${y(next)}`);
357
+ i++;
358
+ }
359
+ }
360
+ parts.push("Z");
361
+ return parts.join(" ");
362
+ }
363
+ function normalizeContour(contour) {
364
+ const count = contour.length;
365
+ if (count === 0) return [];
366
+ const expanded = [];
367
+ for (let i = 0; i < count; i++) {
368
+ const point = contour[i];
369
+ expanded.push(point);
370
+ const next = contour[(i + 1) % count];
371
+ if (!point.onCurve && !next.onCurve) expanded.push({
372
+ x: (point.x + next.x) / 2,
373
+ y: (point.y + next.y) / 2,
374
+ onCurve: true
375
+ });
376
+ }
377
+ const start = expanded.findIndex((point) => point.onCurve);
378
+ if (start <= 0) return expanded;
379
+ return [...expanded.slice(start), ...expanded.slice(0, start)];
380
+ }
381
+ //#endregion
382
+ export { glyphPathD, parseEmbeddedFont };
383
+
384
+ //# sourceMappingURL=font.js.map