@updog/data-editor-wc 0.1.74 → 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 +25 -13
  2. package/index.js +804 -770
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1147,8 +1147,13 @@ type DataEditorResult<TRow extends DataEditorRow = DataEditorRow> = {
1147
1147
  invalid: number;
1148
1148
  };
1149
1149
  /**
1150
- * Import mappings the user confirmed that weren't already known, split into
1151
- * `columns` and `values`. Persist and feed back through `synonyms` so repeat
1150
+ * Import mappings the user changed **by hand** in the wizard, split into
1151
+ * `columns` (header column title) and `values` (imported value option).
1152
+ * Mappings the SDK matched on its own are excluded, as are mappings returned
1153
+ * by `onColumnMatch` / `onValueMatch` and pairs the synonym tables already
1154
+ * cover. A cancelled import contributes nothing.
1155
+ *
1156
+ * Persist and feed back through `synonyms` — the shapes line up — so repeat
1152
1157
  * imports auto-match. Each list is `[]` when nothing new was learned.
1153
1158
  */
1154
1159
  learnedSynonyms: LearnedSynonyms;
@@ -1420,24 +1425,31 @@ type DataEditorBaseProps<TRow extends DataEditorRow = DataEditorRow> = {
1420
1425
  */
1421
1426
  onValueMatch?: (valuesToMatch: Record<string, ValueMatchInput>) => ValueMatchOutput | Promise<ValueMatchOutput>;
1422
1427
  /**
1423
- * Extra synonyms layered on top of the built-ins for both column matching
1424
- * (header vs column) and value matching (imported value vs select option).
1425
- * Each key is the canonical target (a column ID/title, or a select option
1426
- * value); the array lists aliases the matching engine should treat as
1427
- * equivalent. Merged with the built-ins as a union per key.
1428
+ * Extra synonyms layered on top of the built-ins, in two tables that stay
1429
+ * apart: `columns` scores a file header against your columns, `values`
1430
+ * scores an imported cell against a select option. Each key is the canonical
1431
+ * target (a column ID/title, or an option value); the array lists aliases the
1432
+ * matching engine treats as equivalent. Merged with the built-ins per key.
1433
+ *
1434
+ * Feed `result.learnedSynonyms` straight back — it comes out in this shape.
1428
1435
  *
1429
1436
  * @example
1430
1437
  * ```ts
1431
1438
  * synonyms={{
1432
- * // column aliases
1433
- * productSku: ["sku", "article_no", "item_code"],
1434
- * firstName: ["first", "given_name", "fname"],
1435
- * // value aliases (e.g. for a "status" select)
1436
- * Active: ["live", "enabled"],
1439
+ * columns: {
1440
+ * productSku: ["sku", "article_no", "item_code"],
1441
+ * firstName: ["first", "given_name", "fname"],
1442
+ * },
1443
+ * values: {
1444
+ * Active: ["live", "enabled"],
1445
+ * },
1437
1446
  * }}
1438
1447
  * ```
1439
1448
  */
1440
- synonyms?: Record<string, string[]>;
1449
+ synonyms?: {
1450
+ columns?: Record<string, string[]>;
1451
+ values?: Record<string, string[]>;
1452
+ };
1441
1453
  /**
1442
1454
  * Sample rows included in the "Download Example" file. When the user clicks
1443
1455
  * "Download Example" in the import wizard, the SDK generates a template