@univerjs-pro/slides-chart-ui 1.0.0-alpha.7 → 1.0.0-beta.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 (103) 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 +10 -209
  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/operations/chart-panel.operation.d.ts +1 -1
  63. package/lib/types/common/slide-chart-frame-style.d.ts +3 -3
  64. package/lib/types/components/SlideChartDataEditor.d.ts +3 -3
  65. package/lib/types/components/SlideChartEditPanel.d.ts +51 -14
  66. package/lib/types/controllers/slide-chart-element-float-menu.controller.d.ts +5 -3
  67. package/lib/types/index.d.ts +2 -6
  68. package/lib/types/locale/en-US.d.ts +111 -79
  69. package/lib/types/menu/contextmenu.menu.d.ts +1 -2
  70. package/lib/types/services/slide-chart-data-edit.service.d.ts +3 -3
  71. package/lib/types/services/slide-chart-edit-session.service.d.ts +1 -1
  72. package/lib/types/services/slide-chart-host-provider.service.d.ts +20 -4
  73. package/lib/types/services/slide-chart-host.d.ts +4 -13
  74. package/lib/types/services/slide-chart-insert.service.d.ts +3 -3
  75. package/lib/types/services/slide-chart-render.service.d.ts +4 -8
  76. package/lib/types/services/slide-chart-ui.service.d.ts +20 -97
  77. package/lib/types/views/render/chart-adaptor.d.ts +3 -2
  78. package/lib/umd/index.js +1 -1
  79. package/lib/umd/locale/ar-SA.js +1 -1
  80. package/lib/umd/locale/ca-ES.js +1 -1
  81. package/lib/umd/locale/de-DE.js +1 -1
  82. package/lib/umd/locale/en-US.js +1 -1
  83. package/lib/umd/locale/es-ES.js +1 -1
  84. package/lib/umd/locale/fa-IR.js +1 -1
  85. package/lib/umd/locale/fr-FR.js +1 -1
  86. package/lib/umd/locale/id-ID.js +1 -1
  87. package/lib/umd/locale/it-IT.js +1 -1
  88. package/lib/umd/locale/ja-JP.js +1 -1
  89. package/lib/umd/locale/ko-KR.js +1 -1
  90. package/lib/umd/locale/pl-PL.js +1 -1
  91. package/lib/umd/locale/pt-BR.js +1 -1
  92. package/lib/umd/locale/ru-RU.js +1 -1
  93. package/lib/umd/locale/sk-SK.js +1 -1
  94. package/lib/umd/locale/vi-VN.js +1 -1
  95. package/lib/umd/locale/zh-CN.js +1 -1
  96. package/lib/umd/locale/zh-HK.js +1 -1
  97. package/lib/umd/locale/zh-TW.js +1 -1
  98. package/package.json +15 -15
  99. package/lib/types/components/SlideChartInlineTableEditor.d.ts +0 -11
  100. package/lib/types/hooks.d.ts +0 -3
  101. package/lib/types/services/chart-element-selection.d.ts +0 -10
  102. package/lib/types/services/chart-panel-route.d.ts +0 -22
  103. package/lib/types/utils/ChartPanelOptions.d.ts +0 -78
@@ -1,118 +1,41 @@
1
- import type { ChartStyle, DeepPartial, IChartContext, IChartDataAggregation, IPieLabelStyle, IRuntimeAxis, TitlePositionEnum, WaterfallStackTypeEnum } from '@univerjs-pro/engine-chart';
1
+ import type { IChartEditPanelRoute, IChartPanelRouteState, IChartSelectedElementState } from '@univerjs-pro/chart-ui';
2
+ import type { IChartContext, IChartDataAggregation } from '@univerjs-pro/engine-chart';
2
3
  import type { ISlideChartRuntimeModel, IUpdateSlideChartConfigCommandParams } from '@univerjs-pro/slides-chart';
3
- import type { Nullable } from '@univerjs/core';
4
- import type { Observable } from 'rxjs';
5
- import type { IChartEditPanelRoute, IChartPanelRouteState, IChartSelectedElementState } from './chart-panel-route';
6
- import { ChartTypeBits, DataOrientation, StackType } from '@univerjs-pro/engine-chart';
4
+ import { ChartUIService, ChartViewStateRegistry } from '@univerjs-pro/chart-ui';
7
5
  import { ISlideDrawingService } from '@univerjs-pro/slides';
8
6
  import { SlideChartModelService, SlideChartResourceService } from '@univerjs-pro/slides-chart';
9
- import { Disposable, ICommandService, LocaleService } from '@univerjs/core';
10
- export interface ISlideChartOption {
11
- label: string;
12
- value: string;
13
- }
14
- export interface ISlideChartConfigStateMap {
15
- chartType: ISlideChartConfigState<ChartTypeBits>;
16
- chartThemeColorType: ISlideChartConfigState<string | undefined, string | undefined>;
17
- backgroundColor: ISlideChartConfigState<string | undefined, string | undefined>;
18
- borderColor: ISlideChartConfigState<string | undefined, string | undefined>;
19
- title: ISlideChartConfigState<string | undefined, string>;
20
- dataRange: ISlideChartConfigState<string>;
21
- gradientFill: ISlideChartConfigState<boolean | undefined, boolean | undefined>;
22
- stackType: ISlideChartConfigState<StackType | undefined, StackType | ''>;
23
- orient: ISlideChartConfigState<DataOrientation | undefined, DataOrientation>;
24
- categoryIndex: ISlideChartConfigState<number | undefined, number>;
25
- titles: ISlideChartConfigState<ChartStyle['titles'] | undefined, ChartStyle['titles']>;
26
- titlePosition: ISlideChartConfigState<TitlePositionEnum | undefined, TitlePositionEnum | undefined>;
27
- legendStyle: ISlideChartConfigState<ChartStyle['legend'] | undefined, ChartStyle['legend']>;
28
- xAxisOptions: ISlideChartConfigState<ChartStyle['xAxis'] | undefined, ChartStyle['xAxis']>;
29
- yAxisOptions: ISlideChartConfigState<ChartStyle['yAxis'] | undefined, ChartStyle['yAxis']>;
30
- rightYAxisOptions: ISlideChartConfigState<ChartStyle['rightYAxis'] | undefined, ChartStyle['rightYAxis']>;
31
- runtimeAxes: ISlideChartConfigState<IRuntimeAxis[] | undefined>;
32
- indicator: ISlideChartConfigState<ChartStyle['tooltip'] | undefined, ChartStyle['tooltip']>;
33
- pieLabelStyle: ISlideChartConfigState<DeepPartial<IPieLabelStyle> | undefined, DeepPartial<IPieLabelStyle>>;
34
- padAngleStyle: ISlideChartConfigState<boolean | undefined, boolean>;
35
- isHalfPie: ISlideChartConfigState<boolean | undefined, boolean>;
36
- isRosePie: ISlideChartConfigState<boolean | undefined, boolean>;
37
- showLabelLine: ISlideChartConfigState<boolean | undefined, boolean>;
38
- doughnutHole: ISlideChartConfigState<Nullable<number>, number>;
39
- pieBorderColor: ISlideChartConfigState<string | undefined, string>;
40
- valueScale: ISlideChartConfigState<number | undefined, number>;
41
- digitalFixed: ISlideChartConfigState<number | undefined, number>;
42
- valueSuffix: ISlideChartConfigState<string | undefined, string>;
43
- wordCloudMask: ISlideChartConfigState<string | undefined, string | undefined>;
44
- wordCloudRepeat: ISlideChartConfigState<boolean | undefined, boolean>;
45
- waterfallStack: ISlideChartConfigState<WaterfallStackTypeEnum | undefined, WaterfallStackTypeEnum>;
46
- useSubtotal: ISlideChartConfigState<boolean | undefined, boolean>;
47
- categoryList: ISlideChartConfigState<ISlideChartOption[]>;
48
- seriesValues: ISlideChartConfigState<number[]>;
49
- seriesResourceList: ISlideChartConfigState<ISlideChartOption[]>;
50
- }
51
- export type SlideChartConfigStateKey = keyof ISlideChartConfigStateMap;
52
- export type SlideChartConfigStateValue = InferSlideChartConfigStateValue<SlideChartConfigStateKey>;
53
- export type InferSlideChartConfigStateValue<T extends SlideChartConfigStateKey, M = ISlideChartConfigStateMap[T]> = M extends ISlideChartConfigState<infer V> ? V : never;
54
- export type ISlideChartConfigState<GetValue, SetValue = GetValue> = {
55
- set?(value: SetValue): void;
56
- get(): Observable<GetValue> | undefined;
57
- } | Observable<GetValue>;
58
- export interface ISlideChartUIService {
59
- readonly activeRuntimeModel: ISlideChartRuntimeModel | null;
60
- readonly activeRuntimeModel$: Observable<ISlideChartRuntimeModel | null>;
61
- readonly activeEditChart: string | null;
62
- readonly activeEditChart$: Observable<string | null>;
63
- readonly selectedElement$: Observable<IChartSelectedElementState | null>;
64
- readonly panelRoute$: Observable<IChartPanelRouteState | null>;
65
- readonly localeService: LocaleService;
66
- readonly resourceService: SlideChartResourceService;
67
- registerViewState<T extends SlideChartConfigStateKey = SlideChartConfigStateKey>(id: T, state: (runtime: ISlideChartRuntimeModel) => ISlideChartConfigStateMap[T]): void;
68
- getViewState<V extends SlideChartConfigStateValue = SlideChartConfigStateValue>(id: SlideChartConfigStateKey, runtime?: ISlideChartRuntimeModel | null): ISlideChartConfigState<V> | undefined;
69
- executeChartUpdateConfig(params: Omit<IUpdateSlideChartConfigCommandParams, 'unitId' | 'chartId'> & {
70
- unitId?: string;
71
- chartId?: string;
72
- context?: Partial<IChartContext>;
73
- dataAggregation?: Partial<IChartDataAggregation>;
74
- }): void;
75
- getDrawingBorderColor(unitId: string, subUnitId: string, drawingId: string): string | undefined;
76
- updateDrawingBorderColor(unitId: string, subUnitId: string, drawingId: string, color: string): boolean;
77
- setActiveEditChart(chartId: string | null): void;
78
- isElementEditModeActive(chartId: string): boolean;
79
- setSelectedElement(state: IChartSelectedElementState | null): void;
80
- setPanelRoute(chartId: string, route: IChartEditPanelRoute | null): void;
81
- clearPanelRoute(): void;
82
- }
83
- export declare const ISlideChartUIService: import("@wendellhu/redi").IdentifierDecorator<ISlideChartUIService>;
84
- export declare function registerSlideChartConfigState(service: ISlideChartUIService): void;
85
- export declare class SlideChartUIService extends Disposable implements ISlideChartUIService {
7
+ import { ICommandService } from '@univerjs/core';
8
+ type SlideChartUpdateConfigParams = Omit<IUpdateSlideChartConfigCommandParams, 'unitId' | 'chartId'> & {
9
+ unitId?: string;
10
+ chartId?: string;
11
+ context?: Partial<IChartContext>;
12
+ dataAggregation?: Partial<IChartDataAggregation>;
13
+ };
14
+ export type ISlideChartUIService = SlideChartUIService;
15
+ export declare const ISlideChartUIService: import("@wendellhu/redi").IdentifierDecorator<SlideChartUIService>;
16
+ export declare class SlideChartUIService extends ChartUIService<ISlideChartRuntimeModel, SlideChartUpdateConfigParams> {
86
17
  private readonly _chartModelService;
87
18
  private readonly _commandService;
88
- readonly localeService: LocaleService;
89
19
  readonly resourceService: SlideChartResourceService;
90
20
  private readonly _slideDrawingService;
91
- private readonly _viewState;
92
21
  private readonly _activeEditChart$;
93
22
  private readonly _selectedElement$;
94
23
  private readonly _panelRoute$;
95
- readonly activeEditChart$: Observable<string | null>;
96
- readonly selectedElement$: Observable<IChartSelectedElementState | null>;
97
- readonly panelRoute$: Observable<IChartPanelRouteState | null>;
98
- constructor(_chartModelService: SlideChartModelService, _commandService: ICommandService, localeService: LocaleService, resourceService: SlideChartResourceService, _slideDrawingService: ISlideDrawingService);
24
+ readonly activeEditChart$: import("rxjs").Observable<string | null>;
25
+ readonly selectedElement$: import("rxjs").Observable<IChartSelectedElementState | null>;
26
+ readonly panelRoute$: import("rxjs").Observable<IChartPanelRouteState | null>;
27
+ constructor(_chartModelService: SlideChartModelService, _commandService: ICommandService, resourceService: SlideChartResourceService, _slideDrawingService: ISlideDrawingService, viewStates: ChartViewStateRegistry);
99
28
  get activeRuntimeModel(): ISlideChartRuntimeModel | null;
100
- get activeRuntimeModel$(): Observable<ISlideChartRuntimeModel | null>;
29
+ get activeRuntimeModel$(): import("rxjs").Observable<ISlideChartRuntimeModel | null>;
101
30
  get activeEditChart(): string | null;
102
31
  setActiveEditChart(chartId: string | null): void;
103
32
  isElementEditModeActive(chartId: string): boolean;
104
33
  setSelectedElement(state: IChartSelectedElementState | null): void;
105
34
  setPanelRoute(chartId: string, route: IChartEditPanelRoute | null): void;
106
35
  clearPanelRoute(): void;
107
- registerViewState<T extends SlideChartConfigStateKey = SlideChartConfigStateKey>(id: T, state: (runtime: ISlideChartRuntimeModel) => ISlideChartConfigStateMap[T]): void;
108
- getViewState<V extends SlideChartConfigStateValue = SlideChartConfigStateValue>(id: SlideChartConfigStateKey, runtime?: ISlideChartRuntimeModel | null): ISlideChartConfigState<V> | undefined;
109
- executeChartUpdateConfig(params: Omit<IUpdateSlideChartConfigCommandParams, 'unitId' | 'chartId'> & {
110
- unitId?: string;
111
- chartId?: string;
112
- context?: Partial<IChartContext>;
113
- dataAggregation?: Partial<IChartDataAggregation>;
114
- }): void;
36
+ executeChartUpdateConfig(params: SlideChartUpdateConfigParams): void;
115
37
  getDrawingBorderColor(unitId: string, subUnitId: string, drawingId: string): string | undefined;
116
38
  updateDrawingBorderColor(unitId: string, subUnitId: string, drawingId: string, color: string): boolean;
117
39
  dispose(): void;
118
40
  }
41
+ export {};
@@ -1,4 +1,5 @@
1
- import type { ISlideDrawing, ISlideLineStyle } from '@univerjs-pro/slides';
1
+ import type { IShapeLineStyle } from '@univerjs-pro/engine-shape';
2
+ import type { ISlideDrawing } from '@univerjs-pro/slides';
2
3
  import type { IRenderConvertContext } from '@univerjs-pro/slides-ui';
3
4
  import type { Nullable } from '@univerjs/core';
4
5
  import type { BaseObject, IViewportInfo, UniverRenderingContext } from '@univerjs/engine-render';
@@ -9,7 +10,7 @@ export declare class SlideChartImageObject extends SlideImageObject {
9
10
  private _chartStroke?;
10
11
  private _hideImage;
11
12
  constructor(key: string, props: SlideChartImageObjectProps);
12
- setChartStroke(stroke?: ISlideLineStyle): void;
13
+ setChartStroke(stroke?: IShapeLineStyle): void;
13
14
  setImageHidden(hidden: boolean): void;
14
15
  changeChartSource(url: string): void;
15
16
  protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo, renderWidth?: number, renderHeight?: number): void;