@kanunilabs/pivotgrid 1.0.2 → 1.2.0

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
@@ -1,5 +1,5 @@
1
- import { PivotField, PivotCell, PivotEngineResult, PivotLayoutState, PivotTheme, PivotLocale, PivotDictionary, PivotStateStoringConfig, PivotToolbarConfig, PivotControllerOptions, PivotController } from '@kanunilabs/pivotgrid-core';
2
- export { ExportFormat, ExportOptions, FilterCondition, FilterGroup, FilterOperator, PivotArea, PivotController, PivotControllerOptions, PivotControllerState, PivotDictionary, PivotEngineResult, PivotField, PivotGroupInterval, PivotLayoutState, PivotLocale, PivotPrefilter, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, defaultPivotLayout, getAdvancedExporter, registerAdvancedExporter } from '@kanunilabs/pivotgrid-core';
1
+ import { PivotField, PivotCell, PivotEngineResult, PivotControllerOptions, PivotLayoutState, PivotTheme, PivotColumnWidthDefaults, PivotLocale, PivotDictionary, PivotStateStoringConfig, PivotToolbarConfig, PivotController, PivotRowTransaction, PivotTransactionResult } from '@kanunilabs/pivotgrid-core';
2
+ export { ExportFormat, ExportOptions, FilterCondition, FilterGroup, FilterOperator, PivotArea, PivotController, PivotControllerOptions, PivotControllerState, PivotDictionary, PivotEngineResult, PivotField, PivotGroupInterval, PivotLayoutState, PivotLocale, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, defaultPivotLayout, getAdvancedExporter, registerAdvancedExporter } from '@kanunilabs/pivotgrid-core';
3
3
 
4
4
  /**
5
5
  * A themed portal host: carries the grid root's classes, inline theme vars,
@@ -58,7 +58,6 @@ interface VanillaCellClickEvent {
58
58
  records?: unknown[];
59
59
  }
60
60
 
61
- /** …and the width React's grip starts its drag from. Ported quirk, see below. */
62
61
  /** The vanilla cell-prepared contract: text is a string or a Node, never JSX. */
63
62
  interface VanillaCellConfig {
64
63
  text: string | Node | null;
@@ -79,6 +78,18 @@ interface ChartSeriesDef {
79
78
  name: string;
80
79
  color: string;
81
80
  yAxisId?: string;
81
+ /**
82
+ * The data field this series measures — so a chart can print its values
83
+ * with that field's own `format`. Set by the built-in transformers.
84
+ */
85
+ fieldId?: string;
86
+ /**
87
+ * The column path this series belongs to ('' for a pivot without column
88
+ * fields) and its label. Series of the same group are the same column cut
89
+ * of different measures — what an X-Y chart pairs as x, y and size.
90
+ */
91
+ seriesKey?: string;
92
+ seriesLabel?: string;
82
93
  }
83
94
  interface ChartSyncResult {
84
95
  chartData: unknown[];
@@ -156,6 +167,8 @@ declare function resolveI18n(locale?: PivotLocale, dictionary?: Partial<PivotDic
156
167
  interface PivotGridVanillaConfig<TRow = unknown> {
157
168
  gridId?: string;
158
169
  data: TRow[];
170
+ /** What identifies a row for `applyTransaction` — a field name or a function. */
171
+ rowKey?: PivotControllerOptions<TRow>['rowKey'];
159
172
  initialFields?: PivotField<TRow>[];
160
173
  /** Controlled fields — same semantics as the React `fields` prop. */
161
174
  fields?: PivotField<TRow>[];
@@ -163,6 +176,13 @@ interface PivotGridVanillaConfig<TRow = unknown> {
163
176
  layout?: PivotLayoutState;
164
177
  theme?: PivotTheme;
165
178
  striped?: boolean;
179
+ /**
180
+ * Starting widths in pixels: `{ rowHeader, data }` for every row-header
181
+ * column and every data column. Defaults 150 and 95. A width the user drags
182
+ * (or `controller.setColumnWidths` writes) still wins; see
183
+ * `PivotControllerState.columnWidths` for its keys.
184
+ */
185
+ defaultColumnWidths?: PivotColumnWidthDefaults;
166
186
  locale?: PivotLocale;
167
187
  rtl?: boolean;
168
188
  dictionary?: Partial<PivotDictionary>;
@@ -171,6 +191,8 @@ interface PivotGridVanillaConfig<TRow = unknown> {
171
191
  workerUrl?: string | URL;
172
192
  previewImport?: boolean;
173
193
  registry?: PivotControllerOptions<TRow>['registry'];
194
+ /** Server-side pivot (Enterprise): the server aggregates; `data` is not read. */
195
+ serverSource?: PivotControllerOptions<TRow>['serverSource'];
174
196
  keyboardNavigation?: {
175
197
  enabled: boolean;
176
198
  };
@@ -228,7 +250,13 @@ interface PivotGridApi<TRow = unknown> {
228
250
  controller: PivotController<TRow>;
229
251
  element: HTMLElement;
230
252
  destroy(): void;
253
+ /** Replace every row (a full rebuild). */
231
254
  setData(data: TRow[]): void;
255
+ /**
256
+ * Add, update and remove rows without rebuilding (live updates) — see
257
+ * `PivotController.applyTransaction`. Rows are matched by the `rowKey` option.
258
+ */
259
+ applyTransaction(transaction: PivotRowTransaction<TRow>): PivotTransactionResult;
232
260
  setFields(fields: PivotField<TRow>[]): void;
233
261
  setLocale(locale: PivotLocale, dictionary?: Partial<PivotDictionary>, rtl?: boolean): void;
234
262
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { PivotField, PivotCell, PivotEngineResult, PivotLayoutState, PivotTheme, PivotLocale, PivotDictionary, PivotStateStoringConfig, PivotToolbarConfig, PivotControllerOptions, PivotController } from '@kanunilabs/pivotgrid-core';
2
- export { ExportFormat, ExportOptions, FilterCondition, FilterGroup, FilterOperator, PivotArea, PivotController, PivotControllerOptions, PivotControllerState, PivotDictionary, PivotEngineResult, PivotField, PivotGroupInterval, PivotLayoutState, PivotLocale, PivotPrefilter, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, defaultPivotLayout, getAdvancedExporter, registerAdvancedExporter } from '@kanunilabs/pivotgrid-core';
1
+ import { PivotField, PivotCell, PivotEngineResult, PivotControllerOptions, PivotLayoutState, PivotTheme, PivotColumnWidthDefaults, PivotLocale, PivotDictionary, PivotStateStoringConfig, PivotToolbarConfig, PivotController, PivotRowTransaction, PivotTransactionResult } from '@kanunilabs/pivotgrid-core';
2
+ export { ExportFormat, ExportOptions, FilterCondition, FilterGroup, FilterOperator, PivotArea, PivotController, PivotControllerOptions, PivotControllerState, PivotDictionary, PivotEngineResult, PivotField, PivotGroupInterval, PivotLayoutState, PivotLocale, PivotPrefilter, PivotRowKey, PivotRowKeyResolver, PivotRowTransaction, PivotStateStoringConfig, PivotSummaryDisplayMode, PivotSummaryType, PivotTheme, PivotToolbarConfig, PivotTransactionResult, defaultPivotLayout, getAdvancedExporter, registerAdvancedExporter } from '@kanunilabs/pivotgrid-core';
3
3
 
4
4
  /**
5
5
  * A themed portal host: carries the grid root's classes, inline theme vars,
@@ -58,7 +58,6 @@ interface VanillaCellClickEvent {
58
58
  records?: unknown[];
59
59
  }
60
60
 
61
- /** …and the width React's grip starts its drag from. Ported quirk, see below. */
62
61
  /** The vanilla cell-prepared contract: text is a string or a Node, never JSX. */
63
62
  interface VanillaCellConfig {
64
63
  text: string | Node | null;
@@ -79,6 +78,18 @@ interface ChartSeriesDef {
79
78
  name: string;
80
79
  color: string;
81
80
  yAxisId?: string;
81
+ /**
82
+ * The data field this series measures — so a chart can print its values
83
+ * with that field's own `format`. Set by the built-in transformers.
84
+ */
85
+ fieldId?: string;
86
+ /**
87
+ * The column path this series belongs to ('' for a pivot without column
88
+ * fields) and its label. Series of the same group are the same column cut
89
+ * of different measures — what an X-Y chart pairs as x, y and size.
90
+ */
91
+ seriesKey?: string;
92
+ seriesLabel?: string;
82
93
  }
83
94
  interface ChartSyncResult {
84
95
  chartData: unknown[];
@@ -156,6 +167,8 @@ declare function resolveI18n(locale?: PivotLocale, dictionary?: Partial<PivotDic
156
167
  interface PivotGridVanillaConfig<TRow = unknown> {
157
168
  gridId?: string;
158
169
  data: TRow[];
170
+ /** What identifies a row for `applyTransaction` — a field name or a function. */
171
+ rowKey?: PivotControllerOptions<TRow>['rowKey'];
159
172
  initialFields?: PivotField<TRow>[];
160
173
  /** Controlled fields — same semantics as the React `fields` prop. */
161
174
  fields?: PivotField<TRow>[];
@@ -163,6 +176,13 @@ interface PivotGridVanillaConfig<TRow = unknown> {
163
176
  layout?: PivotLayoutState;
164
177
  theme?: PivotTheme;
165
178
  striped?: boolean;
179
+ /**
180
+ * Starting widths in pixels: `{ rowHeader, data }` for every row-header
181
+ * column and every data column. Defaults 150 and 95. A width the user drags
182
+ * (or `controller.setColumnWidths` writes) still wins; see
183
+ * `PivotControllerState.columnWidths` for its keys.
184
+ */
185
+ defaultColumnWidths?: PivotColumnWidthDefaults;
166
186
  locale?: PivotLocale;
167
187
  rtl?: boolean;
168
188
  dictionary?: Partial<PivotDictionary>;
@@ -171,6 +191,8 @@ interface PivotGridVanillaConfig<TRow = unknown> {
171
191
  workerUrl?: string | URL;
172
192
  previewImport?: boolean;
173
193
  registry?: PivotControllerOptions<TRow>['registry'];
194
+ /** Server-side pivot (Enterprise): the server aggregates; `data` is not read. */
195
+ serverSource?: PivotControllerOptions<TRow>['serverSource'];
174
196
  keyboardNavigation?: {
175
197
  enabled: boolean;
176
198
  };
@@ -228,7 +250,13 @@ interface PivotGridApi<TRow = unknown> {
228
250
  controller: PivotController<TRow>;
229
251
  element: HTMLElement;
230
252
  destroy(): void;
253
+ /** Replace every row (a full rebuild). */
231
254
  setData(data: TRow[]): void;
255
+ /**
256
+ * Add, update and remove rows without rebuilding (live updates) — see
257
+ * `PivotController.applyTransaction`. Rows are matched by the `rowKey` option.
258
+ */
259
+ applyTransaction(transaction: PivotRowTransaction<TRow>): PivotTransactionResult;
232
260
  setFields(fields: PivotField<TRow>[]): void;
233
261
  setLocale(locale: PivotLocale, dictionary?: Partial<PivotDictionary>, rtl?: boolean): void;
234
262
  }