@bizdoc/core 1.13.18 → 1.13.19

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.
@@ -21794,10 +21794,12 @@ let CubeWidgetFilterComponent = class CubeWidgetFilterComponent {
21794
21794
  this.exclude = [];
21795
21795
  const { xAxis, series, exclude, cube: name } = this._widgetRef.options;
21796
21796
  this.cube = name;
21797
- if (isArray(xAxis))
21798
- this.exclude = [...xAxis];
21799
- else
21800
- this.exclude.push(xAxis);
21797
+ if (xAxis) {
21798
+ if (isArray(xAxis))
21799
+ this.exclude = [...xAxis];
21800
+ else
21801
+ this.exclude.push(xAxis);
21802
+ }
21801
21803
  if (series) {
21802
21804
  if (isArray(series))
21803
21805
  this.exclude = this.exclude.concat(series);
@@ -26746,6 +26748,206 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
26746
26748
  }]
26747
26749
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: ReportRef }, { type: i0.ViewContainerRef }]; } });
26748
26750
 
26751
+ var CubeCompareWidget_1;
26752
+ /** */
26753
+ let CubeCompareWidget = CubeCompareWidget_1 = class CubeCompareWidget {
26754
+ constructor(_translate, _widgetRef, _elementRef, _type, _session) {
26755
+ this._translate = _translate;
26756
+ this._widgetRef = _widgetRef;
26757
+ this._elementRef = _elementRef;
26758
+ this._type = _type;
26759
+ this._session = _session;
26760
+ this.id = `cube-compare-${CubeCompareWidget_1.nextId++}`;
26761
+ this.palettes = this._session.accentPalette;
26762
+ this.theme = this._session.theme.dark ? 'MaterialDark' : 'Material';
26763
+ this.enableRtl = this._session.inverse;
26764
+ this.rows = [
26765
+ {
26766
+ height: '15%'
26767
+ }, {
26768
+ height: '85%'
26769
+ }
26770
+ ];
26771
+ this.axes = [{
26772
+ name: 'primary',
26773
+ labelStyle: { size: '0px' },
26774
+ rowIndex: 1
26775
+ }, {
26776
+ name: 'volume',
26777
+ rowIndex: 0,
26778
+ majorGridLines: { width: 0 }, lineStyle: { width: 0 },
26779
+ labelStyle: { size: '0px' },
26780
+ majorTickLines: { width: 0 }
26781
+ }];
26782
+ this.chartArea = {
26783
+ border: {
26784
+ width: 0
26785
+ }
26786
+ };
26787
+ this.zoomSettings = {
26788
+ mode: 'X',
26789
+ enableMouseWheelZooming: true,
26790
+ enablePinchZooming: true,
26791
+ toolbarItems: [],
26792
+ enableSelectionZooming: false,
26793
+ enableScrollbar: true
26794
+ };
26795
+ this.primaryXAxis = {
26796
+ valueType: 'DateTime',
26797
+ labelFormat: 'MMM dd',
26798
+ labelStyle: {
26799
+ fontFamily: FONT_FAMILY
26800
+ },
26801
+ labelIntersectAction: 'Hide',
26802
+ majorGridLines: { width: 0 }
26803
+ };
26804
+ this.crosshair = {
26805
+ enable: true,
26806
+ lineType: 'Vertical'
26807
+ };
26808
+ this.tooltip = {
26809
+ enable: true, shared: true, textStyle: {
26810
+ fontFamily: FONT_FAMILY
26811
+ },
26812
+ };
26813
+ this.legend = {
26814
+ visible: true,
26815
+ isInversed: this._session.inverse,
26816
+ textStyle: {
26817
+ fontFamily: FONT_FAMILY
26818
+ },
26819
+ };
26820
+ this.primaryYAxis = {
26821
+ skeleton: 'duration',
26822
+ labelStyle: {
26823
+ size: '0px'
26824
+ },
26825
+ lineStyle: { width: 0 },
26826
+ minorTickLines: { width: 0 }
26827
+ };
26828
+ this.margin = {
26829
+ bottom: 0
26830
+ };
26831
+ this._destroy = new Subject();
26832
+ _session.themeChange.pipe(takeUntil(this._destroy)).subscribe(t => {
26833
+ this.theme = t.dark ? 'MaterialDark' : 'Material';
26834
+ this.palettes = _session.accentPalette;
26835
+ this._draw();
26836
+ });
26837
+ _widgetRef.resize.subscribe(d => {
26838
+ this.height = `${d.height}px`;
26839
+ if (this.chart)
26840
+ this.chart.height = this.height;
26841
+ });
26842
+ }
26843
+ onBind(data) {
26844
+ return __awaiter(this, void 0, void 0, function* () {
26845
+ yield this._prepare(data);
26846
+ this._draw();
26847
+ });
26848
+ }
26849
+ _draw() {
26850
+ this.chart && this.chart.destroy();
26851
+ this.chart = new Chart$1({
26852
+ axes: this.axes,
26853
+ series: this.series,
26854
+ height: this.height,
26855
+ rows: this.rows,
26856
+ legendSettings: this.legend,
26857
+ crosshair: this.crosshair,
26858
+ tooltip: this.tooltip,
26859
+ background: 'transparent',
26860
+ chartArea: this.chartArea,
26861
+ primaryXAxis: this.primaryXAxis,
26862
+ primaryYAxis: this.primaryYAxis,
26863
+ theme: this.theme,
26864
+ margin: this.margin,
26865
+ useGroupingSeparator: true,
26866
+ palettes: this.palettes,
26867
+ zoomSettings: this.zoomSettings,
26868
+ sharedTooltipRender: this.sharedTooltipRender.bind(this),
26869
+ }, this._elementRef.nativeElement);
26870
+ }
26871
+ sharedTooltipRender(evt) {
26872
+ evt.data.forEach((d, i) => {
26873
+ if (evt.series[d.seriesIndex].yName !== 'count')
26874
+ evt.text[i] = `${d.seriesName} : <b>${dayjs.duration(d.pointY, 's').humanize()}</b>`;
26875
+ });
26876
+ }
26877
+ _prepare(data) {
26878
+ return __awaiter(this, void 0, void 0, function* () {
26879
+ const indicatorData = [], series = [];
26880
+ for (var item of data) {
26881
+ item.points.forEach(p => {
26882
+ const date = p.date = new Date(p.date), indicator = indicatorData.find(i => i.date.valueOf() === date.valueOf());
26883
+ if (indicator)
26884
+ indicator.count += p.count;
26885
+ else
26886
+ indicatorData.push({ count: p.count, date });
26887
+ });
26888
+ const cube = this._session.profile.cubes.find(c => c.name === this._widgetRef.options.cube || this._widgetRef.options.cube == null);
26889
+ const axis = cube.axes.find(a => a.name === this._widgetRef.options.series);
26890
+ const title = yield this._type.get(axis.dataType, item.series).toPromise();
26891
+ series.push({
26892
+ type: 'Line',
26893
+ xName: 'date',
26894
+ yName: 'duration',
26895
+ yAxisName: 'primary',
26896
+ name: title,
26897
+ dataSource: item.points,
26898
+ marker: {
26899
+ width: 6,
26900
+ height: 6,
26901
+ visible: false
26902
+ }
26903
+ });
26904
+ }
26905
+ series.push({
26906
+ type: 'Column',
26907
+ xName: 'date',
26908
+ yName: 'count',
26909
+ name: this._translate.get('Volume'),
26910
+ dataSource: indicatorData,
26911
+ yAxisName: 'volume',
26912
+ marker: {
26913
+ width: 0,
26914
+ height: 0,
26915
+ visible: false
26916
+ }
26917
+ });
26918
+ this.series = series;
26919
+ });
26920
+ }
26921
+ ngOnDestroy() {
26922
+ this.chart && this.chart.destroy();
26923
+ this._destroy.next();
26924
+ this._destroy.complete();
26925
+ }
26926
+ };
26927
+ CubeCompareWidget.nextId = 0;
26928
+ CubeCompareWidget.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CubeCompareWidget, deps: [{ token: TranslateService }, { token: WidgetRef }, { token: i0.ElementRef }, { token: DatasourceService }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Component });
26929
+ CubeCompareWidget.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: CubeCompareWidget, selector: "ng-component", host: { attributes: { "dir": "ltr" }, properties: { "id": "id" } }, providers: [LineSeriesService, CrosshairService, ColumnSeriesService], viewQueries: [{ propertyName: "chart", first: true, predicate: ChartComponent, descendants: true }], ngImport: i0, template: '', isInline: true });
26930
+ CubeCompareWidget = CubeCompareWidget_1 = __decorate([
26931
+ BizDoc({
26932
+ selector: 'bizdoc-cube-compare'
26933
+ })
26934
+ ], CubeCompareWidget);
26935
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CubeCompareWidget, decorators: [{
26936
+ type: Component,
26937
+ args: [{
26938
+ //templateUrl: './compare.widget.html',
26939
+ template: '',
26940
+ providers: [LineSeriesService, CrosshairService, ColumnSeriesService],
26941
+ host: {
26942
+ '[id]': 'id',
26943
+ dir: 'ltr'
26944
+ }
26945
+ }]
26946
+ }], ctorParameters: function () { return [{ type: TranslateService }, { type: WidgetRef }, { type: i0.ElementRef }, { type: DatasourceService }, { type: SessionService }]; }, propDecorators: { chart: [{
26947
+ type: ViewChild,
26948
+ args: [ChartComponent]
26949
+ }] } });
26950
+
26749
26951
  // https://day.js.org/docs/en/customization/relative-time
26750
26952
  dayjs.extend(relativeTime, {
26751
26953
  thresholds: [
@@ -26764,7 +26966,7 @@ dayjs.extend(relativeTime, {
26764
26966
  });
26765
26967
  dayjs.extend(duration);
26766
26968
  dayjs.extend(calendar);
26767
- const CORE_COMPONENTS = [CubeParallelViewComponent, CubeExploreViewComponent, CubeChartViewComponent, CubeDocumentSumComponent, CubeDocumentMatrixComponent, CubeDocumentViewComponent, CubePivotViewComponent, TimelineViewComponent,
26969
+ const CORE_COMPONENTS = [CubeCompareWidget, CubeParallelViewComponent, CubeExploreViewComponent, CubeChartViewComponent, CubeDocumentSumComponent, CubeDocumentMatrixComponent, CubeDocumentViewComponent, CubePivotViewComponent, TimelineViewComponent,
26768
26970
  SubstitutionComponent, AssignActionComponent, ReturnActionComponent, ExploreDocumentComponent,
26769
26971
  ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
26770
26972
  CompareDepartmentsWidget, PeersPerformanceWidget, PendingResultsWidget, PersonalScoreWidget, CubeWidgetFilterComponent,
@@ -26797,7 +26999,7 @@ class SharedModule {
26797
26999
  }
26798
27000
  }
26799
27001
  SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
26800
- SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SharedModule, declarations: [CubeUsageComponent, CubeDocumentsComponent, FileInput, DateFormatPipe, CalendarPipe, DifferencePipe, DurationPipe, TimeAgoPipe,
27002
+ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SharedModule, declarations: [CubeCompareWidget, CubeUsageComponent, CubeDocumentsComponent, FileInput, DateFormatPipe, CalendarPipe, DifferencePipe, DurationPipe, TimeAgoPipe,
26801
27003
  CheckboxComponent, CubeParallelComponent, CubeSumComponent, CubeParallelViewComponent, CubeChartViewComponent, CubeExploreViewComponent, CubeDocumentSumComponent, ExploreItemImplComponent, DocumentInfoComponent, DocumentViewsComponent, ViewItemComponent, CubeDocumentMatrixComponent, CubeDocumentViewComponent, CubePivotViewComponent, ActionPicker, HtmlSimplePipe, QuickCommentComponent,
26802
27004
  DurationFormatPipe, CombinationPicker, CombinationPickerBody, CombinationPool, TimelineViewComponent,
26803
27005
  MatIconAnimate, DateRangePipe, AgoPipe, ColorPicker, StateDirective, BrokenPage,
@@ -26889,7 +27091,7 @@ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
26889
27091
  BizDocApp, AttachmentPreview, PrivilegeHiddenDirective,
26890
27092
  PrivilegeDisabledDirective, CompareGroupDirective, CompareNameDirective, CompareContextDirective, TraceViewComponent, FlowViewComponent,
26891
27093
  AssignActionComponent, ReturnActionComponent, ExploreDocumentComponent,
26892
- ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
27094
+ CubeCompareWidget, ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
26893
27095
  CompareDepartmentsWidget, PeersPerformanceWidget, PendingResultsWidget, PersonalScoreWidget, CubeWidgetFilterComponent,
26894
27096
  CubeDocumentsTableComponent, CubeDocumentsGridComponent, TasksComponent, UsageReportArgs, UsageChartComponent, UsagePivotComponent, TimespanInput,
26895
27097
  VersionCompareComponent, LottieAnimation,
@@ -26936,7 +27138,7 @@ SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
26936
27138
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SharedModule, decorators: [{
26937
27139
  type: NgModule,
26938
27140
  args: [{
26939
- declarations: [CubeUsageComponent, CubeDocumentsComponent, FileInput, DateFormatPipe, CalendarPipe, DifferencePipe, DurationPipe, TimeAgoPipe,
27141
+ declarations: [CubeCompareWidget, CubeUsageComponent, CubeDocumentsComponent, FileInput, DateFormatPipe, CalendarPipe, DifferencePipe, DurationPipe, TimeAgoPipe,
26940
27142
  CheckboxComponent, CubeParallelComponent, CubeSumComponent, CubeParallelViewComponent, CubeChartViewComponent, CubeExploreViewComponent, CubeDocumentSumComponent, ExploreItemImplComponent, DocumentInfoComponent, DocumentViewsComponent, ViewItemComponent, CubeDocumentMatrixComponent, CubeDocumentViewComponent, CubePivotViewComponent, ActionPicker, HtmlSimplePipe, QuickCommentComponent,
26941
27143
  DurationFormatPipe, CombinationPicker, CombinationPickerBody, CombinationPool, TimelineViewComponent,
26942
27144
  MatIconAnimate, DateRangePipe, AgoPipe, ColorPicker, StateDirective, BrokenPage,
@@ -27049,7 +27251,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
27049
27251
  BizDocApp, AttachmentPreview, PrivilegeHiddenDirective,
27050
27252
  PrivilegeDisabledDirective, CompareGroupDirective, CompareNameDirective, CompareContextDirective, TraceViewComponent, FlowViewComponent,
27051
27253
  AssignActionComponent, ReturnActionComponent, ExploreDocumentComponent,
27052
- ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
27254
+ CubeCompareWidget, ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
27053
27255
  CompareDepartmentsWidget, PeersPerformanceWidget, PendingResultsWidget, PersonalScoreWidget, CubeWidgetFilterComponent,
27054
27256
  CubeDocumentsTableComponent, CubeDocumentsGridComponent, TasksComponent, UsageReportArgs, UsageChartComponent, UsagePivotComponent, TimespanInput,
27055
27257
  VersionCompareComponent, LottieAnimation,
@@ -29627,5 +29829,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
29627
29829
  * Generated bundle index. Do not edit.
29628
29830
  */
29629
29831
 
29630
- export { AccountService, AceInput, ActionDialog, ActionPicker, ActionPipe, ActionRef, ActionsWidget, AddressInput, AgoPipe, ArraySortPipe, AssignActionComponent, AttachmentInfo, AttachmentPreview, AuthenticationImpl, AvatarComponent, BIZDOC_CONFIG, BizDoc, BizDocApp, BizDocModule, BrokenPage, BrowseFilterComponent, BrowseItemsComponent, CalendarPipe, ChatInfo, CheckboxComponent, ColorPicker, CombinationPicker, CombinationPickerBody, CombinationPool, CommentsComponent, CompareContextDirective, CompareDepartmentsWidget, CompareGroupDirective, CompareNameDirective, ComposeFormComponent, ContactsComponent, ConversationComponent, CubeAccumAnalysisWidget, CubeAccumulationChartComponent, CubeAnalysisWidget, CubeChartAnalysisWidget, CubeChartComponent, CubeDocumentsGridComponent, CubeDocumentsTableComponent, CubeDocumentsWidget, CubeFilterComponent, CubeGridComponent, CubeInfo, CubeMatrixComponent, CubeParallelComponent, CubePivotComponent, CubeService, CubeSpreadsheetComponent, CubeSumComponent, CubeViewComponent, CubeWidgetFilterComponent, DEFAULT_POLICY, DRAFT, DashboardComponent, DatasourceService, DateFormatPipe, DateRangePipe, DifferencePipe, DocumentInfo, DocumentInfoComponent, DocumentResolveService, DocumentViewRef, DocumentViewsComponent, DurationFormatPipe, DurationPipe, EnterExitLeft, EnterExitRight, EnterExitTop, ExploreDocumentComponent, ExploreItemImplComponent, ExploreItemsComponent, FadeSlideInOut, FieldType, FileInput, FilterPipe, FilterTagsComponent, FlowViewComponent, FormPipe, FormRef, GuideService, INBOX, IdentityName, ItemResolveService, JoinPipe, LottieAnimation, MailboxService, MapInfo, MatIconAnimate, MaterialModule, NavigationEnd, NavigationSelected, NavigationStart, NgxComponentOutlet, NotificationsTableComponent, OpenPolicy, POPUP_DATA, PaneRef, PanesRouter, ParamNavigation, PeersPerformanceWidget, PendingResultsWidget, PersonalActivityWidget, PersonalScoreWidget, Popup, PopupRef, PrivilegeDisabledDirective, PrivilegeHiddenDirective, PulseAnimation, QueryParamNavigation, QuickCommentComponent, RecentsWidget, RecipientResolveService, ReportArgumentsComponent, ReportRef, ReportViewerComponent, ReturnActionComponent, RolePipe, RouterImpl, SanitizeHtmlPipe, SaveChangesDialog, ScheduleViewComponent, SearchInput, SessionService, ShakeAnimation, SharedModule, SlotRouterDirective, StateDirective, StatePipe, SubstitutionComponent, SwapAnimation, TagsComponent, TasksComponent, TimeAgoPipe, TimePicker, TimespanInput, TooltipDirective, TraceViewComponent, TranslatePipe, TranslateService, TypeAutocomplete, TypeSelect, TypeValuePipe, UsageChartComponent, UsagePivotComponent, UsageReportArgs, UserNamePipe, UtilityRef, VersionCompareComponent, WidgetItemComponent, WidgetRef, isArray, isBoolean, isDate, isFunction, isImage, isMobile, isObject, isPrimitive, isPromise, isString, modelize, registerComponents };
29832
+ export { AccountService, AceInput, ActionDialog, ActionPicker, ActionPipe, ActionRef, ActionsWidget, AddressInput, AgoPipe, ArraySortPipe, AssignActionComponent, AttachmentInfo, AttachmentPreview, AuthenticationImpl, AvatarComponent, BIZDOC_CONFIG, BizDoc, BizDocApp, BizDocModule, BrokenPage, BrowseFilterComponent, BrowseItemsComponent, CalendarPipe, ChatInfo, CheckboxComponent, ColorPicker, CombinationPicker, CombinationPickerBody, CombinationPool, CommentsComponent, CompareContextDirective, CompareDepartmentsWidget, CompareGroupDirective, CompareNameDirective, ComposeFormComponent, ContactsComponent, ConversationComponent, CubeAccumAnalysisWidget, CubeAccumulationChartComponent, CubeAnalysisWidget, CubeChartAnalysisWidget, CubeChartComponent, CubeCompareWidget, CubeDocumentsGridComponent, CubeDocumentsTableComponent, CubeDocumentsWidget, CubeFilterComponent, CubeGridComponent, CubeInfo, CubeMatrixComponent, CubeParallelComponent, CubePivotComponent, CubeService, CubeSpreadsheetComponent, CubeSumComponent, CubeViewComponent, CubeWidgetFilterComponent, DEFAULT_POLICY, DRAFT, DashboardComponent, DatasourceService, DateFormatPipe, DateRangePipe, DifferencePipe, DocumentInfo, DocumentInfoComponent, DocumentResolveService, DocumentViewRef, DocumentViewsComponent, DurationFormatPipe, DurationPipe, EnterExitLeft, EnterExitRight, EnterExitTop, ExploreDocumentComponent, ExploreItemImplComponent, ExploreItemsComponent, FadeSlideInOut, FieldType, FileInput, FilterPipe, FilterTagsComponent, FlowViewComponent, FormPipe, FormRef, GuideService, INBOX, IdentityName, ItemResolveService, JoinPipe, LottieAnimation, MailboxService, MapInfo, MatIconAnimate, MaterialModule, NavigationEnd, NavigationSelected, NavigationStart, NgxComponentOutlet, NotificationsTableComponent, OpenPolicy, POPUP_DATA, PaneRef, PanesRouter, ParamNavigation, PeersPerformanceWidget, PendingResultsWidget, PersonalActivityWidget, PersonalScoreWidget, Popup, PopupRef, PrivilegeDisabledDirective, PrivilegeHiddenDirective, PulseAnimation, QueryParamNavigation, QuickCommentComponent, RecentsWidget, RecipientResolveService, ReportArgumentsComponent, ReportRef, ReportViewerComponent, ReturnActionComponent, RolePipe, RouterImpl, SanitizeHtmlPipe, SaveChangesDialog, ScheduleViewComponent, SearchInput, SessionService, ShakeAnimation, SharedModule, SlotRouterDirective, StateDirective, StatePipe, SubstitutionComponent, SwapAnimation, TagsComponent, TasksComponent, TimeAgoPipe, TimePicker, TimespanInput, TooltipDirective, TraceViewComponent, TranslatePipe, TranslateService, TypeAutocomplete, TypeSelect, TypeValuePipe, UsageChartComponent, UsagePivotComponent, UsageReportArgs, UserNamePipe, UtilityRef, VersionCompareComponent, WidgetItemComponent, WidgetRef, isArray, isBoolean, isDate, isFunction, isImage, isMobile, isObject, isPrimitive, isPromise, isString, modelize, registerComponents };
29631
29833
  //# sourceMappingURL=bizdoc-core.mjs.map