@updog/data-editor 0.1.91 → 0.1.93

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.
package/index.d.ts CHANGED
@@ -411,6 +411,7 @@ declare var export_default = {
411
411
  validation: {
412
412
  alreadyExists: "Already exists in your database",
413
413
  endDateBeforeStart: "End date must be after start date",
414
+ invalidBoolean: "Invalid boolean",
414
415
  invalidCountry: "Invalid country",
415
416
  invalidCurrency: "Invalid currency",
416
417
  invalidDate: "Invalid date",
@@ -839,6 +840,16 @@ type CurrencyEditorCell = {
839
840
  /** The ISO 4217 codes the column takes, in the order the dropdown shows them. */
840
841
  only?: string[];
841
842
  };
843
+ /**
844
+ * Boolean cell. Stores a real `true`/`false`. Reads `true/yes/y/1/t/on/+`,
845
+ * `false/no/n/0/f/off/-` and Excel's localized TRUE/FALSE on the way in,
846
+ * case and surrounding spaces ignored; an empty cell reads as `false`. A
847
+ * value the dictionary has not got stays as it came and is flagged by the
848
+ * column's implicit `{ type: "boolean" }` validator.
849
+ */
850
+ type BooleanEditorCell = {
851
+ type: "boolean";
852
+ };
842
853
  /** Number input cell with locale-aware formatting. Bounds and decimal digits come from the column's `{ type: "number" }` validator. */
843
854
  type NumberEditorCell = {
844
855
  type: "number";
@@ -858,8 +869,9 @@ type NumberEditorCell = {
858
869
  * - `"country"` — dropdown over the ISO country list; stores the alpha-2 code, shows the name.
859
870
  * - `"currency"` — dropdown over the ISO 4217 list; stores and shows the three-letter code.
860
871
  * - `"number"` — number input with locale-aware formatting.
872
+ * - `"boolean"` — stores a real `true`/`false`; reads yes/no, 1/0, on/off and Excel's localized TRUE/FALSE.
861
873
  */
862
- type CellEditor = TextEditorCell | DateEditorCell | TimeEditorCell | SelectEditorCell | MultiSelectEditorCell | CountryEditorCell | CurrencyEditorCell | NumberEditorCell;
874
+ type CellEditor = TextEditorCell | DateEditorCell | TimeEditorCell | SelectEditorCell | MultiSelectEditorCell | CountryEditorCell | CurrencyEditorCell | NumberEditorCell | BooleanEditorCell;
863
875
  /** Dropdown filter shown in the sidebar Filters panel. */
864
876
  type SelectColumnFilter = {
865
877
  type: "select";
@@ -1005,6 +1017,11 @@ type BuiltInValidator = {
1005
1017
  | {
1006
1018
  type: "currency";
1007
1019
  message?: string;
1020
+ }
1021
+ /** The cell holds a real boolean. Implicit on every boolean column. */
1022
+ | {
1023
+ type: "boolean";
1024
+ message?: string;
1008
1025
  } | {
1009
1026
  type: "number";
1010
1027
  /** Inclusive lower bound. */
@@ -2029,6 +2046,8 @@ type PasteSpec = {
2029
2046
  targetToSource: ReadonlyMap<TRowId, TRowId>;
2030
2047
  selectOptionsMap: ReadonlyMap<string, ReadonlySet<string>>;
2031
2048
  multiSelectTargets: ReadonlyMap<string, MultiSelectTarget>;
2049
+ /** What a cut leaves in each source column: "" for text, false for a boolean. */
2050
+ sourceEmpty: ReadonlyMap<string, unknown>;
2032
2051
  skipColumnIndices: ReadonlySet<number>;
2033
2052
  isCut: boolean;
2034
2053
  };
@@ -2270,14 +2289,16 @@ declare class DataStore<TRow extends DataEditorRow = DataEditorRow> {
2270
2289
  */
2271
2290
  private fieldReader;
2272
2291
  /**
2273
- * The column's own reader over values an assistant produced. There is no
2274
- * column of file text to vote on here, so the reader runs without a verdict,
2275
- * the same way a formula result is read: it gives the value the shape its
2276
- * column stores rather than a JS number or an exponent. A value that reads
2277
- * back onto what the cell already holds leaves the delta, so an untouched
2278
- * cell stays untouched.
2292
+ * The column's own reader over values that arrive without file text: an
2293
+ * assistant's answer, a paste from another cell, a fill. There is no column
2294
+ * to vote on, so the reader runs without a verdict, the same way a formula
2295
+ * result is read: it gives the value the shape its column stores rather
2296
+ * than a JS number or an exponent. A boolean crosses as its word, so a text
2297
+ * column holds "true" the way the OS clipboard carries it and a boolean
2298
+ * column reads it back. A value that reads back onto what the cell already
2299
+ * holds leaves the delta, so an untouched cell stays untouched.
2279
2300
  */
2280
- private readChatDeltas;
2301
+ private readDeltas;
2281
2302
  private normalizeClientRows;
2282
2303
  appendRows(sourceId: DataSourceId, newRows: TRow[], rowIdMap?: Map<number, TRowId>): TRowId[];
2283
2304
  /**
@@ -2408,6 +2429,7 @@ declare class DataStore<TRow extends DataEditorRow = DataEditorRow> {
2408
2429
  private _revertInternal;
2409
2430
  private _buildRevertCommand;
2410
2431
  clearColumn(field: string): Promise<void>;
2432
+ private readonly clearedValue;
2411
2433
  clearColumns(fields: string[]): Promise<void>;
2412
2434
  purgeField(columnId: string, rowIds?: TRowId[]): void;
2413
2435
  deleteColumn(columnId: string): Promise<void>;