verben-ng-ui 0.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/README.md +24 -0
- package/ng-package.json +10 -0
- package/package.json +34 -0
- package/src/lib/Verbena-input/error.service.ts +23 -0
- package/src/lib/Verbena-input/verbena-input.component.css +59 -0
- package/src/lib/Verbena-input/verbena-input.component.html +64 -0
- package/src/lib/Verbena-input/verbena-input.component.spec.ts +25 -0
- package/src/lib/Verbena-input/verbena-input.component.ts +162 -0
- package/src/lib/Verbena-input/verbena-input.module.ts +12 -0
- package/src/lib/components/TemplateDirective.directive.ts +10 -0
- package/src/lib/components/card/card.component.css +20 -0
- package/src/lib/components/card/card.component.html +23 -0
- package/src/lib/components/card/card.component.spec.ts +23 -0
- package/src/lib/components/card/card.component.ts +33 -0
- package/src/lib/components/card/card.module.ts +10 -0
- package/src/lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component.css +3 -0
- package/src/lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component.html +1 -0
- package/src/lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component.ts +10 -0
- package/src/lib/components/card-data-view/card-data-view-header/card-data-view-header.component.css +7 -0
- package/src/lib/components/card-data-view/card-data-view-header/card-data-view-header.component.html +1 -0
- package/src/lib/components/card-data-view/card-data-view-header/card-data-view-header.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/card-data-view-header/card-data-view-header.component.ts +10 -0
- package/src/lib/components/card-data-view/card-data-view.component.css +39 -0
- package/src/lib/components/card-data-view/card-data-view.component.html +29 -0
- package/src/lib/components/card-data-view/card-data-view.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/card-data-view.component.ts +66 -0
- package/src/lib/components/card-data-view/card-data-view.module.ts +20 -0
- package/src/lib/components/card-data-view/card-data.ts +7 -0
- package/src/lib/components/card-data-view/left-card-data/left-card-data.component.css +15 -0
- package/src/lib/components/card-data-view/left-card-data/left-card-data.component.html +4 -0
- package/src/lib/components/card-data-view/left-card-data/left-card-data.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/left-card-data/left-card-data.component.ts +19 -0
- package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.css +0 -0
- package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.html +4 -0
- package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.ts +12 -0
- package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.css +3 -0
- package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.html +1 -0
- package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.spec.ts +23 -0
- package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.ts +10 -0
- package/src/lib/components/chip/ChipChangeEvent.ts +4 -0
- package/src/lib/components/chip/chip.component.css +94 -0
- package/src/lib/components/chip/chip.component.html +49 -0
- package/src/lib/components/chip/chip.component.spec.ts +23 -0
- package/src/lib/components/chip/chip.component.ts +209 -0
- package/src/lib/components/chip/chip.module.ts +24 -0
- package/src/lib/components/chip/documentation.md +26 -0
- package/src/lib/components/data-export/data-export.component.css +0 -0
- package/src/lib/components/data-export/data-export.component.html +90 -0
- package/src/lib/components/data-export/data-export.component.spec.ts +23 -0
- package/src/lib/components/data-export/data-export.component.ts +158 -0
- package/src/lib/components/data-export/data-export.module.ts +13 -0
- package/src/lib/components/data-export/data-export.service.spec.ts +16 -0
- package/src/lib/components/data-export/data-export.service.ts +152 -0
- package/src/lib/components/data-export/data-export.types.ts +21 -0
- package/src/lib/components/data-table/column.directive.spec.ts +8 -0
- package/src/lib/components/data-table/column.directive.ts +19 -0
- package/src/lib/components/data-table/data-table.component.css +0 -0
- package/src/lib/components/data-table/data-table.component.html +55 -0
- package/src/lib/components/data-table/data-table.component.spec.ts +21 -0
- package/src/lib/components/data-table/data-table.component.ts +336 -0
- package/src/lib/components/data-table/data-table.module.ts +11 -0
- package/src/lib/components/data-table/data-table.types.ts +13 -0
- package/src/lib/components/data-table/style.types.ts +55 -0
- package/src/lib/components/data-view/data-view-click-outside.directive.ts +44 -0
- package/src/lib/components/data-view/data-view.component.css +74 -0
- package/src/lib/components/data-view/data-view.component.html +161 -0
- package/src/lib/components/data-view/data-view.component.spec.ts +23 -0
- package/src/lib/components/data-view/data-view.component.ts +136 -0
- package/src/lib/components/data-view/data-view.module.ts +16 -0
- package/src/lib/components/date-picker/date-picker.component.css +65 -0
- package/src/lib/components/date-picker/date-picker.component.html +60 -0
- package/src/lib/components/date-picker/date-picker.component.specs.ts +23 -0
- package/src/lib/components/date-picker/date-picker.component.ts +143 -0
- package/src/lib/components/date-picker/date-picker.module.ts +12 -0
- package/src/lib/components/drop-down/DropdownChangeEvent.ts +4 -0
- package/src/lib/components/drop-down/DropdownLoadEvent.ts +19 -0
- package/src/lib/components/drop-down/DropdownMenuItem.ts +42 -0
- package/src/lib/components/drop-down/documentation.md +69 -0
- package/src/lib/components/drop-down/drop-down-item/drop-down-item.component.css +123 -0
- package/src/lib/components/drop-down/drop-down-item/drop-down-item.component.html +133 -0
- package/src/lib/components/drop-down/drop-down-item/drop-down-item.component.spec.ts +23 -0
- package/src/lib/components/drop-down/drop-down-item/drop-down-item.component.ts +88 -0
- package/src/lib/components/drop-down/drop-down.component.css +317 -0
- package/src/lib/components/drop-down/drop-down.component.html +177 -0
- package/src/lib/components/drop-down/drop-down.component.spec.ts +23 -0
- package/src/lib/components/drop-down/drop-down.component.ts +757 -0
- package/src/lib/components/drop-down/drop-down.module.ts +24 -0
- package/src/lib/components/image/image.component.css +12 -0
- package/src/lib/components/image/image.component.html +18 -0
- package/src/lib/components/image/image.component.spec.ts +23 -0
- package/src/lib/components/image/image.component.ts +45 -0
- package/src/lib/components/image/image.module.ts +11 -0
- package/src/lib/components/notification/notification.component.css +3 -0
- package/src/lib/components/notification/notification.component.html +19 -0
- package/src/lib/components/notification/notification.component.spec.ts +23 -0
- package/src/lib/components/notification/notification.component.ts +77 -0
- package/src/lib/components/notification/notification.module.ts +14 -0
- package/src/lib/components/shared.module.ts +9 -0
- package/src/lib/components/sort-table/sort-table.component.css +67 -0
- package/src/lib/components/sort-table/sort-table.component.html +164 -0
- package/src/lib/components/sort-table/sort-table.component.spec.ts +23 -0
- package/src/lib/components/sort-table/sort-table.component.ts +204 -0
- package/src/lib/components/sort-table/sort-table.module.ts +11 -0
- package/src/lib/components/svg/svg.component.css +0 -0
- package/src/lib/components/svg/svg.component.html +1 -0
- package/src/lib/components/svg/svg.component.spec.ts +23 -0
- package/src/lib/components/svg/svg.component.ts +64 -0
- package/src/lib/components/svg/svg.module.ts +10 -0
- package/src/lib/components/table-filter/table-filter.component.css +93 -0
- package/src/lib/components/table-filter/table-filter.component.html +293 -0
- package/src/lib/components/table-filter/table-filter.component.spec.ts +23 -0
- package/src/lib/components/table-filter/table-filter.component.ts +221 -0
- package/src/lib/components/table-filter/table-filter.module.ts +25 -0
- package/src/lib/components/tooltip/tooltip.component.css +8 -0
- package/src/lib/components/tooltip/tooltip.component.html +13 -0
- package/src/lib/components/tooltip/tooltip.component.spec.ts +23 -0
- package/src/lib/components/tooltip/tooltip.component.ts +84 -0
- package/src/lib/components/tooltip/tooltip.module.ts +11 -0
- package/src/lib/components/verben-mail/verben-mail.component.config.ts +11 -0
- package/src/lib/components/verben-mail/verben-mail.component.css +71 -0
- package/src/lib/components/verben-mail/verben-mail.component.html +139 -0
- package/src/lib/components/verben-mail/verben-mail.component.ts +151 -0
- package/src/lib/components/verben-mail/verben-mail.module.ts +18 -0
- package/src/lib/components/visible-column/visible-column.component.css +83 -0
- package/src/lib/components/visible-column/visible-column.component.html +77 -0
- package/src/lib/components/visible-column/visible-column.component.spec.ts +23 -0
- package/src/lib/components/visible-column/visible-column.component.ts +106 -0
- package/src/lib/components/visible-column/visible-column.module.ts +11 -0
- package/src/lib/config.ts +37 -0
- package/src/lib/control-options/control-options.directive.ts +129 -0
- package/src/lib/control-options/control-options.module.ts +10 -0
- package/src/lib/convert-to-integer/convert-to-integer.directive.ts +28 -0
- package/src/lib/convert-to-integer/convert-to-integer.module.ts +10 -0
- package/src/lib/convert-to-integer/public-api.ts +1 -0
- package/src/lib/convert-to-number/convert-to-number.directive.ts +22 -0
- package/src/lib/convert-to-number/convert-to-number.module.ts +8 -0
- package/src/lib/convert-to-number/public-api.ts +1 -0
- package/src/lib/email-validator/email-validator.directive.ts +24 -0
- package/src/lib/email-validator/email-validator.module.ts +14 -0
- package/src/lib/models/column-filter.ts +5 -0
- package/src/lib/models/data-filter.ts +8 -0
- package/src/lib/models/mail-model.ts +8 -0
- package/src/lib/models/sort-filter.ts +0 -0
- package/src/lib/models/table-filter.ts +34 -0
- package/src/lib/number-range/number-range.directive.ts +35 -0
- package/src/lib/number-range/number-range.module.ts +11 -0
- package/src/lib/phone-number/phone-number.directive.ts +22 -0
- package/src/lib/phone-number/phone-number.module.ts +10 -0
- package/src/lib/phone-number/public-api.ts +1 -0
- package/src/lib/required-input/required-input.directive.ts +18 -0
- package/src/lib/required-input/required-input.module.ts +8 -0
- package/src/lib/theme-switcher/theme-switcher.directive.spec.ts +8 -0
- package/src/lib/theme-switcher/theme-switcher.directive.ts +70 -0
- package/src/lib/theme-switcher/theme-switcher.module.ts +8 -0
- package/src/lib/validate/error-message.service.ts +104 -0
- package/src/lib/validate/validate.directive.ts +110 -0
- package/src/lib/validate/validate.module.ts +17 -0
- package/src/lib/validate-input/validate-input.directive.ts +8 -0
- package/src/lib/validate-input/validate-input.module.ts +8 -0
- package/src/lib/verben-ng-ui.component.spec.ts +23 -0
- package/src/lib/verben-ng-ui.component.ts +16 -0
- package/src/lib/verben-ng-ui.service.spec.ts +16 -0
- package/src/lib/verben-ng-ui.service.ts +9 -0
- package/src/lib/verbena-badge/verbena-badge.component.css +16 -0
- package/src/lib/verbena-badge/verbena-badge.component.html +13 -0
- package/src/lib/verbena-badge/verbena-badge.component.spec.ts +25 -0
- package/src/lib/verbena-badge/verbena-badge.component.ts +18 -0
- package/src/lib/verbena-badge/verbena-badge.module.ts +10 -0
- package/src/lib/verbena-button/verbena-button.component.css +20 -0
- package/src/lib/verbena-button/verbena-button.component.html +25 -0
- package/src/lib/verbena-button/verbena-button.component.spec.ts +25 -0
- package/src/lib/verbena-button/verbena-button.component.ts +92 -0
- package/src/lib/verbena-button/verbena-button.module.ts +11 -0
- package/src/lib/verbena-switch/verbena-switch.component.css +45 -0
- package/src/lib/verbena-switch/verbena-switch.component.html +8 -0
- package/src/lib/verbena-switch/verbena-switch.component.spec.ts +25 -0
- package/src/lib/verbena-switch/verbena-switch.component.ts +31 -0
- package/src/lib/verbena-switch/verbena-switch.module.ts +10 -0
- package/src/lib/verbena-textarea/verbena-textarea.component.css +0 -0
- package/src/lib/verbena-textarea/verbena-textarea.component.html +19 -0
- package/src/lib/verbena-textarea/verbena-textarea.component.spec.ts +33 -0
- package/src/lib/verbena-textarea/verbena-textarea.component.ts +44 -0
- package/src/lib/verbena-textarea/verbena-textarea.module.ts +11 -0
- package/src/public-api.ts +122 -0
- package/src/styles.css +103 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
<div class="container flex-col" [style.display]="'flex'" [style.margin]="mg" >
|
|
3
|
+
<!-- Header -->
|
|
4
|
+
<ng-container ngProjectAs="verben-card-data-view-header">
|
|
5
|
+
<ng-content select='verben-card-data-view-header'></ng-content>
|
|
6
|
+
</ng-container>
|
|
7
|
+
|
|
8
|
+
<div [style.padding]="pd" [ngClass]="!hasCurrentItem()?'master-only-container':'master-detail-container'" >
|
|
9
|
+
<!-- Card and Footer -->
|
|
10
|
+
<div [style.borderRadius]="borderRadius" [style.backgroundColor]="lbgColor" class="flex-col ">
|
|
11
|
+
<!-- Card section -->
|
|
12
|
+
<ng-container ngProjectAs="verben-left-card-data-view">
|
|
13
|
+
<ng-content select='verben-left-card-data-view'></ng-content>
|
|
14
|
+
</ng-container>
|
|
15
|
+
|
|
16
|
+
<!-- Footer-->
|
|
17
|
+
<ng-container ngProjectAs="verben-card-data-view-footer">
|
|
18
|
+
<ng-content select='verben-card-data-view-footer'></ng-content>
|
|
19
|
+
</ng-container>
|
|
20
|
+
</div>
|
|
21
|
+
<!-- Detail Section-->
|
|
22
|
+
<div [style.backgroundColor]="rbgColor" *ngIf="hasCurrentItem()" [style.borderRadius]="borderRadius">
|
|
23
|
+
<verben-svg (click)="clearData()" class="cursor-pointer toRight" icon="close" [width]="20" [height]="20" color="black"></verben-svg>
|
|
24
|
+
<ng-container ngProjectAs="verben-right-card-data-view">
|
|
25
|
+
<ng-content select='verben-right-card-data-view'></ng-content>
|
|
26
|
+
</ng-container>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CardDataViewComponent } from './card-data-view.component';
|
|
4
|
+
|
|
5
|
+
describe('CardDataViewComponent', () => {
|
|
6
|
+
let component: CardDataViewComponent;
|
|
7
|
+
let fixture: ComponentFixture<CardDataViewComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [CardDataViewComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(CardDataViewComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AfterContentInit, Component, ContentChild, ElementRef, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core';
|
|
2
|
+
import { CardData } from './card-data';
|
|
3
|
+
import { Title } from '@angular/platform-browser';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'verben-card-data-view',
|
|
7
|
+
templateUrl: './card-data-view.component.html',
|
|
8
|
+
styleUrl: './card-data-view.component.css'
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export class CardDataViewComponent {
|
|
12
|
+
@Input() pd = '10px';
|
|
13
|
+
@Input() mg = '0px';
|
|
14
|
+
@Input() lHeight?:string="100%";
|
|
15
|
+
@Input() rHeight?:string="100%";
|
|
16
|
+
@Input() rWidth?:string="70%";
|
|
17
|
+
@Input() lWidth?:string="30%";
|
|
18
|
+
@Input() textColor?:string ;
|
|
19
|
+
@Input() lbgColor?:string ;
|
|
20
|
+
@Input() rbgColor?:string ;
|
|
21
|
+
@Input() border?:string ;
|
|
22
|
+
@Input() display?:string ;
|
|
23
|
+
@Input() borderRadius?:string="12px";
|
|
24
|
+
@Input() activeCss?:string ;
|
|
25
|
+
@Input() inActiveCss?:string ;
|
|
26
|
+
@Input() displayAsRow?:boolean =true;
|
|
27
|
+
@Input() cardDataList:CardData[]=[];
|
|
28
|
+
@Input() dataId!:string;
|
|
29
|
+
@Input() totalRecords:number=0;
|
|
30
|
+
@Input() footer:boolean=false;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@ContentChild('card') card!: TemplateRef<any>;
|
|
34
|
+
// @ContentChild('content') content!: TemplateRef<any>;
|
|
35
|
+
currentItem:any={};
|
|
36
|
+
hasCurrentItem()
|
|
37
|
+
{
|
|
38
|
+
return !!Object.keys(this.currentItem).length
|
|
39
|
+
}
|
|
40
|
+
clearData()
|
|
41
|
+
{
|
|
42
|
+
this.currentItem={} as CardData
|
|
43
|
+
this.cardDataList.forEach(_=>{
|
|
44
|
+
_.selected=false;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
@Input() onItemClick(item:CardData){
|
|
48
|
+
item.selected= true;
|
|
49
|
+
this.cardDataList.forEach(element => {
|
|
50
|
+
if(element.data[this.dataId]==item.data[this.dataId])
|
|
51
|
+
{
|
|
52
|
+
this.currentItem= item;
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
{
|
|
56
|
+
element.selected=false;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return this.currentItem
|
|
60
|
+
}
|
|
61
|
+
@Output() loadMoreClick = new EventEmitter();
|
|
62
|
+
onLoadMoreClick()
|
|
63
|
+
{
|
|
64
|
+
this.loadMoreClick.emit();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { CardDataViewComponent } from './card-data-view.component';
|
|
4
|
+
import { LeftCardDataComponent } from './left-card-data/left-card-data.component';
|
|
5
|
+
import { LeftCardDataViewComponent } from './left-card-data-view/left-card-data-view.component';
|
|
6
|
+
import { RightCardDataViewComponent } from './right-card-data-view/right-card-data-view.component';
|
|
7
|
+
import { CardDataViewFooterComponent } from './card-data-view-footer/card-data-view-footer.component';
|
|
8
|
+
import { CardDataViewHeaderComponent } from './card-data-view-header/card-data-view-header.component';
|
|
9
|
+
import { SvgModule } from "../svg/svg.module";
|
|
10
|
+
|
|
11
|
+
@NgModule({
|
|
12
|
+
declarations:[CardDataViewComponent,LeftCardDataComponent,
|
|
13
|
+
LeftCardDataViewComponent,RightCardDataViewComponent,CardDataViewFooterComponent,
|
|
14
|
+
CardDataViewHeaderComponent],
|
|
15
|
+
imports: [CommonModule, SvgModule],
|
|
16
|
+
exports: [CardDataViewComponent,LeftCardDataComponent,
|
|
17
|
+
LeftCardDataViewComponent,RightCardDataViewComponent,CardDataViewFooterComponent,
|
|
18
|
+
CardDataViewHeaderComponent]
|
|
19
|
+
})
|
|
20
|
+
export class CardDataViewModule {}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* .left-side
|
|
2
|
+
{
|
|
3
|
+
border:1.5px solid rgb(246, 191, 109);
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
padding: 10px;
|
|
6
|
+
left: 0;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
} */
|
|
9
|
+
:host{
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
|
|
12
|
+
gap:15px;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
padding: 15px;
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { LeftCardDataComponent } from './left-card-data.component';
|
|
4
|
+
|
|
5
|
+
describe('LeftCardDataComponent', () => {
|
|
6
|
+
let component: LeftCardDataComponent;
|
|
7
|
+
let fixture: ComponentFixture<LeftCardDataComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [LeftCardDataComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(LeftCardDataComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
|
|
2
|
+
import { CardData } from '../card-data';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'verben-left-card-data',
|
|
6
|
+
templateUrl: './left-card-data.component.html',
|
|
7
|
+
styleUrl: './left-card-data.component.css'
|
|
8
|
+
})
|
|
9
|
+
export class LeftCardDataComponent {
|
|
10
|
+
@Input() pd = '10px';
|
|
11
|
+
@Input() mg = '0px';
|
|
12
|
+
@Input() height?:string="100%";
|
|
13
|
+
@Input() weight?:string="100%";
|
|
14
|
+
@Input() activeCss?:string ;
|
|
15
|
+
@Input() inActiveCss?:string ;
|
|
16
|
+
@Input() cardDataList:CardData[]=[];
|
|
17
|
+
@ContentChild('card') card!: TemplateRef<any>;
|
|
18
|
+
|
|
19
|
+
}
|
package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.css
ADDED
|
File without changes
|
package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.spec.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { LeftCardDataViewComponent } from './left-card-data-view.component';
|
|
4
|
+
|
|
5
|
+
describe('LeftCardDataViewComponent', () => {
|
|
6
|
+
let component: LeftCardDataViewComponent;
|
|
7
|
+
let fixture: ComponentFixture<LeftCardDataViewComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [LeftCardDataViewComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(LeftCardDataViewComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
package/src/lib/components/card-data-view/left-card-data-view/left-card-data-view.component.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { CardData } from '../card-data';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'verben-left-card-data-view',
|
|
6
|
+
templateUrl: './left-card-data-view.component.html',
|
|
7
|
+
styleUrl: './left-card-data-view.component.css'
|
|
8
|
+
})
|
|
9
|
+
export class LeftCardDataViewComponent {
|
|
10
|
+
@Input() cardDataList:CardData[]=[];
|
|
11
|
+
|
|
12
|
+
}
|
package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.html
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<ng-content></ng-content>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RightCardDataViewComponent } from './right-card-data-view.component';
|
|
4
|
+
|
|
5
|
+
describe('RightCardDataViewComponent', () => {
|
|
6
|
+
let component: RightCardDataViewComponent;
|
|
7
|
+
let fixture: ComponentFixture<RightCardDataViewComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [RightCardDataViewComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(RightCardDataViewComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
package/src/lib/components/card-data-view/right-card-data-view/right-card-data-view.component.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'verben-right-card-data-view',
|
|
5
|
+
templateUrl: './right-card-data-view.component.html',
|
|
6
|
+
styleUrl: './right-card-data-view.component.css'
|
|
7
|
+
})
|
|
8
|
+
export class RightCardDataViewComponent {
|
|
9
|
+
|
|
10
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@import '../../../styles.css';
|
|
2
|
+
|
|
3
|
+
.chip {
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.chip-content-input {
|
|
8
|
+
gap: 5px;
|
|
9
|
+
padding: 5px;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
min-height: 23px;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.chip-content-input.disabled .chips-container {
|
|
16
|
+
color: #64748b;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.chip-main-content {
|
|
20
|
+
min-width: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.chips-container {
|
|
24
|
+
width: 100%;
|
|
25
|
+
gap: 5px;
|
|
26
|
+
color: #334155;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.item-chip {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 5px;
|
|
34
|
+
border-radius: 5px;
|
|
35
|
+
padding: 1px 5px;
|
|
36
|
+
background-color: rgba(52, 121, 233, 0.5);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.item-chip>span {
|
|
40
|
+
max-width: 100px;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.item-chip>svg {
|
|
47
|
+
width: 12px;
|
|
48
|
+
height: 12px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
.input-container {
|
|
53
|
+
flex: 1 1 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.chip-input {
|
|
57
|
+
width: 100%;
|
|
58
|
+
border: none;
|
|
59
|
+
outline: none;
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.chip-input::placeholder {
|
|
64
|
+
color: #64748b;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.error-message {
|
|
68
|
+
position: absolute;
|
|
69
|
+
z-index: 1;
|
|
70
|
+
left: 0;
|
|
71
|
+
right: 0;
|
|
72
|
+
bottom: -20px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.top-error .error-message {
|
|
76
|
+
top: -20px !important;
|
|
77
|
+
bottom: initial !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.left-error .error-message {
|
|
81
|
+
bottom: 50% !important;
|
|
82
|
+
right: calc(100% + 10px) !important;
|
|
83
|
+
width: max-content;
|
|
84
|
+
left: initial !important;
|
|
85
|
+
transform: translateY(50%);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.right-error .error-message {
|
|
89
|
+
bottom: 50% !important;
|
|
90
|
+
left: calc(100% + 10px) !important;
|
|
91
|
+
width: max-content;
|
|
92
|
+
right: initial !important;
|
|
93
|
+
transform: translateY(50%);
|
|
94
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<div [ngClass]="styleClass" [style.width]="width"
|
|
2
|
+
[ngClass]="{'right-error': errorPosition == 'right', 'left-error': errorPosition == 'left', 'top-error': errorPosition == 'top'}"
|
|
3
|
+
class="chip">
|
|
4
|
+
<div [class.focused]="isFocused" [ngClass]="{'ng-invalid': isInvalid, 'disabled': disabled}" (focus)="onFocus()"
|
|
5
|
+
(blur)="onBlur()" tabindex="0" class="chip-content-input verben-input flex">
|
|
6
|
+
<div class="chip-main-content">
|
|
7
|
+
<div class="default-item flex">
|
|
8
|
+
<!-- <div class="dropdown-label place-holder" *ngIf="this.chips.length == 0">{{placeholder}}</div> -->
|
|
9
|
+
<div *ngIf="chips && this.chips.length > 0" class="chips-container flex">
|
|
10
|
+
<span *ngFor="let item of chips; index as i" class="item-chip flex">
|
|
11
|
+
<ng-container *ngIf="itemTemplate; else defaultItem">
|
|
12
|
+
<ng-container *ngTemplateOutlet="itemTemplate; context: { $implicit: item }"></ng-container>
|
|
13
|
+
</ng-container>
|
|
14
|
+
<ng-template #defaultItem>
|
|
15
|
+
<span>{{item}}</span>
|
|
16
|
+
</ng-template>
|
|
17
|
+
<verben-svg (click)="removeChip(i, $event);" icon="close-circle" [width]="15" [height]="15"></verben-svg>
|
|
18
|
+
<!-- <svg (click)="removeChip(i, $event);" width="10" height="10" viewBox="0 0 10 10" fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
20
|
+
<path
|
|
21
|
+
d="M5.00065 9.33333C7.30184 9.33333 9.16732 7.46785 9.16732 5.16667C9.16732 2.86548 7.30184 1 5.00065 1C2.69946 1 0.833984 2.86548 0.833984 5.16667C0.833984 7.46785 2.69946 9.33333 5.00065 9.33333Z"
|
|
22
|
+
stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
|
23
|
+
<path d="M6.25 3.91797L3.75 6.41797" stroke="currentColor" stroke-linecap="round"
|
|
24
|
+
stroke-linejoin="round" />
|
|
25
|
+
<path d="M3.75 3.91797L6.25 6.41797" stroke="currentColor" stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round" />
|
|
27
|
+
</svg> -->
|
|
28
|
+
</span>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="input-container">
|
|
33
|
+
<input [disabled]="this.max != null && chips && this.chips.length == max" (keydown)="onKeyDown($event)"
|
|
34
|
+
[placeholder]="placeholderState" [(ngModel)]="chipInput" (focus)="onInputFocus()" (blur)="onInputBlur()"
|
|
35
|
+
class="chip-input" />
|
|
36
|
+
</div>
|
|
37
|
+
<!-- <span *ngIf="this.chips.length > 0" (click)="this.clearSelection($event); $event.stopPropagation()"
|
|
38
|
+
class="chip-icon-item chip-clear-button">
|
|
39
|
+
<svg width="9" height="9" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
40
|
+
<path d="M0.84375 0.84375L8.15625 8.15625" stroke="currentColor" stroke-linecap="round"
|
|
41
|
+
stroke-linejoin="round" />
|
|
42
|
+
<path d="M0.84375 8.15625L8.15625 0.84375" stroke="currentColor" stroke-linecap="round"
|
|
43
|
+
stroke-linejoin="round" />
|
|
44
|
+
</svg>
|
|
45
|
+
</span> -->
|
|
46
|
+
</div>
|
|
47
|
+
<div *ngIf="this.isInvalid && this.invalidMessage" class="verben-error-message error-message">{{invalidMessage}}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ChipComponent } from './chip.component';
|
|
4
|
+
|
|
5
|
+
describe('ChipComponent', () => {
|
|
6
|
+
let component: ChipComponent;
|
|
7
|
+
let fixture: ComponentFixture<ChipComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [ChipComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ChipComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|