{
  "version": 3,
  "sources": ["../../src/types/dataform.ts"],
  "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Field, FieldValidity } from './field-api';\n\n/**\n * DataForm layouts.\n */\nexport type LayoutType = 'regular' | 'panel' | 'card' | 'row' | 'details';\nexport type LabelPosition = 'top' | 'side' | 'none';\n\nexport type PanelSummaryField = string | string[];\nexport type NormalizedPanelSummaryField = string[];\n\nexport type RegularLayout = {\n\ttype: 'regular';\n\tlabelPosition?: LabelPosition;\n};\nexport type NormalizedRegularLayout = {\n\ttype: 'regular';\n\tlabelPosition: LabelPosition;\n};\n\nexport type EditVisibility = 'always' | 'on-hover';\n\ntype PanelOpenAsDropdown = {\n\ttype: 'dropdown';\n};\nexport type PanelOpenAsModal = {\n\ttype: 'modal';\n\tapplyLabel: string;\n\tcancelLabel: string;\n};\n\nexport type PanelLayout = {\n\ttype: 'panel';\n\tlabelPosition?: LabelPosition;\n\topenAs?:\n\t\t| 'dropdown'\n\t\t| 'modal'\n\t\t| { type: 'dropdown' }\n\t\t| { type: 'modal'; applyLabel?: string; cancelLabel?: string };\n\tsummary?: PanelSummaryField;\n\teditVisibility?: EditVisibility;\n};\nexport type NormalizedPanelLayout = {\n\ttype: 'panel';\n\tlabelPosition: LabelPosition;\n\topenAs: PanelOpenAsDropdown | PanelOpenAsModal;\n\tsummary: NormalizedPanelSummaryField;\n\teditVisibility: EditVisibility;\n};\n\nexport type CardSummaryField =\n\t| PanelSummaryField // Basic usage: string or string[]\n\t| Array<\n\t\t\t| string\n\t\t\t| {\n\t\t\t\t\tid: string;\n\t\t\t\t\tvisibility: 'always' | 'when-collapsed';\n\t\t\t  }\n\t  >;\n\nexport type NormalizedCardSummaryField = Array< {\n\tid: string;\n\tvisibility: 'always' | 'when-collapsed';\n} >;\n\nexport type CardLayout =\n\t| {\n\t\t\ttype: 'card';\n\t\t\twithHeader: false;\n\t\t\t// isOpened cannot be false if withHeader is false as well.\n\t\t\t// Otherwise, the card would not be visible.\n\t\t\tisOpened?: true;\n\t\t\t// isCollapsible cannot be true if withHeader is false as well.\n\t\t\tisCollapsible?: false;\n\t  }\n\t| {\n\t\t\ttype: 'card';\n\t\t\twithHeader?: true | undefined;\n\t\t\tisOpened?: boolean;\n\t\t\tsummary?: CardSummaryField;\n\t\t\tisCollapsible?: boolean | undefined;\n\t  };\nexport type NormalizedCardLayout =\n\t| {\n\t\t\ttype: 'card';\n\t\t\twithHeader: false;\n\t\t\t// isOpened cannot be false if withHeader is false as well.\n\t\t\t// Otherwise, the card would not be visible.\n\t\t\tisOpened: true;\n\t\t\t// Summary is an empty array\n\t\t\tsummary: [];\n\t\t\t// If no header, the card should not be collapsible.\n\t\t\tisCollapsible: false;\n\t  }\n\t| {\n\t\t\ttype: 'card';\n\t\t\twithHeader: true;\n\t\t\tisOpened: boolean;\n\t\t\tsummary: NormalizedCardSummaryField;\n\t\t\tisCollapsible: boolean;\n\t  };\n\nexport type RowLayout = {\n\ttype: 'row';\n\talignment?: 'start' | 'center' | 'end';\n\tstyles?: Record< string, { flex?: React.CSSProperties[ 'flex' ] } >;\n};\nexport type NormalizedRowLayout = {\n\ttype: 'row';\n\talignment: 'start' | 'center' | 'end';\n\tstyles: Record< string, { flex?: React.CSSProperties[ 'flex' ] } >;\n};\n\nexport type DetailsLayout = {\n\ttype: 'details';\n\tsummary?: string;\n};\nexport type NormalizedDetailsLayout = {\n\ttype: 'details';\n\tsummary: string;\n};\n\nexport type Layout =\n\t| RegularLayout\n\t| PanelLayout\n\t| CardLayout\n\t| RowLayout\n\t| DetailsLayout;\nexport type NormalizedLayout =\n\t| NormalizedRegularLayout\n\t| NormalizedPanelLayout\n\t| NormalizedCardLayout\n\t| NormalizedRowLayout\n\t| NormalizedDetailsLayout;\n\nexport type NormalizedSummaryField =\n\t| NormalizedPanelSummaryField\n\t| NormalizedCardSummaryField;\n\nexport type FormField = {\n\tid: string;\n\tlabel?: string;\n\tdescription?: string;\n\tlayout?: Layout;\n\tchildren?: Array< FormField | string >;\n};\nexport type NormalizedFormField = {\n\tid: string;\n\tlayout: NormalizedLayout;\n\tlabel?: string;\n\tdescription?: string;\n\tchildren?: NormalizedFormField[];\n};\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\tlayout?: Layout;\n\tfields?: Array< FormField | string >;\n};\nexport type NormalizedForm = {\n\tlayout: NormalizedLayout;\n\tfields: NormalizedFormField[];\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n\tvalidity?: FormValidity;\n}\n\nexport type FormValidity = Record< string, FieldValidity > | undefined;\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: NormalizedFormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n\tmarkWhenOptional?: boolean;\n\tvalidity?: FieldValidity;\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
  "names": []
}
