monkey-front-components 0.0.423 → 0.0.424

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.
@@ -1817,11 +1817,31 @@ class MECXFilterOptionsComponent {
1817
1817
  this.onSubmit = new EventEmitter();
1818
1818
  this.onShowFromChildren = new EventEmitter();
1819
1819
  this._showMenu = false;
1820
+ this._isLoading = false;
1821
+ this._hasMoreValues = false;
1820
1822
  this.closeMenu = () => {
1821
1823
  this._showMenu = false;
1822
1824
  };
1823
1825
  // not to do
1824
1826
  }
1827
+ onHandleLoading(loading = false) {
1828
+ this._isLoading = loading;
1829
+ }
1830
+ onHandleLoadValues(first = false) {
1831
+ const { values } = this.option;
1832
+ this.onHandleLoading(true);
1833
+ if (!values?.length && first) {
1834
+ const { values, hasMoreValues } = this.option.loadValues();
1835
+ this._hasMoreValues = hasMoreValues;
1836
+ this.option.values = values;
1837
+ }
1838
+ else if (!first) {
1839
+ const { values, hasMoreValues } = this.option.loadMoreValues();
1840
+ this._hasMoreValues = hasMoreValues;
1841
+ this.option.values = values;
1842
+ }
1843
+ this.onHandleLoading(false);
1844
+ }
1825
1845
  onHandleChildrenAction(child) {
1826
1846
  const { option } = this;
1827
1847
  const { field, action } = child;
@@ -1845,12 +1865,18 @@ class MECXFilterOptionsComponent {
1845
1865
  }
1846
1866
  this._showMenu = true;
1847
1867
  }
1868
+ ngAfterViewInit() {
1869
+ this.onHandleLoadValues(true);
1870
+ }
1871
+ onHandleLoadMoreValues() {
1872
+ this.onHandleLoadValues();
1873
+ }
1848
1874
  }
1849
1875
  MECXFilterOptionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1850
- MECXFilterOptionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterOptionsComponent, selector: "mecx-filter-options", inputs: { option: "option", closeDirectly: "closeDirectly" }, outputs: { onClose: "onClose", onRemove: "onRemove", onSubmit: "onSubmit", onShowFromChildren: "onShowFromChildren" }, ngImport: i0, template: "<div class=\"d-flex justify-content-between header\">\r\n <span class=\"title\">\r\n {{ option?.label | translate }}\r\n </span>\r\n <div class=\"close\" #actionElement (click)=\"onHandleShowMenu()\">\r\n <monkey-icon icon=\"close-12\" color=\"#474747\"></monkey-icon>\r\n </div>\r\n</div>\r\n<ng-container *ngIf=\"option?.type as type\">\r\n <ng-container *ngIf=\"option?.children; else withoutChildren\">\r\n <mecx-filter-options-children [option]=\"option\" (onSubmit)=\"onHandleSubmitChildren($event)\"\r\n (onShow)=\"onShowFromChildren.next($event)\">\r\n </mecx-filter-options-children>\r\n </ng-container>\r\n <ng-template #withoutChildren>\r\n <ng-container [ngSwitch]=\"type\">\r\n <mecx-filter-options-status *ngSwitchCase=\"'status'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-status>\r\n <mecx-filter-options-date-range *ngSwitchCase=\"'date-range'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-date-range>\r\n <mecx-filter-options-currency *ngSwitchCase=\"'currency'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-currency>\r\n <mecx-filter-options-input *ngSwitchCase=\"'input'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-input>\r\n </ng-container>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-container\r\n *monkeyecxPopover=\"_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'ltr'\">\r\n <div class=\"close-menu\">\r\n <monkey-button type=\"tertiary\" color=\"error\" (click)=\"onRemove.next()\" size=\"sm\">\r\n {{ 'BUTTONS.REMOVE' | translate }}\r\n </monkey-button>\r\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose.next()\" size=\"sm\">\r\n {{ 'BUTTONS.CLOSE' | translate }}\r\n </monkey-button>\r\n </div>\r\n</ng-container>", styles: [":host{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px}:host .header{border-bottom:1px solid #d6d6d6;padding:8px}:host .header .title{color:#4b4a53;font-style:normal;font-size:14px;line-height:16px;font-weight:500;text-align:left}:host .header .close{cursor:pointer;border-radius:120px;padding:4px}:host .header .close:hover{background-color:#6d6d6d0c}.close-menu{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px;padding:8px}.close-menu ::ng-deep monkey-button{width:100%}.close-menu ::ng-deep monkey-button button{width:100%}\n"], components: [{ type: i1$2.MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "color", "contrast", "disabled"] }, { type: MECXFilterOptionsChildrenComponent, selector: "mecx-filter-options-children", inputs: ["option"], outputs: ["onSubmit", "onShow"] }, { type: MECXFilterOptionsStatusComponent, selector: "mecx-filter-options-status", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsDateRangeComponent, selector: "mecx-filter-options-date-range", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsCurrencyComponent, selector: "mecx-filter-options-currency", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsInputComponent, selector: "mecx-filter-options-input", inputs: ["option"], outputs: ["onSubmit"] }, { type: i1$2.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$4.MonkeyEcxPopoverDirective, selector: "[monkeyecxPopover]", inputs: ["monkeyecxPopover", "monkeyecxPopoverClosed", "monkeyecxPopoverTarget", "monkeyecxPopoverMinwidth", "monkeyecxPopoverBackdrop", "monkeyecxPopoverWatch", "monkeyecxPopoverDir", "monkeyecxPopoverContextmenu", "monkeyecxPopoverHeight"] }], pipes: { "translate": i1$3.TranslatePipe } });
1876
+ MECXFilterOptionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterOptionsComponent, selector: "mecx-filter-options", inputs: { option: "option", closeDirectly: "closeDirectly" }, outputs: { onClose: "onClose", onRemove: "onRemove", onSubmit: "onSubmit", onShowFromChildren: "onShowFromChildren" }, ngImport: i0, template: "<div class=\"d-flex justify-content-between header\">\r\n <span class=\"title\">\r\n {{ option?.label | translate }}\r\n </span>\r\n <div class=\"close\" #actionElement (click)=\"onHandleShowMenu()\">\r\n <monkey-icon icon=\"close-12\" color=\"#474747\"></monkey-icon>\r\n </div>\r\n</div>\r\n<ng-container *ngIf=\"option?.type as type\">\r\n <ng-container *ngIf=\"option?.children; else withoutChildren\">\r\n <mecx-filter-options-children [option]=\"option\" (onSubmit)=\"onHandleSubmitChildren($event)\"\r\n (onShow)=\"onShowFromChildren.next($event)\">\r\n </mecx-filter-options-children>\r\n </ng-container>\r\n <ng-template #withoutChildren>\r\n <ng-container [ngSwitch]=\"type\">\r\n <mecx-filter-options-status *ngSwitchCase=\"'status'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-status>\r\n <mecx-filter-options-date-range *ngSwitchCase=\"'date-range'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-date-range>\r\n <mecx-filter-options-currency *ngSwitchCase=\"'currency'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-currency>\r\n <mecx-filter-options-input *ngSwitchCase=\"'input'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-input>\r\n </ng-container>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<div class=\"box-loading\" *ngIf=\"_isLoading\">\r\n <div class=\"loading\"></div>\r\n <div class=\"loading\"></div>\r\n <div class=\"loading\"></div>\r\n</div>\r\n\r\n<div class=\"footer\" *ngIf=\"_hasMoreValues && !_isLoading\">\r\n <monkey-button type=\"tertiary\" color=\"theme\" [label]=\"'BUTTONS.LOAD-MORE' | translate\"\r\n (click)=\"onHandleLoadMoreValues()\">\r\n </monkey-button>\r\n</div>\r\n\r\n<ng-container\r\n *monkeyecxPopover=\"_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'ltr'\">\r\n <div class=\"close-menu\">\r\n <monkey-button type=\"tertiary\" color=\"error\" (click)=\"onRemove.next()\" size=\"sm\">\r\n {{ 'BUTTONS.REMOVE' | translate }}\r\n </monkey-button>\r\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose.next()\" size=\"sm\">\r\n {{ 'BUTTONS.CLOSE' | translate }}\r\n </monkey-button>\r\n </div>\r\n</ng-container>", styles: [":host{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px}:host .header{border-bottom:1px solid #d6d6d6;padding:8px}:host .header .title{color:#4b4a53;font-style:normal;font-size:14px;line-height:16px;font-weight:500;text-align:left}:host .header .close{cursor:pointer;border-radius:120px;padding:4px}:host .header .close:hover{background-color:#6d6d6d0c}:host .box-loaing{display:flex;flex-direction:column;gap:12px}:host .footer ::ng-deep monkey-button{width:100%}:host .footer ::ng-deep monkey-button button{width:100%}:host .loading:empty{margin-top:4px;height:24px;width:100%}:host .loading:empty{animation:loading 1.1s infinite linear;background:#ebebeb;background-image:linear-gradient(to right,#ebebeb 0%,#f2f3f5 20%,#ebebeb 40%,#ebebeb 100%);background-repeat:no-repeat}@keyframes loading{0%{background-position:-100px}to{background-position:500px}}.close-menu{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px;padding:8px}.close-menu ::ng-deep monkey-button{width:100%}.close-menu ::ng-deep monkey-button button{width:100%}\n"], components: [{ type: i1$2.MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "color", "contrast", "disabled"] }, { type: MECXFilterOptionsChildrenComponent, selector: "mecx-filter-options-children", inputs: ["option"], outputs: ["onSubmit", "onShow"] }, { type: MECXFilterOptionsStatusComponent, selector: "mecx-filter-options-status", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsDateRangeComponent, selector: "mecx-filter-options-date-range", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsCurrencyComponent, selector: "mecx-filter-options-currency", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsInputComponent, selector: "mecx-filter-options-input", inputs: ["option"], outputs: ["onSubmit"] }, { type: i1$2.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$4.MonkeyEcxPopoverDirective, selector: "[monkeyecxPopover]", inputs: ["monkeyecxPopover", "monkeyecxPopoverClosed", "monkeyecxPopoverTarget", "monkeyecxPopoverMinwidth", "monkeyecxPopoverBackdrop", "monkeyecxPopoverWatch", "monkeyecxPopoverDir", "monkeyecxPopoverContextmenu", "monkeyecxPopoverHeight"] }], pipes: { "translate": i1$3.TranslatePipe } });
1851
1877
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsComponent, decorators: [{
1852
1878
  type: Component,
1853
- args: [{ selector: 'mecx-filter-options', template: "<div class=\"d-flex justify-content-between header\">\r\n <span class=\"title\">\r\n {{ option?.label | translate }}\r\n </span>\r\n <div class=\"close\" #actionElement (click)=\"onHandleShowMenu()\">\r\n <monkey-icon icon=\"close-12\" color=\"#474747\"></monkey-icon>\r\n </div>\r\n</div>\r\n<ng-container *ngIf=\"option?.type as type\">\r\n <ng-container *ngIf=\"option?.children; else withoutChildren\">\r\n <mecx-filter-options-children [option]=\"option\" (onSubmit)=\"onHandleSubmitChildren($event)\"\r\n (onShow)=\"onShowFromChildren.next($event)\">\r\n </mecx-filter-options-children>\r\n </ng-container>\r\n <ng-template #withoutChildren>\r\n <ng-container [ngSwitch]=\"type\">\r\n <mecx-filter-options-status *ngSwitchCase=\"'status'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-status>\r\n <mecx-filter-options-date-range *ngSwitchCase=\"'date-range'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-date-range>\r\n <mecx-filter-options-currency *ngSwitchCase=\"'currency'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-currency>\r\n <mecx-filter-options-input *ngSwitchCase=\"'input'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-input>\r\n </ng-container>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-container\r\n *monkeyecxPopover=\"_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'ltr'\">\r\n <div class=\"close-menu\">\r\n <monkey-button type=\"tertiary\" color=\"error\" (click)=\"onRemove.next()\" size=\"sm\">\r\n {{ 'BUTTONS.REMOVE' | translate }}\r\n </monkey-button>\r\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose.next()\" size=\"sm\">\r\n {{ 'BUTTONS.CLOSE' | translate }}\r\n </monkey-button>\r\n </div>\r\n</ng-container>", styles: [":host{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px}:host .header{border-bottom:1px solid #d6d6d6;padding:8px}:host .header .title{color:#4b4a53;font-style:normal;font-size:14px;line-height:16px;font-weight:500;text-align:left}:host .header .close{cursor:pointer;border-radius:120px;padding:4px}:host .header .close:hover{background-color:#6d6d6d0c}.close-menu{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px;padding:8px}.close-menu ::ng-deep monkey-button{width:100%}.close-menu ::ng-deep monkey-button button{width:100%}\n"] }]
1879
+ args: [{ selector: 'mecx-filter-options', template: "<div class=\"d-flex justify-content-between header\">\r\n <span class=\"title\">\r\n {{ option?.label | translate }}\r\n </span>\r\n <div class=\"close\" #actionElement (click)=\"onHandleShowMenu()\">\r\n <monkey-icon icon=\"close-12\" color=\"#474747\"></monkey-icon>\r\n </div>\r\n</div>\r\n<ng-container *ngIf=\"option?.type as type\">\r\n <ng-container *ngIf=\"option?.children; else withoutChildren\">\r\n <mecx-filter-options-children [option]=\"option\" (onSubmit)=\"onHandleSubmitChildren($event)\"\r\n (onShow)=\"onShowFromChildren.next($event)\">\r\n </mecx-filter-options-children>\r\n </ng-container>\r\n <ng-template #withoutChildren>\r\n <ng-container [ngSwitch]=\"type\">\r\n <mecx-filter-options-status *ngSwitchCase=\"'status'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-status>\r\n <mecx-filter-options-date-range *ngSwitchCase=\"'date-range'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-date-range>\r\n <mecx-filter-options-currency *ngSwitchCase=\"'currency'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-currency>\r\n <mecx-filter-options-input *ngSwitchCase=\"'input'\" [option]=\"option\"\r\n (onSubmit)=\"onHandleSubmit($event)\">\r\n </mecx-filter-options-input>\r\n </ng-container>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<div class=\"box-loading\" *ngIf=\"_isLoading\">\r\n <div class=\"loading\"></div>\r\n <div class=\"loading\"></div>\r\n <div class=\"loading\"></div>\r\n</div>\r\n\r\n<div class=\"footer\" *ngIf=\"_hasMoreValues && !_isLoading\">\r\n <monkey-button type=\"tertiary\" color=\"theme\" [label]=\"'BUTTONS.LOAD-MORE' | translate\"\r\n (click)=\"onHandleLoadMoreValues()\">\r\n </monkey-button>\r\n</div>\r\n\r\n<ng-container\r\n *monkeyecxPopover=\"_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'ltr'\">\r\n <div class=\"close-menu\">\r\n <monkey-button type=\"tertiary\" color=\"error\" (click)=\"onRemove.next()\" size=\"sm\">\r\n {{ 'BUTTONS.REMOVE' | translate }}\r\n </monkey-button>\r\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose.next()\" size=\"sm\">\r\n {{ 'BUTTONS.CLOSE' | translate }}\r\n </monkey-button>\r\n </div>\r\n</ng-container>", styles: [":host{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px}:host .header{border-bottom:1px solid #d6d6d6;padding:8px}:host .header .title{color:#4b4a53;font-style:normal;font-size:14px;line-height:16px;font-weight:500;text-align:left}:host .header .close{cursor:pointer;border-radius:120px;padding:4px}:host .header .close:hover{background-color:#6d6d6d0c}:host .box-loaing{display:flex;flex-direction:column;gap:12px}:host .footer ::ng-deep monkey-button{width:100%}:host .footer ::ng-deep monkey-button button{width:100%}:host .loading:empty{margin-top:4px;height:24px;width:100%}:host .loading:empty{animation:loading 1.1s infinite linear;background:#ebebeb;background-image:linear-gradient(to right,#ebebeb 0%,#f2f3f5 20%,#ebebeb 40%,#ebebeb 100%);background-repeat:no-repeat}@keyframes loading{0%{background-position:-100px}to{background-position:500px}}.close-menu{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px;padding:8px}.close-menu ::ng-deep monkey-button{width:100%}.close-menu ::ng-deep monkey-button button{width:100%}\n"] }]
1854
1880
  }], ctorParameters: function () { return []; }, propDecorators: { option: [{
1855
1881
  type: Input
1856
1882
  }], closeDirectly: [{