@univerjs-pro/boards-chart-ui 1.0.0-alpha.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.
Files changed (131) hide show
  1. package/README.md +42 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/cjs/locale/ar-SA.js +1 -0
  4. package/lib/cjs/locale/ca-ES.js +1 -0
  5. package/lib/cjs/locale/de-DE.js +1 -0
  6. package/lib/cjs/locale/en-US.js +1 -0
  7. package/lib/cjs/locale/es-ES.js +1 -0
  8. package/lib/cjs/locale/fa-IR.js +1 -0
  9. package/lib/cjs/locale/fr-FR.js +1 -0
  10. package/lib/cjs/locale/id-ID.js +1 -0
  11. package/lib/cjs/locale/it-IT.js +1 -0
  12. package/lib/cjs/locale/ja-JP.js +1 -0
  13. package/lib/cjs/locale/ko-KR.js +1 -0
  14. package/lib/cjs/locale/pl-PL.js +1 -0
  15. package/lib/cjs/locale/pt-BR.js +1 -0
  16. package/lib/cjs/locale/ru-RU.js +1 -0
  17. package/lib/cjs/locale/sk-SK.js +1 -0
  18. package/lib/cjs/locale/vi-VN.js +1 -0
  19. package/lib/cjs/locale/zh-CN.js +1 -0
  20. package/lib/cjs/locale/zh-HK.js +1 -0
  21. package/lib/cjs/locale/zh-TW.js +1 -0
  22. package/lib/es/index.js +1 -0
  23. package/lib/es/locale/ar-SA.js +1 -0
  24. package/lib/es/locale/ca-ES.js +1 -0
  25. package/lib/es/locale/de-DE.js +1 -0
  26. package/lib/es/locale/en-US.js +1 -0
  27. package/lib/es/locale/es-ES.js +1 -0
  28. package/lib/es/locale/fa-IR.js +1 -0
  29. package/lib/es/locale/fr-FR.js +1 -0
  30. package/lib/es/locale/id-ID.js +1 -0
  31. package/lib/es/locale/it-IT.js +1 -0
  32. package/lib/es/locale/ja-JP.js +1 -0
  33. package/lib/es/locale/ko-KR.js +1 -0
  34. package/lib/es/locale/pl-PL.js +1 -0
  35. package/lib/es/locale/pt-BR.js +1 -0
  36. package/lib/es/locale/ru-RU.js +1 -0
  37. package/lib/es/locale/sk-SK.js +1 -0
  38. package/lib/es/locale/vi-VN.js +1 -0
  39. package/lib/es/locale/zh-CN.js +1 -0
  40. package/lib/es/locale/zh-HK.js +1 -0
  41. package/lib/es/locale/zh-TW.js +1 -0
  42. package/lib/index.css +325 -0
  43. package/lib/index.js +1 -0
  44. package/lib/locale/ar-SA.js +1 -0
  45. package/lib/locale/ca-ES.js +1 -0
  46. package/lib/locale/de-DE.js +1 -0
  47. package/lib/locale/en-US.js +1 -0
  48. package/lib/locale/es-ES.js +1 -0
  49. package/lib/locale/fa-IR.js +1 -0
  50. package/lib/locale/fr-FR.js +1 -0
  51. package/lib/locale/id-ID.js +1 -0
  52. package/lib/locale/it-IT.js +1 -0
  53. package/lib/locale/ja-JP.js +1 -0
  54. package/lib/locale/ko-KR.js +1 -0
  55. package/lib/locale/pl-PL.js +1 -0
  56. package/lib/locale/pt-BR.js +1 -0
  57. package/lib/locale/ru-RU.js +1 -0
  58. package/lib/locale/sk-SK.js +1 -0
  59. package/lib/locale/vi-VN.js +1 -0
  60. package/lib/locale/zh-CN.js +1 -0
  61. package/lib/locale/zh-HK.js +1 -0
  62. package/lib/locale/zh-TW.js +1 -0
  63. package/lib/types/common/BoardChartTypeOptions.d.ts +9 -0
  64. package/lib/types/common/board-chart-frame-style.d.ts +40 -0
  65. package/lib/types/components/BoardChartDataEditorDialog.d.ts +13 -0
  66. package/lib/types/components/BoardChartDomRenderer.d.ts +7 -0
  67. package/lib/types/components/BoardChartEditPanel.d.ts +8 -0
  68. package/lib/types/config/config.d.ts +5 -0
  69. package/lib/types/controllers/board-chart-element-float-menu.controller.d.ts +27 -0
  70. package/lib/types/controllers/board-chart-floating-toolbar.render-controller.d.ts +27 -0
  71. package/lib/types/controllers/board-chart-open-edit.controller.d.ts +21 -0
  72. package/lib/types/controllers/board-chart-panel.controller.d.ts +24 -0
  73. package/lib/types/controllers/board-chart-selection.controller.d.ts +21 -0
  74. package/lib/types/controllers/board-chart-snapshot-refresh.controller.d.ts +12 -0
  75. package/lib/types/controllers/boards-chart-ui-components.controller.d.ts +5 -0
  76. package/lib/types/hooks.d.ts +3 -0
  77. package/lib/types/index.d.ts +27 -0
  78. package/lib/types/locale/ar-SA.d.ts +3 -0
  79. package/lib/types/locale/ca-ES.d.ts +3 -0
  80. package/lib/types/locale/de-DE.d.ts +3 -0
  81. package/lib/types/locale/en-US.d.ts +248 -0
  82. package/lib/types/locale/es-ES.d.ts +3 -0
  83. package/lib/types/locale/fa-IR.d.ts +3 -0
  84. package/lib/types/locale/fr-FR.d.ts +3 -0
  85. package/lib/types/locale/id-ID.d.ts +3 -0
  86. package/lib/types/locale/it-IT.d.ts +3 -0
  87. package/lib/types/locale/ja-JP.d.ts +3 -0
  88. package/lib/types/locale/ko-KR.d.ts +3 -0
  89. package/lib/types/locale/pl-PL.d.ts +3 -0
  90. package/lib/types/locale/pt-BR.d.ts +3 -0
  91. package/lib/types/locale/ru-RU.d.ts +3 -0
  92. package/lib/types/locale/sk-SK.d.ts +3 -0
  93. package/lib/types/locale/types.d.ts +3 -0
  94. package/lib/types/locale/vi-VN.d.ts +3 -0
  95. package/lib/types/locale/zh-CN.d.ts +3 -0
  96. package/lib/types/locale/zh-HK.d.ts +3 -0
  97. package/lib/types/locale/zh-TW.d.ts +3 -0
  98. package/lib/types/plugin.d.ts +23 -0
  99. package/lib/types/render-adapters/board-chart-render-adapter.d.ts +23 -0
  100. package/lib/types/render-objects/board-chart-image-rect.d.ts +24 -0
  101. package/lib/types/services/board-chart-clipboard-adapter.d.ts +28 -0
  102. package/lib/types/services/board-chart-data-edit.service.d.ts +24 -0
  103. package/lib/types/services/board-chart-edit-session.service.d.ts +31 -0
  104. package/lib/types/services/board-chart-element-popup-anchor.d.ts +10 -0
  105. package/lib/types/services/board-chart-element-selection.d.ts +7 -0
  106. package/lib/types/services/board-chart-host.d.ts +29 -0
  107. package/lib/types/services/board-chart-render.service.d.ts +55 -0
  108. package/lib/types/services/board-chart-snapshot-render.service.d.ts +57 -0
  109. package/lib/types/services/board-chart-ui.service.d.ts +124 -0
  110. package/lib/types/views/BoardChartFloatingToolbar.d.ts +14 -0
  111. package/lib/umd/index.js +1 -0
  112. package/lib/umd/locale/ar-SA.js +1 -0
  113. package/lib/umd/locale/ca-ES.js +1 -0
  114. package/lib/umd/locale/de-DE.js +1 -0
  115. package/lib/umd/locale/en-US.js +1 -0
  116. package/lib/umd/locale/es-ES.js +1 -0
  117. package/lib/umd/locale/fa-IR.js +1 -0
  118. package/lib/umd/locale/fr-FR.js +1 -0
  119. package/lib/umd/locale/id-ID.js +1 -0
  120. package/lib/umd/locale/it-IT.js +1 -0
  121. package/lib/umd/locale/ja-JP.js +1 -0
  122. package/lib/umd/locale/ko-KR.js +1 -0
  123. package/lib/umd/locale/pl-PL.js +1 -0
  124. package/lib/umd/locale/pt-BR.js +1 -0
  125. package/lib/umd/locale/ru-RU.js +1 -0
  126. package/lib/umd/locale/sk-SK.js +1 -0
  127. package/lib/umd/locale/vi-VN.js +1 -0
  128. package/lib/umd/locale/zh-CN.js +1 -0
  129. package/lib/umd/locale/zh-HK.js +1 -0
  130. package/lib/umd/locale/zh-TW.js +1 -0
  131. package/package.json +91 -0
@@ -0,0 +1,124 @@
1
+ import type { IBoardChartRuntimeModel, IUpdateBoardChartConfigCommandParams } from '@univerjs-pro/boards-chart';
2
+ import type { AreaLineStyle, ChartStyle, DeepPartial, IAllSeriesStyle, IChartContext, IChartDataAggregation, InvalidValueType, IPieLabelStyle, IRelationForceOptions, IRuntimeAxis, ITrendLine, LinePointShape, RadarShape, RelationChartLayoutEnum, TitlePositionEnum, WaterfallStackTypeEnum, WordCloudShapeEnum } from '@univerjs-pro/engine-chart';
3
+ import type { Nullable } from '@univerjs/core';
4
+ import type { Observable } from 'rxjs';
5
+ import { BoardChartModelService, BoardChartResourceService } from '@univerjs-pro/boards-chart';
6
+ import { ChartTypeBits, DataOrientation, StackType } from '@univerjs-pro/engine-chart';
7
+ import { Disposable, ICommandService, LocaleService } from '@univerjs/core';
8
+ export interface IBoardChartOption {
9
+ label: string;
10
+ value: string;
11
+ }
12
+ export interface IBoardChartConfigStateMap {
13
+ allSeriesStyle: IBoardChartConfigState<DeepPartial<IAllSeriesStyle> | undefined, DeepPartial<IAllSeriesStyle>>;
14
+ areaLineStyle: IBoardChartConfigState<AreaLineStyle | undefined, AreaLineStyle | undefined>;
15
+ backgroundColor: IBoardChartConfigState<string | undefined, string | undefined>;
16
+ borderColor: IBoardChartConfigState<Nullable<string>, Nullable<string>>;
17
+ bubbleCategoryList: IBoardChartConfigState<IBoardChartOption[]>;
18
+ bubbleSeriesIndex: IBoardChartConfigState<number | undefined, number | undefined>;
19
+ bubbleSizeIndex: IBoardChartConfigState<number | undefined, number | undefined>;
20
+ scatterLabelIndex: IBoardChartConfigState<number | undefined, number | undefined>;
21
+ scatterXIndex: IBoardChartConfigState<number | undefined, number | undefined>;
22
+ scatterYIndex: IBoardChartConfigState<number | undefined, number | undefined>;
23
+ categoryIndex: IBoardChartConfigState<number | undefined, number>;
24
+ categoryList: IBoardChartConfigState<IBoardChartOption[]>;
25
+ chartThemeColorType: IBoardChartConfigState<string | undefined, string | undefined>;
26
+ chartType: IBoardChartConfigState<ChartTypeBits>;
27
+ dataPointsOptions: IBoardChartConfigState<IBoardChartOption[]>;
28
+ dataRange: IBoardChartConfigState<string>;
29
+ digitalFixed: IBoardChartConfigState<number | undefined, number>;
30
+ doughnutHole: IBoardChartConfigState<Nullable<number>, number | null>;
31
+ fontSize: IBoardChartConfigState<number | undefined, number | undefined>;
32
+ forceOption: IBoardChartConfigState<IRelationForceOptions | undefined, IRelationForceOptions | undefined>;
33
+ funnelGap: IBoardChartConfigState<number | undefined, number | undefined>;
34
+ funnelUseAbsValue: IBoardChartConfigState<boolean | undefined, boolean | undefined>;
35
+ gradientFill: IBoardChartConfigState<boolean | undefined, boolean | undefined>;
36
+ heatmapMax: IBoardChartConfigState<number | undefined, number | undefined>;
37
+ heatmapMin: IBoardChartConfigState<number | undefined, number | undefined>;
38
+ indicator: IBoardChartConfigState<ChartStyle['tooltip'] | undefined, ChartStyle['tooltip']>;
39
+ invalidValueType: IBoardChartConfigState<InvalidValueType | undefined, InvalidValueType | undefined>;
40
+ isHalfPie: IBoardChartConfigState<boolean | undefined, boolean>;
41
+ isRosePie: IBoardChartConfigState<boolean | undefined, boolean>;
42
+ legendStyle: IBoardChartConfigState<ChartStyle['legend'] | undefined, ChartStyle['legend']>;
43
+ orient: IBoardChartConfigState<DataOrientation | undefined, DataOrientation>;
44
+ padAngleStyle: IBoardChartConfigState<boolean | undefined, boolean>;
45
+ paretoDataPointsOptions: IBoardChartConfigState<IBoardChartOption[]>;
46
+ paretoStyle: IBoardChartConfigState<ChartStyle['pareto'] | undefined, ChartStyle['pareto']>;
47
+ pieBorderColor: IBoardChartConfigState<string | undefined, string>;
48
+ pieLabelStyle: IBoardChartConfigState<DeepPartial<IPieLabelStyle> | undefined, DeepPartial<IPieLabelStyle>>;
49
+ radarFill: IBoardChartConfigState<boolean | undefined, boolean>;
50
+ radarShape: IBoardChartConfigState<RadarShape | undefined, RadarShape>;
51
+ relationLayout: IBoardChartConfigState<RelationChartLayoutEnum | undefined, RelationChartLayoutEnum>;
52
+ relationNodeShape: IBoardChartConfigState<LinePointShape | undefined, LinePointShape>;
53
+ rightYAxisOptions: IBoardChartConfigState<ChartStyle['rightYAxis'] | undefined, ChartStyle['rightYAxis']>;
54
+ rotateLabel: IBoardChartConfigState<boolean | undefined, boolean>;
55
+ runtimeAxes: Observable<IRuntimeAxis[]>;
56
+ seriesResourceList: IBoardChartConfigState<IBoardChartOption[]>;
57
+ seriesList: IBoardChartConfigState<IBoardChartOption[]>;
58
+ seriesStyleMap: IBoardChartConfigState<ChartStyle['seriesStyleMap'] | undefined, ChartStyle['seriesStyleMap']>;
59
+ seriesValues: IBoardChartConfigState<number[]>;
60
+ showLabelLine: IBoardChartConfigState<boolean | undefined, boolean>;
61
+ stackType: IBoardChartConfigState<StackType | undefined, StackType | ''>;
62
+ title: IBoardChartConfigState<string | undefined, string>;
63
+ titleFontSize: IBoardChartConfigState<number | undefined, number | undefined>;
64
+ titles: IBoardChartConfigState<ChartStyle['titles'] | undefined, ChartStyle['titles']>;
65
+ titlePosition: IBoardChartConfigState<TitlePositionEnum | undefined, TitlePositionEnum | undefined>;
66
+ trendlineValues: IBoardChartConfigState<ITrendLine[] | undefined, ITrendLine[] | undefined>;
67
+ useDateAxis: IBoardChartConfigState<boolean | undefined, boolean>;
68
+ useEmphasis: IBoardChartConfigState<boolean | undefined, boolean>;
69
+ useSubtotal: IBoardChartConfigState<boolean | undefined, boolean>;
70
+ useValueAsSymbolSize: IBoardChartConfigState<boolean | undefined, boolean>;
71
+ valueScale: IBoardChartConfigState<number | undefined, number>;
72
+ valueSuffix: IBoardChartConfigState<string | undefined, string>;
73
+ visualMapType: IBoardChartConfigState<'continuous' | 'piecewise' | undefined, 'continuous' | 'piecewise' | undefined>;
74
+ waterfallStack: IBoardChartConfigState<WaterfallStackTypeEnum | undefined, WaterfallStackTypeEnum>;
75
+ wordCloudMask: IBoardChartConfigState<string | undefined, string | undefined>;
76
+ wordCloudRepeat: IBoardChartConfigState<boolean | undefined, boolean>;
77
+ wordCloudShape: IBoardChartConfigState<WordCloudShapeEnum | undefined, WordCloudShapeEnum | undefined>;
78
+ xAxisOptions: IBoardChartConfigState<ChartStyle['xAxis'] | undefined, ChartStyle['xAxis']>;
79
+ yAxisOptions: IBoardChartConfigState<ChartStyle['yAxis'] | undefined, ChartStyle['yAxis']>;
80
+ }
81
+ export type BoardChartConfigStateKey = keyof IBoardChartConfigStateMap;
82
+ export type BoardChartConfigStateValue = InferBoardChartConfigStateValue<BoardChartConfigStateKey>;
83
+ export type InferBoardChartConfigStateValue<T extends BoardChartConfigStateKey, M = IBoardChartConfigStateMap[T]> = M extends IBoardChartConfigState<infer V> ? V : never;
84
+ export type IBoardChartConfigState<GetValue, SetValue = GetValue> = {
85
+ set?(value: SetValue): void;
86
+ get(): Observable<GetValue> | undefined;
87
+ } | Observable<GetValue>;
88
+ export interface IBoardChartUIService {
89
+ readonly activeRuntimeModel: IBoardChartRuntimeModel | null;
90
+ readonly activeRuntimeModel$: Observable<IBoardChartRuntimeModel | null>;
91
+ readonly localeService: LocaleService;
92
+ readonly resourceService: BoardChartResourceService;
93
+ registerViewState<T extends BoardChartConfigStateKey = BoardChartConfigStateKey>(id: T, state: (runtime: IBoardChartRuntimeModel) => IBoardChartConfigStateMap[T]): void;
94
+ getViewState<V extends BoardChartConfigStateValue = BoardChartConfigStateValue>(id: BoardChartConfigStateKey, runtime?: IBoardChartRuntimeModel | null): IBoardChartConfigState<V> | undefined;
95
+ executeChartUpdateConfig(params: Omit<IUpdateBoardChartConfigCommandParams, 'unitId' | 'chartId'> & {
96
+ unitId?: string;
97
+ chartId?: string;
98
+ context?: Partial<IChartContext>;
99
+ dataAggregation?: Partial<IChartDataAggregation>;
100
+ }): void;
101
+ getDataRangeLabel(runtime: IBoardChartRuntimeModel): string;
102
+ }
103
+ export declare const IBoardChartUIService: import("@wendellhu/redi").IdentifierDecorator<IBoardChartUIService>;
104
+ export declare class BoardChartUIService extends Disposable implements IBoardChartUIService {
105
+ private readonly _modelService;
106
+ private readonly _resourceService;
107
+ private readonly _commandService;
108
+ readonly localeService: LocaleService;
109
+ private readonly _viewState;
110
+ constructor(_modelService: BoardChartModelService, _resourceService: BoardChartResourceService, _commandService: ICommandService, localeService: LocaleService);
111
+ get activeRuntimeModel(): IBoardChartRuntimeModel | null;
112
+ get activeRuntimeModel$(): Observable<IBoardChartRuntimeModel | null>;
113
+ get resourceService(): BoardChartResourceService;
114
+ registerViewState<T extends BoardChartConfigStateKey = BoardChartConfigStateKey>(id: T, state: (runtime: IBoardChartRuntimeModel) => IBoardChartConfigStateMap[T]): void;
115
+ getViewState<V extends BoardChartConfigStateValue = BoardChartConfigStateValue>(id: BoardChartConfigStateKey, runtime?: IBoardChartRuntimeModel | null): IBoardChartConfigState<V> | undefined;
116
+ executeChartUpdateConfig(params: Omit<IUpdateBoardChartConfigCommandParams, 'unitId' | 'chartId'> & {
117
+ unitId?: string;
118
+ chartId?: string;
119
+ context?: Partial<IChartContext>;
120
+ dataAggregation?: Partial<IChartDataAggregation>;
121
+ }): void;
122
+ getDataRangeLabel(runtime: IBoardChartRuntimeModel): string;
123
+ dispose(): void;
124
+ }
@@ -0,0 +1,14 @@
1
+ export declare const BOARD_CHART_FLOATING_TOOLBAR_KEY = "board.chart.floating-toolbar";
2
+ interface IBoardChartFloatingToolbarExtraProps {
3
+ unitId: string;
4
+ subUnitId: string;
5
+ elementId: string;
6
+ chartId: string;
7
+ }
8
+ interface IBoardChartFloatingToolbarProps {
9
+ popup: {
10
+ extraProps?: IBoardChartFloatingToolbarExtraProps;
11
+ };
12
+ }
13
+ export declare function BoardChartFloatingToolbar(props: IBoardChartFloatingToolbarProps): import("react").JSX.Element | null;
14
+ export {};