@updog/data-editor 0.1.94 → 0.1.95

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.
Files changed (3) hide show
  1. package/index.d.ts +26 -1
  2. package/index.js +2756 -2712
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -420,6 +420,7 @@ declare var export_default = {
420
420
  invalidNumber: "Invalid number",
421
421
  invalidOption: "Invalid option",
422
422
  invalidTime: "Invalid time",
423
+ invalidUrl: "Invalid URL",
423
424
  outOfRange: "Out of range",
424
425
  required: "This field is required",
425
426
  structuralMismatch: "This might be in the wrong column.",
@@ -764,6 +765,23 @@ type CellValidator = (value: unknown, row: DataEditorRow) => ValidationError | n
764
765
  type TextEditorCell = {
765
766
  type: "text";
766
767
  };
768
+ /**
769
+ * Email cell. A plain text input; the column is checked against
770
+ * `{ type: "email" }` even when it declares no validator. On the way in,
771
+ * surrounding spaces are cut and the domain is lower-cased.
772
+ */
773
+ type EmailEditorCell = {
774
+ type: "email";
775
+ };
776
+ /**
777
+ * Web address cell. A plain text input; the column is checked against
778
+ * `{ type: "url" }` even when it declares no validator. On the way in,
779
+ * surrounding spaces are cut and a bare host such as `acme.com` becomes
780
+ * `https://acme.com`.
781
+ */
782
+ type UrlEditorCell = {
783
+ type: "url";
784
+ };
767
785
  /** Date picker cell. Bounds come from the column's `{ type: "date" }` validator. */
768
786
  type DateEditorCell = {
769
787
  type: "date";
@@ -862,6 +880,8 @@ type NumberEditorCell = {
862
880
  * Controls how a cell is edited.
863
881
  *
864
882
  * - `"text"` — plain text input (default).
883
+ * - `"email"` — plain text input; the column is checked against `{ type: "email" }`, spaces cut and the domain lower-cased on the way in.
884
+ * - `"url"` — plain text input; the column is checked against `{ type: "url" }`, a bare host such as `acme.com` becomes `https://acme.com` on the way in.
865
885
  * - `"date"` — date picker; the calendar honours the column's date validator bounds.
866
886
  * - `"time"` — plain text input for a time of day; the column is checked against `{ type: "time" }`.
867
887
  * - `"select"` — dropdown with a fixed list of options.
@@ -871,7 +891,7 @@ type NumberEditorCell = {
871
891
  * - `"number"` — number input with locale-aware formatting.
872
892
  * - `"boolean"` — stores a real `true`/`false`; reads yes/no, 1/0, on/off and Excel's localized TRUE/FALSE.
873
893
  */
874
- type CellEditor = TextEditorCell | DateEditorCell | TimeEditorCell | SelectEditorCell | MultiSelectEditorCell | CountryEditorCell | CurrencyEditorCell | NumberEditorCell | BooleanEditorCell;
894
+ type CellEditor = TextEditorCell | EmailEditorCell | UrlEditorCell | DateEditorCell | TimeEditorCell | SelectEditorCell | MultiSelectEditorCell | CountryEditorCell | CurrencyEditorCell | NumberEditorCell | BooleanEditorCell;
875
895
  /** Dropdown filter shown in the sidebar Filters panel. */
876
896
  type SelectColumnFilter = {
877
897
  type: "select";
@@ -1034,6 +1054,11 @@ type BuiltInValidator = {
1034
1054
  } | {
1035
1055
  type: "email";
1036
1056
  message?: string;
1057
+ }
1058
+ /** The cell holds an `http` or `https` address with a dotted host. Implicit on every url column. */
1059
+ | {
1060
+ type: "url";
1061
+ message?: string;
1037
1062
  } | {
1038
1063
  type: "date";
1039
1064
  min?: string;