raise-common-lib 0.0.248 → 0.0.249

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.
Files changed (62) hide show
  1. package/README.md +57 -57
  2. package/bundles/raise-common-lib.umd.js +1937 -12
  3. package/bundles/raise-common-lib.umd.js.map +1 -1
  4. package/bundles/raise-common-lib.umd.min.js +1 -1
  5. package/bundles/raise-common-lib.umd.min.js.map +1 -1
  6. package/esm2015/lib/common-grid/index.component.js +210 -8
  7. package/esm2015/lib/date-tree-filter/date-tree-filter-popover/index.component.js +761 -0
  8. package/esm2015/lib/date-tree-filter/date-tree-filter.helper.js +679 -0
  9. package/esm2015/lib/raise-common-lib.module.js +4 -1
  10. package/esm2015/public-api.js +3 -1
  11. package/esm2015/raise-common-lib.js +2 -2
  12. package/esm5/lib/common-grid/index.component.js +244 -8
  13. package/esm5/lib/date-tree-filter/date-tree-filter-popover/index.component.js +902 -0
  14. package/esm5/lib/date-tree-filter/date-tree-filter.helper.js +787 -0
  15. package/esm5/lib/raise-common-lib.module.js +4 -1
  16. package/esm5/public-api.js +3 -1
  17. package/esm5/raise-common-lib.js +2 -2
  18. package/fesm2015/raise-common-lib.js +1649 -9
  19. package/fesm2015/raise-common-lib.js.map +1 -1
  20. package/fesm5/raise-common-lib.js +1931 -10
  21. package/fesm5/raise-common-lib.js.map +1 -1
  22. package/lib/common-grid/index.component.d.ts +30 -1
  23. package/lib/date-tree-filter/date-tree-filter-popover/index.component.d.ts +46 -0
  24. package/lib/date-tree-filter/date-tree-filter.helper.d.ts +54 -0
  25. package/package.json +1 -1
  26. package/public-api.d.ts +2 -0
  27. package/raise-common-lib.metadata.json +1 -1
  28. package/src/assets/img/arrow_right.svg +4 -4
  29. package/src/assets/img/calendar-disabled.svg +6 -6
  30. package/src/assets/img/calendar.svg +6 -6
  31. package/src/assets/img/calendar_arrow_left.svg +3 -3
  32. package/src/assets/img/calendar_arrow_right.svg +3 -3
  33. package/src/assets/img/checked-vector.svg +3 -3
  34. package/src/assets/img/dialog-close.svg +4 -4
  35. package/src/assets/img/dialog-grow.svg +6 -6
  36. package/src/assets/img/dialog-shrink.svg +6 -6
  37. package/src/assets/img/plus.svg +4 -4
  38. package/src/assets/img/raise_logo_main_new.svg +27 -27
  39. package/src/assets/img/search.svg +4 -4
  40. package/src/assets/img/shrink-icon.svg +6 -6
  41. package/src/assets/img/time-disabled.svg +4 -4
  42. package/src/assets/img/time.svg +4 -4
  43. package/src/assets/img/toolbar-action-addFolder.svg +17 -17
  44. package/src/assets/img/toolbar-action-calculator.svg +11 -11
  45. package/src/assets/img/toolbar-action-collapse.svg +7 -7
  46. package/src/assets/img/toolbar-action-combine.svg +4 -4
  47. package/src/assets/img/toolbar-action-edit.svg +4 -4
  48. package/src/assets/img/toolbar-action-expand.svg +7 -7
  49. package/src/assets/img/toolbar-action-folderMove.svg +8 -8
  50. package/src/assets/img/toolbar-action-lock.svg +6 -6
  51. package/src/assets/img/toolbar-action-preview.svg +7 -7
  52. package/src/assets/img/toolbar-action-publish.svg +5 -5
  53. package/src/assets/img/toolbar-action-reminders.svg +10 -10
  54. package/src/assets/img/toolbar-action-rename.svg +7 -7
  55. package/src/assets/img/toolbar-action-saveSequence.svg +5 -5
  56. package/src/assets/img/toolbar-action-send-file.svg +5 -5
  57. package/src/assets/img/toolbar-action-settle.svg +7 -7
  58. package/src/assets/img/toolbar-action-share.svg +5 -5
  59. package/src/assets/img/toolbar-action-submitForApproval.svg +4 -4
  60. package/src/assets/img/toolbar-action-sync.svg +4 -4
  61. package/src/assets/img/toolbar-action-template.svg +6 -6
  62. package/src/assets/img/toolbar-action-workflow.svg +9 -9
@@ -1,11 +1,11 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@syncfusion/ej2-angular-grids'), require('lodash'), require('rxjs'), require('@angular/material/snack-bar'), require('@angular/material/dialog'), require('@syncfusion/ej2-angular-treegrid'), require('@syncfusion/ej2-angular-navigations'), require('@angular/router'), require('rxjs/operators'), require('@angular/cdk/drag-drop'), require('@angular/common/http'), require('@syncfusion/ej2-base'), require('resize-observer-polyfill'), require('@syncfusion/ej2-data'), require('moment'), require('circular-json'), require('@angular/material/core'), require('@syncfusion/ej2-angular-layouts'), require('@angular/common'), require('@angular/material/icon'), require('@angular/platform-browser'), require('@angular/forms'), require('ng-inline-svg'), require('@syncfusion/ej2-angular-buttons'), require('@syncfusion/ej2-angular-diagrams'), require('@syncfusion/ej2-angular-popups'), require('@syncfusion/ej2-angular-calendars'), require('@syncfusion/ej2-angular-inputs'), require('@syncfusion/ej2-angular-dropdowns'), require('@syncfusion/ej2-angular-pivotview'), require('@syncfusion/ej2-angular-charts'), require('@syncfusion/ej2-angular-pdfviewer'), require('@syncfusion/ej2-angular-splitbuttons'), require('@syncfusion/ej2-angular-richtexteditor'), require('@angular/material/menu'), require('@angular/material/tooltip'), require('@angular/material/checkbox'), require('@angular/material/select'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/button'), require('@syncfusion/ej2-inputs/src/maskedtextbox/maskedtextbox'), require('@syncfusion/ej2-data/src/manager'), require('@syncfusion/ej2-data/src/query')) :
3
- typeof define === 'function' && define.amd ? define('raise-common-lib', ['exports', '@angular/core', '@syncfusion/ej2-angular-grids', 'lodash', 'rxjs', '@angular/material/snack-bar', '@angular/material/dialog', '@syncfusion/ej2-angular-treegrid', '@syncfusion/ej2-angular-navigations', '@angular/router', 'rxjs/operators', '@angular/cdk/drag-drop', '@angular/common/http', '@syncfusion/ej2-base', 'resize-observer-polyfill', '@syncfusion/ej2-data', 'moment', 'circular-json', '@angular/material/core', '@syncfusion/ej2-angular-layouts', '@angular/common', '@angular/material/icon', '@angular/platform-browser', '@angular/forms', 'ng-inline-svg', '@syncfusion/ej2-angular-buttons', '@syncfusion/ej2-angular-diagrams', '@syncfusion/ej2-angular-popups', '@syncfusion/ej2-angular-calendars', '@syncfusion/ej2-angular-inputs', '@syncfusion/ej2-angular-dropdowns', '@syncfusion/ej2-angular-pivotview', '@syncfusion/ej2-angular-charts', '@syncfusion/ej2-angular-pdfviewer', '@syncfusion/ej2-angular-splitbuttons', '@syncfusion/ej2-angular-richtexteditor', '@angular/material/menu', '@angular/material/tooltip', '@angular/material/checkbox', '@angular/material/select', '@angular/material/form-field', '@angular/material/input', '@angular/material/button', '@syncfusion/ej2-inputs/src/maskedtextbox/maskedtextbox', '@syncfusion/ej2-data/src/manager', '@syncfusion/ej2-data/src/query'], factory) :
4
- (global = global || self, factory(global['raise-common-lib'] = {}, global.ng.core, global.ej2AngularGrids, global.lodash, global.rxjs, global.ng.material['snack-bar'], global.ng.material.dialog, global.ej2AngularTreegrid, global.ej2AngularNavigations, global.ng.router, global.rxjs.operators, global.ng.cdk['drag-drop'], global.ng.common.http, global.ej2Base, global.ResizeObserver, global.ej2Data, global.moment, global.CircularJSON, global.ng.material.core, global.ej2AngularLayouts, global.ng.common, global.ng.material.icon, global.ng.platformBrowser, global.ng.forms, global.ngInlineSvg, global.ej2AngularButtons, global.ej2AngularDiagrams, global.ej2AngularPopups, global.ej2AngularCalendars, global.ej2AngularInputs, global.ej2AngularDropdowns, global.ej2AngularPivotview, global.ej2AngularCharts, global.ej2AngularPdfviewer, global.ej2AngularSplitbuttons, global.ej2AngularRichtexteditor, global.ng.material.menu, global.ng.material.tooltip, global.ng.material.checkbox, global.ng.material.select, global.ng.material['form-field'], global.ng.material.input, global.ng.material.button, global.maskedtextbox, global.manager, global.query));
5
- }(this, (function (exports, core, ej2AngularGrids, lodash, rxjs, snackBar, dialog, ej2AngularTreegrid, ej2AngularNavigations, router, operators, dragDrop, http, ej2Base, ResizeObserver, ej2Data, moment, CircularJSON, core$1, ej2AngularLayouts, common, icon, platformBrowser, forms, ngInlineSvg, ej2AngularButtons, ej2AngularDiagrams, ej2AngularPopups, ej2AngularCalendars, ej2AngularInputs, ej2AngularDropdowns, ej2AngularPivotview, ej2AngularCharts, ej2AngularPdfviewer, ej2AngularSplitbuttons, ej2AngularRichtexteditor, menu, tooltip, checkbox, select, formField, input, button, maskedtextbox, manager, query) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@syncfusion/ej2-angular-grids'), require('lodash'), require('moment'), require('rxjs'), require('@angular/material/snack-bar'), require('@angular/material/dialog'), require('@syncfusion/ej2-angular-treegrid'), require('@syncfusion/ej2-angular-navigations'), require('@angular/router'), require('rxjs/operators'), require('@angular/cdk/drag-drop'), require('@angular/common/http'), require('@syncfusion/ej2-base'), require('resize-observer-polyfill'), require('@syncfusion/ej2-data'), require('circular-json'), require('@angular/material/core'), require('@syncfusion/ej2-angular-layouts'), require('@angular/common'), require('@angular/material/icon'), require('@angular/platform-browser'), require('@angular/forms'), require('ng-inline-svg'), require('@syncfusion/ej2-angular-buttons'), require('@syncfusion/ej2-angular-diagrams'), require('@syncfusion/ej2-angular-popups'), require('@syncfusion/ej2-angular-calendars'), require('@syncfusion/ej2-angular-inputs'), require('@syncfusion/ej2-angular-dropdowns'), require('@syncfusion/ej2-angular-pivotview'), require('@syncfusion/ej2-angular-charts'), require('@syncfusion/ej2-angular-pdfviewer'), require('@syncfusion/ej2-angular-splitbuttons'), require('@syncfusion/ej2-angular-richtexteditor'), require('@angular/material/menu'), require('@angular/material/tooltip'), require('@angular/material/checkbox'), require('@angular/material/select'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/button'), require('@syncfusion/ej2-inputs/src/maskedtextbox/maskedtextbox'), require('@syncfusion/ej2-data/src/manager'), require('@syncfusion/ej2-data/src/query')) :
3
+ typeof define === 'function' && define.amd ? define('raise-common-lib', ['exports', '@angular/core', '@syncfusion/ej2-angular-grids', 'lodash', 'moment', 'rxjs', '@angular/material/snack-bar', '@angular/material/dialog', '@syncfusion/ej2-angular-treegrid', '@syncfusion/ej2-angular-navigations', '@angular/router', 'rxjs/operators', '@angular/cdk/drag-drop', '@angular/common/http', '@syncfusion/ej2-base', 'resize-observer-polyfill', '@syncfusion/ej2-data', 'circular-json', '@angular/material/core', '@syncfusion/ej2-angular-layouts', '@angular/common', '@angular/material/icon', '@angular/platform-browser', '@angular/forms', 'ng-inline-svg', '@syncfusion/ej2-angular-buttons', '@syncfusion/ej2-angular-diagrams', '@syncfusion/ej2-angular-popups', '@syncfusion/ej2-angular-calendars', '@syncfusion/ej2-angular-inputs', '@syncfusion/ej2-angular-dropdowns', '@syncfusion/ej2-angular-pivotview', '@syncfusion/ej2-angular-charts', '@syncfusion/ej2-angular-pdfviewer', '@syncfusion/ej2-angular-splitbuttons', '@syncfusion/ej2-angular-richtexteditor', '@angular/material/menu', '@angular/material/tooltip', '@angular/material/checkbox', '@angular/material/select', '@angular/material/form-field', '@angular/material/input', '@angular/material/button', '@syncfusion/ej2-inputs/src/maskedtextbox/maskedtextbox', '@syncfusion/ej2-data/src/manager', '@syncfusion/ej2-data/src/query'], factory) :
4
+ (global = global || self, factory(global['raise-common-lib'] = {}, global.ng.core, global.ej2AngularGrids, global.lodash, global.moment, global.rxjs, global.ng.material['snack-bar'], global.ng.material.dialog, global.ej2AngularTreegrid, global.ej2AngularNavigations, global.ng.router, global.rxjs.operators, global.ng.cdk['drag-drop'], global.ng.common.http, global.ej2Base, global.ResizeObserver, global.ej2Data, global.CircularJSON, global.ng.material.core, global.ej2AngularLayouts, global.ng.common, global.ng.material.icon, global.ng.platformBrowser, global.ng.forms, global.ngInlineSvg, global.ej2AngularButtons, global.ej2AngularDiagrams, global.ej2AngularPopups, global.ej2AngularCalendars, global.ej2AngularInputs, global.ej2AngularDropdowns, global.ej2AngularPivotview, global.ej2AngularCharts, global.ej2AngularPdfviewer, global.ej2AngularSplitbuttons, global.ej2AngularRichtexteditor, global.ng.material.menu, global.ng.material.tooltip, global.ng.material.checkbox, global.ng.material.select, global.ng.material['form-field'], global.ng.material.input, global.ng.material.button, global.maskedtextbox, global.manager, global.query));
5
+ }(this, (function (exports, core, ej2AngularGrids, lodash, moment, rxjs, snackBar, dialog, ej2AngularTreegrid, ej2AngularNavigations, router, operators, dragDrop, http, ej2Base, ResizeObserver, ej2Data, CircularJSON, core$1, ej2AngularLayouts, common, icon, platformBrowser, forms, ngInlineSvg, ej2AngularButtons, ej2AngularDiagrams, ej2AngularPopups, ej2AngularCalendars, ej2AngularInputs, ej2AngularDropdowns, ej2AngularPivotview, ej2AngularCharts, ej2AngularPdfviewer, ej2AngularSplitbuttons, ej2AngularRichtexteditor, menu, tooltip, checkbox, select, formField, input, button, maskedtextbox, manager, query) { 'use strict';
6
6
 
7
- ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
8
7
  moment = moment && moment.hasOwnProperty('default') ? moment['default'] : moment;
8
+ ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
9
9
  CircularJSON = CircularJSON && CircularJSON.hasOwnProperty('default') ? CircularJSON['default'] : CircularJSON;
10
10
 
11
11
  /******************************************************************************
@@ -443,6 +443,791 @@
443
443
  return {};
444
444
  }
445
445
 
446
+ /**
447
+ * @fileoverview added by tsickle
448
+ * Generated from: lib/date-tree-filter/date-tree-filter.helper.ts
449
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
450
+ */
451
+ /**
452
+ * @record
453
+ */
454
+ function DateTreeFilterSetupOptions() { }
455
+ if (false) {
456
+ /** @type {?} */
457
+ DateTreeFilterSetupOptions.prototype.rows;
458
+ /** @type {?} */
459
+ DateTreeFilterSetupOptions.prototype.fields;
460
+ /** @type {?} */
461
+ DateTreeFilterSetupOptions.prototype.hints;
462
+ }
463
+ /**
464
+ * @record
465
+ */
466
+ function DateTreeFilterHelperOptions() { }
467
+ if (false) {
468
+ /** @type {?} */
469
+ DateTreeFilterHelperOptions.prototype.getTranslation;
470
+ /** @type {?} */
471
+ DateTreeFilterHelperOptions.prototype.getPopoverElement;
472
+ /** @type {?} */
473
+ DateTreeFilterHelperOptions.prototype.getGridElement;
474
+ /** @type {?} */
475
+ DateTreeFilterHelperOptions.prototype.applyRows;
476
+ /** @type {?|undefined} */
477
+ DateTreeFilterHelperOptions.prototype.parseDateValue;
478
+ /** @type {?|undefined} */
479
+ DateTreeFilterHelperOptions.prototype.dateFormats;
480
+ }
481
+ /**
482
+ * @record
483
+ */
484
+ function RsCommonGridDateTreeFactoryHost() { }
485
+ if (false) {
486
+ /** @type {?} */
487
+ RsCommonGridDateTreeFactoryHost.prototype.translation;
488
+ /** @type {?} */
489
+ RsCommonGridDateTreeFactoryHost.prototype.dateTreePopoverRef;
490
+ /** @type {?} */
491
+ RsCommonGridDateTreeFactoryHost.prototype.grid;
492
+ }
493
+ /** @type {?} */
494
+ var DATE_TREE_DEFAULT_DATE_FORMATS = [
495
+ "YYYY-MM-DD",
496
+ "MM/DD/YYYY",
497
+ "DD/MM/YYYY",
498
+ "YYYY/MM/DD",
499
+ "DD-MMM-YYYY",
500
+ "MMM DD, YYYY",
501
+ ];
502
+ var DateTreeFilterHelper = /** @class */ (function () {
503
+ function DateTreeFilterHelper(options) {
504
+ this.popoverVisible = false;
505
+ this.popoverField = "";
506
+ this.popoverStyle = {};
507
+ this.selectedByField = {};
508
+ this.fieldLabelMap = {};
509
+ this.dateFields = [];
510
+ this.sourceRows = [];
511
+ this.defaultDateFormats = [
512
+ "YYYY-MM-DD",
513
+ "MM/DD/YYYY",
514
+ "DD/MM/YYYY",
515
+ "YYYY/MM/DD",
516
+ "DD-MMM-YYYY",
517
+ "DD-MMM-YYYY hh:mm A",
518
+ "MMM DD, YYYY",
519
+ moment.ISO_8601,
520
+ ];
521
+ this.options = options;
522
+ }
523
+ /**
524
+ * @param {?} config
525
+ * @return {?}
526
+ */
527
+ DateTreeFilterHelper.prototype.setup = /**
528
+ * @param {?} config
529
+ * @return {?}
530
+ */
531
+ function (config) {
532
+ var _this = this;
533
+ /** @type {?} */
534
+ var rows = config && config.rows ? config.rows : [];
535
+ /** @type {?} */
536
+ var fields = config && config.fields ? config.fields : [];
537
+ /** @type {?} */
538
+ var hints = config && config.hints ? config.hints : [];
539
+ this.sourceRows = rows;
540
+ this.dateFields = this.resolveDateTreeFieldsByHints(fields, hints);
541
+ this.fieldLabelMap = {};
542
+ (fields || []).forEach((/**
543
+ * @param {?} item
544
+ * @return {?}
545
+ */
546
+ function (item) {
547
+ if (!item || !item.columnName) {
548
+ return;
549
+ }
550
+ _this.fieldLabelMap[item.columnName] =
551
+ item.columnDisplayName || item.columnName;
552
+ }));
553
+ this.apply();
554
+ };
555
+ /**
556
+ * @param {?} args
557
+ * @return {?}
558
+ */
559
+ DateTreeFilterHelper.prototype.handleGridActionBegin = /**
560
+ * @param {?} args
561
+ * @return {?}
562
+ */
563
+ function (args) {
564
+ /** @type {?} */
565
+ var requestType = this.getRequestType(args);
566
+ if (requestType === "filterchoicerequest" ||
567
+ requestType === "filtersearchbegin") {
568
+ args.filterChoiceCount = 15000;
569
+ }
570
+ if (requestType !== "filterbeforeopen") {
571
+ return;
572
+ }
573
+ /** @type {?} */
574
+ var columnName = this.resolveActionColumnName(args);
575
+ if (!this.isDateTreeField(columnName)) {
576
+ this.close();
577
+ return;
578
+ }
579
+ args.cancel = true;
580
+ this.open(columnName);
581
+ };
582
+ /**
583
+ * @param {?} selectionMap
584
+ * @return {?}
585
+ */
586
+ DateTreeFilterHelper.prototype.updateSelection = /**
587
+ * @param {?} selectionMap
588
+ * @return {?}
589
+ */
590
+ function (selectionMap) {
591
+ this.selectedByField = selectionMap || {};
592
+ this.apply();
593
+ };
594
+ /**
595
+ * @return {?}
596
+ */
597
+ DateTreeFilterHelper.prototype.close = /**
598
+ * @return {?}
599
+ */
600
+ function () {
601
+ if (!this.popoverVisible) {
602
+ return;
603
+ }
604
+ this.popoverVisible = false;
605
+ this.popoverField = "";
606
+ this.popoverStyle = {};
607
+ };
608
+ /**
609
+ * @param {?} event
610
+ * @return {?}
611
+ */
612
+ DateTreeFilterHelper.prototype.handleDocumentMouseDown = /**
613
+ * @param {?} event
614
+ * @return {?}
615
+ */
616
+ function (event) {
617
+ if (!this.popoverVisible) {
618
+ return;
619
+ }
620
+ /** @type {?} */
621
+ var target = (/** @type {?} */ (event.target));
622
+ if (!target) {
623
+ return;
624
+ }
625
+ if (this.isInsidePopover(target) || this.isDateFilterMenuItem(target)) {
626
+ return;
627
+ }
628
+ this.close();
629
+ };
630
+ /**
631
+ * @param {?} event
632
+ * @return {?}
633
+ */
634
+ DateTreeFilterHelper.prototype.handleDocumentMouseOver = /**
635
+ * @param {?} event
636
+ * @return {?}
637
+ */
638
+ function (event) {
639
+ if (!this.popoverVisible) {
640
+ return;
641
+ }
642
+ /** @type {?} */
643
+ var target = (/** @type {?} */ (event.target));
644
+ if (!target) {
645
+ return;
646
+ }
647
+ if (this.isInsidePopover(target)) {
648
+ return;
649
+ }
650
+ /** @type {?} */
651
+ var menuItem = (/** @type {?} */ (target.closest(".e-menu-item")));
652
+ if (menuItem) {
653
+ if (!this.isDateFilterMenuItem(menuItem)) {
654
+ this.close();
655
+ }
656
+ return;
657
+ }
658
+ /** @type {?} */
659
+ var otherFilterTarget = (/** @type {?} */ (target.closest(".e-filtermenudiv, .e-headercell .e-columnmenu, .e-columnmenu, .e-contextmenu")));
660
+ if (otherFilterTarget && !this.isDateFilterMenuItem(otherFilterTarget)) {
661
+ this.close();
662
+ }
663
+ };
664
+ /**
665
+ * @return {?}
666
+ */
667
+ DateTreeFilterHelper.prototype.updatePosition = /**
668
+ * @return {?}
669
+ */
670
+ function () {
671
+ if (!this.popoverVisible) {
672
+ return;
673
+ }
674
+ /** @type {?} */
675
+ var anchor = this.findDateFilterAnchorElement();
676
+ if (anchor) {
677
+ /** @type {?} */
678
+ var rect = anchor.getBoundingClientRect();
679
+ /** @type {?} */
680
+ var viewportWidth = window.innerWidth || document.documentElement.clientWidth;
681
+ /** @type {?} */
682
+ var viewportHeight = window.innerHeight || document.documentElement.clientHeight;
683
+ /** @type {?} */
684
+ var popoverElement = this.options.getPopoverElement
685
+ ? this.options.getPopoverElement()
686
+ : null;
687
+ /** @type {?} */
688
+ var popoverWidth = popoverElement && popoverElement.offsetWidth
689
+ ? popoverElement.offsetWidth
690
+ : 300;
691
+ /** @type {?} */
692
+ var popoverHeight = popoverElement && popoverElement.offsetHeight
693
+ ? popoverElement.offsetHeight
694
+ : 420;
695
+ /** @type {?} */
696
+ var edgeGap = 8;
697
+ /** @type {?} */
698
+ var anchorGap = 8;
699
+ /** @type {?} */
700
+ var top = rect.top - 6;
701
+ /** @type {?} */
702
+ var left = rect.right + anchorGap;
703
+ if (left + popoverWidth > viewportWidth - edgeGap) {
704
+ left = rect.left - popoverWidth - anchorGap;
705
+ }
706
+ if (left < edgeGap) {
707
+ left = edgeGap;
708
+ }
709
+ if (left + popoverWidth > viewportWidth - edgeGap) {
710
+ left = Math.max(edgeGap, viewportWidth - popoverWidth - edgeGap);
711
+ }
712
+ if (top + popoverHeight > viewportHeight - edgeGap) {
713
+ top = Math.max(edgeGap, viewportHeight - popoverHeight - edgeGap);
714
+ }
715
+ this.popoverStyle = {
716
+ position: "fixed",
717
+ left: left + "px",
718
+ top: top + "px",
719
+ };
720
+ return;
721
+ }
722
+ /** @type {?} */
723
+ var gridElement = this.options.getGridElement
724
+ ? this.options.getGridElement()
725
+ : null;
726
+ if (gridElement && gridElement.getBoundingClientRect) {
727
+ /** @type {?} */
728
+ var fallbackRect = gridElement.getBoundingClientRect();
729
+ this.popoverStyle = {
730
+ position: "fixed",
731
+ left: Math.max(8, fallbackRect.right - 312) + "px",
732
+ top: Math.max(8, fallbackRect.top + 8) + "px",
733
+ };
734
+ }
735
+ };
736
+ /**
737
+ * @private
738
+ * @param {?} field
739
+ * @return {?}
740
+ */
741
+ DateTreeFilterHelper.prototype.open = /**
742
+ * @private
743
+ * @param {?} field
744
+ * @return {?}
745
+ */
746
+ function (field) {
747
+ var _this = this;
748
+ this.popoverField = field;
749
+ this.popoverVisible = true;
750
+ this.updatePosition();
751
+ setTimeout((/**
752
+ * @return {?}
753
+ */
754
+ function () { return _this.updatePosition(); }), 50);
755
+ setTimeout((/**
756
+ * @return {?}
757
+ */
758
+ function () { return _this.updatePosition(); }), 150);
759
+ };
760
+ /**
761
+ * @private
762
+ * @return {?}
763
+ */
764
+ DateTreeFilterHelper.prototype.apply = /**
765
+ * @private
766
+ * @return {?}
767
+ */
768
+ function () {
769
+ /** @type {?} */
770
+ var filteredRows = this.filterRowsBySelectedDateTree(this.sourceRows || []);
771
+ this.options.applyRows(filteredRows);
772
+ };
773
+ /**
774
+ * @private
775
+ * @param {?} args
776
+ * @return {?}
777
+ */
778
+ DateTreeFilterHelper.prototype.getRequestType = /**
779
+ * @private
780
+ * @param {?} args
781
+ * @return {?}
782
+ */
783
+ function (args) {
784
+ if (!args || !args.requestType) {
785
+ return "";
786
+ }
787
+ return String(args.requestType).trim().toLowerCase();
788
+ };
789
+ /**
790
+ * @private
791
+ * @param {?} args
792
+ * @return {?}
793
+ */
794
+ DateTreeFilterHelper.prototype.resolveActionColumnName = /**
795
+ * @private
796
+ * @param {?} args
797
+ * @return {?}
798
+ */
799
+ function (args) {
800
+ if (!args) {
801
+ return "";
802
+ }
803
+ return (args.columnName ||
804
+ args.field ||
805
+ args.currentFilteringColumn ||
806
+ (args.column && (args.column.field || args.column.columnName)) ||
807
+ "");
808
+ };
809
+ /**
810
+ * @private
811
+ * @param {?} fields
812
+ * @param {?} hints
813
+ * @return {?}
814
+ */
815
+ DateTreeFilterHelper.prototype.resolveDateTreeFieldsByHints = /**
816
+ * @private
817
+ * @param {?} fields
818
+ * @param {?} hints
819
+ * @return {?}
820
+ */
821
+ function (fields, hints) {
822
+ /** @type {?} */
823
+ var normalizedHints = (hints || [])
824
+ .filter((/**
825
+ * @param {?} item
826
+ * @return {?}
827
+ */
828
+ function (item) { return !!item; }))
829
+ .map((/**
830
+ * @param {?} item
831
+ * @return {?}
832
+ */
833
+ function (item) { return String(item).trim().toLowerCase(); }));
834
+ if (!fields || !fields.length || !normalizedHints.length) {
835
+ return [];
836
+ }
837
+ return fields
838
+ .filter((/**
839
+ * @param {?} item
840
+ * @return {?}
841
+ */
842
+ function (item) {
843
+ if (!item || !item.columnName) {
844
+ return false;
845
+ }
846
+ /** @type {?} */
847
+ var columnName = String(item.columnName || "").toLowerCase();
848
+ /** @type {?} */
849
+ var displayName = String(item.columnDisplayName || "").toLowerCase();
850
+ return normalizedHints.some((/**
851
+ * @param {?} hint
852
+ * @return {?}
853
+ */
854
+ function (hint) {
855
+ return (columnName === hint ||
856
+ displayName === hint ||
857
+ (hint.length >= 3 &&
858
+ (columnName.indexOf(hint) > -1 ||
859
+ displayName.indexOf(hint) > -1)));
860
+ }));
861
+ }))
862
+ .map((/**
863
+ * @param {?} item
864
+ * @return {?}
865
+ */
866
+ function (item) { return item.columnName; }));
867
+ };
868
+ /**
869
+ * @private
870
+ * @param {?} field
871
+ * @return {?}
872
+ */
873
+ DateTreeFilterHelper.prototype.isDateTreeField = /**
874
+ * @private
875
+ * @param {?} field
876
+ * @return {?}
877
+ */
878
+ function (field) {
879
+ return this.dateFields.indexOf(field) > -1;
880
+ };
881
+ /**
882
+ * @private
883
+ * @param {?} field
884
+ * @return {?}
885
+ */
886
+ DateTreeFilterHelper.prototype.getFieldDaySelectionMap = /**
887
+ * @private
888
+ * @param {?} field
889
+ * @return {?}
890
+ */
891
+ function (field) {
892
+ if (!this.selectedByField[field]) {
893
+ this.selectedByField[field] = {};
894
+ }
895
+ return this.selectedByField[field];
896
+ };
897
+ /**
898
+ * @private
899
+ * @param {?} rows
900
+ * @param {?=} excludeField
901
+ * @return {?}
902
+ */
903
+ DateTreeFilterHelper.prototype.filterRowsBySelectedDateTree = /**
904
+ * @private
905
+ * @param {?} rows
906
+ * @param {?=} excludeField
907
+ * @return {?}
908
+ */
909
+ function (rows, excludeField) {
910
+ var _this = this;
911
+ /** @type {?} */
912
+ var filteredRows = rows ? rows.slice() : [];
913
+ this.dateFields.forEach((/**
914
+ * @param {?} field
915
+ * @return {?}
916
+ */
917
+ function (field) {
918
+ if (excludeField && field === excludeField) {
919
+ return;
920
+ }
921
+ /** @type {?} */
922
+ var selectedMap = _this.getFieldDaySelectionMap(field);
923
+ /** @type {?} */
924
+ var selectedKeys = Object.keys(selectedMap);
925
+ if (!selectedKeys.length) {
926
+ return;
927
+ }
928
+ filteredRows = filteredRows.filter((/**
929
+ * @param {?} row
930
+ * @return {?}
931
+ */
932
+ function (row) {
933
+ /** @type {?} */
934
+ var dayKey = _this.getDayKeyByRowValue(row[field]);
935
+ return dayKey ? !!selectedMap[dayKey] : false;
936
+ }));
937
+ }));
938
+ return filteredRows;
939
+ };
940
+ /**
941
+ * @private
942
+ * @param {?} value
943
+ * @return {?}
944
+ */
945
+ DateTreeFilterHelper.prototype.getDayKeyByRowValue = /**
946
+ * @private
947
+ * @param {?} value
948
+ * @return {?}
949
+ */
950
+ function (value) {
951
+ /** @type {?} */
952
+ var date = this.parseDateValue(value);
953
+ if (!date) {
954
+ return "";
955
+ }
956
+ return this.toDayKey(date.getFullYear(), date.getMonth() + 1, date.getDate());
957
+ };
958
+ /**
959
+ * @private
960
+ * @param {?} value
961
+ * @return {?}
962
+ */
963
+ DateTreeFilterHelper.prototype.parseDateValue = /**
964
+ * @private
965
+ * @param {?} value
966
+ * @return {?}
967
+ */
968
+ function (value) {
969
+ if (this.options.parseDateValue) {
970
+ return this.options.parseDateValue(value);
971
+ }
972
+ if (!value) {
973
+ return null;
974
+ }
975
+ if (value instanceof Date) {
976
+ return value;
977
+ }
978
+ /** @type {?} */
979
+ var formats = this.options && this.options.dateFormats && this.options.dateFormats.length
980
+ ? this.options.dateFormats
981
+ : this.defaultDateFormats;
982
+ /** @type {?} */
983
+ var parsed = moment(value, formats, true);
984
+ if (parsed.isValid()) {
985
+ return parsed.toDate();
986
+ }
987
+ /** @type {?} */
988
+ var fallback = new Date(value);
989
+ return isNaN(fallback.getTime()) ? null : fallback;
990
+ };
991
+ /**
992
+ * @private
993
+ * @param {?} year
994
+ * @param {?} month
995
+ * @param {?} day
996
+ * @return {?}
997
+ */
998
+ DateTreeFilterHelper.prototype.toDayKey = /**
999
+ * @private
1000
+ * @param {?} year
1001
+ * @param {?} month
1002
+ * @param {?} day
1003
+ * @return {?}
1004
+ */
1005
+ function (year, month, day) {
1006
+ return year + "-" + this.pad2(month) + "-" + this.pad2(day);
1007
+ };
1008
+ /**
1009
+ * @private
1010
+ * @param {?} value
1011
+ * @return {?}
1012
+ */
1013
+ DateTreeFilterHelper.prototype.pad2 = /**
1014
+ * @private
1015
+ * @param {?} value
1016
+ * @return {?}
1017
+ */
1018
+ function (value) {
1019
+ return value < 10 ? "0" + value : String(value);
1020
+ };
1021
+ /**
1022
+ * @private
1023
+ * @param {?} target
1024
+ * @return {?}
1025
+ */
1026
+ DateTreeFilterHelper.prototype.isInsidePopover = /**
1027
+ * @private
1028
+ * @param {?} target
1029
+ * @return {?}
1030
+ */
1031
+ function (target) {
1032
+ /** @type {?} */
1033
+ var popoverElement = this.options.getPopoverElement
1034
+ ? this.options.getPopoverElement()
1035
+ : null;
1036
+ if (!target || !popoverElement) {
1037
+ return false;
1038
+ }
1039
+ return popoverElement.contains(target);
1040
+ };
1041
+ /**
1042
+ * @private
1043
+ * @param {?} element
1044
+ * @return {?}
1045
+ */
1046
+ DateTreeFilterHelper.prototype.isDateFilterMenuItem = /**
1047
+ * @private
1048
+ * @param {?} element
1049
+ * @return {?}
1050
+ */
1051
+ function (element) {
1052
+ if (!element) {
1053
+ return false;
1054
+ }
1055
+ /** @type {?} */
1056
+ var menuItem = (/** @type {?} */ (element.closest(".e-menu-item")));
1057
+ if (!menuItem) {
1058
+ return false;
1059
+ }
1060
+ /** @type {?} */
1061
+ var text = (menuItem.textContent || "").trim().toLowerCase();
1062
+ /** @type {?} */
1063
+ var translation = this.options.getTranslation
1064
+ ? this.options.getTranslation()
1065
+ : null;
1066
+ /** @type {?} */
1067
+ var filterText = String((translation && translation.FILTER) || "filter")
1068
+ .trim()
1069
+ .toLowerCase();
1070
+ if (!text) {
1071
+ return false;
1072
+ }
1073
+ if (text.indexOf(filterText) > -1 || text.indexOf("filter") > -1) {
1074
+ return true;
1075
+ }
1076
+ /** @type {?} */
1077
+ var cls = (menuItem.className || "").toLowerCase();
1078
+ return cls.indexOf("filter") > -1;
1079
+ };
1080
+ /**
1081
+ * @private
1082
+ * @return {?}
1083
+ */
1084
+ DateTreeFilterHelper.prototype.findDateFilterAnchorElement = /**
1085
+ * @private
1086
+ * @return {?}
1087
+ */
1088
+ function () {
1089
+ var _this = this;
1090
+ /** @type {?} */
1091
+ var menuContainers = (/** @type {?} */ (Array.from(document.querySelectorAll(".e-columnmenu, .e-contextmenu"))));
1092
+ /** @type {?} */
1093
+ var visibleContainers = menuContainers.filter((/**
1094
+ * @param {?} container
1095
+ * @return {?}
1096
+ */
1097
+ function (container) {
1098
+ if (!container || !container.getBoundingClientRect) {
1099
+ return false;
1100
+ }
1101
+ /** @type {?} */
1102
+ var rect = container.getBoundingClientRect();
1103
+ if (rect.width <= 0 || rect.height <= 0) {
1104
+ return false;
1105
+ }
1106
+ /** @type {?} */
1107
+ var style = window.getComputedStyle(container);
1108
+ if (!style || style.display === "none" || style.visibility === "hidden") {
1109
+ return false;
1110
+ }
1111
+ return true;
1112
+ }));
1113
+ if (!visibleContainers.length) {
1114
+ return null;
1115
+ }
1116
+ /** @type {?} */
1117
+ var currentContainer = visibleContainers[visibleContainers.length - 1];
1118
+ /** @type {?} */
1119
+ var menuItems = (/** @type {?} */ (Array.from(currentContainer.querySelectorAll(".e-menu-item"))));
1120
+ /** @type {?} */
1121
+ var visibleFilterItems = menuItems.filter((/**
1122
+ * @param {?} item
1123
+ * @return {?}
1124
+ */
1125
+ function (item) {
1126
+ if (!_this.isDateFilterMenuItem(item)) {
1127
+ return false;
1128
+ }
1129
+ if (!item.getBoundingClientRect) {
1130
+ return false;
1131
+ }
1132
+ /** @type {?} */
1133
+ var rect = item.getBoundingClientRect();
1134
+ return rect.width > 0 && rect.height > 0;
1135
+ }));
1136
+ if (!visibleFilterItems.length) {
1137
+ return null;
1138
+ }
1139
+ /** @type {?} */
1140
+ var focusedItem = visibleFilterItems.find((/**
1141
+ * @param {?} item
1142
+ * @return {?}
1143
+ */
1144
+ function (item) {
1145
+ return (item.classList.contains("e-focused") ||
1146
+ item.classList.contains("e-selected") ||
1147
+ item.classList.contains("e-hover"));
1148
+ }));
1149
+ return focusedItem || visibleFilterItems[visibleFilterItems.length - 1];
1150
+ };
1151
+ return DateTreeFilterHelper;
1152
+ }());
1153
+ if (false) {
1154
+ /** @type {?} */
1155
+ DateTreeFilterHelper.prototype.popoverVisible;
1156
+ /** @type {?} */
1157
+ DateTreeFilterHelper.prototype.popoverField;
1158
+ /** @type {?} */
1159
+ DateTreeFilterHelper.prototype.popoverStyle;
1160
+ /** @type {?} */
1161
+ DateTreeFilterHelper.prototype.selectedByField;
1162
+ /** @type {?} */
1163
+ DateTreeFilterHelper.prototype.fieldLabelMap;
1164
+ /** @type {?} */
1165
+ DateTreeFilterHelper.prototype.dateFields;
1166
+ /**
1167
+ * @type {?}
1168
+ * @private
1169
+ */
1170
+ DateTreeFilterHelper.prototype.sourceRows;
1171
+ /**
1172
+ * @type {?}
1173
+ * @private
1174
+ */
1175
+ DateTreeFilterHelper.prototype.options;
1176
+ /**
1177
+ * @type {?}
1178
+ * @private
1179
+ */
1180
+ DateTreeFilterHelper.prototype.defaultDateFormats;
1181
+ }
1182
+ /**
1183
+ * @param {?} host
1184
+ * @return {?}
1185
+ */
1186
+ function resolveGridElement(host) {
1187
+ if (!host || !host.grid) {
1188
+ return null;
1189
+ }
1190
+ /** @type {?} */
1191
+ var gridRef = host.grid;
1192
+ if (gridRef.grid && gridRef.grid.element) {
1193
+ return gridRef.grid.element;
1194
+ }
1195
+ if (gridRef.element) {
1196
+ return gridRef.element;
1197
+ }
1198
+ return null;
1199
+ }
1200
+ /**
1201
+ * @param {?} host
1202
+ * @param {?} applyRows
1203
+ * @param {?=} dateFormats
1204
+ * @return {?}
1205
+ */
1206
+ function createRsCommonGridDateTreeHelper(host, applyRows, dateFormats) {
1207
+ return new DateTreeFilterHelper({
1208
+ getTranslation: (/**
1209
+ * @return {?}
1210
+ */
1211
+ function () { return (host ? host.translation : null); }),
1212
+ getPopoverElement: (/**
1213
+ * @return {?}
1214
+ */
1215
+ function () {
1216
+ return host && host.dateTreePopoverRef
1217
+ ? host.dateTreePopoverRef.nativeElement
1218
+ : null;
1219
+ }),
1220
+ getGridElement: (/**
1221
+ * @return {?}
1222
+ */
1223
+ function () { return resolveGridElement(host); }),
1224
+ applyRows: applyRows,
1225
+ dateFormats: dateFormats && dateFormats.length
1226
+ ? dateFormats
1227
+ : DATE_TREE_DEFAULT_DATE_FORMATS,
1228
+ });
1229
+ }
1230
+
446
1231
  /**
447
1232
  * @fileoverview added by tsickle
448
1233
  * Generated from: lib/common-grid/index.component.ts
@@ -450,6 +1235,7 @@
450
1235
  */
451
1236
  var CommonGridComponent = /** @class */ (function () {
452
1237
  function CommonGridComponent(ref) {
1238
+ var _this = this;
453
1239
  this.ref = ref;
454
1240
  this.showCheckBox = true;
455
1241
  this.loaded = true;
@@ -496,6 +1282,23 @@
496
1282
  this.alwaysShowCheckbox = false;
497
1283
  this.disableSystemRow = false; // 禁用IsSytem = true的整行
498
1284
  // 禁用IsSytem = true的整行
1285
+ /**
1286
+ * 开启日期树筛选(默认关闭,不影响现有页面)
1287
+ */
1288
+ this.enableDateTreeFilter = false;
1289
+ /**
1290
+ * 参与日期树筛选的列名或 hint,如 ['CreatedOn', 'ModifiedOn']
1291
+ */
1292
+ this.dateTreeFilterFields = [];
1293
+ /**
1294
+ * 未筛选原始数据(可选)。
1295
+ * 不传时由组件在 dataSource 变更时自动快照;传则由页面自行维护 raw。
1296
+ */
1297
+ this.dateTreeSourceRows = null;
1298
+ /**
1299
+ * 内聚模式下仍向页面同步筛选结果(默认 false,一般无需绑定)
1300
+ */
1301
+ this.dateTreeEmitFilteredRows = false;
499
1302
  this.recordDoubleClick = new core.EventEmitter();
500
1303
  this.actionComplete = new core.EventEmitter();
501
1304
  this.rowSelected = new core.EventEmitter();
@@ -513,6 +1316,16 @@
513
1316
  this.rowDrop = new core.EventEmitter();
514
1317
  this.rowDrag = new core.EventEmitter();
515
1318
  this.rowDragStart = new core.EventEmitter();
1319
+ /**
1320
+ * 日期树筛选后的行数据(可选,复杂页面与 dateTreeSourceRows 搭配使用)
1321
+ */
1322
+ this.dateTreeFilteredRows = new core.EventEmitter();
1323
+ /**
1324
+ * 内聚模式:表格实际绑定的数据
1325
+ */
1326
+ this.dateTreeDisplayRows = [];
1327
+ this.dateTreeRawRows = [];
1328
+ this.dateTreeApplyingFilter = false;
516
1329
  this.selectId = [];
517
1330
  this.startPaging = false;
518
1331
  this.indexList = [];
@@ -540,6 +1353,11 @@
540
1353
  return list;
541
1354
  });
542
1355
  this.translation = getTranslation();
1356
+ this.dateTreeHelper = createRsCommonGridDateTreeHelper(this, (/**
1357
+ * @param {?} rows
1358
+ * @return {?}
1359
+ */
1360
+ function (rows) { return _this.onDateTreeRowsApplied(rows); }));
543
1361
  }
544
1362
  /**
545
1363
  * @return {?}
@@ -567,6 +1385,36 @@
567
1385
  function (index, item) {
568
1386
  return index; // or a unique identifier in your object
569
1387
  };
1388
+ Object.defineProperty(CommonGridComponent.prototype, "gridBindDataSource", {
1389
+ /** ejs-grid 绑定数据源:内聚模式用内部展示数据,否则用 dataSource */
1390
+ get: /**
1391
+ * ejs-grid 绑定数据源:内聚模式用内部展示数据,否则用 dataSource
1392
+ * @return {?}
1393
+ */
1394
+ function () {
1395
+ if (this.enableDateTreeFilter && this.dateTreeSourceRows == null) {
1396
+ return this.dateTreeDisplayRows;
1397
+ }
1398
+ return this.dataSource;
1399
+ },
1400
+ enumerable: true,
1401
+ configurable: true
1402
+ });
1403
+ Object.defineProperty(CommonGridComponent.prototype, "dateTreePopoverSourceRows", {
1404
+ /** 日期树 popover 用的全量数据 */
1405
+ get: /**
1406
+ * 日期树 popover 用的全量数据
1407
+ * @return {?}
1408
+ */
1409
+ function () {
1410
+ if (this.dateTreeSourceRows != null) {
1411
+ return this.dateTreeSourceRows;
1412
+ }
1413
+ return this.dateTreeRawRows;
1414
+ },
1415
+ enumerable: true,
1416
+ configurable: true
1417
+ });
570
1418
  /**
571
1419
  * @param {?} changes
572
1420
  * @return {?}
@@ -576,12 +1424,16 @@
576
1424
  * @return {?}
577
1425
  */
578
1426
  function (changes) {
579
- if (changes.dataSource && changes.dataSource.currentValue) {
1427
+ /** @type {?} */
1428
+ var bindRows = changes.dataSource && changes.dataSource.currentValue
1429
+ ? changes.dataSource.currentValue
1430
+ : null;
1431
+ if (bindRows) {
580
1432
  if (this.allowPaging &&
581
- changes.dataSource.currentValue.length &&
1433
+ bindRows.length &&
582
1434
  !this.pageSettings) {
583
1435
  this.pageSettings =
584
- changes.dataSource.currentValue.length > 9
1436
+ bindRows.length > 9
585
1437
  ? {
586
1438
  pageSizes: ["All", "25", "50", "100"],
587
1439
  pageSize: 50,
@@ -589,11 +1441,123 @@
589
1441
  : null;
590
1442
  }
591
1443
  }
1444
+ if (this.enableDateTreeFilter &&
1445
+ this.dateTreeSourceRows == null &&
1446
+ changes.dataSource &&
1447
+ !this.dateTreeApplyingFilter) {
1448
+ this.captureDateTreeRawFromDataSource(changes.dataSource.currentValue);
1449
+ }
1450
+ if (changes.enableDateTreeFilter && changes.enableDateTreeFilter.currentValue) {
1451
+ this.captureDateTreeRawFromDataSource(this.dataSource);
1452
+ }
1453
+ if (changes.enableDateTreeFilter && !changes.enableDateTreeFilter.currentValue) {
1454
+ this.dateTreeHelper && this.dateTreeHelper.close();
1455
+ this.dateTreeDisplayRows = [];
1456
+ this.dateTreeRawRows = [];
1457
+ }
1458
+ if (this.enableDateTreeFilter &&
1459
+ (changes.enableDateTreeFilter ||
1460
+ changes.dateTreeFilterFields ||
1461
+ changes.dateTreeSourceRows ||
1462
+ changes.fields ||
1463
+ changes.dataSource)) {
1464
+ this.refreshDateTreeFilter();
1465
+ }
592
1466
  };
593
1467
  /**
1468
+ * @private
1469
+ * @param {?} rows
594
1470
  * @return {?}
595
1471
  */
596
- CommonGridComponent.prototype._load = /**
1472
+ CommonGridComponent.prototype.captureDateTreeRawFromDataSource = /**
1473
+ * @private
1474
+ * @param {?} rows
1475
+ * @return {?}
1476
+ */
1477
+ function (rows) {
1478
+ this.dateTreeRawRows = rows ? rows.slice() : [];
1479
+ };
1480
+ /**
1481
+ * @param {?} event
1482
+ * @return {?}
1483
+ */
1484
+ CommonGridComponent.prototype.onDocumentMouseDown = /**
1485
+ * @param {?} event
1486
+ * @return {?}
1487
+ */
1488
+ function (event) {
1489
+ if (this.enableDateTreeFilter && this.dateTreeHelper) {
1490
+ this.dateTreeHelper.handleDocumentMouseDown(event);
1491
+ }
1492
+ };
1493
+ /**
1494
+ * @param {?} event
1495
+ * @return {?}
1496
+ */
1497
+ CommonGridComponent.prototype.onDocumentMouseOver = /**
1498
+ * @param {?} event
1499
+ * @return {?}
1500
+ */
1501
+ function (event) {
1502
+ if (this.enableDateTreeFilter && this.dateTreeHelper) {
1503
+ this.dateTreeHelper.handleDocumentMouseOver(event);
1504
+ }
1505
+ };
1506
+ /**
1507
+ * @private
1508
+ * @return {?}
1509
+ */
1510
+ CommonGridComponent.prototype.refreshDateTreeFilter = /**
1511
+ * @private
1512
+ * @return {?}
1513
+ */
1514
+ function () {
1515
+ if (!this.enableDateTreeFilter || !this.dateTreeHelper) {
1516
+ return;
1517
+ }
1518
+ /** @type {?} */
1519
+ var rows = this.dateTreeSourceRows != null
1520
+ ? this.dateTreeSourceRows
1521
+ : this.dateTreeRawRows || [];
1522
+ this.dateTreeHelper.setup({
1523
+ rows: rows,
1524
+ fields: this.fields || [],
1525
+ hints: this.dateTreeFilterFields || [],
1526
+ });
1527
+ };
1528
+ /**
1529
+ * @private
1530
+ * @param {?} rows
1531
+ * @return {?}
1532
+ */
1533
+ CommonGridComponent.prototype.onDateTreeRowsApplied = /**
1534
+ * @private
1535
+ * @param {?} rows
1536
+ * @return {?}
1537
+ */
1538
+ function (rows) {
1539
+ var _this = this;
1540
+ /** @type {?} */
1541
+ var result = rows || [];
1542
+ this.dateTreeApplyingFilter = true;
1543
+ if (this.enableDateTreeFilter && this.dateTreeSourceRows == null) {
1544
+ this.dateTreeDisplayRows = result;
1545
+ }
1546
+ if (this.dateTreeSourceRows != null || this.dateTreeEmitFilteredRows) {
1547
+ this.dateTreeFilteredRows.emit(result);
1548
+ }
1549
+ this.ref && this.ref.markForCheck();
1550
+ setTimeout((/**
1551
+ * @return {?}
1552
+ */
1553
+ function () {
1554
+ _this.dateTreeApplyingFilter = false;
1555
+ }), 0);
1556
+ };
1557
+ /**
1558
+ * @return {?}
1559
+ */
1560
+ CommonGridComponent.prototype._load = /**
597
1561
  * @return {?}
598
1562
  */
599
1563
  function () {
@@ -847,7 +1811,10 @@
847
1811
  args.requestType === "sorting")) {
848
1812
  this.startPaging = true;
849
1813
  }
850
- if (args.requestType == "filterchoicerequest" ||
1814
+ if (this.enableDateTreeFilter && this.dateTreeHelper) {
1815
+ this.dateTreeHelper.handleGridActionBegin(args);
1816
+ }
1817
+ else if (args.requestType == "filterchoicerequest" ||
851
1818
  args.requestType === "filtersearchbegin") {
852
1819
  args.filterChoiceCount = 15000;
853
1820
  }
@@ -1220,7 +2187,7 @@
1220
2187
  CommonGridComponent.decorators = [
1221
2188
  { type: core.Component, args: [{
1222
2189
  selector: "rs-common-grid",
1223
- template: "<ejs-grid\r\n #grid\r\n [id]=\"gridId\"\r\n [ngClass]=\"{\r\n 'hide-Check-box': !alwaysShowCheckbox,\r\n 'grid-loading': className === 'grid-loading'\r\n }\"\r\n [dataSource]=\"dataSource\"\r\n [allowPaging]=\"allowPaging && pageSettings\"\r\n [allowResizing]=\"true\"\r\n [pageSettings]=\"pageSettings\"\r\n [showColumnMenu]=\"true\"\r\n [allowSorting]=\"true\"\r\n [allowFiltering]=\"true\"\r\n [allowExcelExport]=\"true\"\r\n [allowRowDragAndDrop]=\"allowRowDragAndDrop\"\r\n [filterSettings]=\"filterSettings\"\r\n [resizeSettings]=\"resizeSettings\"\r\n [allowSelection]=\"true\"\r\n [editSettings]=\"editSettings\"\r\n [childGrid]=\"childGrid\"\r\n [contextMenuItems]=\"dataSource && dataSource.length ? contextMenuItems : null\"\r\n [selectionSettings]=\"selectionSettings\"\r\n (recordClick)=\"_recordClick($event)\"\r\n (recordDoubleClick)=\"_recordDoubleClick($event)\"\r\n (actionBegin)=\"_actionBegin($event)\"\r\n (actionComplete)=\"_actionHandler($event)\"\r\n (rowSelected)=\"_rowSelected($event)\"\r\n (rowDeselecting)=\"_rowDeselecting($event)\"\r\n (rowDeselected)=\"_rowDeselected($event)\"\r\n style=\"border: none\"\r\n (contextMenuClick)=\"_onContextMenu($event)\"\r\n (contextMenuOpen)=\"contextMenuOpen($event)\"\r\n (queryCellInfo)=\"customiseCell($event)\"\r\n (dataBound)=\"_dataBound($event)\"\r\n (rowDataBound)=\"_rowDataBound($event)\"\r\n (rowSelecting)=\"_rowSelecting($event)\"\r\n (excelQueryCellInfo)=\"_exportQueryCellInfo($event)\"\r\n (rowDrop)=\"onRowDrop($event)\"\r\n (rowDragStart)=\"_rowDragStart($event)\"\r\n (rowDrag)=\"_rowDrag($event)\"\r\n (load)=\"_load()\"\r\n [frozenColumns]=\"frozenColumns\"\r\n [columnChooserSettings]=\"columnChooserSettings\"\r\n>\r\n <e-columns>\r\n <e-column\r\n *ngIf=\"showCheckBox\"\r\n type=\"checkbox\"\r\n [width]=\"checkBoxWidth\"\r\n [minWidth]=\"checkBoxWidth\"\r\n [showColumnMenu]=\"false\"\r\n [allowResizing]=\"false\"\r\n ></e-column>\r\n <e-column\r\n *ngFor=\"let item of fields; trackBy: trackByFn; let last = last\"\r\n [field]=\"item.columnName\"\r\n [filter]=\"item.filter ? item.filter : { type: 'CheckBox' }\"\r\n [customAttributes]=\"\r\n item.colName === 'entityUserList' || item.colName === 'kycProgress'\r\n ? { class: 'hideColumnFilterClass' }\r\n : {}\r\n \"\r\n [headerText]=\"item.columnDisplayName\"\r\n [textAlign]=\"item.textAlign\"\r\n [showColumnMenu]=\"item.showColumnMenu === undefined ? true : false\"\r\n [allowFiltering]=\"item.allowFiltering === undefined ? true : false\"\r\n [allowSorting]=\"item.allowSorting === undefined ? true : false\"\r\n [showInColumnChooser]=\"\r\n item.showInColumnChooser === undefined ? true : item.showInColumnChooser\r\n \"\r\n [editType]=\"item.editType\"\r\n [validationRules]=\"item.validationRules\"\r\n [type]=\"item.dataType || 'string'\"\r\n [width]=\"item.width\"\r\n [minWidth]=\"item.minWidth\"\r\n [format]=\"item.format\"\r\n [visible]=\"item.visible\"\r\n [template]=\"item.showTemplate ? columnTemplate : undefined\"\r\n [clipMode]=\"\r\n item.clipMode ? item.clipMode : clipMode || 'EllipsisWithTooltip'\r\n \"\r\n [sortComparer]=\"item.dateComparer || null\"\r\n [allowResizing]=\"!last\"\r\n [headerTemplate]=\"item.showHeaderTemplate ? headerTemplate : undefined\"\r\n [isPrimaryKey]=\"item?.isPrimaryKey ? true : false\"\r\n >\r\n </e-column>\r\n </e-columns>\r\n</ejs-grid>\r\n",
2190
+ template: "<rs-date-tree-filter-popover\r\n *ngIf=\"enableDateTreeFilter && dateTreeHelper && dateTreeHelper.popoverVisible\"\r\n #dateTreePopoverRef\r\n [ngStyle]=\"dateTreeHelper.popoverStyle\"\r\n [field]=\"dateTreeHelper.popoverField\"\r\n [translation]=\"translation\"\r\n [sourceRows]=\"dateTreePopoverSourceRows\"\r\n [dateFields]=\"dateTreeHelper.dateFields\"\r\n [selectedByField]=\"dateTreeHelper.selectedByField\"\r\n [fieldLabelMap]=\"dateTreeHelper.fieldLabelMap\"\r\n (apply)=\"dateTreeHelper.updateSelection($event)\"\r\n (close)=\"dateTreeHelper.close()\"\r\n></rs-date-tree-filter-popover>\r\n<ejs-grid\r\n #grid\r\n [id]=\"gridId\"\r\n [ngClass]=\"{\r\n 'hide-Check-box': !alwaysShowCheckbox,\r\n 'grid-loading': className === 'grid-loading'\r\n }\"\r\n [dataSource]=\"gridBindDataSource\"\r\n [allowPaging]=\"allowPaging && pageSettings\"\r\n [allowResizing]=\"true\"\r\n [pageSettings]=\"pageSettings\"\r\n [showColumnMenu]=\"true\"\r\n [allowSorting]=\"true\"\r\n [allowFiltering]=\"true\"\r\n [allowExcelExport]=\"true\"\r\n [allowRowDragAndDrop]=\"allowRowDragAndDrop\"\r\n [filterSettings]=\"filterSettings\"\r\n [resizeSettings]=\"resizeSettings\"\r\n [allowSelection]=\"true\"\r\n [editSettings]=\"editSettings\"\r\n [childGrid]=\"childGrid\"\r\n [contextMenuItems]=\"gridBindDataSource && gridBindDataSource.length ? contextMenuItems : null\"\r\n [selectionSettings]=\"selectionSettings\"\r\n (recordClick)=\"_recordClick($event)\"\r\n (recordDoubleClick)=\"_recordDoubleClick($event)\"\r\n (actionBegin)=\"_actionBegin($event)\"\r\n (actionComplete)=\"_actionHandler($event)\"\r\n (rowSelected)=\"_rowSelected($event)\"\r\n (rowDeselecting)=\"_rowDeselecting($event)\"\r\n (rowDeselected)=\"_rowDeselected($event)\"\r\n style=\"border: none\"\r\n (contextMenuClick)=\"_onContextMenu($event)\"\r\n (contextMenuOpen)=\"contextMenuOpen($event)\"\r\n (queryCellInfo)=\"customiseCell($event)\"\r\n (dataBound)=\"_dataBound($event)\"\r\n (rowDataBound)=\"_rowDataBound($event)\"\r\n (rowSelecting)=\"_rowSelecting($event)\"\r\n (excelQueryCellInfo)=\"_exportQueryCellInfo($event)\"\r\n (rowDrop)=\"onRowDrop($event)\"\r\n (rowDragStart)=\"_rowDragStart($event)\"\r\n (rowDrag)=\"_rowDrag($event)\"\r\n (load)=\"_load()\"\r\n [frozenColumns]=\"frozenColumns\"\r\n [columnChooserSettings]=\"columnChooserSettings\"\r\n>\r\n <e-columns>\r\n <e-column\r\n *ngIf=\"showCheckBox\"\r\n type=\"checkbox\"\r\n [width]=\"checkBoxWidth\"\r\n [minWidth]=\"checkBoxWidth\"\r\n [showColumnMenu]=\"false\"\r\n [allowResizing]=\"false\"\r\n ></e-column>\r\n <e-column\r\n *ngFor=\"let item of fields; trackBy: trackByFn; let last = last\"\r\n [field]=\"item.columnName\"\r\n [filter]=\"item.filter ? item.filter : { type: 'CheckBox' }\"\r\n [customAttributes]=\"\r\n item.colName === 'entityUserList' || item.colName === 'kycProgress'\r\n ? { class: 'hideColumnFilterClass' }\r\n : {}\r\n \"\r\n [headerText]=\"item.columnDisplayName\"\r\n [textAlign]=\"item.textAlign\"\r\n [showColumnMenu]=\"item.showColumnMenu === undefined ? true : false\"\r\n [allowFiltering]=\"item.allowFiltering === undefined ? true : false\"\r\n [allowSorting]=\"item.allowSorting === undefined ? true : false\"\r\n [showInColumnChooser]=\"\r\n item.showInColumnChooser === undefined ? true : item.showInColumnChooser\r\n \"\r\n [editType]=\"item.editType\"\r\n [validationRules]=\"item.validationRules\"\r\n [type]=\"item.dataType || 'string'\"\r\n [width]=\"item.width\"\r\n [minWidth]=\"item.minWidth\"\r\n [format]=\"item.format\"\r\n [visible]=\"item.visible\"\r\n [template]=\"item.showTemplate ? columnTemplate : undefined\"\r\n [clipMode]=\"\r\n item.clipMode ? item.clipMode : clipMode || 'EllipsisWithTooltip'\r\n \"\r\n [sortComparer]=\"item.dateComparer || null\"\r\n [allowResizing]=\"!last\"\r\n [headerTemplate]=\"item.showHeaderTemplate ? headerTemplate : undefined\"\r\n [isPrimaryKey]=\"item?.isPrimaryKey ? true : false\"\r\n >\r\n </e-column>\r\n </e-columns>\r\n</ejs-grid>\r\n",
1224
2191
  styles: [""]
1225
2192
  }] }
1226
2193
  ];
@@ -1258,6 +2225,10 @@
1258
2225
  alwaysShowCheckbox: [{ type: core.Input }],
1259
2226
  defaultRecord: [{ type: core.Input }],
1260
2227
  disableSystemRow: [{ type: core.Input }],
2228
+ enableDateTreeFilter: [{ type: core.Input }],
2229
+ dateTreeFilterFields: [{ type: core.Input }],
2230
+ dateTreeSourceRows: [{ type: core.Input }],
2231
+ dateTreeEmitFilteredRows: [{ type: core.Input }],
1261
2232
  recordDoubleClick: [{ type: core.Output }],
1262
2233
  actionComplete: [{ type: core.Output }],
1263
2234
  rowSelected: [{ type: core.Output }],
@@ -1274,7 +2245,11 @@
1274
2245
  rowSelecting: [{ type: core.Output }],
1275
2246
  rowDrop: [{ type: core.Output }],
1276
2247
  rowDrag: [{ type: core.Output }],
1277
- rowDragStart: [{ type: core.Output }]
2248
+ rowDragStart: [{ type: core.Output }],
2249
+ dateTreeFilteredRows: [{ type: core.Output }],
2250
+ dateTreePopoverRef: [{ type: core.ViewChild, args: ["dateTreePopoverRef", { read: core.ElementRef, static: false },] }],
2251
+ onDocumentMouseDown: [{ type: core.HostListener, args: ["document:mousedown", ["$event"],] }],
2252
+ onDocumentMouseOver: [{ type: core.HostListener, args: ["document:mouseover", ["$event"],] }]
1278
2253
  };
1279
2254
  return CommonGridComponent;
1280
2255
  }());
@@ -1354,6 +2329,27 @@
1354
2329
  CommonGridComponent.prototype.defaultRecord;
1355
2330
  /** @type {?} */
1356
2331
  CommonGridComponent.prototype.disableSystemRow;
2332
+ /**
2333
+ * 开启日期树筛选(默认关闭,不影响现有页面)
2334
+ * @type {?}
2335
+ */
2336
+ CommonGridComponent.prototype.enableDateTreeFilter;
2337
+ /**
2338
+ * 参与日期树筛选的列名或 hint,如 ['CreatedOn', 'ModifiedOn']
2339
+ * @type {?}
2340
+ */
2341
+ CommonGridComponent.prototype.dateTreeFilterFields;
2342
+ /**
2343
+ * 未筛选原始数据(可选)。
2344
+ * 不传时由组件在 dataSource 变更时自动快照;传则由页面自行维护 raw。
2345
+ * @type {?}
2346
+ */
2347
+ CommonGridComponent.prototype.dateTreeSourceRows;
2348
+ /**
2349
+ * 内聚模式下仍向页面同步筛选结果(默认 false,一般无需绑定)
2350
+ * @type {?}
2351
+ */
2352
+ CommonGridComponent.prototype.dateTreeEmitFilteredRows;
1357
2353
  /** @type {?} */
1358
2354
  CommonGridComponent.prototype.recordDoubleClick;
1359
2355
  /** @type {?} */
@@ -1388,6 +2384,30 @@
1388
2384
  CommonGridComponent.prototype.rowDrag;
1389
2385
  /** @type {?} */
1390
2386
  CommonGridComponent.prototype.rowDragStart;
2387
+ /**
2388
+ * 日期树筛选后的行数据(可选,复杂页面与 dateTreeSourceRows 搭配使用)
2389
+ * @type {?}
2390
+ */
2391
+ CommonGridComponent.prototype.dateTreeFilteredRows;
2392
+ /** @type {?} */
2393
+ CommonGridComponent.prototype.dateTreePopoverRef;
2394
+ /** @type {?} */
2395
+ CommonGridComponent.prototype.dateTreeHelper;
2396
+ /**
2397
+ * 内聚模式:表格实际绑定的数据
2398
+ * @type {?}
2399
+ */
2400
+ CommonGridComponent.prototype.dateTreeDisplayRows;
2401
+ /**
2402
+ * @type {?}
2403
+ * @private
2404
+ */
2405
+ CommonGridComponent.prototype.dateTreeRawRows;
2406
+ /**
2407
+ * @type {?}
2408
+ * @private
2409
+ */
2410
+ CommonGridComponent.prototype.dateTreeApplyingFilter;
1391
2411
  /** @type {?} */
1392
2412
  CommonGridComponent.prototype.selectId;
1393
2413
  /** @type {?} */
@@ -1527,6 +2547,905 @@
1527
2547
  GridActionItemComponent.prototype.ImageType;
1528
2548
  }
1529
2549
 
2550
+ /**
2551
+ * @fileoverview added by tsickle
2552
+ * Generated from: lib/date-tree-filter/date-tree-filter-popover/index.component.ts
2553
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2554
+ */
2555
+ var DateTreeFilterPopoverComponent = /** @class */ (function () {
2556
+ function DateTreeFilterPopoverComponent() {
2557
+ this.field = "";
2558
+ this.sourceRows = [];
2559
+ this.dateFields = [];
2560
+ this.selectedByField = {};
2561
+ this.fieldLabelMap = {};
2562
+ this.apply = new core.EventEmitter();
2563
+ this.close = new core.EventEmitter();
2564
+ this.keyword = "";
2565
+ this.years = [];
2566
+ this.expandStateByField = {};
2567
+ this.workingSelectedByField = {};
2568
+ }
2569
+ /**
2570
+ * @param {?} changes
2571
+ * @return {?}
2572
+ */
2573
+ DateTreeFilterPopoverComponent.prototype.ngOnChanges = /**
2574
+ * @param {?} changes
2575
+ * @return {?}
2576
+ */
2577
+ function (changes) {
2578
+ if (changes.field ||
2579
+ changes.sourceRows ||
2580
+ changes.selectedByField ||
2581
+ changes.dateFields) {
2582
+ this.keyword = "";
2583
+ this.workingSelectedByField = this.cloneSelectionMap(this.selectedByField);
2584
+ this.rebuildTree();
2585
+ }
2586
+ };
2587
+ /**
2588
+ * @return {?}
2589
+ */
2590
+ DateTreeFilterPopoverComponent.prototype.closePopover = /**
2591
+ * @return {?}
2592
+ */
2593
+ function () {
2594
+ this.close.emit();
2595
+ };
2596
+ /**
2597
+ * @param {?} value
2598
+ * @return {?}
2599
+ */
2600
+ DateTreeFilterPopoverComponent.prototype.onKeywordChange = /**
2601
+ * @param {?} value
2602
+ * @return {?}
2603
+ */
2604
+ function (value) {
2605
+ this.keyword = value || "";
2606
+ };
2607
+ /**
2608
+ * @return {?}
2609
+ */
2610
+ DateTreeFilterPopoverComponent.prototype.getVisibleYears = /**
2611
+ * @return {?}
2612
+ */
2613
+ function () {
2614
+ /** @type {?} */
2615
+ var searchText = (this.keyword || "").trim().toLowerCase();
2616
+ if (!searchText) {
2617
+ return this.years;
2618
+ }
2619
+ return this.years
2620
+ .map((/**
2621
+ * @param {?} yearNode
2622
+ * @return {?}
2623
+ */
2624
+ function (yearNode) {
2625
+ /** @type {?} */
2626
+ var yearMatched = String(yearNode.year).toLowerCase().indexOf(searchText) > -1;
2627
+ /** @type {?} */
2628
+ var months = yearNode.months
2629
+ .map((/**
2630
+ * @param {?} monthNode
2631
+ * @return {?}
2632
+ */
2633
+ function (monthNode) {
2634
+ /** @type {?} */
2635
+ var monthMatched = String(monthNode.label)
2636
+ .toLowerCase()
2637
+ .indexOf(searchText) > -1;
2638
+ /** @type {?} */
2639
+ var days = monthNode.days.filter((/**
2640
+ * @param {?} dayNode
2641
+ * @return {?}
2642
+ */
2643
+ function (dayNode) {
2644
+ return (String(dayNode.label)
2645
+ .toLowerCase()
2646
+ .indexOf(searchText) > -1);
2647
+ }));
2648
+ if (yearMatched || monthMatched) {
2649
+ return monthNode;
2650
+ }
2651
+ return Object.assign({}, monthNode, { days: days });
2652
+ }))
2653
+ .filter((/**
2654
+ * @param {?} monthNode
2655
+ * @return {?}
2656
+ */
2657
+ function (monthNode) { return monthNode.days.length > 0; }));
2658
+ if (yearMatched) {
2659
+ return yearNode;
2660
+ }
2661
+ return Object.assign({}, yearNode, { months: months });
2662
+ }))
2663
+ .filter((/**
2664
+ * @param {?} yearNode
2665
+ * @return {?}
2666
+ */
2667
+ function (yearNode) { return yearNode.months.length > 0; }));
2668
+ };
2669
+ /**
2670
+ * @param {?} yearNode
2671
+ * @return {?}
2672
+ */
2673
+ DateTreeFilterPopoverComponent.prototype.toggleYearExpanded = /**
2674
+ * @param {?} yearNode
2675
+ * @return {?}
2676
+ */
2677
+ function (yearNode) {
2678
+ /** @type {?} */
2679
+ var state = this.getOrCreateExpandState(this.field);
2680
+ state.years[yearNode.key] = !state.years[yearNode.key];
2681
+ yearNode.expanded = !!state.years[yearNode.key];
2682
+ };
2683
+ /**
2684
+ * @param {?} monthNode
2685
+ * @return {?}
2686
+ */
2687
+ DateTreeFilterPopoverComponent.prototype.toggleMonthExpanded = /**
2688
+ * @param {?} monthNode
2689
+ * @return {?}
2690
+ */
2691
+ function (monthNode) {
2692
+ /** @type {?} */
2693
+ var state = this.getOrCreateExpandState(this.field);
2694
+ state.months[monthNode.key] = !state.months[monthNode.key];
2695
+ monthNode.expanded = !!state.months[monthNode.key];
2696
+ };
2697
+ /**
2698
+ * @return {?}
2699
+ */
2700
+ DateTreeFilterPopoverComponent.prototype.isAllChecked = /**
2701
+ * @return {?}
2702
+ */
2703
+ function () {
2704
+ /** @type {?} */
2705
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2706
+ /** @type {?} */
2707
+ var enabledDayKeys = this.getEnabledDayKeysInCurrentField();
2708
+ if (!enabledDayKeys.length) {
2709
+ return false;
2710
+ }
2711
+ return enabledDayKeys.every((/**
2712
+ * @param {?} key
2713
+ * @return {?}
2714
+ */
2715
+ function (key) { return !!selectedMap[key]; }));
2716
+ };
2717
+ /**
2718
+ * @return {?}
2719
+ */
2720
+ DateTreeFilterPopoverComponent.prototype.isAllIndeterminate = /**
2721
+ * @return {?}
2722
+ */
2723
+ function () {
2724
+ /** @type {?} */
2725
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2726
+ /** @type {?} */
2727
+ var enabledDayKeys = this.getEnabledDayKeysInCurrentField();
2728
+ if (!enabledDayKeys.length) {
2729
+ return false;
2730
+ }
2731
+ /** @type {?} */
2732
+ var selectedCount = enabledDayKeys.filter((/**
2733
+ * @param {?} key
2734
+ * @return {?}
2735
+ */
2736
+ function (key) { return !!selectedMap[key]; }))
2737
+ .length;
2738
+ return selectedCount > 0 && selectedCount < enabledDayKeys.length;
2739
+ };
2740
+ /**
2741
+ * @param {?} checked
2742
+ * @return {?}
2743
+ */
2744
+ DateTreeFilterPopoverComponent.prototype.toggleAllDays = /**
2745
+ * @param {?} checked
2746
+ * @return {?}
2747
+ */
2748
+ function (checked) {
2749
+ /** @type {?} */
2750
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2751
+ /** @type {?} */
2752
+ var enabledDayKeys = this.getEnabledDayKeysInCurrentField();
2753
+ enabledDayKeys.forEach((/**
2754
+ * @param {?} key
2755
+ * @return {?}
2756
+ */
2757
+ function (key) {
2758
+ if (checked) {
2759
+ selectedMap[key] = true;
2760
+ }
2761
+ else {
2762
+ delete selectedMap[key];
2763
+ }
2764
+ }));
2765
+ };
2766
+ /**
2767
+ * @param {?} dayNode
2768
+ * @return {?}
2769
+ */
2770
+ DateTreeFilterPopoverComponent.prototype.isDayChecked = /**
2771
+ * @param {?} dayNode
2772
+ * @return {?}
2773
+ */
2774
+ function (dayNode) {
2775
+ /** @type {?} */
2776
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2777
+ return !!selectedMap[dayNode.key];
2778
+ };
2779
+ /**
2780
+ * @param {?} dayNode
2781
+ * @param {?} checked
2782
+ * @return {?}
2783
+ */
2784
+ DateTreeFilterPopoverComponent.prototype.toggleDay = /**
2785
+ * @param {?} dayNode
2786
+ * @param {?} checked
2787
+ * @return {?}
2788
+ */
2789
+ function (dayNode, checked) {
2790
+ if (dayNode.disabled) {
2791
+ return;
2792
+ }
2793
+ /** @type {?} */
2794
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2795
+ if (checked) {
2796
+ selectedMap[dayNode.key] = true;
2797
+ }
2798
+ else {
2799
+ delete selectedMap[dayNode.key];
2800
+ }
2801
+ };
2802
+ /**
2803
+ * @param {?} monthNode
2804
+ * @return {?}
2805
+ */
2806
+ DateTreeFilterPopoverComponent.prototype.isMonthDisabled = /**
2807
+ * @param {?} monthNode
2808
+ * @return {?}
2809
+ */
2810
+ function (monthNode) {
2811
+ return monthNode.days.every((/**
2812
+ * @param {?} dayNode
2813
+ * @return {?}
2814
+ */
2815
+ function (dayNode) { return dayNode.disabled; }));
2816
+ };
2817
+ /**
2818
+ * @param {?} monthNode
2819
+ * @return {?}
2820
+ */
2821
+ DateTreeFilterPopoverComponent.prototype.isMonthChecked = /**
2822
+ * @param {?} monthNode
2823
+ * @return {?}
2824
+ */
2825
+ function (monthNode) {
2826
+ if (this.isMonthDisabled(monthNode)) {
2827
+ return false;
2828
+ }
2829
+ /** @type {?} */
2830
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2831
+ /** @type {?} */
2832
+ var enabledDays = monthNode.days.filter((/**
2833
+ * @param {?} dayNode
2834
+ * @return {?}
2835
+ */
2836
+ function (dayNode) { return !dayNode.disabled; }));
2837
+ return enabledDays.every((/**
2838
+ * @param {?} dayNode
2839
+ * @return {?}
2840
+ */
2841
+ function (dayNode) { return !!selectedMap[dayNode.key]; }));
2842
+ };
2843
+ /**
2844
+ * @param {?} monthNode
2845
+ * @return {?}
2846
+ */
2847
+ DateTreeFilterPopoverComponent.prototype.isMonthIndeterminate = /**
2848
+ * @param {?} monthNode
2849
+ * @return {?}
2850
+ */
2851
+ function (monthNode) {
2852
+ if (this.isMonthDisabled(monthNode)) {
2853
+ return false;
2854
+ }
2855
+ /** @type {?} */
2856
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2857
+ /** @type {?} */
2858
+ var enabledDays = monthNode.days.filter((/**
2859
+ * @param {?} dayNode
2860
+ * @return {?}
2861
+ */
2862
+ function (dayNode) { return !dayNode.disabled; }));
2863
+ /** @type {?} */
2864
+ var selectedCount = enabledDays.filter((/**
2865
+ * @param {?} dayNode
2866
+ * @return {?}
2867
+ */
2868
+ function (dayNode) {
2869
+ return !!selectedMap[dayNode.key];
2870
+ })).length;
2871
+ return selectedCount > 0 && selectedCount < enabledDays.length;
2872
+ };
2873
+ /**
2874
+ * @param {?} monthNode
2875
+ * @param {?} checked
2876
+ * @return {?}
2877
+ */
2878
+ DateTreeFilterPopoverComponent.prototype.toggleMonth = /**
2879
+ * @param {?} monthNode
2880
+ * @param {?} checked
2881
+ * @return {?}
2882
+ */
2883
+ function (monthNode, checked) {
2884
+ if (this.isMonthDisabled(monthNode)) {
2885
+ return;
2886
+ }
2887
+ /** @type {?} */
2888
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2889
+ monthNode.days.forEach((/**
2890
+ * @param {?} dayNode
2891
+ * @return {?}
2892
+ */
2893
+ function (dayNode) {
2894
+ if (dayNode.disabled) {
2895
+ return;
2896
+ }
2897
+ if (checked) {
2898
+ selectedMap[dayNode.key] = true;
2899
+ }
2900
+ else {
2901
+ delete selectedMap[dayNode.key];
2902
+ }
2903
+ }));
2904
+ };
2905
+ /**
2906
+ * @param {?} yearNode
2907
+ * @return {?}
2908
+ */
2909
+ DateTreeFilterPopoverComponent.prototype.isYearDisabled = /**
2910
+ * @param {?} yearNode
2911
+ * @return {?}
2912
+ */
2913
+ function (yearNode) {
2914
+ var _this = this;
2915
+ return yearNode.months.every((/**
2916
+ * @param {?} monthNode
2917
+ * @return {?}
2918
+ */
2919
+ function (monthNode) {
2920
+ return _this.isMonthDisabled(monthNode);
2921
+ }));
2922
+ };
2923
+ /**
2924
+ * @param {?} yearNode
2925
+ * @return {?}
2926
+ */
2927
+ DateTreeFilterPopoverComponent.prototype.isYearChecked = /**
2928
+ * @param {?} yearNode
2929
+ * @return {?}
2930
+ */
2931
+ function (yearNode) {
2932
+ var _this = this;
2933
+ if (this.isYearDisabled(yearNode)) {
2934
+ return false;
2935
+ }
2936
+ /** @type {?} */
2937
+ var enabledMonths = yearNode.months.filter((/**
2938
+ * @param {?} monthNode
2939
+ * @return {?}
2940
+ */
2941
+ function (monthNode) { return !_this.isMonthDisabled(monthNode); }));
2942
+ return enabledMonths.every((/**
2943
+ * @param {?} monthNode
2944
+ * @return {?}
2945
+ */
2946
+ function (monthNode) { return _this.isMonthChecked(monthNode); }));
2947
+ };
2948
+ /**
2949
+ * @param {?} yearNode
2950
+ * @return {?}
2951
+ */
2952
+ DateTreeFilterPopoverComponent.prototype.isYearIndeterminate = /**
2953
+ * @param {?} yearNode
2954
+ * @return {?}
2955
+ */
2956
+ function (yearNode) {
2957
+ if (this.isYearDisabled(yearNode)) {
2958
+ return false;
2959
+ }
2960
+ /** @type {?} */
2961
+ var selectedMap = this.getFieldDaySelectionMap(this.field);
2962
+ /** @type {?} */
2963
+ var enabledDays = [];
2964
+ yearNode.months.forEach((/**
2965
+ * @param {?} monthNode
2966
+ * @return {?}
2967
+ */
2968
+ function (monthNode) {
2969
+ monthNode.days.forEach((/**
2970
+ * @param {?} dayNode
2971
+ * @return {?}
2972
+ */
2973
+ function (dayNode) {
2974
+ if (!dayNode.disabled) {
2975
+ enabledDays.push(dayNode.key);
2976
+ }
2977
+ }));
2978
+ }));
2979
+ /** @type {?} */
2980
+ var selectedCount = enabledDays.filter((/**
2981
+ * @param {?} key
2982
+ * @return {?}
2983
+ */
2984
+ function (key) { return !!selectedMap[key]; })).length;
2985
+ return selectedCount > 0 && selectedCount < enabledDays.length;
2986
+ };
2987
+ /**
2988
+ * @param {?} yearNode
2989
+ * @param {?} checked
2990
+ * @return {?}
2991
+ */
2992
+ DateTreeFilterPopoverComponent.prototype.toggleYear = /**
2993
+ * @param {?} yearNode
2994
+ * @param {?} checked
2995
+ * @return {?}
2996
+ */
2997
+ function (yearNode, checked) {
2998
+ var _this = this;
2999
+ if (this.isYearDisabled(yearNode)) {
3000
+ return;
3001
+ }
3002
+ yearNode.months.forEach((/**
3003
+ * @param {?} monthNode
3004
+ * @return {?}
3005
+ */
3006
+ function (monthNode) {
3007
+ _this.toggleMonth(monthNode, checked);
3008
+ }));
3009
+ };
3010
+ /**
3011
+ * @return {?}
3012
+ */
3013
+ DateTreeFilterPopoverComponent.prototype.clearSelection = /**
3014
+ * @return {?}
3015
+ */
3016
+ function () {
3017
+ if (this.field) {
3018
+ this.workingSelectedByField[this.field] = {};
3019
+ }
3020
+ this.apply.emit(this.cloneSelectionMap(this.workingSelectedByField));
3021
+ this.rebuildTree();
3022
+ };
3023
+ /**
3024
+ * @return {?}
3025
+ */
3026
+ DateTreeFilterPopoverComponent.prototype.applySelection = /**
3027
+ * @return {?}
3028
+ */
3029
+ function () {
3030
+ this.apply.emit(this.cloneSelectionMap(this.workingSelectedByField));
3031
+ this.closePopover();
3032
+ };
3033
+ /**
3034
+ * @private
3035
+ * @return {?}
3036
+ */
3037
+ DateTreeFilterPopoverComponent.prototype.rebuildTree = /**
3038
+ * @private
3039
+ * @return {?}
3040
+ */
3041
+ function () {
3042
+ var _this = this;
3043
+ if (!this.field) {
3044
+ this.years = [];
3045
+ return;
3046
+ }
3047
+ /** @type {?} */
3048
+ var sourceRows = this.sourceRows || [];
3049
+ /** @type {?} */
3050
+ var rowsByOtherFilters = this.filterRowsBySelectedDateTree(sourceRows, this.field);
3051
+ /** @type {?} */
3052
+ var availableDayKeyMap = {};
3053
+ rowsByOtherFilters.forEach((/**
3054
+ * @param {?} row
3055
+ * @return {?}
3056
+ */
3057
+ function (row) {
3058
+ /** @type {?} */
3059
+ var dayKey = _this.getDayKeyByRowValue(row[_this.field]);
3060
+ if (dayKey) {
3061
+ availableDayKeyMap[dayKey] = true;
3062
+ }
3063
+ }));
3064
+ /** @type {?} */
3065
+ var groupedMap = {};
3066
+ sourceRows.forEach((/**
3067
+ * @param {?} row
3068
+ * @return {?}
3069
+ */
3070
+ function (row) {
3071
+ /** @type {?} */
3072
+ var date = _this.parseDateValue(row[_this.field]);
3073
+ if (!date) {
3074
+ return;
3075
+ }
3076
+ /** @type {?} */
3077
+ var year = date.getFullYear();
3078
+ /** @type {?} */
3079
+ var month = date.getMonth() + 1;
3080
+ /** @type {?} */
3081
+ var day = date.getDate();
3082
+ if (!groupedMap[year]) {
3083
+ groupedMap[year] = {};
3084
+ }
3085
+ if (!groupedMap[year][month]) {
3086
+ groupedMap[year][month] = {};
3087
+ }
3088
+ if (!groupedMap[year][month][day]) {
3089
+ groupedMap[year][month][day] = 0;
3090
+ }
3091
+ groupedMap[year][month][day] += 1;
3092
+ }));
3093
+ /** @type {?} */
3094
+ var expandState = this.getOrCreateExpandState(this.field);
3095
+ this.years = Object.keys(groupedMap)
3096
+ .map((/**
3097
+ * @param {?} key
3098
+ * @return {?}
3099
+ */
3100
+ function (key) { return Number(key); }))
3101
+ .sort((/**
3102
+ * @param {?} a
3103
+ * @param {?} b
3104
+ * @return {?}
3105
+ */
3106
+ function (a, b) { return b - a; }))
3107
+ .map((/**
3108
+ * @param {?} year
3109
+ * @return {?}
3110
+ */
3111
+ function (year) {
3112
+ /** @type {?} */
3113
+ var months = Object.keys(groupedMap[year])
3114
+ .map((/**
3115
+ * @param {?} key
3116
+ * @return {?}
3117
+ */
3118
+ function (key) { return Number(key); }))
3119
+ .sort((/**
3120
+ * @param {?} a
3121
+ * @param {?} b
3122
+ * @return {?}
3123
+ */
3124
+ function (a, b) { return a - b; }))
3125
+ .map((/**
3126
+ * @param {?} month
3127
+ * @return {?}
3128
+ */
3129
+ function (month) {
3130
+ /** @type {?} */
3131
+ var monthKey = year + "-" + _this.pad2(month);
3132
+ if (expandState.months[monthKey] === undefined) {
3133
+ expandState.months[monthKey] = true;
3134
+ }
3135
+ /** @type {?} */
3136
+ var days = Object.keys(groupedMap[year][month])
3137
+ .map((/**
3138
+ * @param {?} key
3139
+ * @return {?}
3140
+ */
3141
+ function (key) { return Number(key); }))
3142
+ .sort((/**
3143
+ * @param {?} a
3144
+ * @param {?} b
3145
+ * @return {?}
3146
+ */
3147
+ function (a, b) { return a - b; }))
3148
+ .map((/**
3149
+ * @param {?} day
3150
+ * @return {?}
3151
+ */
3152
+ function (day) {
3153
+ /** @type {?} */
3154
+ var dayKey = _this.toDayKey(year, month, day);
3155
+ /** @type {?} */
3156
+ var dayDate = new Date(year, month - 1, day);
3157
+ return {
3158
+ key: dayKey,
3159
+ day: day,
3160
+ label: moment(dayDate).format("D MMM YYYY"),
3161
+ count: groupedMap[year][month][day],
3162
+ disabled: !availableDayKeyMap[dayKey],
3163
+ };
3164
+ }));
3165
+ return {
3166
+ key: monthKey,
3167
+ month: month,
3168
+ label: moment()
3169
+ .month(month - 1)
3170
+ .format("MMM"),
3171
+ expanded: !!expandState.months[monthKey],
3172
+ days: days,
3173
+ };
3174
+ }));
3175
+ /** @type {?} */
3176
+ var yearKey = String(year);
3177
+ if (expandState.years[yearKey] === undefined) {
3178
+ expandState.years[yearKey] = true;
3179
+ }
3180
+ return {
3181
+ key: yearKey,
3182
+ year: year,
3183
+ expanded: !!expandState.years[yearKey],
3184
+ months: months,
3185
+ };
3186
+ }));
3187
+ };
3188
+ /**
3189
+ * @private
3190
+ * @param {?} rows
3191
+ * @param {?=} excludeField
3192
+ * @return {?}
3193
+ */
3194
+ DateTreeFilterPopoverComponent.prototype.filterRowsBySelectedDateTree = /**
3195
+ * @private
3196
+ * @param {?} rows
3197
+ * @param {?=} excludeField
3198
+ * @return {?}
3199
+ */
3200
+ function (rows, excludeField) {
3201
+ var _this = this;
3202
+ /** @type {?} */
3203
+ var filteredRows = rows ? rows.slice() : [];
3204
+ (this.dateFields || []).forEach((/**
3205
+ * @param {?} field
3206
+ * @return {?}
3207
+ */
3208
+ function (field) {
3209
+ if (excludeField && field === excludeField) {
3210
+ return;
3211
+ }
3212
+ /** @type {?} */
3213
+ var selectedMap = _this.getFieldDaySelectionMap(field);
3214
+ /** @type {?} */
3215
+ var selectedKeys = Object.keys(selectedMap);
3216
+ if (!selectedKeys.length) {
3217
+ return;
3218
+ }
3219
+ filteredRows = filteredRows.filter((/**
3220
+ * @param {?} row
3221
+ * @return {?}
3222
+ */
3223
+ function (row) {
3224
+ /** @type {?} */
3225
+ var dayKey = _this.getDayKeyByRowValue(row[field]);
3226
+ return dayKey ? !!selectedMap[dayKey] : false;
3227
+ }));
3228
+ }));
3229
+ return filteredRows;
3230
+ };
3231
+ /**
3232
+ * @private
3233
+ * @param {?} value
3234
+ * @return {?}
3235
+ */
3236
+ DateTreeFilterPopoverComponent.prototype.parseDateValue = /**
3237
+ * @private
3238
+ * @param {?} value
3239
+ * @return {?}
3240
+ */
3241
+ function (value) {
3242
+ if (!value) {
3243
+ return null;
3244
+ }
3245
+ if (value instanceof Date) {
3246
+ return value;
3247
+ }
3248
+ /** @type {?} */
3249
+ var parsed = moment(value, [
3250
+ "YYYY-MM-DD",
3251
+ "MM/DD/YYYY",
3252
+ "DD/MM/YYYY",
3253
+ "YYYY/MM/DD",
3254
+ "DD-MMM-YYYY",
3255
+ "MMM DD, YYYY",
3256
+ moment.ISO_8601,
3257
+ ], true);
3258
+ if (parsed.isValid()) {
3259
+ return parsed.toDate();
3260
+ }
3261
+ /** @type {?} */
3262
+ var fallback = new Date(value);
3263
+ return isNaN(fallback.getTime()) ? null : fallback;
3264
+ };
3265
+ /**
3266
+ * @private
3267
+ * @param {?} field
3268
+ * @return {?}
3269
+ */
3270
+ DateTreeFilterPopoverComponent.prototype.getOrCreateExpandState = /**
3271
+ * @private
3272
+ * @param {?} field
3273
+ * @return {?}
3274
+ */
3275
+ function (field) {
3276
+ if (!this.expandStateByField[field]) {
3277
+ this.expandStateByField[field] = { years: {}, months: {} };
3278
+ }
3279
+ return this.expandStateByField[field];
3280
+ };
3281
+ /**
3282
+ * @private
3283
+ * @param {?} field
3284
+ * @return {?}
3285
+ */
3286
+ DateTreeFilterPopoverComponent.prototype.getFieldDaySelectionMap = /**
3287
+ * @private
3288
+ * @param {?} field
3289
+ * @return {?}
3290
+ */
3291
+ function (field) {
3292
+ if (!this.workingSelectedByField[field]) {
3293
+ this.workingSelectedByField[field] = {};
3294
+ }
3295
+ return this.workingSelectedByField[field];
3296
+ };
3297
+ /**
3298
+ * @private
3299
+ * @param {?} year
3300
+ * @param {?} month
3301
+ * @param {?} day
3302
+ * @return {?}
3303
+ */
3304
+ DateTreeFilterPopoverComponent.prototype.toDayKey = /**
3305
+ * @private
3306
+ * @param {?} year
3307
+ * @param {?} month
3308
+ * @param {?} day
3309
+ * @return {?}
3310
+ */
3311
+ function (year, month, day) {
3312
+ return year + "-" + this.pad2(month) + "-" + this.pad2(day);
3313
+ };
3314
+ /**
3315
+ * @private
3316
+ * @param {?} value
3317
+ * @return {?}
3318
+ */
3319
+ DateTreeFilterPopoverComponent.prototype.pad2 = /**
3320
+ * @private
3321
+ * @param {?} value
3322
+ * @return {?}
3323
+ */
3324
+ function (value) {
3325
+ return value < 10 ? "0" + value : String(value);
3326
+ };
3327
+ /**
3328
+ * @private
3329
+ * @param {?} value
3330
+ * @return {?}
3331
+ */
3332
+ DateTreeFilterPopoverComponent.prototype.getDayKeyByRowValue = /**
3333
+ * @private
3334
+ * @param {?} value
3335
+ * @return {?}
3336
+ */
3337
+ function (value) {
3338
+ /** @type {?} */
3339
+ var date = this.parseDateValue(value);
3340
+ if (!date) {
3341
+ return "";
3342
+ }
3343
+ return this.toDayKey(date.getFullYear(), date.getMonth() + 1, date.getDate());
3344
+ };
3345
+ /**
3346
+ * @private
3347
+ * @return {?}
3348
+ */
3349
+ DateTreeFilterPopoverComponent.prototype.getEnabledDayKeysInCurrentField = /**
3350
+ * @private
3351
+ * @return {?}
3352
+ */
3353
+ function () {
3354
+ /** @type {?} */
3355
+ var keys = [];
3356
+ this.years.forEach((/**
3357
+ * @param {?} yearNode
3358
+ * @return {?}
3359
+ */
3360
+ function (yearNode) {
3361
+ yearNode.months.forEach((/**
3362
+ * @param {?} monthNode
3363
+ * @return {?}
3364
+ */
3365
+ function (monthNode) {
3366
+ monthNode.days.forEach((/**
3367
+ * @param {?} dayNode
3368
+ * @return {?}
3369
+ */
3370
+ function (dayNode) {
3371
+ if (!dayNode.disabled) {
3372
+ keys.push(dayNode.key);
3373
+ }
3374
+ }));
3375
+ }));
3376
+ }));
3377
+ return keys;
3378
+ };
3379
+ /**
3380
+ * @private
3381
+ * @param {?} source
3382
+ * @return {?}
3383
+ */
3384
+ DateTreeFilterPopoverComponent.prototype.cloneSelectionMap = /**
3385
+ * @private
3386
+ * @param {?} source
3387
+ * @return {?}
3388
+ */
3389
+ function (source) {
3390
+ try {
3391
+ return source ? JSON.parse(JSON.stringify(source)) : {};
3392
+ }
3393
+ catch (e) {
3394
+ return {};
3395
+ }
3396
+ };
3397
+ DateTreeFilterPopoverComponent.decorators = [
3398
+ { type: core.Component, args: [{
3399
+ selector: "rs-date-tree-filter-popover",
3400
+ template: "<div class=\"date-tree-filter-popover\">\r\n <div class=\"popover-search\">\r\n <span class=\"search-icon\"><img src=\"/assets/img/search.svg\" alt=\"\" /></span>\r\n <input\r\n type=\"text\"\r\n [placeholder]=\"translation.SEARCH || '.SEARCH'\"\r\n [value]=\"keyword\"\r\n (input)=\"onKeywordChange($event.target.value)\"\r\n />\r\n </div>\r\n\r\n <div class=\"popover-tree\">\r\n <label class=\"tree-row all-row\">\r\n <input\r\n type=\"checkbox\"\r\n [checked]=\"isAllChecked()\"\r\n [indeterminate]=\"isAllIndeterminate()\"\r\n (change)=\"toggleAllDays($event.target.checked)\"\r\n />\r\n <span class=\"row-label\">{{ translation.ALL || '.ALL' }}</span>\r\n </label>\r\n\r\n <div class=\"year-block\" *ngFor=\"let yearNode of getVisibleYears()\">\r\n <div class=\"tree-row\">\r\n <button\r\n type=\"button\"\r\n class=\"tree-toggle-btn\"\r\n (click)=\"toggleYearExpanded(yearNode); $event.stopPropagation()\"\r\n >\r\n <span class=\"tree-arrow\" [ngClass]=\"{ expanded: yearNode.expanded }\"></span>\r\n </button>\r\n <input\r\n type=\"checkbox\"\r\n [disabled]=\"isYearDisabled(yearNode)\"\r\n [checked]=\"isYearChecked(yearNode)\"\r\n [indeterminate]=\"isYearIndeterminate(yearNode)\"\r\n (change)=\"toggleYear(yearNode, $event.target.checked)\"\r\n />\r\n <span class=\"row-label\">{{ yearNode.year }}</span>\r\n </div>\r\n\r\n <div class=\"month-block\" *ngIf=\"yearNode.expanded\">\r\n <div class=\"month-item\" *ngFor=\"let monthNode of yearNode.months\">\r\n <div class=\"tree-row\">\r\n <button\r\n type=\"button\"\r\n class=\"tree-toggle-btn\"\r\n (click)=\"toggleMonthExpanded(monthNode); $event.stopPropagation()\"\r\n >\r\n <span class=\"tree-arrow\" [ngClass]=\"{ expanded: monthNode.expanded }\"></span>\r\n </button>\r\n <input\r\n type=\"checkbox\"\r\n [disabled]=\"isMonthDisabled(monthNode)\"\r\n [checked]=\"isMonthChecked(monthNode)\"\r\n [indeterminate]=\"isMonthIndeterminate(monthNode)\"\r\n (change)=\"toggleMonth(monthNode, $event.target.checked)\"\r\n />\r\n <span class=\"row-label\">{{ monthNode.label }}</span>\r\n </div>\r\n\r\n <div class=\"day-block\" *ngIf=\"monthNode.expanded\">\r\n <label\r\n class=\"tree-row day-row\"\r\n *ngFor=\"let dayNode of monthNode.days\"\r\n [ngClass]=\"{ disabled: dayNode.disabled }\"\r\n >\r\n <span class=\"tree-toggle-spacer\"></span>\r\n <input\r\n type=\"checkbox\"\r\n [disabled]=\"dayNode.disabled\"\r\n [checked]=\"isDayChecked(dayNode)\"\r\n (change)=\"toggleDay(dayNode, $event.target.checked)\"\r\n />\r\n <span class=\"row-label\">{{ dayNode.label }}</span>\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"popover-footer\">\r\n <button type=\"button\" (click)=\"clearSelection()\">\r\n {{ translation.CLEAR || '.CLEAR' }}\r\n </button>\r\n <button type=\"button\" class=\"primary-btn\" (click)=\"applySelection()\">\r\n {{ translation.APPLY || '.APPLY' }}\r\n </button>\r\n </div>\r\n</div>\r\n",
3401
+ styles: [":host{position:fixed;left:12px;top:12px;z-index:20;width:300px}.date-tree-filter-popover{background:#fff;border:1px solid #eaedf0;border-radius:10px;box-shadow:0 0 4px rgba(0,0,0,.25);padding:4px 8px;display:flex;flex-direction:column;color:#44566c;font-family:Arial}.popover-search{position:relative;padding:4px 0 8px}.popover-search .search-icon{position:absolute;left:10px;top:10px;color:#929dab;font-size:12px;line-height:12px}.popover-search input{width:100%;height:28px;border:1px solid #eaedf0;border-radius:16px;padding:0 10px 0 28px;outline:0;font-size:12px;color:#44566c}.popover-tree{max-height:320px;overflow:auto;padding-right:2px}.tree-row{display:flex;align-items:center;min-height:24px;font-size:11px;line-height:14px;color:#44566c}.tree-row input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:14px;height:14px;margin:0 6px 0 0;box-sizing:border-box;border:1px solid #d8d8d8;border-radius:3px;background-color:#fff;cursor:pointer;vertical-align:middle;flex-shrink:0}.tree-row input[type=checkbox]:checked{border-color:#1f7bff;background-color:#1f7bff;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 9 9' fill='none'%3E%3Cpath d='M0.5 4.31818L3 7.5L5.75 4L8.5 0.5' stroke='white' stroke-linecap='round'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:center;background-size:9px 9px}.tree-row input[type=checkbox]:indeterminate{border-color:#1f7bff;background-color:#1f7bff;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 9 9' fill='none'%3E%3Cpath d='M1.5 4.5H7.5' stroke='white' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:center;background-size:9px 9px}.tree-row input[type=checkbox]:disabled{cursor:not-allowed;opacity:.5}.all-row{padding-left:20px;margin-bottom:2px}.year-block{margin-bottom:2px}.month-block{padding-left:20px}.day-block{padding-left:24px}.tree-toggle-btn{width:16px;height:16px;padding:0;margin-right:4px;border:none;background:0 0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.tree-arrow{display:inline-block;width:6px;height:6px;border-right:1px solid #6c7c90;border-bottom:1px solid #6c7c90;transform:rotate(-45deg);transition:transform .15s}.tree-arrow.expanded{transform:rotate(45deg)}.tree-toggle-spacer{width:20px;display:inline-block}.row-label{color:#44566c}.day-row.disabled .row-label{color:#adb5bd}.popover-footer{margin-top:8px;padding:12px 0 8px;border-top:1px solid #eaedf0;display:flex;justify-content:flex-end;gap:12px}.popover-footer button{min-width:56px;height:26px;padding:0 8px;border-radius:4px;border:1px solid #dbe1e7;background:#fff;font-size:11px;color:#44566c;cursor:pointer}.popover-footer .primary-btn{background:#1364b3;border-color:#1364b3;color:#fff}"]
3402
+ }] }
3403
+ ];
3404
+ DateTreeFilterPopoverComponent.propDecorators = {
3405
+ field: [{ type: core.Input }],
3406
+ translation: [{ type: core.Input }],
3407
+ sourceRows: [{ type: core.Input }],
3408
+ dateFields: [{ type: core.Input }],
3409
+ selectedByField: [{ type: core.Input }],
3410
+ fieldLabelMap: [{ type: core.Input }],
3411
+ apply: [{ type: core.Output }],
3412
+ close: [{ type: core.Output }]
3413
+ };
3414
+ return DateTreeFilterPopoverComponent;
3415
+ }());
3416
+ if (false) {
3417
+ /** @type {?} */
3418
+ DateTreeFilterPopoverComponent.prototype.field;
3419
+ /** @type {?} */
3420
+ DateTreeFilterPopoverComponent.prototype.translation;
3421
+ /** @type {?} */
3422
+ DateTreeFilterPopoverComponent.prototype.sourceRows;
3423
+ /** @type {?} */
3424
+ DateTreeFilterPopoverComponent.prototype.dateFields;
3425
+ /** @type {?} */
3426
+ DateTreeFilterPopoverComponent.prototype.selectedByField;
3427
+ /** @type {?} */
3428
+ DateTreeFilterPopoverComponent.prototype.fieldLabelMap;
3429
+ /** @type {?} */
3430
+ DateTreeFilterPopoverComponent.prototype.apply;
3431
+ /** @type {?} */
3432
+ DateTreeFilterPopoverComponent.prototype.close;
3433
+ /** @type {?} */
3434
+ DateTreeFilterPopoverComponent.prototype.keyword;
3435
+ /** @type {?} */
3436
+ DateTreeFilterPopoverComponent.prototype.years;
3437
+ /**
3438
+ * @type {?}
3439
+ * @private
3440
+ */
3441
+ DateTreeFilterPopoverComponent.prototype.expandStateByField;
3442
+ /**
3443
+ * @type {?}
3444
+ * @private
3445
+ */
3446
+ DateTreeFilterPopoverComponent.prototype.workingSelectedByField;
3447
+ }
3448
+
1530
3449
  /**
1531
3450
  * @fileoverview added by tsickle
1532
3451
  * Generated from: lib/float-box/index.component.ts
@@ -54005,6 +55924,7 @@
54005
55924
  CommonGridComponent,
54006
55925
  GridActionComponent,
54007
55926
  GridActionItemComponent,
55927
+ DateTreeFilterPopoverComponent,
54008
55928
  FloatBoxComponent,
54009
55929
  RsPageListComponent,
54010
55930
  RsPageTabComponent,
@@ -54191,6 +56111,7 @@
54191
56111
  CommonGridComponent,
54192
56112
  GridActionComponent,
54193
56113
  GridActionItemComponent,
56114
+ DateTreeFilterPopoverComponent,
54194
56115
  FloatBoxComponent,
54195
56116
  RsPageListComponent,
54196
56117
  RsPageTabComponent,
@@ -54250,6 +56171,9 @@
54250
56171
  exports.CommonDialogComponent = CommonDialogComponent;
54251
56172
  exports.CommonFunctionService = CommonFunctionService;
54252
56173
  exports.CommonGridComponent = CommonGridComponent;
56174
+ exports.DATE_TREE_DEFAULT_DATE_FORMATS = DATE_TREE_DEFAULT_DATE_FORMATS;
56175
+ exports.DateTreeFilterHelper = DateTreeFilterHelper;
56176
+ exports.DateTreeFilterPopoverComponent = DateTreeFilterPopoverComponent;
54253
56177
  exports.DefaultDrawerConfig = DefaultDrawerConfig;
54254
56178
  exports.DialogService = DialogService;
54255
56179
  exports.DrawerComponent = DrawerComponent;
@@ -54288,6 +56212,7 @@
54288
56212
  exports.ToolbarItemComponent = ToolbarItemComponent;
54289
56213
  exports.TranslationService = TranslationService;
54290
56214
  exports.TruncatedTextToggleComponent = TruncatedTextToggleComponent;
56215
+ exports.createRsCommonGridDateTreeHelper = createRsCommonGridDateTreeHelper;
54291
56216
  exports.filterShowSection = filterShowSection;
54292
56217
  exports.ɵa = Debounce;
54293
56218
  exports.ɵb = DashboardService;