pivotkit-react 0.7.0 → 0.8.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +167 -1
  2. package/README.md +33 -15
  3. package/dist/chunks/{chunk-JMRTIOX4.js → chunk-2N2UGSIG.js} +7 -0
  4. package/dist/chunks/{chunk-ZK5RVCHP.js → chunk-BHHIZHUE.js} +1 -1
  5. package/dist/chunks/{chunk-YXLANLGL.js → chunk-GUSQWPTH.js} +56 -3
  6. package/dist/chunks/{chunk-E6M57YLL.js → chunk-MU5BTKSY.js} +7 -0
  7. package/dist/chunks/{chunk-TR2HROIK.js → chunk-RNQ32FCN.js} +66 -5
  8. package/dist/chunks/{chunk-XN5HNKJ2.js → chunk-SJCG4I57.js} +98 -33
  9. package/dist/chunks/{chunk-4WZ5F2TJ.js → chunk-VMJMDP7C.js} +371 -32
  10. package/dist/chunks/{unused-texts-Y4R67XSN.js → unused-texts-LRYVWFFN.js} +1 -1
  11. package/dist/chunks/{unused-texts-de-6YVPTNVS.js → unused-texts-de-GB3IWWEM.js} +1 -1
  12. package/dist/echarts.js +426 -35
  13. package/dist/import-ui.js +2 -2
  14. package/dist/index.js +723 -392
  15. package/dist/labels.js +6 -6
  16. package/dist/menu-texts-de.js +1 -1
  17. package/dist/menus.js +1534 -1020
  18. package/dist/styles.css +268 -158
  19. package/package.json +3 -3
  20. package/types/PivotReport.d.ts +6 -0
  21. package/types/add-menu.d.ts +48 -0
  22. package/types/chart-colors.d.ts +8 -0
  23. package/types/chart-decorate.d.ts +66 -3
  24. package/types/chart-legend.d.ts +176 -0
  25. package/types/chart-summary.d.ts +8 -3
  26. package/types/chart-tooltip.d.ts +159 -17
  27. package/types/chart.d.ts +21 -3
  28. package/types/date-context.d.ts +30 -0
  29. package/types/drill-panel.d.ts +4 -2
  30. package/types/echarts.d.ts +7 -3
  31. package/types/export-run.d.ts +7 -14
  32. package/types/export-scope.d.ts +13 -2
  33. package/types/field-info.d.ts +12 -0
  34. package/types/files.d.ts +14 -0
  35. package/types/filter.d.ts +18 -0
  36. package/types/group-context.d.ts +20 -0
  37. package/types/index.d.ts +35 -6
  38. package/types/label-room.d.ts +13 -0
  39. package/types/labels.d.ts +85 -16
  40. package/types/lazy-menus.d.ts +2 -2
  41. package/types/levels.d.ts +16 -7
  42. package/types/menu-labels.d.ts +67 -1
  43. package/types/menu-ops.d.ts +10 -0
  44. package/types/menu-topics.d.ts +110 -21
  45. package/types/menus.d.ts +2 -1
  46. package/types/names.d.ts +32 -3
  47. package/types/overflow.d.ts +18 -30
  48. package/types/rove.d.ts +10 -0
  49. package/types/toolbar-panels.d.ts +34 -10
  50. package/types/unused-texts.d.ts +7 -0
  51. package/types/use-big-result.d.ts +24 -9
  52. package/types/use-export.d.ts +2 -2
  53. package/types/view-ops.d.ts +19 -8
  54. package/types/view-tabs.d.ts +12 -0
  55. package/types/zones.d.ts +41 -9
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * @param {import("./export-run.js").ExportContext} context
3
- * @returns {{ run: (kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json" | "data-csv" | "data-json") => Promise<void>,
3
+ * @returns {{ run: (kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json" | "copy-chart" | "data-csv" | "data-json") => Promise<void>,
4
4
  * prepare: (what: "menu" | "print") => (() => void) | undefined }}
5
5
  * `prepare`: the Export menu's, when it opens ("menu"; it returns what ends the menu's print frame)
6
6
  * and when Print is pointed at or focused ("print"); one function for the report's lifetime
7
7
  */
8
8
  export declare function useExport(context: import("./export-run.js").ExportContext): {
9
- run: (kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json" | "data-csv" | "data-json") => Promise<void>;
9
+ run: (kind: "xlsx" | "csv" | "png" | "html" | "svg" | "print" | "copy-table" | "copy-json" | "copy-chart" | "data-csv" | "data-json") => Promise<void>;
10
10
  prepare: (what: "menu" | "print") => (() => void) | undefined;
11
11
  };
@@ -125,6 +125,14 @@ export declare function zoneOverLimit(view: any, limits: Partial<import("pivotki
125
125
  zone: "rows" | "cols" | "values";
126
126
  max: number;
127
127
  } | null;
128
+ /**
129
+ * The most entries a zone holds (pivotkit-core's `axisFields` for Rows and Columns, `values` for
130
+ * Values), by the host's limits over the defaults; null for Filters, which has no such limit.
131
+ * @param {string} zone
132
+ * @param {Partial<import("pivotkit-core").Limits> | undefined} limits
133
+ * @returns {number | null}
134
+ */
135
+ export declare function zoneMax(zone: string, limits: Partial<import("pivotkit-core").Limits> | undefined): number | null;
128
136
  /**
129
137
  * Places a field in a zone at an index (default the end). On an axis the field leaves the other axis
130
138
  * (a field is on one axis only); in Values it is added as a new value, so a field can be summed and
@@ -347,17 +355,20 @@ export declare function setDisplay(view: any, display: any): any;
347
355
  /** Switches to the chart with a picker entry's settings (chart-types.js); its display settings stay. */
348
356
  export declare function setChart(view: any, name: any): any;
349
357
  /**
350
- * Changes how the chart is drawn: { valueLabels, legend, title, smooth } (pivotkit-core's chart
358
+ * Changes how the chart is drawn: { valueLabels, legend, title, smooth, ... } (pivotkit-core's chart
351
359
  * settings); the chart type stays.
352
360
  * @param {any} view
353
- * @param {{ valueLabels?: string, legend?: string, title?: string | null, smooth?: boolean }} patch
361
+ * @param {Partial<import("pivotkit-core").View["chart"]>} patch
362
+ */
363
+ export declare function setChartDisplay(view: any, patch: Partial<import("pivotkit-core").View["chart"]>): any;
364
+ /**
365
+ * The chart's hidden legend entries (chart.hidden) after `name` is shown or hidden: a click on the
366
+ * legend, or a checkbox of the Display settings.
367
+ * @param {readonly string[] | undefined} hidden
368
+ * @param {string} name
369
+ * @param {boolean} shown
354
370
  */
355
- export declare function setChartDisplay(view: any, patch: {
356
- valueLabels?: string;
357
- legend?: string;
358
- title?: string | null;
359
- smooth?: boolean;
360
- }): any;
371
+ export declare function hiddenAfter(hidden: readonly string[] | undefined, name: string, shown: boolean): string[];
361
372
  /** Rows and Columns swapped (pivotkit-core's swapAxes): the chart's swap, the zones' Swap button. */
362
373
  export { swapAxes };
363
374
  /** True when nothing is placed: the UI shows its first steps. */
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ /**
3
+ * The id of a tab, from the id of the panel it controls.
4
+ * @param {string} panelId
5
+ * @param {"table" | "chart"} display
6
+ */
7
+ export declare const tabId: (panelId: string, display: "table" | "chart") => string;
8
+ /**
9
+ * @param {any} props see PivotReport for what each one does. `panelId`: the result's id (the tab
10
+ * panel); `narrow`: icons only; `big`: use-big-result.js's Enlarge and Full screen
11
+ */
12
+ export declare function ViewTabs(props: any): React.JSX.Element;
package/types/zones.d.ts CHANGED
@@ -10,34 +10,66 @@ export declare function zoneEntries(view: any, types: any, labels: any): {
10
10
  }[];
11
11
  cols: any;
12
12
  rows: any;
13
- values: any;
13
+ values: {
14
+ id: string;
15
+ field: any;
16
+ text: string;
17
+ type: any;
18
+ index: number;
19
+ }[];
14
20
  };
15
21
  /**
16
22
  * @param {{ view: any, types: Map<string, string>, labels: import("./labels.js").UiLabels,
17
- * commit: (view: object, note?: any) => void, earlier?: () => any[],
23
+ * commit: (view: object, note?: any) => boolean, earlier?: () => any[],
18
24
  * encoded: import("pivotkit-core").Encoded, locale: string, onSwap: () => void,
19
- * id: string, folded: boolean, onShow: () => void, defaultsOf?: (field: string) => import("./index.js").FieldDefaults | undefined,
20
- * infoOf?: (field: string) => import("./field-info.js").FieldInfo | undefined, explain?: boolean, showInfo?: boolean }} props
25
+ * id: string, folded: boolean, onFold: () => void, narrow?: boolean, defaultsOf?: (field: string) => import("./index.js").FieldDefaults | undefined,
26
+ * infoOf?: (field: string) => import("./field-info.js").FieldInfo | undefined, titleOf?: (field: string) => string | undefined,
27
+ * explain?: boolean, showInfo?: boolean,
28
+ * adding?: { fields: Array<{ name: string, type: string }>, placed: Map<string, string[]>, nameOf: (field: string) => string,
29
+ * info: Map<string, import("./field-info.js").FieldInfo>, placeName: (field: string, zone: string) => string,
30
+ * onAdd: (field: string, zone: string) => boolean, filterDraft: (field: string) => { field: string, base: object | undefined },
31
+ * fullText: (zone: string, count: number) => string | null } }} props
21
32
  * `explain`: an "i" next to each zone's title that says what the zone does; `showInfo` false: no "i"
22
33
  * of a field description on the chips (Options → Help)
23
- * `folded`: the compact layout's one line; `defaultsOf`: the host's settings for a source field (fieldDefaults);
34
+ * `folded`: the section folded to its heading row; `onFold`: fold or open it; `defaultsOf`: the host's settings for a source field (fieldDefaults);
24
35
  * `infoOf`: the host's description of a field (its source field's for a grouping); `earlier`: the
25
- * history's views before this one (a value's own colours for its Highlight)
36
+ * history's views before this one (a value's own colours for its Highlight); `titleOf`: a
37
+ * field's name with the years its date grouping combines, the chip's tooltip (the chip shows the
38
+ * plain name); `adding`: what "+ Add"
39
+ * needs (the fields, where each is placed, how a pick is placed); without it there is no "+ Add"
26
40
  */
27
- export declare function Zones({ view, types, labels, commit, earlier, encoded, locale, onSwap, id, folded, onShow, defaultsOf, infoOf, explain, showInfo }: {
41
+ export declare function Zones({ view, types, labels, commit, earlier, encoded, locale, onSwap, id, folded, onFold, defaultsOf, infoOf, titleOf, explain, showInfo, adding }: {
28
42
  view: any;
29
43
  types: Map<string, string>;
30
44
  labels: import("./labels.js").UiLabels;
31
- commit: (view: object, note?: any) => void;
45
+ commit: (view: object, note?: any) => boolean;
32
46
  earlier?: () => any[];
33
47
  encoded: import("pivotkit-core").Encoded;
34
48
  locale: string;
35
49
  onSwap: () => void;
36
50
  id: string;
37
51
  folded: boolean;
38
- onShow: () => void;
52
+ onFold: () => void;
53
+ narrow?: boolean;
39
54
  defaultsOf?: (field: string) => import("./index.js").FieldDefaults | undefined;
40
55
  infoOf?: (field: string) => import("./field-info.js").FieldInfo | undefined;
56
+ titleOf?: (field: string) => string | undefined;
41
57
  explain?: boolean;
42
58
  showInfo?: boolean;
59
+ adding?: {
60
+ fields: Array<{
61
+ name: string;
62
+ type: string;
63
+ }>;
64
+ placed: Map<string, string[]>;
65
+ nameOf: (field: string) => string;
66
+ info: Map<string, import("./field-info.js").FieldInfo>;
67
+ placeName: (field: string, zone: string) => string;
68
+ onAdd: (field: string, zone: string) => boolean;
69
+ filterDraft: (field: string) => {
70
+ field: string;
71
+ base: object | undefined;
72
+ };
73
+ fullText: (zone: string, count: number) => string | null;
74
+ };
43
75
  }): React.JSX.Element;