CnImageWidgetForm
Config sub-form for the image widget — URL, alt text, link, object-fit.
Part of the dashboard widget library (v2). Registered with the dashboard widget registry and consumed by LaunchPad's widget grid. See the widget library overview and docs/architecture/cards-and-widgets.md.
Reference
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
editingWidget | {content: object}|null | null | The placement being edited, or null in create mode. Pre-fills every control from editingWidget.content. | |
value | object | \{ ...DEFAULT_CONTENT \} | Initial content values — used when not editing and the parent supplies registry defaults. | |
fileUploadFn | Function | null | Optional raw-file upload transport async (file: File) => ({ url }) (named fileUploadFn, not uploadFn, to avoid colliding with the base64 uploadFn other sub-forms declare). Called by commit() on submit (never on selection) with the raw picked file; the returned hosted URL is stored (rejected if it uses an unsafe scheme). When omitted, the file is embedded as a data URL on commit instead — allowed only when the raw file is ≤ 1 MB (~1.37 MB once base64-encoded and stored) so a huge inline blob can't freeze the tab. | |
uploadFn | Function | null | Deprecated — use fileUploadFn. Legacy base64 transport async (dataUrl: string) => ({ url }), kept for backward compatibility. When fileUploadFn is not set but this is, commit() reads the file to a data URL and hands it to this function (a one-time console.warn is emitted). fileUploadFn wins when both are set. |
Events
| Name | Payload | Description |
|---|---|---|
update:content | — | Emitted with the assembled {url, alt, link, fit} blob on every field change. |