@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.
@@ -21647,10 +21647,12 @@ let CubeWidgetFilterComponent = class CubeWidgetFilterComponent {
21647
21647
  this.exclude = [];
21648
21648
  const { xAxis, series, exclude, cube: name } = this._widgetRef.options;
21649
21649
  this.cube = name;
21650
- if (isArray(xAxis))
21651
- this.exclude = [...xAxis];
21652
- else
21653
- this.exclude.push(xAxis);
21650
+ if (xAxis) {
21651
+ if (isArray(xAxis))
21652
+ this.exclude = [...xAxis];
21653
+ else
21654
+ this.exclude.push(xAxis);
21655
+ }
21654
21656
  if (series) {
21655
21657
  if (isArray(series))
21656
21658
  this.exclude = this.exclude.concat(series);
@@ -26559,6 +26561,202 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
26559
26561
  }]
26560
26562
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: ReportRef }, { type: i0.ViewContainerRef }]; } });
26561
26563
 
26564
+ var CubeCompareWidget_1;
26565
+ /** */
26566
+ let CubeCompareWidget = CubeCompareWidget_1 = class CubeCompareWidget {
26567
+ constructor(_translate, _widgetRef, _elementRef, _type, _session) {
26568
+ this._translate = _translate;
26569
+ this._widgetRef = _widgetRef;
26570
+ this._elementRef = _elementRef;
26571
+ this._type = _type;
26572
+ this._session = _session;
26573
+ this.id = `cube-compare-${CubeCompareWidget_1.nextId++}`;
26574
+ this.palettes = this._session.accentPalette;
26575
+ this.theme = this._session.theme.dark ? 'MaterialDark' : 'Material';
26576
+ this.enableRtl = this._session.inverse;
26577
+ this.rows = [
26578
+ {
26579
+ height: '15%'
26580
+ }, {
26581
+ height: '85%'
26582
+ }
26583
+ ];
26584
+ this.axes = [{
26585
+ name: 'primary',
26586
+ labelStyle: { size: '0px' },
26587
+ rowIndex: 1
26588
+ }, {
26589
+ name: 'volume',
26590
+ rowIndex: 0,
26591
+ majorGridLines: { width: 0 }, lineStyle: { width: 0 },
26592
+ labelStyle: { size: '0px' },
26593
+ majorTickLines: { width: 0 }
26594
+ }];
26595
+ this.chartArea = {
26596
+ border: {
26597
+ width: 0
26598
+ }
26599
+ };
26600
+ this.zoomSettings = {
26601
+ mode: 'X',
26602
+ enableMouseWheelZooming: true,
26603
+ enablePinchZooming: true,
26604
+ toolbarItems: [],
26605
+ enableSelectionZooming: false,
26606
+ enableScrollbar: true
26607
+ };
26608
+ this.primaryXAxis = {
26609
+ valueType: 'DateTime',
26610
+ labelFormat: 'MMM dd',
26611
+ labelStyle: {
26612
+ fontFamily: FONT_FAMILY
26613
+ },
26614
+ labelIntersectAction: 'Hide',
26615
+ majorGridLines: { width: 0 }
26616
+ };
26617
+ this.crosshair = {
26618
+ enable: true,
26619
+ lineType: 'Vertical'
26620
+ };
26621
+ this.tooltip = {
26622
+ enable: true, shared: true, textStyle: {
26623
+ fontFamily: FONT_FAMILY
26624
+ },
26625
+ };
26626
+ this.legend = {
26627
+ visible: true,
26628
+ isInversed: this._session.inverse,
26629
+ textStyle: {
26630
+ fontFamily: FONT_FAMILY
26631
+ },
26632
+ };
26633
+ this.primaryYAxis = {
26634
+ skeleton: 'duration',
26635
+ labelStyle: {
26636
+ size: '0px'
26637
+ },
26638
+ lineStyle: { width: 0 },
26639
+ minorTickLines: { width: 0 }
26640
+ };
26641
+ this.margin = {
26642
+ bottom: 0
26643
+ };
26644
+ this._destroy = new Subject();
26645
+ _session.themeChange.pipe(takeUntil(this._destroy)).subscribe(t => {
26646
+ this.theme = t.dark ? 'MaterialDark' : 'Material';
26647
+ this.palettes = _session.accentPalette;
26648
+ this._draw();
26649
+ });
26650
+ _widgetRef.resize.subscribe(d => {
26651
+ this.height = `${d.height}px`;
26652
+ if (this.chart)
26653
+ this.chart.height = this.height;
26654
+ });
26655
+ }
26656
+ async onBind(data) {
26657
+ await this._prepare(data);
26658
+ this._draw();
26659
+ }
26660
+ _draw() {
26661
+ this.chart && this.chart.destroy();
26662
+ this.chart = new Chart$1({
26663
+ axes: this.axes,
26664
+ series: this.series,
26665
+ height: this.height,
26666
+ rows: this.rows,
26667
+ legendSettings: this.legend,
26668
+ crosshair: this.crosshair,
26669
+ tooltip: this.tooltip,
26670
+ background: 'transparent',
26671
+ chartArea: this.chartArea,
26672
+ primaryXAxis: this.primaryXAxis,
26673
+ primaryYAxis: this.primaryYAxis,
26674
+ theme: this.theme,
26675
+ margin: this.margin,
26676
+ useGroupingSeparator: true,
26677
+ palettes: this.palettes,
26678
+ zoomSettings: this.zoomSettings,
26679
+ sharedTooltipRender: this.sharedTooltipRender.bind(this),
26680
+ }, this._elementRef.nativeElement);
26681
+ }
26682
+ sharedTooltipRender(evt) {
26683
+ evt.data.forEach((d, i) => {
26684
+ if (evt.series[d.seriesIndex].yName !== 'count')
26685
+ evt.text[i] = `${d.seriesName} : <b>${dayjs.duration(d.pointY, 's').humanize()}</b>`;
26686
+ });
26687
+ }
26688
+ async _prepare(data) {
26689
+ const indicatorData = [], series = [];
26690
+ for (var item of data) {
26691
+ item.points.forEach(p => {
26692
+ const date = p.date = new Date(p.date), indicator = indicatorData.find(i => i.date.valueOf() === date.valueOf());
26693
+ if (indicator)
26694
+ indicator.count += p.count;
26695
+ else
26696
+ indicatorData.push({ count: p.count, date });
26697
+ });
26698
+ const cube = this._session.profile.cubes.find(c => c.name === this._widgetRef.options.cube || this._widgetRef.options.cube == null);
26699
+ const axis = cube.axes.find(a => a.name === this._widgetRef.options.series);
26700
+ const title = await this._type.get(axis.dataType, item.series).toPromise();
26701
+ series.push({
26702
+ type: 'Line',
26703
+ xName: 'date',
26704
+ yName: 'duration',
26705
+ yAxisName: 'primary',
26706
+ name: title,
26707
+ dataSource: item.points,
26708
+ marker: {
26709
+ width: 6,
26710
+ height: 6,
26711
+ visible: false
26712
+ }
26713
+ });
26714
+ }
26715
+ series.push({
26716
+ type: 'Column',
26717
+ xName: 'date',
26718
+ yName: 'count',
26719
+ name: this._translate.get('Volume'),
26720
+ dataSource: indicatorData,
26721
+ yAxisName: 'volume',
26722
+ marker: {
26723
+ width: 0,
26724
+ height: 0,
26725
+ visible: false
26726
+ }
26727
+ });
26728
+ this.series = series;
26729
+ }
26730
+ ngOnDestroy() {
26731
+ this.chart && this.chart.destroy();
26732
+ this._destroy.next();
26733
+ this._destroy.complete();
26734
+ }
26735
+ };
26736
+ CubeCompareWidget.nextId = 0;
26737
+ 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 });
26738
+ 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 });
26739
+ CubeCompareWidget = CubeCompareWidget_1 = __decorate([
26740
+ BizDoc({
26741
+ selector: 'bizdoc-cube-compare'
26742
+ })
26743
+ ], CubeCompareWidget);
26744
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CubeCompareWidget, decorators: [{
26745
+ type: Component,
26746
+ args: [{
26747
+ //templateUrl: './compare.widget.html',
26748
+ template: '',
26749
+ providers: [LineSeriesService, CrosshairService, ColumnSeriesService],
26750
+ host: {
26751
+ '[id]': 'id',
26752
+ dir: 'ltr'
26753
+ }
26754
+ }]
26755
+ }], ctorParameters: function () { return [{ type: TranslateService }, { type: WidgetRef }, { type: i0.ElementRef }, { type: DatasourceService }, { type: SessionService }]; }, propDecorators: { chart: [{
26756
+ type: ViewChild,
26757
+ args: [ChartComponent]
26758
+ }] } });
26759
+
26562
26760
  // https://day.js.org/docs/en/customization/relative-time
26563
26761
  dayjs.extend(relativeTime, {
26564
26762
  thresholds: [
@@ -26577,7 +26775,7 @@ dayjs.extend(relativeTime, {
26577
26775
  });
26578
26776
  dayjs.extend(duration);
26579
26777
  dayjs.extend(calendar);
26580
- const CORE_COMPONENTS = [CubeParallelViewComponent, CubeExploreViewComponent, CubeChartViewComponent, CubeDocumentSumComponent, CubeDocumentMatrixComponent, CubeDocumentViewComponent, CubePivotViewComponent, TimelineViewComponent,
26778
+ const CORE_COMPONENTS = [CubeCompareWidget, CubeParallelViewComponent, CubeExploreViewComponent, CubeChartViewComponent, CubeDocumentSumComponent, CubeDocumentMatrixComponent, CubeDocumentViewComponent, CubePivotViewComponent, TimelineViewComponent,
26581
26779
  SubstitutionComponent, AssignActionComponent, ReturnActionComponent, ExploreDocumentComponent,
26582
26780
  ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
26583
26781
  CompareDepartmentsWidget, PeersPerformanceWidget, PendingResultsWidget, PersonalScoreWidget, CubeWidgetFilterComponent,
@@ -26610,7 +26808,7 @@ class SharedModule {
26610
26808
  }
26611
26809
  }
26612
26810
  SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
26613
- 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,
26811
+ 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,
26614
26812
  CheckboxComponent, CubeParallelComponent, CubeSumComponent, CubeParallelViewComponent, CubeChartViewComponent, CubeExploreViewComponent, CubeDocumentSumComponent, ExploreItemImplComponent, DocumentInfoComponent, DocumentViewsComponent, ViewItemComponent, CubeDocumentMatrixComponent, CubeDocumentViewComponent, CubePivotViewComponent, ActionPicker, HtmlSimplePipe, QuickCommentComponent,
26615
26813
  DurationFormatPipe, CombinationPicker, CombinationPickerBody, CombinationPool, TimelineViewComponent,
26616
26814
  MatIconAnimate, DateRangePipe, AgoPipe, ColorPicker, StateDirective, BrokenPage,
@@ -26702,7 +26900,7 @@ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
26702
26900
  BizDocApp, AttachmentPreview, PrivilegeHiddenDirective,
26703
26901
  PrivilegeDisabledDirective, CompareGroupDirective, CompareNameDirective, CompareContextDirective, TraceViewComponent, FlowViewComponent,
26704
26902
  AssignActionComponent, ReturnActionComponent, ExploreDocumentComponent,
26705
- ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
26903
+ CubeCompareWidget, ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
26706
26904
  CompareDepartmentsWidget, PeersPerformanceWidget, PendingResultsWidget, PersonalScoreWidget, CubeWidgetFilterComponent,
26707
26905
  CubeDocumentsTableComponent, CubeDocumentsGridComponent, TasksComponent, UsageReportArgs, UsageChartComponent, UsagePivotComponent, TimespanInput,
26708
26906
  VersionCompareComponent, LottieAnimation,
@@ -26749,7 +26947,7 @@ SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
26749
26947
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SharedModule, decorators: [{
26750
26948
  type: NgModule,
26751
26949
  args: [{
26752
- declarations: [CubeUsageComponent, CubeDocumentsComponent, FileInput, DateFormatPipe, CalendarPipe, DifferencePipe, DurationPipe, TimeAgoPipe,
26950
+ declarations: [CubeCompareWidget, CubeUsageComponent, CubeDocumentsComponent, FileInput, DateFormatPipe, CalendarPipe, DifferencePipe, DurationPipe, TimeAgoPipe,
26753
26951
  CheckboxComponent, CubeParallelComponent, CubeSumComponent, CubeParallelViewComponent, CubeChartViewComponent, CubeExploreViewComponent, CubeDocumentSumComponent, ExploreItemImplComponent, DocumentInfoComponent, DocumentViewsComponent, ViewItemComponent, CubeDocumentMatrixComponent, CubeDocumentViewComponent, CubePivotViewComponent, ActionPicker, HtmlSimplePipe, QuickCommentComponent,
26754
26952
  DurationFormatPipe, CombinationPicker, CombinationPickerBody, CombinationPool, TimelineViewComponent,
26755
26953
  MatIconAnimate, DateRangePipe, AgoPipe, ColorPicker, StateDirective, BrokenPage,
@@ -26862,7 +27060,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
26862
27060
  BizDocApp, AttachmentPreview, PrivilegeHiddenDirective,
26863
27061
  PrivilegeDisabledDirective, CompareGroupDirective, CompareNameDirective, CompareContextDirective, TraceViewComponent, FlowViewComponent,
26864
27062
  AssignActionComponent, ReturnActionComponent, ExploreDocumentComponent,
26865
- ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
27063
+ CubeCompareWidget, ActionsWidget, CubeAnalysisWidget, CubeDocumentsWidget, RecentsWidget, PersonalActivityWidget,
26866
27064
  CompareDepartmentsWidget, PeersPerformanceWidget, PendingResultsWidget, PersonalScoreWidget, CubeWidgetFilterComponent,
26867
27065
  CubeDocumentsTableComponent, CubeDocumentsGridComponent, TasksComponent, UsageReportArgs, UsageChartComponent, UsagePivotComponent, TimespanInput,
26868
27066
  VersionCompareComponent, LottieAnimation,
@@ -29417,5 +29615,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
29417
29615
  * Generated bundle index. Do not edit.
29418
29616
  */
29419
29617
 
29420
- 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 };
29618
+ 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 };
29421
29619
  //# sourceMappingURL=bizdoc-core.mjs.map