@univerjs-pro/slicer 1.3.1 → 1.5.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.
- package/README.md +7 -6
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/definition.d.ts +23 -0
- package/lib/types/index.d.ts +3 -3
- package/lib/types/rendering/canvas-icons.generated.d.ts +12 -12
- package/lib/types/rendering/control.d.ts +1 -1
- package/lib/types/rendering/types.d.ts +5 -1
- package/lib/types/selection.d.ts +3 -1
- package/lib/types/style.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
|
@@ -94,6 +94,23 @@ export interface ISlicerDefinition extends ISlicerViewConfig {
|
|
|
94
94
|
export interface ITimelineRange {
|
|
95
95
|
startDate: number;
|
|
96
96
|
endDate: number;
|
|
97
|
+
/** Explicit whole-day comparison. Omitted and false retain precise half-open bounds. */
|
|
98
|
+
useWholeDay?: boolean;
|
|
99
|
+
}
|
|
100
|
+
export declare enum TimelineDateFilterOperator {
|
|
101
|
+
Between = "between",
|
|
102
|
+
NotBetween = "notBetween",
|
|
103
|
+
Equal = "equal",
|
|
104
|
+
NotEqual = "notEqual",
|
|
105
|
+
NewerThan = "newerThan",
|
|
106
|
+
NewerThanOrEqual = "newerThanOrEqual",
|
|
107
|
+
OlderThan = "olderThan",
|
|
108
|
+
OlderThanOrEqual = "olderThanOrEqual"
|
|
109
|
+
}
|
|
110
|
+
export interface ITimelineDateCondition {
|
|
111
|
+
operator: TimelineDateFilterOperator;
|
|
112
|
+
expected: number | [number, number];
|
|
113
|
+
useWholeDay?: boolean;
|
|
97
114
|
}
|
|
98
115
|
export interface ITimelineCacheDefinition {
|
|
99
116
|
id: string;
|
|
@@ -105,6 +122,10 @@ export interface ITimelineCacheDefinition {
|
|
|
105
122
|
ownedPivotCharts?: IOwnedPivotSlicerChartReference[];
|
|
106
123
|
state: {
|
|
107
124
|
selection?: ITimelineRange;
|
|
125
|
+
condition?: never;
|
|
126
|
+
} | {
|
|
127
|
+
selection?: never;
|
|
128
|
+
condition: ITimelineDateCondition;
|
|
108
129
|
};
|
|
109
130
|
}
|
|
110
131
|
export interface ITimelineViewConfig {
|
|
@@ -129,6 +150,8 @@ export interface ISlicerResource {
|
|
|
129
150
|
slicers: ISlicerDefinition[];
|
|
130
151
|
timelineCaches: ITimelineCacheDefinition[];
|
|
131
152
|
timelines: ITimelineDefinition[];
|
|
153
|
+
/** Imported Table slicer cache paths that cannot be exported without losing views. */
|
|
154
|
+
unexportableTableSlicerCaches?: string[];
|
|
132
155
|
slicerStyles?: ISlicerStylesDefinition;
|
|
133
156
|
timelineStyles?: ITimelineStylesDefinition;
|
|
134
157
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { IPivotSlicerCacheDefinition, ISlicerDefinition, ISlicerResource, ISlicerViewConfig, ITableSlicerCacheDefinition, ITimelineCacheDefinition, ITimelineDefinition, ITimelineRange, ITimelineViewConfig, SlicerCacheDefinition, } from './definition';
|
|
2
|
-
export { SlicerCacheCrossFilter, SlicerCacheSortOrder, SlicerControlKind, SlicerPresentationStatus, SlicerSourceKind, SlicerTargetKind, TimelineLevel, } from './definition';
|
|
1
|
+
export type { IPivotSlicerCacheDefinition, ISlicerDefinition, ISlicerResource, ISlicerViewConfig, ITableSlicerCacheDefinition, ITimelineCacheDefinition, ITimelineDateCondition, ITimelineDefinition, ITimelineRange, ITimelineViewConfig, SlicerCacheDefinition, } from './definition';
|
|
2
|
+
export { SlicerCacheCrossFilter, SlicerCacheSortOrder, SlicerControlKind, SlicerPresentationStatus, SlicerSourceKind, SlicerTargetKind, TimelineDateFilterOperator, TimelineLevel, } from './definition';
|
|
3
3
|
export { SlicerMemberIndex } from './member-index';
|
|
4
4
|
export type { ISlicerMemberIndexItem } from './member-index';
|
|
5
5
|
export { getAvailableSlicerName } from './name';
|
|
@@ -12,6 +12,6 @@ export { SlicerThemeService } from './rendering/theme';
|
|
|
12
12
|
export { SlicerShapeIntentType } from './rendering/types';
|
|
13
13
|
export type { ISlicerCanvasPresentation, ISlicerResolvedStyle, ITimelineCanvasPresentation, ITimelineResolvedStyle, SlicerCanvasPresentation, SlicerShapeIntent, TimelineShapeIntent, } from './rendering/types';
|
|
14
14
|
export { createEmptySlicerResource, MAX_SLICER_COLUMN_COUNT, MAX_SLICER_UNSIGNED_INT, parseSlicerResource } from './resource';
|
|
15
|
-
export { compileSlicerSelection, compileTimelineRange } from './selection';
|
|
15
|
+
export { compileSlicerSelection, compileTimelineCondition, compileTimelineRange } from './selection';
|
|
16
16
|
export type { BuiltInSlicerStyleName, BuiltInTimelineStyleName, ISlicerItemStyleState, ISlicerStyleDefinition, ISlicerStyleElement, ISlicerStylesDefinition, ITimelineStyleDefinition, ITimelineStyleElement, ITimelineStylesDefinition, SlicerStyleFormatting, } from './style';
|
|
17
17
|
export { BUILT_IN_SLICER_STYLE_NAMES, BUILT_IN_TIMELINE_STYLE_NAMES, getSlicerStyleType, isBuiltInSlicerStyleName, isBuiltInTimelineStyleName, isSlicerStyleReference, isTimelineStyleReference, SlicerStyleType, TimelineStyleType, } from './style';
|
|
@@ -58,19 +58,19 @@ export declare const SLICER_ICONS: {
|
|
|
58
58
|
readonly lineJoin: "miter";
|
|
59
59
|
}];
|
|
60
60
|
readonly moreUp: readonly [{
|
|
61
|
-
readonly d: "
|
|
62
|
-
readonly fill:
|
|
63
|
-
readonly fillRule: "
|
|
64
|
-
readonly strokeWidth:
|
|
65
|
-
readonly lineCap: "
|
|
66
|
-
readonly lineJoin: "
|
|
61
|
+
readonly d: "M5 9.5L8 6.5L11 9.5";
|
|
62
|
+
readonly fill: false;
|
|
63
|
+
readonly fillRule: "nonzero";
|
|
64
|
+
readonly strokeWidth: 1.2;
|
|
65
|
+
readonly lineCap: "round";
|
|
66
|
+
readonly lineJoin: "round";
|
|
67
67
|
}];
|
|
68
68
|
readonly moreDown: readonly [{
|
|
69
|
-
readonly d: "
|
|
70
|
-
readonly fill:
|
|
71
|
-
readonly fillRule: "
|
|
72
|
-
readonly strokeWidth:
|
|
73
|
-
readonly lineCap: "
|
|
74
|
-
readonly lineJoin: "
|
|
69
|
+
readonly d: "M5 6.5L8 9.5L11 6.5";
|
|
70
|
+
readonly fill: false;
|
|
71
|
+
readonly fillRule: "nonzero";
|
|
72
|
+
readonly strokeWidth: 1.2;
|
|
73
|
+
readonly lineCap: "round";
|
|
74
|
+
readonly lineJoin: "round";
|
|
75
75
|
}];
|
|
76
76
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IShapeProps } from '@univerjs/engine-render';
|
|
2
2
|
import type { Observable } from 'rxjs';
|
|
3
|
-
import type { IControlStatusShapeProps, SlicerCanvasPresentation, SlicerShapeIntent, TimelineShapeIntent } from './types';
|
|
4
3
|
import { Disposable } from '@univerjs/core';
|
|
4
|
+
import type { IControlStatusShapeProps, SlicerCanvasPresentation, SlicerShapeIntent, TimelineShapeIntent } from './types';
|
|
5
5
|
import { SlicerControlKind } from '../definition';
|
|
6
6
|
import { SlicerShape } from './slicer';
|
|
7
7
|
import { ControlStatusShape } from './status';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DateSystem, RecordSelection, RecordValue } from '@univerjs/core';
|
|
2
2
|
import type { IShapeProps } from '@univerjs/engine-render';
|
|
3
|
-
import type { ISlicerViewConfig, ITimelineRange, ITimelineViewConfig, SlicerControlKind, SlicerPresentationStatus, TimelineLevel } from '../definition';
|
|
3
|
+
import type { ISlicerViewConfig, ITimelineDateCondition, ITimelineRange, ITimelineViewConfig, SlicerControlKind, SlicerPresentationStatus, TimelineLevel } from '../definition';
|
|
4
4
|
import type { ISlicerStyleDefinition, ITimelineStyleDefinition, SlicerStyleType, TimelineStyleType } from '../style';
|
|
5
5
|
export declare enum SlicerShapeIntentType {
|
|
6
6
|
RequestWindow = "requestWindow",
|
|
@@ -108,6 +108,8 @@ export interface ITimelineCanvasPresentation {
|
|
|
108
108
|
maxDate: number;
|
|
109
109
|
dateSystem: DateSystem;
|
|
110
110
|
selection?: ITimelineRange;
|
|
111
|
+
condition?: ITimelineDateCondition;
|
|
112
|
+
conditionLabel?: string;
|
|
111
113
|
capabilities: {
|
|
112
114
|
canFilter: boolean;
|
|
113
115
|
canConfigure: boolean;
|
|
@@ -195,6 +197,8 @@ export interface ITimelineShapeProps extends IShapeProps {
|
|
|
195
197
|
selectionLevel: TimelineLevel;
|
|
196
198
|
scrollPosition: number;
|
|
197
199
|
selection?: ITimelineRange;
|
|
200
|
+
condition?: ITimelineDateCondition;
|
|
201
|
+
conditionLabel?: string;
|
|
198
202
|
showHeader: boolean;
|
|
199
203
|
showSelectionLabel: boolean;
|
|
200
204
|
showTimeLevel: boolean;
|
package/lib/types/selection.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { RecordSelection, RecordValue } from '@univerjs/core';
|
|
2
|
-
import type { ITimelineRange } from './definition';
|
|
2
|
+
import type { ITimelineDateCondition, ITimelineRange } from './definition';
|
|
3
3
|
export declare function compileSlicerSelection(_selection: RecordSelection): (value: RecordValue) => boolean;
|
|
4
4
|
export declare function compileTimelineRange(_range: ITimelineRange): (value: RecordValue) => boolean;
|
|
5
|
+
export declare function compileTimelineCondition(condition: ITimelineDateCondition): (value: RecordValue) => boolean;
|
|
6
|
+
export declare function compileTimelinePeriodCondition(condition: ITimelineDateCondition): (start: number, end: number) => boolean;
|
package/lib/types/style.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export declare enum TimelineStyleType {
|
|
|
18
18
|
UnselectedTimeBlock = "unselectedTimeBlock",
|
|
19
19
|
SelectedTimeBlockSpace = "selectedTimeBlockSpace"
|
|
20
20
|
}
|
|
21
|
-
export declare const BUILT_IN_SLICER_STYLE_NAMES: readonly [
|
|
22
|
-
export declare const BUILT_IN_TIMELINE_STYLE_NAMES: readonly [
|
|
21
|
+
export declare const BUILT_IN_SLICER_STYLE_NAMES: readonly ['SlicerStyleLight1', 'SlicerStyleLight2', 'SlicerStyleLight3', 'SlicerStyleLight4', 'SlicerStyleLight5', 'SlicerStyleLight6', 'SlicerStyleOther1', 'SlicerStyleOther2', 'SlicerStyleDark1', 'SlicerStyleDark2', 'SlicerStyleDark3', 'SlicerStyleDark4', 'SlicerStyleDark5', 'SlicerStyleDark6'];
|
|
22
|
+
export declare const BUILT_IN_TIMELINE_STYLE_NAMES: readonly ['TimelineStyleLight1', 'TimelineStyleLight2', 'TimelineStyleLight3', 'TimelineStyleLight4', 'TimelineStyleLight5', 'TimelineStyleLight6', 'TimelineStyleDark1', 'TimelineStyleDark2', 'TimelineStyleDark3', 'TimelineStyleDark4', 'TimelineStyleDark5', 'TimelineStyleDark6'];
|
|
23
23
|
export type BuiltInSlicerStyleName = (typeof BUILT_IN_SLICER_STYLE_NAMES)[number];
|
|
24
24
|
export type BuiltInTimelineStyleName = (typeof BUILT_IN_TIMELINE_STYLE_NAMES)[number];
|
|
25
25
|
export type SlicerStyleFormatting = Pick<IStyleData, 'bg' | 'ol' | 'bd' | 'cl' | 'ht' | 'vt' | 'bl'>;
|