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,16 @@
|
|
|
1
|
+
.verbena-badge {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
text-align: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
place-items: center;
|
|
6
|
+
margin: auto;
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.verbena-badge span {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
text-align: center;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
font-weight: bold;
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { VerbenaBadgeComponent } from './verbena-badge.component';
|
|
3
|
+
|
|
4
|
+
describe('VerbenaBadgeComponent', () => {
|
|
5
|
+
let component: VerbenaBadgeComponent;
|
|
6
|
+
let fixture: ComponentFixture<VerbenaBadgeComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [VerbenaBadgeComponent]
|
|
11
|
+
}).compileComponents();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
fixture = TestBed.createComponent(VerbenaBadgeComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Additional tests can be added here
|
|
25
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'verbena-badge',
|
|
5
|
+
templateUrl: './verbena-badge.component.html',
|
|
6
|
+
styleUrls: ['./verbena-badge.component.css']
|
|
7
|
+
})
|
|
8
|
+
export class VerbenaBadgeComponent {
|
|
9
|
+
// Badge text and customization properties
|
|
10
|
+
@Input() text: string = ''; // Text or number inside the badge
|
|
11
|
+
@Input() bgColor: string = '#ff4757'; // Background color (default red)
|
|
12
|
+
@Input() textColor: string = '#fff'; // Text color (default white)
|
|
13
|
+
@Input() borderRadius: string = '12px'; // Border radius (default round)
|
|
14
|
+
@Input() pd: string = '5px 10px'; // Padding inside the badge
|
|
15
|
+
@Input() fontSize: string = '14px'; // Font size for the badge text
|
|
16
|
+
@Input() width: string = '';
|
|
17
|
+
@Input() height: string = '';
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { VerbenaBadgeComponent } from './verbena-badge.component';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
declarations: [VerbenaBadgeComponent],
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [VerbenaBadgeComponent]
|
|
9
|
+
})
|
|
10
|
+
export class VerbenaBadgeModule {}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.verbena-button {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
transition: background-color 0.3s ease;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.verbena-button i {
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.verbena-button svg {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.verbena-button[disabled] {
|
|
18
|
+
cursor: not-allowed;
|
|
19
|
+
opacity: 0.6;
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<button [ngStyle]="{
|
|
2
|
+
'background-color': buttonStyles.bgColor,
|
|
3
|
+
'color': buttonStyles.textColor,
|
|
4
|
+
'border': buttonStyles.border,
|
|
5
|
+
'border-radius': buttonStyles.borderRadius,
|
|
6
|
+
'padding': buttonStyles.pd,
|
|
7
|
+
'width': width,
|
|
8
|
+
'height': height,
|
|
9
|
+
'font-size': fontSize,
|
|
10
|
+
'display': 'flex',
|
|
11
|
+
'gap':'6px'
|
|
12
|
+
}"
|
|
13
|
+
[disabled]="disable"
|
|
14
|
+
class="verbena-button"
|
|
15
|
+
>
|
|
16
|
+
<ng-container *ngIf="svg && svgPosition === 'left'">
|
|
17
|
+
<verben-svg [icon]="svg" [width]="svgWidth" [height]="svgHeight" [stroke]="svgColor"></verben-svg>
|
|
18
|
+
</ng-container>
|
|
19
|
+
|
|
20
|
+
<span *ngIf="text">{{ text }}</span>
|
|
21
|
+
|
|
22
|
+
<ng-container *ngIf="svg && svgPosition === 'right'">
|
|
23
|
+
<verben-svg [icon]="svg" [width]="svgWidth" [height]="svgHeight" [stroke]="svgColor"></verben-svg>
|
|
24
|
+
</ng-container>
|
|
25
|
+
</button>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { VerbenaButtonComponent } from './verbena-button.component';
|
|
3
|
+
|
|
4
|
+
describe('VerbenaButtonComponent', () => {
|
|
5
|
+
let component: VerbenaButtonComponent;
|
|
6
|
+
let fixture: ComponentFixture<VerbenaButtonComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [VerbenaButtonComponent]
|
|
11
|
+
}).compileComponents();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
fixture = TestBed.createComponent(VerbenaButtonComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Additional tests can be added here
|
|
25
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'verbena-button',
|
|
5
|
+
templateUrl: './verbena-button.component.html',
|
|
6
|
+
styleUrls: ['./verbena-button.component.css']
|
|
7
|
+
})
|
|
8
|
+
export class VerbenaButtonComponent {
|
|
9
|
+
@Input() text: string = '';
|
|
10
|
+
@Input() icon: string = '';
|
|
11
|
+
@Input() svgPosition: 'left' | 'right' = 'left';
|
|
12
|
+
@Input() bgColor: string = '';
|
|
13
|
+
@Input() textColor: string = '';
|
|
14
|
+
@Input() border: string = '';
|
|
15
|
+
@Input() borderRadius: string = '';
|
|
16
|
+
@Input() pd: string = '';
|
|
17
|
+
@Input() width: string = '';
|
|
18
|
+
@Input() height: string = '';
|
|
19
|
+
@Input() fontSize: string = '14px';
|
|
20
|
+
@Input() disable: boolean = false;
|
|
21
|
+
|
|
22
|
+
@Input() styleType: 'primary' | 'secondary' | 'danger' | 'small' | 'outline' | 'grey' | 'ylw-outline' = 'primary'; // Predefined styles
|
|
23
|
+
|
|
24
|
+
@Input() svg: string = '';
|
|
25
|
+
@Input() svgWidth: number = 20;
|
|
26
|
+
@Input() svgHeight: number = 20;
|
|
27
|
+
@Input() svgColor: string = '';
|
|
28
|
+
|
|
29
|
+
get buttonStyles() {
|
|
30
|
+
switch (this.styleType) {
|
|
31
|
+
case 'primary':
|
|
32
|
+
return {
|
|
33
|
+
bgColor: this.bgColor || '#007bff',
|
|
34
|
+
textColor: this.textColor || '#ffffff',
|
|
35
|
+
border: this.border || 'none',
|
|
36
|
+
borderRadius: this.borderRadius || '4px',
|
|
37
|
+
pd: this.pd || '10px 15px'
|
|
38
|
+
};
|
|
39
|
+
case 'secondary':
|
|
40
|
+
return {
|
|
41
|
+
bgColor: this.bgColor || '#FFE681',
|
|
42
|
+
textColor: this.textColor || '#404040',
|
|
43
|
+
border: this.border || 'none',
|
|
44
|
+
borderRadius: this.borderRadius || '4px',
|
|
45
|
+
pd: this.pd || '10px 15px'
|
|
46
|
+
};
|
|
47
|
+
case 'danger':
|
|
48
|
+
return {
|
|
49
|
+
bgColor: this.bgColor || '#dc3545',
|
|
50
|
+
textColor: this.textColor || '#ffffff',
|
|
51
|
+
border: this.border || 'none',
|
|
52
|
+
borderRadius: this.borderRadius || '4px',
|
|
53
|
+
pd: this.pd || '8px 10px'
|
|
54
|
+
};
|
|
55
|
+
case 'small':
|
|
56
|
+
return {
|
|
57
|
+
bgColor: this.bgColor || '#fff',
|
|
58
|
+
textColor: this.textColor || '#000',
|
|
59
|
+
border: this.border || '1px solid grey',
|
|
60
|
+
borderRadius: this.borderRadius || '7px',
|
|
61
|
+
pd: this.pd || '0px 10px'
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
case 'outline':
|
|
65
|
+
return {
|
|
66
|
+
bgColor: this.bgColor || 'none',
|
|
67
|
+
textColor: this.textColor || '#000',
|
|
68
|
+
border: this.border || '1px solid #404040',
|
|
69
|
+
borderRadius: this.borderRadius || '5px',
|
|
70
|
+
pd: this.pd || '0px 8px'
|
|
71
|
+
};
|
|
72
|
+
case 'ylw-outline':
|
|
73
|
+
return {
|
|
74
|
+
bgColor: this.bgColor || '#FFFBEB',
|
|
75
|
+
textColor: this.textColor || '#404040',
|
|
76
|
+
border: this.border || '1px solid #FFE681',
|
|
77
|
+
borderRadius: this.borderRadius || '5px',
|
|
78
|
+
pd: this.pd || '10px 15px'
|
|
79
|
+
};
|
|
80
|
+
case 'grey':
|
|
81
|
+
return {
|
|
82
|
+
bgColor: this.bgColor || 'none',
|
|
83
|
+
textColor: this.textColor || '#D9D9D940',
|
|
84
|
+
border: this.border || '2px solid grey',
|
|
85
|
+
borderRadius: this.borderRadius || '4px',
|
|
86
|
+
pd: this.pd || '10px 15px'
|
|
87
|
+
};
|
|
88
|
+
default:
|
|
89
|
+
return {};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { VerbenaButtonComponent } from './verbena-button.component';
|
|
4
|
+
import { SvgModule } from '../components/svg/svg.module';
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
declarations: [VerbenaButtonComponent],
|
|
8
|
+
imports: [CommonModule, SvgModule],
|
|
9
|
+
exports: [VerbenaButtonComponent]
|
|
10
|
+
})
|
|
11
|
+
export class VerbenaButtonModule {}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.switch {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.slider {
|
|
9
|
+
width: 34px;
|
|
10
|
+
height: 20px;
|
|
11
|
+
background-color: #ccc; /* Off state color */
|
|
12
|
+
border-radius: 34px;
|
|
13
|
+
position: relative;
|
|
14
|
+
transition: background-color 0.2s; /* Smooth color transition */
|
|
15
|
+
margin-right: 10px; /* Space between slider and label */
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.slider::before {
|
|
19
|
+
content: "";
|
|
20
|
+
position: absolute;
|
|
21
|
+
height: 16px;
|
|
22
|
+
width: 16px;
|
|
23
|
+
left: 2px;
|
|
24
|
+
bottom: 2px;
|
|
25
|
+
background-color: white;
|
|
26
|
+
border-radius: 50%; /* Makes the knob circular */
|
|
27
|
+
transition: transform 0.2s; /* Smooth knob movement */
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
input:checked + .slider {
|
|
31
|
+
background-color: #4caf50; /* On state color */
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
input:checked + .slider::before {
|
|
35
|
+
transform: translateX(14px); /* Moves the knob to the right when checked */
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.disabled {
|
|
39
|
+
cursor: not-allowed; /* Prevents interaction */
|
|
40
|
+
opacity: 0.5; /* Makes the switch look faded */
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.check {
|
|
44
|
+
display: none; /* Hides the actual checkbox input */
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<div class="switch"
|
|
2
|
+
[ngClass]="{'disabled': disabled}"
|
|
3
|
+
|
|
4
|
+
(click)="toggleSwitch()">
|
|
5
|
+
<input type="checkbox" [checked]="checked" class="check" (change)="onChange($event)" [disabled]="disabled" />
|
|
6
|
+
<span class="slider" [ngStyle]="{ 'background-color': checked ? onColor : offColor }"></span>
|
|
7
|
+
<label *ngIf="label">{{ label }}</label>
|
|
8
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { VerbenaSwitchComponent } from './verbena-switch.component';
|
|
3
|
+
|
|
4
|
+
describe('VerbenaSwitchComponent', () => {
|
|
5
|
+
let component: VerbenaSwitchComponent;
|
|
6
|
+
let fixture: ComponentFixture<VerbenaSwitchComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [VerbenaSwitchComponent]
|
|
11
|
+
}).compileComponents();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
fixture = TestBed.createComponent(VerbenaSwitchComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Additional tests can be added here
|
|
25
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'verbena-switch',
|
|
5
|
+
templateUrl: './verbena-switch.component.html',
|
|
6
|
+
styleUrls: ['./verbena-switch.component.css']
|
|
7
|
+
})
|
|
8
|
+
export class VerbenaSwitchComponent {
|
|
9
|
+
@Input() label: string = '';
|
|
10
|
+
@Input() checked: boolean = false;
|
|
11
|
+
@Input() disabled: boolean = false;
|
|
12
|
+
@Input() offColor: string = '#ccc'; // Default off color
|
|
13
|
+
@Input() onColor: string = '#4caf50'; // Default on color
|
|
14
|
+
@Input() customStyles: string = ''; // Accepts user-defined class for extra styling
|
|
15
|
+
|
|
16
|
+
@Output() change = new EventEmitter<boolean>();
|
|
17
|
+
|
|
18
|
+
toggleSwitch() {
|
|
19
|
+
if (!this.disabled) {
|
|
20
|
+
this.checked = !this.checked;
|
|
21
|
+
this.change.emit(this.checked);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
onChange(event: Event) {
|
|
26
|
+
if (!this.disabled) {
|
|
27
|
+
this.checked = (event.target as HTMLInputElement).checked;
|
|
28
|
+
this.change.emit(this.checked);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { VerbenaSwitchComponent } from './verbena-switch.component';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
declarations: [VerbenaSwitchComponent],
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [VerbenaSwitchComponent]
|
|
9
|
+
})
|
|
10
|
+
export class VerbenaSwitchModule {}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<label [for]="textareaId">{{ label }}</label>
|
|
2
|
+
<textarea
|
|
3
|
+
[id]="textareaId"
|
|
4
|
+
[required]="required"
|
|
5
|
+
[attr.rows]="rows"
|
|
6
|
+
[attr.cols]="cols"
|
|
7
|
+
[ngStyle]="{
|
|
8
|
+
'background-color': bgColor,
|
|
9
|
+
'color': textColor,
|
|
10
|
+
'border': border,
|
|
11
|
+
'border-radius': borderRadius,
|
|
12
|
+
'padding': pd,
|
|
13
|
+
'width': width,
|
|
14
|
+
'height': height
|
|
15
|
+
}"
|
|
16
|
+
[ngModel]="value"
|
|
17
|
+
(ngModelChange)="onValueChange($event)"
|
|
18
|
+
></textarea>
|
|
19
|
+
<span *ngIf="errorMessage" class="error">{{ errorMessage }}</span>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { VerbenaTextareaComponent } from './verbena-textarea.component';
|
|
4
|
+
|
|
5
|
+
describe('VerbenaTextareaComponent', () => {
|
|
6
|
+
let component: VerbenaTextareaComponent;
|
|
7
|
+
let fixture: ComponentFixture<VerbenaTextareaComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ VerbenaTextareaComponent ],
|
|
12
|
+
imports: [ FormsModule ]
|
|
13
|
+
})
|
|
14
|
+
.compileComponents();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
fixture = TestBed.createComponent(VerbenaTextareaComponent);
|
|
19
|
+
component = fixture.componentInstance;
|
|
20
|
+
fixture.detectChanges();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should create', () => {
|
|
24
|
+
expect(component).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should validate required field', () => {
|
|
28
|
+
component.required = true;
|
|
29
|
+
component.value = '';
|
|
30
|
+
component.validate();
|
|
31
|
+
expect(component.errorMessage).toBe('This field is required');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'verbena-textarea',
|
|
5
|
+
templateUrl: './verbena-textarea.component.html',
|
|
6
|
+
styleUrls: ['./verbena-textarea.component.css']
|
|
7
|
+
})
|
|
8
|
+
export class VerbenaTextareaComponent implements OnInit {
|
|
9
|
+
@Input() label: string = '';
|
|
10
|
+
@Input() required: boolean = false;
|
|
11
|
+
@Input() rows: number = 5;
|
|
12
|
+
@Input() cols: number = 40;
|
|
13
|
+
@Input() value: string = '';
|
|
14
|
+
@Input() bgColor: string = '#fff';
|
|
15
|
+
@Input() textColor: string = '#000';
|
|
16
|
+
@Input() border: string = '1px solid #ccc';
|
|
17
|
+
@Input() borderRadius: string = '4px';
|
|
18
|
+
@Input() pd: string = '10px';
|
|
19
|
+
@Input() width: string = '100%';
|
|
20
|
+
@Input() height: string = 'auto';
|
|
21
|
+
|
|
22
|
+
@Output() valueChange = new EventEmitter<string>(); // Output for emitting the value
|
|
23
|
+
|
|
24
|
+
errorMessage: string | undefined;
|
|
25
|
+
textareaId: string = '';
|
|
26
|
+
|
|
27
|
+
ngOnInit() {
|
|
28
|
+
this.textareaId = `verbena-textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
onValueChange(newValue: string) {
|
|
32
|
+
this.value = newValue;
|
|
33
|
+
this.valueChange.emit(this.value); // Emit the value when it changes
|
|
34
|
+
this.validate(); // Optional: Re-validate on each change
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
validate() {
|
|
38
|
+
if (this.required && !this.value) {
|
|
39
|
+
this.errorMessage = 'This field is required';
|
|
40
|
+
} else {
|
|
41
|
+
this.errorMessage = undefined;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { VerbenaTextareaComponent } from './verbena-textarea.component';
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
declarations: [VerbenaTextareaComponent],
|
|
8
|
+
imports: [CommonModule, FormsModule],
|
|
9
|
+
exports: [VerbenaTextareaComponent]
|
|
10
|
+
})
|
|
11
|
+
export class VerbenaTextareaModule {}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of verben-ng-ui
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// export * from './lib/verben-ng-ui.service';
|
|
6
|
+
// export * from './lib/verben-ng-ui.component';
|
|
7
|
+
|
|
8
|
+
// Exporting modules
|
|
9
|
+
export * from './lib/components/card-data-view/card-data-view.component';
|
|
10
|
+
export * from './lib/components/card-data-view/card-data-view.module';
|
|
11
|
+
export * from './lib/components/card-data-view/card-data';
|
|
12
|
+
export * from './lib/components/card-data-view/left-card-data/left-card-data.component';
|
|
13
|
+
export * from './lib/components/card-data-view/left-card-data-view/left-card-data-view.component';
|
|
14
|
+
export * from './lib/components/card-data-view/right-card-data-view/right-card-data-view.component';
|
|
15
|
+
export * from './lib/components/card-data-view/card-data-view-header/card-data-view-header.component';
|
|
16
|
+
export * from './lib/components/card-data-view/card-data-view-footer/card-data-view-footer.component';
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export * from './lib/components/drop-down/DropdownMenuItem';
|
|
20
|
+
export * from './lib/components/drop-down/DropdownChangeEvent';
|
|
21
|
+
export * from './lib/components/drop-down/DropdownLoadEvent';
|
|
22
|
+
export * from './lib/components/chip/ChipChangeEvent';
|
|
23
|
+
export * from './lib/components/drop-down/drop-down.module';
|
|
24
|
+
export * from './lib/components/drop-down/drop-down.component';
|
|
25
|
+
export * from './lib/components/chip/chip.module';
|
|
26
|
+
export * from './lib/components/chip/chip.component';
|
|
27
|
+
export * from './lib/components/shared.module';
|
|
28
|
+
export * from './lib/components/TemplateDirective.directive';
|
|
29
|
+
|
|
30
|
+
export * from './lib/components/image/image.module';
|
|
31
|
+
export * from './lib/components/image/image.component';
|
|
32
|
+
|
|
33
|
+
export * from './lib/components/tooltip/tooltip.component';
|
|
34
|
+
export * from './lib/components/tooltip/tooltip.module';
|
|
35
|
+
|
|
36
|
+
export * from './lib/components/svg/svg.module';
|
|
37
|
+
export * from './lib/components/svg/svg.component';
|
|
38
|
+
|
|
39
|
+
export * from './lib/components/table-filter/table-filter.module';
|
|
40
|
+
export * from './lib/components/table-filter/table-filter.component';
|
|
41
|
+
|
|
42
|
+
export * from './lib/components/notification/notification.module';
|
|
43
|
+
export * from './lib/components/notification/notification.component';
|
|
44
|
+
|
|
45
|
+
export * from './lib/components/card/card.module';
|
|
46
|
+
export * from './lib/components/card/card.component';
|
|
47
|
+
|
|
48
|
+
export * from './lib/convert-to-number/convert-to-number.module';
|
|
49
|
+
export * from './lib/convert-to-integer/convert-to-integer.module';
|
|
50
|
+
export * from './lib/components/sort-table/sort-table.component';
|
|
51
|
+
export * from './lib/components/sort-table/sort-table.module';
|
|
52
|
+
export * from './lib/components/visible-column/visible-column.component';
|
|
53
|
+
export * from './lib/components/visible-column/visible-column.module';
|
|
54
|
+
export * from './lib/components/data-view/data-view.component';
|
|
55
|
+
export * from './lib/components/data-view/data-view.module';
|
|
56
|
+
export * from './lib/components/date-picker/date-picker.component';
|
|
57
|
+
export * from './lib/components/date-picker/date-picker.module';
|
|
58
|
+
// export * from './lib/convert-to-decimal/convert-to-decimal.module';
|
|
59
|
+
export * from './lib/phone-number/phone-number.module';
|
|
60
|
+
|
|
61
|
+
export * from './lib/validate-input/validate-input.module';
|
|
62
|
+
|
|
63
|
+
// Also export the directives if needed directly
|
|
64
|
+
export * from './lib/convert-to-number/convert-to-number.directive';
|
|
65
|
+
export * from './lib/convert-to-integer/convert-to-integer.directive';
|
|
66
|
+
// export * from './lib/convert-to-decimal/convert-to-decimal.directive';
|
|
67
|
+
export * from './lib/phone-number/phone-number.directive';
|
|
68
|
+
export * from './lib/validate-input/validate-input.directive';
|
|
69
|
+
|
|
70
|
+
// Exporting MaxNumberModule and MaxNumberDirective
|
|
71
|
+
export * from './lib/number-range/number-range.module';
|
|
72
|
+
export * from './lib/number-range/number-range.directive';
|
|
73
|
+
|
|
74
|
+
export * from './lib/number-range/number-range.module';
|
|
75
|
+
export * from './lib/number-range/number-range.directive';
|
|
76
|
+
|
|
77
|
+
// Exporting RequiredInputModule and RequiredInputDirective
|
|
78
|
+
export * from './lib/required-input/required-input.module';
|
|
79
|
+
export * from './lib/required-input/required-input.directive';
|
|
80
|
+
|
|
81
|
+
// Exporting EmailValidatorModule and EmailValidatorDirective
|
|
82
|
+
export * from './lib/email-validator/email-validator.module';
|
|
83
|
+
export * from './lib/email-validator/email-validator.directive';
|
|
84
|
+
|
|
85
|
+
export * from './lib/components/data-table/data-table.module';
|
|
86
|
+
export * from './lib/components/data-table/data-table.component';
|
|
87
|
+
export * from './lib/components/data-table/column.directive';
|
|
88
|
+
export * from './lib/components/data-table/data-table.types';
|
|
89
|
+
|
|
90
|
+
export * from './lib/components/data-export/data-export.module';
|
|
91
|
+
export * from './lib/components/data-export/data-export.service';
|
|
92
|
+
export * from './lib/components/data-export/data-export.component';
|
|
93
|
+
export * from './lib/components/data-export/data-export.types';
|
|
94
|
+
|
|
95
|
+
// Exporting ControlOptionModule and ControlOptionDirective
|
|
96
|
+
export * from './lib/control-options/control-options.module';
|
|
97
|
+
export * from './lib/control-options/control-options.directive';
|
|
98
|
+
// Exporting Enum type for sort table
|
|
99
|
+
export * from './lib/models/table-filter';
|
|
100
|
+
export * from './lib/models/mail-model';
|
|
101
|
+
|
|
102
|
+
export * from './lib/validate/error-message.service';
|
|
103
|
+
export * from './lib/validate/validate.directive';
|
|
104
|
+
export * from './lib/validate/validate.module';
|
|
105
|
+
|
|
106
|
+
export * from './lib/Verbena-input/verbena-input.component';
|
|
107
|
+
export * from './lib/Verbena-input/verbena-input.module';
|
|
108
|
+
|
|
109
|
+
export * from './lib/verbena-button/verbena-button.component';
|
|
110
|
+
export * from './lib/verbena-button/verbena-button.module';
|
|
111
|
+
|
|
112
|
+
export * from './lib/verbena-badge/verbena-badge.component';
|
|
113
|
+
export * from './lib/verbena-badge/verbena-badge.module';
|
|
114
|
+
|
|
115
|
+
export * from './lib/verbena-textarea/verbena-textarea.component';
|
|
116
|
+
export * from './lib/verbena-textarea/verbena-textarea.module';
|
|
117
|
+
|
|
118
|
+
export * from './lib/verbena-switch/verbena-switch.component';
|
|
119
|
+
export * from './lib/verbena-switch/verbena-switch.module';
|
|
120
|
+
|
|
121
|
+
export * from './lib/components/verben-mail/verben-mail.module';
|
|
122
|
+
export * from './lib/components/verben-mail/verben-mail.component';
|