node-zugferd
node-zugferd
@node-zugferd/validator-xsd
@node-zugferd/validator-mustang
@node-zugferd/traffiqx
@node-zugferd/templates
@node-zugferd/pdf-template
T
Align
F
aspectRatio
T
AssetSource
T
BackgroundImage
T
Border
T
BorderSides
I
BoxStyle
T
BoxTransform
T
BreakInside
F
brutalistTheme
F
button
I
ButtonOptions
T
CellVerticalAlign
F
checkbox
I
CheckboxOptions
F
cleanTheme
V
Colors
I
ColumnSpec
T
ColumnWidth
T
CrossAxis
F
definePdfTemplate
F
defineStyles
I
DocumentMetadata
F
dropdown
I
DropdownOptions
T
Edges
T
EdgesInput
F
editorialTheme
F
embedFont
F
flattenForm
F
flex
F
flowContinuation
I
FlowOptions
F
flowToPdf
I
FlowToPdfOptions
F
formatCurrency
I
FormFieldAppearance
T
FormFieldNode
T
FormFieldOptions
T
FormValue
T
Fragmentation
F
getFormValues
F
group
F
hex
F
hline
F
hstack
F
image
F
imageFit
F
inlineNode
I
InlineNodeRun
T
InlineVerticalAlign
T
Justify
F
keepTogether
F
link
F
linkRun
F
loadFont
I
LoadFontOptions
F
loadImage
T
MainAxis
I
MainAxisLayout
F
measure
F
measureContent
I
MeasureProfileEvent
T
Node
F
nodeAdapter
F
optionList
I
OptionListOptions
T
Overflow
F
pageContent
I
PageContext
F
pageInner
I
PageOptions
I
PageSize
V
PageSizes
F
paragraph
I
ParagraphFloat
I
ParagraphFloatLayout
T
ParagraphItem
I
ParagraphLayout
I
ParagraphProps
I
ParagraphRun
C
PDFDocument
C
PdfEncryptionError
T
PdfEncryptionErrorCode
I
PdfEncryptionOptions
C
PDFFont
C
PDFImage
C
PDFPage
I
PdfPermissions
T
Position
F
radioOption
I
RadioOptionOptions
T
RelativeLength
F
render
F
renderFlow
T
RenderFlowProfileCallback
I
RenderFlowProfileEvent
I
RenderOptions
F
renderToPdf
I
RenderToPdfOptions
F
resolveMainAxis
T
RGB
F
rgb255
F
run
F
savePdf
I
SavePdfOptions
F
setFormValues
I
Size
F
spacer
T
StandardFontFamily
F
standardFonts
E
StandardFonts
I
StandardFontSet
F
streamFlow
I
StreamFlowOptions
I
StreamPageContext
F
stripeTheme
F
svgPath
F
table
I
TableCell
T
TableCellInput
I
TableDivider
I
TableOptions
V
text
F
textField
I
TextFieldOptions
I
TextOptions
I
TextProps
I
TextRunStyle
I
Theme
I
ThemeColors
I
ThemedTextStyle
I
ThemeFonts
I
ThemeRadii
I
ThemeSpacing
I
ThemeType
T
TransformOrigin
F
vline
F
vstack
@node-zugferd/parser
@node-zugferd/magic-bytes
@node-zugferd/instrumentation
@node-zugferd/docx-template
@node-zugferd/default-template
@node-zugferd/data-types
@node-zugferd/core

resolveMainAxis

Function resolveMainAxis

resolveMainAxis(children: Node[], axis: MainAxis, availableMain: number, availableCross: number, gap: number): MainAxisLayout

Resolve a stack's main-axis layout, applying flex-shrink when intrinsic sizes exceed the available main-axis dimension and at least one child has shrink > 0. Returns possibly-cloned children with reduced widths/heights and their final measured sizes (cross-axis dimensions reflect any text rewrapping that resulted from the shrink).

availableMain is the inner main-axis space (already net of padding). Pass Infinity when the parent has no main-axis constraint — shrink will not fire in that case.

availableCross is what measure(child, ...) should receive as parentWidth for vertical stacks. For an hstack, the main axis IS the width, so the parentWidth passed to children IS availableMain.

Parameters

  • children: Node[]
  • axis: MainAxis
  • availableMain: number
  • availableCross: number
  • gap: number

Returns MainAxisLayout


llms.txt
F
renderToPdf

F
rgb255

Edit on GitHubPrivacyImprint