@samline/forms 2.9.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,27 @@
2
2
 
3
3
  All notable changes to `@samline/forms` are documented in this file. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
- ## [Unreleased]
5
+ ## [2.11.0] - 2026-11-13
6
+
7
+ No breaking API changes.
8
+
9
+ ### Added
10
+
11
+ - `FormatType` accepts `'text'` and `'slug'`, the format types added in `@samline/formatter` 3.1.0. `text` applies a casing mode (`options.case`: `'upper'`, `'lower'`, `'title'`, `'sentence'` or `'capitalize'`); `slug` keeps a trailing separator in the visible input while the user types and submits the trimmed slug in the hidden input. Both need formatter 3.1.0 or newer; the optional peer range stays `^2.1.0 || ^3.0.0`.
12
+ - The standalone script bundles formatter 3.1.0.
13
+
14
+ ## [2.10.0] - 2026-11-12
15
+
16
+ No breaking API changes.
17
+
18
+ ### Added
19
+
20
+ - Support for `@samline/formatter` 3.0.0. The optional peer now accepts `^2.1.0 || ^3.0.0`. Formatter 3 makes phones opt-in, so forms loads `@samline/formatter/phone` and calls `registerPhone()` the first time a field is formatted with `type: 'phone'`. Forms without phone fields never load libphonenumber-js, and bundlers put the phone subpath in its own lazy chunk. If the subpath cannot be loaded, forms logs one `console.error` and leaves the field unformatted.
21
+ - The standalone script bundles formatter 3.0.0, with phone support included.
22
+
23
+ ### Fixed
24
+
25
+ - A submit the user starts while a debounced auto-submit is pending cancels the pending one. Before, the form was submitted twice.
6
26
 
7
27
  ## [2.9.0] - 2026-11-12
8
28
 
@@ -290,7 +310,7 @@ No breaking API changes. The behavior changes below fix incorrect or surprising
290
310
 
291
311
  - Initial release of `@samline/forms`. Vanilla JS form controller with framework-specific variants (React, Vue, Svelte) initially included; bundled `.local/` agent docs at the repo root.
292
312
 
293
- [Unreleased]: https://github.com/samline/forms/compare/v2.9.0...HEAD
313
+ [2.10.0]: https://github.com/samline/forms/compare/v2.9.0...v2.10.0
294
314
  [2.9.0]: https://github.com/samline/forms/compare/v2.8.0...v2.9.0
295
315
  [2.8.0]: https://github.com/samline/forms/compare/v2.7.2...v2.8.0
296
316
  [2.7.2]: https://github.com/samline/forms/compare/v2.7.1...v2.7.2
package/README.md CHANGED
@@ -78,7 +78,7 @@ Invalid submits are always prevented and focus moves to the first invalid field.
78
78
  The standalone build defines `window.Forms` and already includes `@samline/formatter`. Pin the version.
79
79
 
80
80
  ```html
81
- <script src="https://unpkg.com/@samline/forms@2.9.0/dist/browser/global.global.js"></script>
81
+ <script src="https://unpkg.com/@samline/forms@2.11.0/dist/browser/global.global.js"></script>
82
82
  <script>
83
83
  const signup = window.Forms.form('signup', {
84
84
  validators: { email: { required: true, pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/ } },
@@ -1,4 +1,4 @@
1
- type FormatType = 'general' | 'phone' | 'numeral' | 'date' | 'time' | 'creditCard' | 'creditCardType';
1
+ type FormatType = 'general' | 'phone' | 'numeral' | 'date' | 'time' | 'creditCard' | 'creditCardType' | 'text' | 'slug';
2
2
  interface FieldFormatConfig {
3
3
  /** One of the supported `@samline/formatter` `FormatType` values. */
4
4
  type: FormatType;