@univerjs-pro/sheets-chart-ui 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (100) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/cjs/locale/ar-SA.js +1 -1
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/de-DE.js +1 -1
  5. package/lib/cjs/locale/en-US.js +1 -1
  6. package/lib/cjs/locale/es-ES.js +1 -1
  7. package/lib/cjs/locale/fa-IR.js +1 -1
  8. package/lib/cjs/locale/fr-FR.js +1 -1
  9. package/lib/cjs/locale/id-ID.js +1 -1
  10. package/lib/cjs/locale/it-IT.js +1 -1
  11. package/lib/cjs/locale/ja-JP.js +1 -1
  12. package/lib/cjs/locale/ko-KR.js +1 -1
  13. package/lib/cjs/locale/pl-PL.js +1 -1
  14. package/lib/cjs/locale/pt-BR.js +1 -1
  15. package/lib/cjs/locale/ru-RU.js +1 -1
  16. package/lib/cjs/locale/sk-SK.js +1 -1
  17. package/lib/cjs/locale/vi-VN.js +1 -1
  18. package/lib/cjs/locale/zh-CN.js +1 -1
  19. package/lib/cjs/locale/zh-HK.js +1 -1
  20. package/lib/cjs/locale/zh-TW.js +1 -1
  21. package/lib/es/index.js +1 -1
  22. package/lib/es/locale/ar-SA.js +1 -1
  23. package/lib/es/locale/ca-ES.js +1 -1
  24. package/lib/es/locale/de-DE.js +1 -1
  25. package/lib/es/locale/en-US.js +1 -1
  26. package/lib/es/locale/es-ES.js +1 -1
  27. package/lib/es/locale/fa-IR.js +1 -1
  28. package/lib/es/locale/fr-FR.js +1 -1
  29. package/lib/es/locale/id-ID.js +1 -1
  30. package/lib/es/locale/it-IT.js +1 -1
  31. package/lib/es/locale/ja-JP.js +1 -1
  32. package/lib/es/locale/ko-KR.js +1 -1
  33. package/lib/es/locale/pl-PL.js +1 -1
  34. package/lib/es/locale/pt-BR.js +1 -1
  35. package/lib/es/locale/ru-RU.js +1 -1
  36. package/lib/es/locale/sk-SK.js +1 -1
  37. package/lib/es/locale/vi-VN.js +1 -1
  38. package/lib/es/locale/zh-CN.js +1 -1
  39. package/lib/es/locale/zh-HK.js +1 -1
  40. package/lib/es/locale/zh-TW.js +1 -1
  41. package/lib/index.css +37 -12
  42. package/lib/index.js +1 -1
  43. package/lib/locale/ar-SA.js +1 -1
  44. package/lib/locale/ca-ES.js +1 -1
  45. package/lib/locale/de-DE.js +1 -1
  46. package/lib/locale/en-US.js +1 -1
  47. package/lib/locale/es-ES.js +1 -1
  48. package/lib/locale/fa-IR.js +1 -1
  49. package/lib/locale/fr-FR.js +1 -1
  50. package/lib/locale/id-ID.js +1 -1
  51. package/lib/locale/it-IT.js +1 -1
  52. package/lib/locale/ja-JP.js +1 -1
  53. package/lib/locale/ko-KR.js +1 -1
  54. package/lib/locale/pl-PL.js +1 -1
  55. package/lib/locale/pt-BR.js +1 -1
  56. package/lib/locale/ru-RU.js +1 -1
  57. package/lib/locale/sk-SK.js +1 -1
  58. package/lib/locale/vi-VN.js +1 -1
  59. package/lib/locale/zh-CN.js +1 -1
  60. package/lib/locale/zh-HK.js +1 -1
  61. package/lib/locale/zh-TW.js +1 -1
  62. package/lib/types/commands/commands/focused-chart.command.d.ts +3 -1
  63. package/lib/types/config/config.d.ts +4 -0
  64. package/lib/types/controllers/ui.controller.d.ts +4 -2
  65. package/lib/types/locale/en-US.d.ts +53 -0
  66. package/lib/types/menu/chart-context-menu.d.ts +4 -4
  67. package/lib/types/services/chart-element-selection.d.ts +2 -0
  68. package/lib/types/services/sheet-chart-host.d.ts +2 -4
  69. package/lib/types/services/sheets-chart-host-provider.service.d.ts +2 -2
  70. package/lib/types/services/sheets-chart-ui.service.d.ts +15 -2
  71. package/lib/types/views/chart-edit-panel/Options.d.ts +0 -2
  72. package/lib/types/views/chart-edit-panel/button-switch/ButtonSwitch.d.ts +2 -2
  73. package/lib/types/views/chart-edit-panel/data-tab-panel/CandlestickDataEdit.d.ts +7 -0
  74. package/lib/types/views/chart-edit-panel/data-tab-panel/HistogramDataEdit.d.ts +1 -0
  75. package/lib/types/views/chart-edit-panel/data-tab-panel/TreemapDataEdit.d.ts +12 -0
  76. package/lib/types/views/chart-edit-panel/style-tab-panel/CandlestickStyleEdit.d.ts +3 -0
  77. package/lib/types/views/chart-edit-panel/style-tab-panel/DataLabelOptions.d.ts +3 -3
  78. package/lib/types/views/chart-edit-panel/style-tab-panel/HistogramStyleEdit.d.ts +1 -0
  79. package/lib/types/views/chart-edit-panel/style-tab-panel/TreemapStyleEdit.d.ts +6 -0
  80. package/lib/umd/index.js +1 -1
  81. package/lib/umd/locale/ar-SA.js +1 -1
  82. package/lib/umd/locale/ca-ES.js +1 -1
  83. package/lib/umd/locale/de-DE.js +1 -1
  84. package/lib/umd/locale/en-US.js +1 -1
  85. package/lib/umd/locale/es-ES.js +1 -1
  86. package/lib/umd/locale/fa-IR.js +1 -1
  87. package/lib/umd/locale/fr-FR.js +1 -1
  88. package/lib/umd/locale/id-ID.js +1 -1
  89. package/lib/umd/locale/it-IT.js +1 -1
  90. package/lib/umd/locale/ja-JP.js +1 -1
  91. package/lib/umd/locale/ko-KR.js +1 -1
  92. package/lib/umd/locale/pl-PL.js +1 -1
  93. package/lib/umd/locale/pt-BR.js +1 -1
  94. package/lib/umd/locale/ru-RU.js +1 -1
  95. package/lib/umd/locale/sk-SK.js +1 -1
  96. package/lib/umd/locale/vi-VN.js +1 -1
  97. package/lib/umd/locale/zh-CN.js +1 -1
  98. package/lib/umd/locale/zh-HK.js +1 -1
  99. package/lib/umd/locale/zh-TW.js +1 -1
  100. package/package.json +20 -20
@@ -1,4 +1,4 @@
1
- import type { AreaLineStyle, ChartModel, ChartStyle, DeepPartial, IAllSeriesStyle, IAxisOptions, IChartContext, IChartStyle, ILegendStyle, InvalidValueType, IPieLabelStyle, IRelationForceOptions, IRuntimeAxis, ITrendLine, LinePointShape, RadarShape, RelationChartLayoutEnum, RightYAxisOptions, TitlePositionEnum, WaterfallStackTypeEnum, WordCloudShapeEnum } from '@univerjs-pro/engine-chart';
1
+ import type { AreaLineStyle, ChartModel, ChartPendingConfig, ChartStyle, DeepPartial, IAllSeriesStyle, IAxisOptions, IChartCandlestickMappingSpec, IChartCandlestickSpec, IChartConfigOperation, IChartContext, IChartHistogramDataSpec, IChartHistogramStyleSpec, IChartStyle, IChartTreemapSpec, ILegendStyle, InvalidValueType, IPieLabelStyle, IRelationForceOptions, IRuntimeAxis, ITrendLine, IUniverDataSet, LinePointShape, RadarShape, RelationChartLayoutEnum, RightYAxisOptions, TitlePositionEnum, WaterfallStackTypeEnum, WordCloudShapeEnum } from '@univerjs-pro/engine-chart';
2
2
  import type { IChartSourceMultiRangeItem, IChartUpdateConfigCommandParams, IChartUpdateSourceCommandParams, ISheetChartSourceSingleRange, SheetChartModel } from '@univerjs-pro/sheets-chart';
3
3
  import type { Nullable } from '@univerjs/core';
4
4
  import type { Observable } from 'rxjs';
@@ -12,8 +12,10 @@ export interface IChartOptionType {
12
12
  label: string;
13
13
  value: string;
14
14
  }
15
+ export declare function getChartDataResourceOptions(dataSet: IUniverDataSet, headers: string[] | undefined, getFallback: (index: number) => string): IChartOptionType[];
15
16
  export interface IChartConfigStateMap {
16
17
  headers: IChartConfigState<IChartContext['headers']>;
18
+ dataResourceList: IChartConfigState<IChartOptionType[]>;
17
19
  orient: IChartConfigState<Nullable<DataOrientation>>;
18
20
  aggregate: IChartConfigState<boolean>;
19
21
  gradientFill: IChartConfigState<Nullable<boolean>>;
@@ -23,6 +25,13 @@ export interface IChartConfigStateMap {
23
25
  /** Series & Category */
24
26
  categoryIndex: IChartConfigState<Nullable<number>>;
25
27
  categoryType: IChartConfigState<Nullable<CategoryType>>;
28
+ candlestickMapping: IChartConfigState<IChartCandlestickMappingSpec | undefined, IChartCandlestickMappingSpec>;
29
+ candlestickStyle: IChartConfigState<IChartCandlestickSpec | undefined, Exclude<ChartPendingConfig['candlestick'], null | undefined>>;
30
+ histogramData: IChartConfigState<IChartHistogramDataSpec | undefined, IChartHistogramDataSpec | undefined>;
31
+ histogramStyle: IChartConfigState<IChartHistogramStyleSpec | undefined, IChartHistogramStyleSpec | undefined>;
32
+ treemapHierarchyIndexes: IChartConfigState<number[]>;
33
+ treemapValueIndex: IChartConfigState<number | undefined, number | undefined>;
34
+ treemapStyle: IChartConfigState<IChartTreemapSpec | undefined, IChartTreemapSpec | undefined>;
26
35
  categoryList: IChartConfigState<IChartOptionType[]>;
27
36
  bubbleCategoryList: IChartConfigState<IChartOptionType[]>;
28
37
  seriesValues: IChartConfigState<number[]>;
@@ -87,7 +96,9 @@ export interface IChartConfigStateMap {
87
96
  }
88
97
  export type ChartConfigStateKey = keyof IChartConfigStateMap;
89
98
  export type ChartConfigStateValue = InferChartConfigStateValue<ChartConfigStateKey>;
90
- export type InferChartConfigStateValue<T extends ChartConfigStateKey, M = IChartConfigStateMap[T]> = M extends IChartConfigState<infer V> ? V : never;
99
+ export type InferChartConfigStateValue<T extends ChartConfigStateKey, M = IChartConfigStateMap[T]> = M extends {
100
+ get(): Observable<infer V> | undefined;
101
+ } ? V : M extends Observable<infer V> ? V : never;
91
102
  export type IChartConfigState<GetValue, SetValue = GetValue> = {
92
103
  set?(value: SetValue): void;
93
104
  get(): Observable<GetValue> | undefined;
@@ -110,6 +121,7 @@ export interface ISheetsChartUIService {
110
121
  getDataSource(id: string): ReturnType<SheetsChartService['getChartDataSource']>;
111
122
  registerViewState<T extends ChartConfigStateKey = ChartConfigStateKey>(id: T, state: (chartModel: ChartModel) => IChartConfigStateMap[T]): void;
112
123
  getViewState<V extends ChartConfigStateValue = ChartConfigStateValue>(id: ChartConfigStateKey, activeChartModel?: Nullable<SheetChartModel>): IChartConfigState<V> | undefined;
124
+ applyChartConfigOperation(operation: IChartConfigOperation): void;
113
125
  executeChartUpdateConfig(params: Omit<IChartUpdateConfigCommandParams, 'unitId'>): void;
114
126
  executeChartUpdateSourceConfig(params: Omit<IChartUpdateSourceCommandParams, 'unitId'>): void;
115
127
  removeViewState(id: ChartConfigStateKey): void;
@@ -147,6 +159,7 @@ export declare class SheetsChartUIService extends Disposable implements ISheetsC
147
159
  getDataSource(id: string): import("@univerjs-pro/sheets-chart").ISheetChartDataSource | undefined;
148
160
  registerViewState<T extends ChartConfigStateKey = ChartConfigStateKey>(id: T, state: (chartModel: ChartModel) => IChartConfigStateMap[T]): void;
149
161
  getViewState<V extends ChartConfigStateValue = ChartConfigStateValue>(id: ChartConfigStateKey, activeChartModel?: Nullable<SheetChartModel>): IChartConfigState<V> | undefined;
162
+ applyChartConfigOperation(operation: IChartConfigOperation): void;
150
163
  executeChartUpdateConfig(params: Omit<IChartUpdateConfigCommandParams, 'unitId'>): void;
151
164
  executeChartUpdateSourceConfig(params: Omit<IChartUpdateSourceCommandParams, 'unitId'>): void;
152
165
  removeViewState(id: ChartConfigStateKey): void;
@@ -1,8 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { LocaleKey } from '../../locale/types';
3
- import type { IChartOptionType } from '../../services/sheets-chart-ui.service';
4
3
  import { AreaLineStyle, AxisAlignEnum, ChartBorderDashType, ChartTrendlineType, InvalidValueType, LabelContentType, LegendPositionEnum, LinePointShape, PieLabelPosition, RadarShape, SelectModeEnum, SeriesLabelPosition, TextAlign, TextVerticalAlign, TitlePositionEnum, WaterfallStackTypeEnum } from '@univerjs-pro/engine-chart';
5
- export type OptionType = IChartOptionType;
6
4
  export interface ILocaleOption<T = string> {
7
5
  label: LocaleKey;
8
6
  value: T;
@@ -1,7 +1,7 @@
1
- import type { OptionType } from '../Options';
1
+ import type { IChartOptionType } from '../../../services/sheets-chart-ui.service';
2
2
  export interface IButtonSwitchProps {
3
3
  className?: string;
4
- options: OptionType[];
4
+ options: IChartOptionType[];
5
5
  value?: string;
6
6
  onChange?: (value: string) => void;
7
7
  }
@@ -0,0 +1,7 @@
1
+ import type { IChartCandlestickMappingSpec } from '@univerjs-pro/engine-chart';
2
+ type CandlestickDraft = Partial<IChartCandlestickMappingSpec> & {
3
+ categoryIndex?: number;
4
+ };
5
+ export declare function isCompleteCandlestickDraft(draft: CandlestickDraft): draft is Required<CandlestickDraft>;
6
+ export declare const CandlestickDataEdit: () => import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare const HistogramDataEdit: () => import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ interface ITreemapFieldOption {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ export declare function getTreemapFieldChoices(fields: ITreemapFieldOption[], hierarchy: number[], valueIndex: number | undefined): {
6
+ hierarchyChoices: ITreemapFieldOption[];
7
+ valueChoices: ITreemapFieldOption[];
8
+ };
9
+ export declare function reorderTreemapHierarchy(hierarchy: number[], index: number, offset: number): number[];
10
+ export declare function removeTreemapHierarchy(hierarchy: number[], index: number): number[];
11
+ export declare const TreemapDataEdit: () => import("react").JSX.Element;
12
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function toCanonicalCandlestickOpacity(percent: number): number;
2
+ export declare function toCanonicalCandleWidth(value: string): number | null;
3
+ export declare const CandlestickStyleEdit: () => import("react").JSX.Element;
@@ -1,14 +1,14 @@
1
1
  import type { PropertyChangeFunction } from '@univerjs-pro/chart-ui';
2
2
  import type { ChartTypeBits, IPieLabelStyle, ISeriesLabelStyle } from '@univerjs-pro/engine-chart';
3
3
  import type { Nullable } from '@univerjs/core';
4
- import type { OptionType } from '../Options';
4
+ import type { IChartOptionType } from '../../../services/sheets-chart-ui.service';
5
5
  type UnionLabelStyle = ISeriesLabelStyle | IPieLabelStyle;
6
6
  export interface IDataLabelOptionsProps {
7
7
  chartType: Nullable<ChartTypeBits>;
8
8
  fallbackLabelStyle?: Partial<UnionLabelStyle>;
9
9
  labelStyle: Partial<UnionLabelStyle>;
10
- contentTypeOptions?: OptionType[];
11
- positionOptions?: OptionType[];
10
+ contentTypeOptions?: IChartOptionType[];
11
+ positionOptions?: IChartOptionType[];
12
12
  onVisibleChange?: (visible: boolean) => void;
13
13
  onPadAngleChange?: (padAngle: boolean) => void;
14
14
  onLabelStyleChange?: PropertyChangeFunction<UnionLabelStyle>;
@@ -0,0 +1 @@
1
+ export declare const HistogramStyleEdit: () => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { IChartTreemapSpec } from '@univerjs-pro/engine-chart';
2
+ import { LabelContentType } from '@univerjs-pro/engine-chart';
3
+ export declare function resolveEffectiveTreemapStyle(style: IChartTreemapSpec | undefined): Required<Pick<IChartTreemapSpec, 'parentLabelLayout' | 'label'>>;
4
+ export declare function getTreemapLabelContentValues(contentType: LabelContentType | undefined): string[];
5
+ export declare function mergeTreemapLabelContentTypes(values: string[]): LabelContentType | undefined;
6
+ export declare const TreemapStyleEdit: () => import("react").JSX.Element;