@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.
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/index.css +37 -12
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/commands/commands/focused-chart.command.d.ts +3 -1
- package/lib/types/config/config.d.ts +4 -0
- package/lib/types/controllers/ui.controller.d.ts +4 -2
- package/lib/types/locale/en-US.d.ts +53 -0
- package/lib/types/menu/chart-context-menu.d.ts +4 -4
- package/lib/types/services/chart-element-selection.d.ts +2 -0
- package/lib/types/services/sheet-chart-host.d.ts +2 -4
- package/lib/types/services/sheets-chart-host-provider.service.d.ts +2 -2
- package/lib/types/services/sheets-chart-ui.service.d.ts +15 -2
- package/lib/types/views/chart-edit-panel/Options.d.ts +0 -2
- package/lib/types/views/chart-edit-panel/button-switch/ButtonSwitch.d.ts +2 -2
- package/lib/types/views/chart-edit-panel/data-tab-panel/CandlestickDataEdit.d.ts +7 -0
- package/lib/types/views/chart-edit-panel/data-tab-panel/HistogramDataEdit.d.ts +1 -0
- package/lib/types/views/chart-edit-panel/data-tab-panel/TreemapDataEdit.d.ts +12 -0
- package/lib/types/views/chart-edit-panel/style-tab-panel/CandlestickStyleEdit.d.ts +3 -0
- package/lib/types/views/chart-edit-panel/style-tab-panel/DataLabelOptions.d.ts +3 -3
- package/lib/types/views/chart-edit-panel/style-tab-panel/HistogramStyleEdit.d.ts +1 -0
- package/lib/types/views/chart-edit-panel/style-tab-panel/TreemapStyleEdit.d.ts +6 -0
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- 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
|
|
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 {
|
|
1
|
+
import type { IChartOptionType } from '../../../services/sheets-chart-ui.service';
|
|
2
2
|
export interface IButtonSwitchProps {
|
|
3
3
|
className?: string;
|
|
4
|
-
options:
|
|
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 {};
|
|
@@ -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 {
|
|
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?:
|
|
11
|
-
positionOptions?:
|
|
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;
|