@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.
@@ -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
  }
@@ -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: "M4.64645 9.85355C4.45118 9.65829 4.45118 9.34171 4.64645 9.14645L7.64645 6.14645C7.84171 5.95118 8.15829 5.95118 8.35355 6.14645L11.3536 9.14645C11.5488 9.34171 11.5488 9.65829 11.3536 9.85355C11.1583 10.0488 10.8417 10.0488 10.6464 9.85355L8 7.20711L5.35355 9.85355C5.15829 10.0488 4.84171 10.0488 4.64645 9.85355Z";
62
- readonly fill: true;
63
- readonly fillRule: "evenodd";
64
- readonly strokeWidth: 0;
65
- readonly lineCap: "butt";
66
- readonly lineJoin: "miter";
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: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z";
70
- readonly fill: true;
71
- readonly fillRule: "evenodd";
72
- readonly strokeWidth: 0;
73
- readonly lineCap: "butt";
74
- readonly lineJoin: "miter";
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;
@@ -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;
@@ -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 ["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"];
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'>;