@factor_ec/ui 2.0.0 → 2.0.1
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.
- package/esm2020/lib/io/expression-builder/expression-builder.component.mjs +72 -0
- package/esm2020/lib/io/io.module.mjs +10 -5
- package/esm2020/lib/models/module-configuration.mjs +2 -0
- package/esm2020/lib/ui.module.mjs +9 -1
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/factor_ec-ui.mjs +85 -5
- package/fesm2015/factor_ec-ui.mjs.map +1 -1
- package/fesm2020/factor_ec-ui.mjs +85 -5
- package/fesm2020/factor_ec-ui.mjs.map +1 -1
- package/lib/io/expression-builder/expression-builder.component.d.ts +46 -0
- package/lib/io/io.module.d.ts +6 -5
- package/lib/models/module-configuration.d.ts +6 -0
- package/lib/ui.module.d.ts +3 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -632,6 +632,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
632
632
|
args: [{ selector: 'ft-listview', template: "<p>listview works!</p>\n" }]
|
|
633
633
|
}] });
|
|
634
634
|
|
|
635
|
+
class ExpressionBuilderComponent {
|
|
636
|
+
constructor() {
|
|
637
|
+
this.properties = [
|
|
638
|
+
{ label: 'Nombre', type: 'string', field: 'name' },
|
|
639
|
+
{ label: 'Monto', type: 'number', field: 'amount' },
|
|
640
|
+
{ label: 'Tarjeta adicional', type: 'boolean', field: 'additional' }
|
|
641
|
+
];
|
|
642
|
+
this.groupOperators = [
|
|
643
|
+
{ label: 'Y', value: 'AND' },
|
|
644
|
+
{ label: 'O', value: 'OR' }
|
|
645
|
+
];
|
|
646
|
+
this.filters = {
|
|
647
|
+
id: 'root',
|
|
648
|
+
type: 'group',
|
|
649
|
+
operator: 'AND',
|
|
650
|
+
children: [
|
|
651
|
+
{
|
|
652
|
+
type: 'filter',
|
|
653
|
+
property: '',
|
|
654
|
+
operator: '>',
|
|
655
|
+
value: ''
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
type: 'filter',
|
|
659
|
+
property: '',
|
|
660
|
+
operator: true,
|
|
661
|
+
value: ''
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
type: 'filter',
|
|
665
|
+
property: '',
|
|
666
|
+
operator: '==',
|
|
667
|
+
value: ''
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
type: 'group',
|
|
671
|
+
operator: 'OR',
|
|
672
|
+
children: [
|
|
673
|
+
{
|
|
674
|
+
type: 'filter',
|
|
675
|
+
property: '',
|
|
676
|
+
operator: '==',
|
|
677
|
+
value: ''
|
|
678
|
+
}
|
|
679
|
+
]
|
|
680
|
+
}
|
|
681
|
+
]
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
add(type, filter) {
|
|
685
|
+
if (!filter.children) {
|
|
686
|
+
filter.children = [];
|
|
687
|
+
}
|
|
688
|
+
filter.children.push({ type });
|
|
689
|
+
filter.children = filter.children.sort((a, b) => a.type !== 'group' ? -1 : 0);
|
|
690
|
+
}
|
|
691
|
+
remove(filter, parent) {
|
|
692
|
+
const index = parent.indexOf(filter);
|
|
693
|
+
parent.splice(index, 1);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
ExpressionBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: ExpressionBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
697
|
+
ExpressionBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.2", type: ExpressionBuilderComponent, selector: "ft-expression-builder", ngImport: i0, template: "<ng-container [ngTemplateOutlet]=\"filterGroupTemplate\" [ngTemplateOutletContext]=\"{filter:filters, parent:null}\">\n</ng-container>\n<ng-template #filterGroupTemplate let-filter=\"filter\" let-parent=\"parent\">\n <div class=\"ft-filter\">\n <div class=\"ft-filter__tools\">\n <button type=\"button\" class=\"filter__button filter__button--icon filter__button--toggle\"\n (click)=\"filter.collapsed = !filter.collapsed\" *ngIf=\"filter.children && filter.children.length > 0\">\n <ft-icon name=\"angle-right\" [ngClass]=\"{'ft-icon--open': !filter.collapsed}\"></ft-icon>\n </button>\n <div class=\"ft-filter__button-group\">\n <button type=\"button\" class=\"filter__button\"\n [ngClass]=\"{'ft-filter__button--active': filter.operator === operator.value}\"\n *ngFor=\"let operator of groupOperators\" (click)=\"filter.operator = operator.value\">{{ operator.label\n }}</button>\n </div>\n <button type=\"button\" class=\"ft-filter__button\" (click)=\"add('filter', filter)\" *ngIf=\"filter.operator\">Agregar\n filtro</button>\n <button type=\"button\" class=\"ft-filter__button\" (click)=\"add('group', filter)\" *ngIf=\"filter.operator\">Agregar\n grupo</button>\n <button type=\"button\" class=\"ft-filter__button filter__button--icon filter__button--remove\"\n (click)=\"remove(filter, parent)\" *ngIf=\"parent\">\n <ft-icon name=\"close\"></ft-icon>\n </button>\n </div>\n <div class=\"ft-filter__children\" *ngIf=\"filter.children && filter.children.length > 0 && !filter.collapsed\">\n <ng-container *ngFor=\"let child of filter.children\">\n <ng-container [ngTemplateOutlet]=\"child.type === 'group' ? filterGroupTemplate : filterTemplate\"\n [ngTemplateOutletContext]=\"{filter:child, parent:filter.children}\">\n </ng-container>\n </ng-container>\n </div>\n </div>\n</ng-template>\n<ng-template #filterTemplate let-filter=\"filter\" let-parent=\"parent\">\n <div class=\"ft-filter\">\n <div class=\"ft-filter__tools\">\n <select class=\"filter__input\">\n <option *ngFor=\"let property of properties\" value=\"property.value\">{{ property.label }}</option>\n </select>\n <select class=\"ft-filter__input\">\n <option>Mayor que</option>\n <option>Mayor igual que</option>\n <option>Igual que</option>\n <option>Menor que</option>\n <option>Menor igual que</option>\n </select>\n <input type=\"text\" class=\"ft-filter__input\" />\n <button type=\"button\" class=\"filter__button filter__button--icon\" (click)=\"remove(filter, parent)\">\n <ft-icon name=\"close\"></ft-icon>\n </button>\n </div>\n </div>\n</ng-template>", styles: [":host{display:block;padding:2rem}.ft-filter{--focus-color: #00bcd4;--focus-color-rgb: 0, 188, 212;display:inline-flex;flex-direction:column;align-items:flex-start;gap:.5rem}.ft-filter__tools{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem;background-color:#0000000d;border:1px solid rgba(0,0,0,.1);border-radius:.5rem;overflow:hidden}.ft-filter__children{padding-left:1rem;position:relative;display:inline-flex;flex-direction:column;align-items:flex-start;gap:.5rem}.ft-filter__button{border:1px solid rgba(0,0,0,.2);background-color:transparent;border-radius:.25rem;padding:.25rem .5rem;background-color:#ffffff4d}.ft-filter__button--icon{border-color:transparent;background-color:transparent;padding:.25rem}.ft-filter__button--active{background-color:var(--focus-color);color:#fff}.ft-filter__button:not(.ft-filter__button--active):hover{border-color:var(--focus-color);background-color:rgba(var(--focus-color-rgb),.1)}.ft-filter__button:not(.ft-filter__button--active):active{background-color:rgba(var(--focus-color-rgb),.3)}.ft-filter__button:focus{outline:none;border-color:var(--focus-color)}.ft-filter__button .ft-icon{display:block;transition:transform .2s}.ft-filter__button .ft-icon--open{transform:rotate(90deg)}.ft-filter__button-group .ft-filter__button{border-radius:0}.ft-filter__button-group .ft-filter__button:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-right:0}.ft-filter__button-group .ft-filter__button:last-child{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.ft-filter__input{background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:.25rem;padding:.25rem;transition:box-shadow .2s}.ft-filter__input:hover{border-color:var(--focus-color)}.ft-filter__input:focus{outline:none;border-color:var(--focus-color);box-shadow:0 0 0 2px rgba(var(--focus-color-rgb),.2)}.ft-filter select.ft-filter__input{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right .5rem center;background-size:.625rem;padding-right:1.5rem;-webkit-appearance:none;appearance:none}@keyframes slide-right{0%{margin-left:calc(-40px + .5rem)}to{margin-left:0}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "ft-icon", inputs: ["class", "collection", "mode", "name", "path", "size", "src"] }] });
|
|
698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: ExpressionBuilderComponent, decorators: [{
|
|
699
|
+
type: Component,
|
|
700
|
+
args: [{ selector: 'ft-expression-builder', template: "<ng-container [ngTemplateOutlet]=\"filterGroupTemplate\" [ngTemplateOutletContext]=\"{filter:filters, parent:null}\">\n</ng-container>\n<ng-template #filterGroupTemplate let-filter=\"filter\" let-parent=\"parent\">\n <div class=\"ft-filter\">\n <div class=\"ft-filter__tools\">\n <button type=\"button\" class=\"filter__button filter__button--icon filter__button--toggle\"\n (click)=\"filter.collapsed = !filter.collapsed\" *ngIf=\"filter.children && filter.children.length > 0\">\n <ft-icon name=\"angle-right\" [ngClass]=\"{'ft-icon--open': !filter.collapsed}\"></ft-icon>\n </button>\n <div class=\"ft-filter__button-group\">\n <button type=\"button\" class=\"filter__button\"\n [ngClass]=\"{'ft-filter__button--active': filter.operator === operator.value}\"\n *ngFor=\"let operator of groupOperators\" (click)=\"filter.operator = operator.value\">{{ operator.label\n }}</button>\n </div>\n <button type=\"button\" class=\"ft-filter__button\" (click)=\"add('filter', filter)\" *ngIf=\"filter.operator\">Agregar\n filtro</button>\n <button type=\"button\" class=\"ft-filter__button\" (click)=\"add('group', filter)\" *ngIf=\"filter.operator\">Agregar\n grupo</button>\n <button type=\"button\" class=\"ft-filter__button filter__button--icon filter__button--remove\"\n (click)=\"remove(filter, parent)\" *ngIf=\"parent\">\n <ft-icon name=\"close\"></ft-icon>\n </button>\n </div>\n <div class=\"ft-filter__children\" *ngIf=\"filter.children && filter.children.length > 0 && !filter.collapsed\">\n <ng-container *ngFor=\"let child of filter.children\">\n <ng-container [ngTemplateOutlet]=\"child.type === 'group' ? filterGroupTemplate : filterTemplate\"\n [ngTemplateOutletContext]=\"{filter:child, parent:filter.children}\">\n </ng-container>\n </ng-container>\n </div>\n </div>\n</ng-template>\n<ng-template #filterTemplate let-filter=\"filter\" let-parent=\"parent\">\n <div class=\"ft-filter\">\n <div class=\"ft-filter__tools\">\n <select class=\"filter__input\">\n <option *ngFor=\"let property of properties\" value=\"property.value\">{{ property.label }}</option>\n </select>\n <select class=\"ft-filter__input\">\n <option>Mayor que</option>\n <option>Mayor igual que</option>\n <option>Igual que</option>\n <option>Menor que</option>\n <option>Menor igual que</option>\n </select>\n <input type=\"text\" class=\"ft-filter__input\" />\n <button type=\"button\" class=\"filter__button filter__button--icon\" (click)=\"remove(filter, parent)\">\n <ft-icon name=\"close\"></ft-icon>\n </button>\n </div>\n </div>\n</ng-template>", styles: [":host{display:block;padding:2rem}.ft-filter{--focus-color: #00bcd4;--focus-color-rgb: 0, 188, 212;display:inline-flex;flex-direction:column;align-items:flex-start;gap:.5rem}.ft-filter__tools{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem;background-color:#0000000d;border:1px solid rgba(0,0,0,.1);border-radius:.5rem;overflow:hidden}.ft-filter__children{padding-left:1rem;position:relative;display:inline-flex;flex-direction:column;align-items:flex-start;gap:.5rem}.ft-filter__button{border:1px solid rgba(0,0,0,.2);background-color:transparent;border-radius:.25rem;padding:.25rem .5rem;background-color:#ffffff4d}.ft-filter__button--icon{border-color:transparent;background-color:transparent;padding:.25rem}.ft-filter__button--active{background-color:var(--focus-color);color:#fff}.ft-filter__button:not(.ft-filter__button--active):hover{border-color:var(--focus-color);background-color:rgba(var(--focus-color-rgb),.1)}.ft-filter__button:not(.ft-filter__button--active):active{background-color:rgba(var(--focus-color-rgb),.3)}.ft-filter__button:focus{outline:none;border-color:var(--focus-color)}.ft-filter__button .ft-icon{display:block;transition:transform .2s}.ft-filter__button .ft-icon--open{transform:rotate(90deg)}.ft-filter__button-group .ft-filter__button{border-radius:0}.ft-filter__button-group .ft-filter__button:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-right:0}.ft-filter__button-group .ft-filter__button:last-child{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.ft-filter__input{background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:.25rem;padding:.25rem;transition:box-shadow .2s}.ft-filter__input:hover{border-color:var(--focus-color)}.ft-filter__input:focus{outline:none;border-color:var(--focus-color);box-shadow:0 0 0 2px rgba(var(--focus-color-rgb),.2)}.ft-filter select.ft-filter__input{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e\");background-repeat:no-repeat;background-position:right .5rem center;background-size:.625rem;padding-right:1.5rem;-webkit-appearance:none;appearance:none}@keyframes slide-right{0%{margin-left:calc(-40px + .5rem)}to{margin-left:0}}\n"] }]
|
|
701
|
+
}], ctorParameters: function () { return []; } });
|
|
702
|
+
|
|
635
703
|
class IoModule {
|
|
636
704
|
}
|
|
637
705
|
IoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: IoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -644,7 +712,8 @@ IoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0
|
|
|
644
712
|
ObserveIntersectingDirective,
|
|
645
713
|
TimelineComponent,
|
|
646
714
|
ListviewComponent,
|
|
647
|
-
MessageContentComponent
|
|
715
|
+
MessageContentComponent,
|
|
716
|
+
ExpressionBuilderComponent], imports: [CommonModule,
|
|
648
717
|
MatButtonModule,
|
|
649
718
|
MatDialogModule,
|
|
650
719
|
MatSnackBarModule], exports: [AvatarComponent,
|
|
@@ -656,7 +725,8 @@ IoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0
|
|
|
656
725
|
ObserveIntersectingDirective,
|
|
657
726
|
TimelineComponent,
|
|
658
727
|
ListviewComponent,
|
|
659
|
-
MessageContentComponent
|
|
728
|
+
MessageContentComponent,
|
|
729
|
+
ExpressionBuilderComponent] });
|
|
660
730
|
IoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: IoModule, imports: [CommonModule,
|
|
661
731
|
MatButtonModule,
|
|
662
732
|
MatDialogModule,
|
|
@@ -674,7 +744,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
674
744
|
ObserveIntersectingDirective,
|
|
675
745
|
TimelineComponent,
|
|
676
746
|
ListviewComponent,
|
|
677
|
-
MessageContentComponent
|
|
747
|
+
MessageContentComponent,
|
|
748
|
+
ExpressionBuilderComponent
|
|
678
749
|
],
|
|
679
750
|
imports: [
|
|
680
751
|
CommonModule,
|
|
@@ -692,7 +763,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
692
763
|
ObserveIntersectingDirective,
|
|
693
764
|
TimelineComponent,
|
|
694
765
|
ListviewComponent,
|
|
695
|
-
MessageContentComponent
|
|
766
|
+
MessageContentComponent,
|
|
767
|
+
ExpressionBuilderComponent
|
|
696
768
|
]
|
|
697
769
|
}]
|
|
698
770
|
}] });
|
|
@@ -1011,6 +1083,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
1011
1083
|
}] });
|
|
1012
1084
|
|
|
1013
1085
|
class UiModule {
|
|
1086
|
+
static forRoot(configuration) {
|
|
1087
|
+
return {
|
|
1088
|
+
ngModule: UiModule,
|
|
1089
|
+
providers: [
|
|
1090
|
+
{ provide: 'FactorUiConfiguration', useValue: configuration }
|
|
1091
|
+
]
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1014
1094
|
}
|
|
1015
1095
|
UiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: UiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1016
1096
|
UiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.2", ngImport: i0, type: UiModule, imports: [CommonModule,
|
|
@@ -1045,5 +1125,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImpor
|
|
|
1045
1125
|
* Generated bundle index. Do not edit.
|
|
1046
1126
|
*/
|
|
1047
1127
|
|
|
1048
|
-
export { AvatarComponent, IconComponent, ImageComponent, IoModule, ListComponent, ListviewComponent, MessageComponent, MessageContentComponent, MessageService, NavbarComponent, NavigationModule, ObserveIntersectingDirective, ProgressComponent, ProgressService, RatingComponent, SearchboxComponent, TimelineComponent, ToolbarComponent, UiModule };
|
|
1128
|
+
export { AvatarComponent, ExpressionBuilderComponent, IconComponent, ImageComponent, IoModule, ListComponent, ListviewComponent, MessageComponent, MessageContentComponent, MessageService, NavbarComponent, NavigationModule, ObserveIntersectingDirective, ProgressComponent, ProgressService, RatingComponent, SearchboxComponent, TimelineComponent, ToolbarComponent, UiModule };
|
|
1049
1129
|
//# sourceMappingURL=factor_ec-ui.mjs.map
|