@updog/data-editor 0.1.59 → 0.1.60

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 (5) hide show
  1. package/README.md +3 -3
  2. package/index.css +1 -1
  3. package/index.d.ts +110 -11
  4. package/index.js +2747 -2201
  5. package/package.json +1 -1
package/README.md CHANGED
@@ -176,11 +176,10 @@ const columns: DataEditorColumn[] = [
176
176
  validators: [
177
177
  { type: "required", message: "Email is required" },
178
178
  { type: "email", message: "Enter a valid email" },
179
+ // Flag duplicates in this column as errors. Always checked last.
180
+ { type: "unique" },
179
181
  ],
180
182
 
181
- // Flag duplicates in this column as errors.
182
- unique: true,
183
-
184
183
  // Revalidate these columns when this one changes.
185
184
  dependentFields: ["confirmEmail"],
186
185
 
@@ -222,6 +221,7 @@ Validators are declarative objects passed in the `validators` array on each colu
222
221
  | `"range"` | `min?`, `max?`, `message?` | Value must be numerically within `[min, max]`. Either bound is optional. |
223
222
  | `"oneOf"` | `values: string[]`, `message?` | Value must be one of the listed strings. |
224
223
  | `"date"` | `format?: "YYYY-MM-DD" \| "DD/MM/YYYY"`, `message?` | Value must parse as a date in the given format. When `format` is omitted, either format is accepted. |
224
+ | `"unique"` | `message?` | Value must not appear in any other row of the column. Always checked last, after all other validators pass — list position is ignored. |
225
225
 
226
226
  ```tsx
227
227
  const columns: DataEditorColumn[] = [