Skip to content

Releases: formhaus-dev/formhaus-swift

0.1.4

Choose a tag to compare

@ignsm ignsm released this 21 Oct 10:52
56362d3

FormhausCore

  • Passes the conformance suite of @formhaus/core 1.1.1.
  • Format 1.6: "randomize": true on a radio, multiselect or select field shows its options in a random order per respondent. Options with "pinned": true and exclusive options keep their written position.
  • New FormEngineOptions.seed and FormEngineOptions.research. The same seed shows the same order. engine.seed returns it.
  • New engine.orderOptions(_:options:) returns the options of a field in shown order.
  • New FormResearch protocol for the option order.
  • Without research, options show in written order, and debug builds report missing-research once per process through onWarning.
  • checkDefinition() reports randomize-not-applicable, and outdated-format-version for randomize or pinned below format 1.6.

FormhausResearch

  • New product with Research, the option order of @formhaus/core/research. Pass Research() as research to apply it.

FormhausUI

  • Fields with randomize show their options in the order of engine.orderOptions(_:options:), including options from a provider.

0.1.3

Choose a tag to compare

@ignsm ignsm released this 21 Oct 05:17
b7f3110

FormhausCore

  • Passes the conformance suite of @formhaus/core 1.0.0.

FormhausUI

  • The formhaus set colors the step title red and announces the error count when the current step has errors, as in the web renderers.
  • ProgressContext has errorCount and errorLabel for the current step, independent of stepErrorMarks.
  • The focused field keeps focus and the keyboard while a submit or async step validation runs. Text typed meanwhile applies once the form unlocks.
  • Fixed the step counter and description clipping at the left edge in the system set on iOS.

0.1.2

Choose a tag to compare

@ignsm ignsm released this 20 Oct 14:02
51f96ad

FormhausUI

  • Switching from the system set to another set inside a NavigationStack shows Back only in the navigation bar.
  • Focusing the error summary scrolls only as far as needed to show it, in every component set. A summary that is already on screen no longer moves the page.
  • The formhaus set shows the error summary below the fields, before the actions, as in the web renderers.

0.1.1

Choose a tag to compare

@ignsm ignsm released this 20 Oct 12:13
992de1c

FormhausCore

  • JSONValue and JSONObject have jsonData() and jsonString() for request bodies, and JSONValue conforms to Codable.

FormhausUI

  • The system set shows the step counter, such as "Step 2 of 3", above the step title, like the formhaus set.

0.1.0

Choose a tag to compare

@ignsm ignsm released this 20 Oct 11:11
26cc9b3

First release of formhaus for Swift. It runs formhaus JSON form definitions natively on iOS and macOS with the same engine rules as @formhaus/core 0.22.0.

Install

.package(url: "https://github.com/formhaus-dev/formhaus-swift.git", from: "0.1.0")

Requires Swift 6.2, iOS 17 or macOS 14.

What is included

  • FormhausCore: the form engine, definition checks, server validation with validateSubmission, answer recall, translations, and a native ECMAScript regular expression engine. No dependencies.
  • FormhausUI: a SwiftUI renderer with three ways to draw a form:
    • the formhaus component set, matching the web look,
    • FormComponents.system, a native iOS grouped form,
    • your own components through the registry.
  • Theme generated from the formhaus design tokens, with light, dark and Increase Contrast palettes.
  • VoiceOver labels, Dynamic Type and 44 pt touch targets in the built-in sets, checked by tests.

Compatibility

Passes the full conformance suite of @formhaus/core 0.22.0: every corpus fixture and engine scenario.

Before 1.0

The API can change between minor versions until 1.0. Differences from the TypeScript packages are listed in the README.