You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tables): drop URL and Duration, harden Email and Phone validation
Removes the `url` and `duration` types entirely — type files, icons, registry
entries, tests and docs. `percent` stays, and with it the shared `precision`
key that also gives Number columns decimal places.
The remaining two now validate properly rather than permissively.
Email was `/^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/`, which accepted `a..b@x.com`,
`.a@x.com`, `a.@x.com`, `a,b@x.com` (a LIST of addresses, not one), `a@-x.com`,
`a@x-.com`, `a@x.123`, and an address of unbounded length. It now checks an
RFC 5322 dot-atom local part, real DNS labels, an alphabetic TLD, and the
RFC 5321 length caps (254 total, 64 local, 253 domain, 63 per label). Quoted
local parts stay unsupported, deliberately: admitting them would mean carrying
quoting rules through case-folding and every downstream comparison.
Phone accepted `+0123456789` — an E.164 number whose country code starts with
zero, which no network can route. A leading `+` now requires a country code
starting 1-9, while a number WITHOUT one keeps its leading zero, since that is
a real national trunk prefix (UK 020, DE 030). Whether the country code exists
is deliberately not checked: that needs a table that goes stale and then starts
rejecting valid numbers.
Every new rule is covered, and each was verified to fail with the old loose
rule restored — 12 email cases and the phone one.
Copy file name to clipboardExpand all lines: apps/docs/content/docs/en/tables/index.mdx
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,13 @@ Every column has a type, which decides how its values are stored and validated.
29
29
|**Select**| One of a fixed set of options, or several |`Pro`|
30
30
|**Email**| An email address |`person@example.com`|
31
31
|**Phone**| A phone number |`+1 555 123 4567`|
32
-
|**URL**| A link |`https://sim.ai`|
33
-
|**Duration**| A length of time |`1:30:00`|
34
32
|**JSON**| An object or array |`{ "tier": "pro" }`|
35
33
36
34
Types are enforced as you enter values, so a Number column only takes numbers.
37
35
38
-
Currency, Percent, and Duration columns all store a plain number, so filters, sorts, and exports see the amount itself rather than its formatting — `> 50%`and `>= 1h` are ordinary numeric comparisons. Changing a column's currency relabels it; it does not convert the amounts. Number and Percent columns take a decimal-place setting that changes how values are shown without rounding what is stored.
36
+
Currencyand Percent columns both store a plain number, so filters, sorts, and exports see the amount itself rather than its formatting — `> 50%`is an ordinary numeric comparison. Changing a column's currency relabels it; it does not convert the amounts. Number and Percent columns take a decimal-place setting that changes how values are shown without rounding what is stored.
39
37
40
-
Email, Phone, and URL columns tidy values as you enter them — addresses are lower-cased, phone numbers stripped to digits, and links given a scheme — so the same value entered two ways matches. URL cells render as clickable links.
38
+
Emailand Phone columns tidy and check values as you enter them — addresses are lower-cased, phone numbers stripped to their digits— so the same value entered two ways matches. A value that isn't a valid address or number is rejected rather than stored.
41
39
42
40
A Date column can carry a time of day or just a calendar date. Turning **Include time** off on a column that already has times will drop them.
0 commit comments