@kanunilabs/pivotgrid 1.6.1 → 1.6.3

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/dist/index.d.cts CHANGED
@@ -171,6 +171,11 @@ interface PivotGridVanillaConfig<TRow = unknown> {
171
171
  rowKey?: PivotControllerOptions<TRow>['rowKey'];
172
172
  /** How long `applyTransactionAsync` collects transactions before applying them together. Default 50 ms. */
173
173
  asyncTransactionWait?: number;
174
+ /**
175
+ * The rows are still being fetched: while true, a grid with no result shows
176
+ * its loader instead of the "no data" text. Change it with `grid.setLoading`.
177
+ */
178
+ loading?: boolean;
174
179
  initialFields?: PivotField<TRow>[];
175
180
  /** Controlled fields — same semantics as the React `fields` prop. */
176
181
  fields?: PivotField<TRow>[];
@@ -189,7 +194,7 @@ interface PivotGridVanillaConfig<TRow = unknown> {
189
194
  striped?: boolean;
190
195
  /**
191
196
  * Row rhythm: `'compact'` (24px rows, one size smaller type), `'normal'`
192
- * (28px, the default) or `'comfortable'` (36px). Change it later with
197
+ * (28px, the default), `'comfortable'` (36px) or `'touch'` (45px rows and headers, every target 44px, for a touch screen). Change it later with
193
198
  * `setDensity`.
194
199
  */
195
200
  density?: PivotDensity;
@@ -206,7 +211,6 @@ interface PivotGridVanillaConfig<TRow = unknown> {
206
211
  stateStoring?: PivotStateStoringConfig;
207
212
  toolbar?: PivotToolbarConfig;
208
213
  workerUrl?: string | URL;
209
- previewImport?: boolean;
210
214
  registry?: PivotControllerOptions<TRow>['registry'];
211
215
  /** Server-side pivot (Enterprise): the server aggregates; `data` is not read. */
212
216
  serverSource?: PivotControllerOptions<TRow>['serverSource'];
@@ -262,13 +266,24 @@ interface PivotGridVanillaConfig<TRow = unknown> {
262
266
  */
263
267
  customContextMenuItems?: (field: PivotField<TRow>) => VanillaContextMenuItem[] | undefined;
264
268
  onRefresh?: () => void;
265
- onImportData?: (data: TRow[]) => void;
266
269
  onFieldsChange?: (fields: PivotField<TRow>[]) => void;
267
270
  onLayoutChange?: (layout: PivotLayoutState) => void;
268
271
  onFieldMove?: PivotControllerOptions<TRow>['onFieldMove'];
272
+ /** How long (ms) a finger holds still on a field chip before it drags (B.35). Moving sooner scrolls. Default 200. */
273
+ touchDragDelay?: number;
269
274
  onBeforePivotCalculate?: () => void;
270
275
  onAfterPivotCalculate?: PivotControllerOptions<TRow>['onAfterPivotCalculate'];
271
276
  onExporting?: PivotControllerOptions<TRow>['onExporting'];
277
+ /** Before a styled Excel export gives way to the plain .xls one; `false` cancels (B.23). */
278
+ onLargeExport?: PivotControllerOptions<TRow>['onLargeExport'];
279
+ /**
280
+ * The pivot started (`true`) or finished (`false`) computing a change;
281
+ * `exportData` waits for `false` (B.31).
282
+ * The export waits without a time limit, a slow `serverSource.compute`
283
+ * included. Print and clipboard run after the wait, so a browser may refuse
284
+ * them once the click that asked for them has expired.
285
+ */
286
+ onComputingChange?: (computing: boolean) => void;
272
287
  onError?: (error: Error) => void;
273
288
  onChartStateLoaded?: PivotControllerOptions<TRow>['onChartStateLoaded'];
274
289
  }
@@ -293,10 +308,32 @@ interface PivotGridApi<TRow = unknown> {
293
308
  applyTransactionAsync(transaction: PivotRowTransaction<TRow>, callback?: () => void): void;
294
309
  /** Apply the queued transactions now. */
295
310
  flushAsyncTransactions(): void;
311
+ /**
312
+ * Say whether the rows are still being fetched: while true, a grid with no
313
+ * result shows its loader, not the "no data" text. See `PivotController.setLoading`.
314
+ */
315
+ setLoading(loading: boolean): void;
316
+ /**
317
+ * Take back the last layout change — areas, order, shown or hidden,
318
+ * caption, group; not filters (B.43). False when there is none. No
319
+ * shortcut is bound: the app provides it. See `PivotController.undoLayout`.
320
+ */
321
+ undoLayout(): boolean;
322
+ /** Put back the last change `undoLayout` took back. */
323
+ redoLayout(): boolean;
324
+ canUndoLayout(): boolean;
325
+ canRedoLayout(): boolean;
326
+ /** Forget every undo and redo step. */
327
+ clearLayoutHistory(): void;
296
328
  setFields(fields: PivotField<TRow>[]): void;
297
329
  setLocale(locale: PivotLocale, dictionary?: Partial<PivotDictionary>, rtl?: boolean): void;
298
330
  /** Switch the row rhythm (`compact` / `normal` / `comfortable`) and repaint. */
299
331
  setDensity(density: PivotDensity | undefined): void;
332
+ /** Open or close the field chooser from the app (B.28). */
333
+ openFieldChooser(): void;
334
+ closeFieldChooser(): void;
335
+ /** Every field's filter off in one change; the prefilter stays (B.28). */
336
+ clearAllFilters(): void;
300
337
  /** Quick search over the row members; `''` clears it. See `PivotController.setSearchText`. */
301
338
  setSearchText(text: string): void;
302
339
  }
package/dist/index.d.ts CHANGED
@@ -171,6 +171,11 @@ interface PivotGridVanillaConfig<TRow = unknown> {
171
171
  rowKey?: PivotControllerOptions<TRow>['rowKey'];
172
172
  /** How long `applyTransactionAsync` collects transactions before applying them together. Default 50 ms. */
173
173
  asyncTransactionWait?: number;
174
+ /**
175
+ * The rows are still being fetched: while true, a grid with no result shows
176
+ * its loader instead of the "no data" text. Change it with `grid.setLoading`.
177
+ */
178
+ loading?: boolean;
174
179
  initialFields?: PivotField<TRow>[];
175
180
  /** Controlled fields — same semantics as the React `fields` prop. */
176
181
  fields?: PivotField<TRow>[];
@@ -189,7 +194,7 @@ interface PivotGridVanillaConfig<TRow = unknown> {
189
194
  striped?: boolean;
190
195
  /**
191
196
  * Row rhythm: `'compact'` (24px rows, one size smaller type), `'normal'`
192
- * (28px, the default) or `'comfortable'` (36px). Change it later with
197
+ * (28px, the default), `'comfortable'` (36px) or `'touch'` (45px rows and headers, every target 44px, for a touch screen). Change it later with
193
198
  * `setDensity`.
194
199
  */
195
200
  density?: PivotDensity;
@@ -206,7 +211,6 @@ interface PivotGridVanillaConfig<TRow = unknown> {
206
211
  stateStoring?: PivotStateStoringConfig;
207
212
  toolbar?: PivotToolbarConfig;
208
213
  workerUrl?: string | URL;
209
- previewImport?: boolean;
210
214
  registry?: PivotControllerOptions<TRow>['registry'];
211
215
  /** Server-side pivot (Enterprise): the server aggregates; `data` is not read. */
212
216
  serverSource?: PivotControllerOptions<TRow>['serverSource'];
@@ -262,13 +266,24 @@ interface PivotGridVanillaConfig<TRow = unknown> {
262
266
  */
263
267
  customContextMenuItems?: (field: PivotField<TRow>) => VanillaContextMenuItem[] | undefined;
264
268
  onRefresh?: () => void;
265
- onImportData?: (data: TRow[]) => void;
266
269
  onFieldsChange?: (fields: PivotField<TRow>[]) => void;
267
270
  onLayoutChange?: (layout: PivotLayoutState) => void;
268
271
  onFieldMove?: PivotControllerOptions<TRow>['onFieldMove'];
272
+ /** How long (ms) a finger holds still on a field chip before it drags (B.35). Moving sooner scrolls. Default 200. */
273
+ touchDragDelay?: number;
269
274
  onBeforePivotCalculate?: () => void;
270
275
  onAfterPivotCalculate?: PivotControllerOptions<TRow>['onAfterPivotCalculate'];
271
276
  onExporting?: PivotControllerOptions<TRow>['onExporting'];
277
+ /** Before a styled Excel export gives way to the plain .xls one; `false` cancels (B.23). */
278
+ onLargeExport?: PivotControllerOptions<TRow>['onLargeExport'];
279
+ /**
280
+ * The pivot started (`true`) or finished (`false`) computing a change;
281
+ * `exportData` waits for `false` (B.31).
282
+ * The export waits without a time limit, a slow `serverSource.compute`
283
+ * included. Print and clipboard run after the wait, so a browser may refuse
284
+ * them once the click that asked for them has expired.
285
+ */
286
+ onComputingChange?: (computing: boolean) => void;
272
287
  onError?: (error: Error) => void;
273
288
  onChartStateLoaded?: PivotControllerOptions<TRow>['onChartStateLoaded'];
274
289
  }
@@ -293,10 +308,32 @@ interface PivotGridApi<TRow = unknown> {
293
308
  applyTransactionAsync(transaction: PivotRowTransaction<TRow>, callback?: () => void): void;
294
309
  /** Apply the queued transactions now. */
295
310
  flushAsyncTransactions(): void;
311
+ /**
312
+ * Say whether the rows are still being fetched: while true, a grid with no
313
+ * result shows its loader, not the "no data" text. See `PivotController.setLoading`.
314
+ */
315
+ setLoading(loading: boolean): void;
316
+ /**
317
+ * Take back the last layout change — areas, order, shown or hidden,
318
+ * caption, group; not filters (B.43). False when there is none. No
319
+ * shortcut is bound: the app provides it. See `PivotController.undoLayout`.
320
+ */
321
+ undoLayout(): boolean;
322
+ /** Put back the last change `undoLayout` took back. */
323
+ redoLayout(): boolean;
324
+ canUndoLayout(): boolean;
325
+ canRedoLayout(): boolean;
326
+ /** Forget every undo and redo step. */
327
+ clearLayoutHistory(): void;
296
328
  setFields(fields: PivotField<TRow>[]): void;
297
329
  setLocale(locale: PivotLocale, dictionary?: Partial<PivotDictionary>, rtl?: boolean): void;
298
330
  /** Switch the row rhythm (`compact` / `normal` / `comfortable`) and repaint. */
299
331
  setDensity(density: PivotDensity | undefined): void;
332
+ /** Open or close the field chooser from the app (B.28). */
333
+ openFieldChooser(): void;
334
+ closeFieldChooser(): void;
335
+ /** Every field's filter off in one change; the prefilter stays (B.28). */
336
+ clearAllFilters(): void;
300
337
  /** Quick search over the row members; `''` clears it. See `PivotController.setSearchText`. */
301
338
  setSearchText(text: string): void;
302
339
  }