@updog/data-editor 0.1.73 → 0.1.75

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 +40 -28
  2. package/index.js +753 -714
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1550,21 +1550,6 @@ declare class ErrorHandler {
1550
1550
  handleError(error: UpdogError): void;
1551
1551
  }
1552
1552
 
1553
- type UniqueConfig = {
1554
- message?: string;
1555
- fn?: UniqueRemoteFn;
1556
- };
1557
- /**
1558
- * Core-internal column shape produced by normalizeUniqueColumns. Uniqueness
1559
- * lives in `uniqueConfig` and asyncFunction rules in `asyncConfig` — the
1560
- * single internal sources of truth — never as entries in `validators`.
1561
- * Never exported from the package entry.
1562
- */
1563
- type NormalizedColumn = DataEditorColumn & {
1564
- uniqueConfig?: UniqueConfig;
1565
- asyncConfig?: AsyncFunctionValidator[];
1566
- };
1567
-
1568
1553
  type FormulaCellContext = {
1569
1554
  value: unknown;
1570
1555
  field: string;
@@ -1648,6 +1633,21 @@ declare class FormulaRegistry {
1648
1633
  getExpressionCallable(): FormulaDefinition[];
1649
1634
  }
1650
1635
 
1636
+ type UniqueConfig = {
1637
+ message?: string;
1638
+ fn?: UniqueRemoteFn;
1639
+ };
1640
+ /**
1641
+ * Core-internal column shape produced by normalizeUniqueColumns. Uniqueness
1642
+ * lives in `uniqueConfig` and asyncFunction rules in `asyncConfig` — the
1643
+ * single internal sources of truth — never as entries in `validators`.
1644
+ * Never exported from the package entry.
1645
+ */
1646
+ type NormalizedColumn = DataEditorColumn & {
1647
+ uniqueConfig?: UniqueConfig;
1648
+ asyncConfig?: AsyncFunctionValidator[];
1649
+ };
1650
+
1651
1651
  type RegisterSourceOptions = {
1652
1652
  name: string;
1653
1653
  id?: DataSourceId;
@@ -2890,8 +2890,13 @@ type DataEditorResult<TRow extends DataEditorRow = DataEditorRow> = {
2890
2890
  invalid: number;
2891
2891
  };
2892
2892
  /**
2893
- * Import mappings the user confirmed that weren't already known, split into
2894
- * `columns` and `values`. Persist and feed back through `synonyms` so repeat
2893
+ * Import mappings the user changed **by hand** in the wizard, split into
2894
+ * `columns` (header column title) and `values` (imported value option).
2895
+ * Mappings the SDK matched on its own are excluded, as are mappings returned
2896
+ * by `onColumnMatch` / `onValueMatch` and pairs the synonym tables already
2897
+ * cover. A cancelled import contributes nothing.
2898
+ *
2899
+ * Persist and feed back through `synonyms` — the shapes line up — so repeat
2895
2900
  * imports auto-match. Each list is `[]` when nothing new was learned.
2896
2901
  */
2897
2902
  learnedSynonyms: LearnedSynonyms;
@@ -3225,24 +3230,31 @@ type DataEditorBaseProps<TRow extends DataEditorRow = DataEditorRow> = {
3225
3230
  */
3226
3231
  onValueMatch?: (valuesToMatch: Record<string, ValueMatchInput>) => ValueMatchOutput | Promise<ValueMatchOutput>;
3227
3232
  /**
3228
- * Extra synonyms layered on top of the built-ins for both column matching
3229
- * (header vs column) and value matching (imported value vs select option).
3230
- * Each key is the canonical target (a column ID/title, or a select option
3231
- * value); the array lists aliases the matching engine should treat as
3232
- * equivalent. Merged with the built-ins as a union per key.
3233
+ * Extra synonyms layered on top of the built-ins, in two tables that stay
3234
+ * apart: `columns` scores a file header against your columns, `values`
3235
+ * scores an imported cell against a select option. Each key is the canonical
3236
+ * target (a column ID/title, or an option value); the array lists aliases the
3237
+ * matching engine treats as equivalent. Merged with the built-ins per key.
3238
+ *
3239
+ * Feed `result.learnedSynonyms` straight back — it comes out in this shape.
3233
3240
  *
3234
3241
  * @example
3235
3242
  * ```ts
3236
3243
  * synonyms={{
3237
- * // column aliases
3238
- * productSku: ["sku", "article_no", "item_code"],
3239
- * firstName: ["first", "given_name", "fname"],
3240
- * // value aliases (e.g. for a "status" select)
3241
- * Active: ["live", "enabled"],
3244
+ * columns: {
3245
+ * productSku: ["sku", "article_no", "item_code"],
3246
+ * firstName: ["first", "given_name", "fname"],
3247
+ * },
3248
+ * values: {
3249
+ * Active: ["live", "enabled"],
3250
+ * },
3242
3251
  * }}
3243
3252
  * ```
3244
3253
  */
3245
- synonyms?: Record<string, string[]>;
3254
+ synonyms?: {
3255
+ columns?: Record<string, string[]>;
3256
+ values?: Record<string, string[]>;
3257
+ };
3246
3258
  /**
3247
3259
  * Sample rows included in the "Download Example" file. When the user clicks
3248
3260
  * "Download Example" in the import wizard, the SDK generates a template