PORT CONTRACT

Hand off a form safely

A spreadsheet can guide inputs with validation, protect formula cells, and make unusual values visible.

Try this

  1. Select an input cell and enter a value.
  2. Inspect the formula bar and status area.
  3. Switch sheets without losing the editing session.

How it works

Validation, protection, and conditional formatting are optional feature ports. They belong to the same provider composition as the grid, so a host can enable only the capabilities it implements.

View source

import type {
  DisplayCell,
  StaticSeedMatrix,
  StaticSpreadsheetSeed,
} from '@einfach/solid-excel/vnext'

const matrix: StaticSeedMatrix = [
  ['Expense request', 'August product launch', null, null],
  ['Owner', 'Mina Cho', null, null],
  ['Cost centre', 'Product', null, null],
  [],
  ['Line item', 'Requested amount', 'Approved amount', 'Variance'],
  ['Research incentive', 1800, 1500, null],
  ['Prototype materials', 2400, 2400, null],
  ['Accessibility review', 1200, 900, null],
  ['Contingency', 600, 0, null],
  [],
  ['Total', null, null, null],
]

const cells: DisplayCell[] = [
  { row: 5, col: 3, displayValue: '0', formula: '=C6-B6' },
  { row: 6, col: 3, displayValue: '0', formula: '=C7-B7' },
  { row: 7, col: 3, displayValue: '0', formula: '=C8-B8' },