@factor_ec/ui 1.0.12 → 1.0.13
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/.browserslistrc +16 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +3 -23
- package/src/lib/display/avatar/avatar.component.html +1 -0
- package/src/lib/display/avatar/avatar.component.scss +20 -0
- package/src/lib/display/avatar/avatar.component.spec.ts +23 -0
- package/src/lib/display/avatar/avatar.component.ts +69 -0
- package/src/lib/display/content/content.component.html +4 -0
- package/src/lib/display/content/content.component.scss +0 -0
- package/src/lib/display/content/content.component.spec.ts +23 -0
- package/src/lib/display/content/content.component.ts +15 -0
- package/src/lib/display/display.module.ts +41 -0
- package/src/lib/display/icon/icon.component.html +4 -0
- package/src/lib/display/icon/icon.component.scss +47 -0
- package/src/lib/display/icon/icon.component.spec.ts +23 -0
- package/src/lib/display/icon/icon.component.ts +88 -0
- package/src/lib/display/image/image.component.html +2 -0
- package/src/lib/display/image/image.component.scss +53 -0
- package/src/lib/display/image/image.component.spec.ts +23 -0
- package/src/lib/display/image/image.component.ts +71 -0
- package/src/lib/display/message/message.component.html +33 -0
- package/src/lib/display/message/message.component.scss +25 -0
- package/src/lib/display/message/message.component.spec.ts +23 -0
- package/src/lib/display/message/message.component.ts +24 -0
- package/src/lib/display/message.service.spec.ts +16 -0
- package/src/lib/display/message.service.ts +58 -0
- package/src/lib/display/observe-intersecting.directive.spec.ts +8 -0
- package/src/lib/display/observe-intersecting.directive.ts +34 -0
- package/src/lib/display/progress/progress.component.html +6 -0
- package/src/lib/display/progress/progress.component.scss +121 -0
- package/src/lib/display/progress/progress.component.spec.ts +23 -0
- package/src/lib/display/progress/progress.component.ts +36 -0
- package/src/lib/display/progress.service.spec.ts +16 -0
- package/src/lib/display/progress.service.ts +51 -0
- package/src/lib/inputs/inputs.module.ts +17 -0
- package/src/lib/inputs/rating/rating.component.html +13 -0
- package/src/lib/inputs/rating/rating.component.scss +61 -0
- package/src/lib/inputs/rating/rating.component.spec.ts +25 -0
- package/src/lib/inputs/rating/rating.component.ts +66 -0
- package/src/lib/models/action-group.ts +9 -0
- package/{lib/models/action.d.ts → src/lib/models/action.ts} +1 -1
- package/{lib/models/content.d.ts → src/lib/models/content.ts} +1 -1
- package/{lib/models/icon.d.ts → src/lib/models/icon.ts} +1 -1
- package/{lib/models/message-options.d.ts → src/lib/models/message-options.ts} +2 -1
- package/src/lib/models/module-configuration.ts +6 -0
- package/src/lib/models/ui-configuration.ts +7 -0
- package/src/lib/navigation/list/list.component.html +52 -0
- package/src/lib/navigation/list/list.component.scss +93 -0
- package/src/lib/navigation/list/list.component.spec.ts +23 -0
- package/src/lib/navigation/list/list.component.ts +56 -0
- package/src/lib/navigation/navbar/navbar.component.html +23 -0
- package/src/lib/navigation/navbar/navbar.component.scss +202 -0
- package/src/lib/navigation/navbar/navbar.component.spec.ts +23 -0
- package/src/lib/navigation/navbar/navbar.component.ts +57 -0
- package/src/lib/navigation/navigation.module.ts +34 -0
- package/src/lib/navigation/searchbox/searchbox.component.html +34 -0
- package/src/lib/navigation/searchbox/searchbox.component.scss +37 -0
- package/src/lib/navigation/searchbox/searchbox.component.spec.ts +23 -0
- package/src/lib/navigation/searchbox/searchbox.component.ts +94 -0
- package/src/lib/navigation/toolbar/toolbar.component.html +43 -0
- package/src/lib/navigation/toolbar/toolbar.component.scss +29 -0
- package/src/lib/navigation/toolbar/toolbar.component.spec.ts +23 -0
- package/src/lib/navigation/toolbar/toolbar.component.ts +43 -0
- package/src/lib/scss/breakpoints.scss +123 -0
- package/src/lib/scss/variables.scss +8 -0
- package/src/lib/ui.module.ts +34 -0
- package/{public-api.d.ts → src/public-api.ts} +4 -0
- package/src/test.ts +27 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2020/factor_ec-ui.mjs +0 -5
- package/esm2020/lib/display/avatar/avatar.component.mjs +0 -74
- package/esm2020/lib/display/content/content.component.mjs +0 -19
- package/esm2020/lib/display/display.module.mjs +0 -66
- package/esm2020/lib/display/icon/icon.component.mjs +0 -97
- package/esm2020/lib/display/image/image.component.mjs +0 -80
- package/esm2020/lib/display/message/message.component.mjs +0 -30
- package/esm2020/lib/display/message.service.mjs +0 -58
- package/esm2020/lib/display/observe-intersecting.directive.mjs +0 -43
- package/esm2020/lib/display/progress/progress.component.mjs +0 -42
- package/esm2020/lib/display/progress.service.mjs +0 -50
- package/esm2020/lib/inputs/inputs.module.mjs +0 -24
- package/esm2020/lib/inputs/rating/rating.component.mjs +0 -73
- package/esm2020/lib/models/action.mjs +0 -2
- package/esm2020/lib/models/content.mjs +0 -2
- package/esm2020/lib/models/icon.mjs +0 -2
- package/esm2020/lib/models/message-options.mjs +0 -2
- package/esm2020/lib/models/module-configuration.mjs +0 -2
- package/esm2020/lib/models/ui-configuration.mjs +0 -2
- package/esm2020/lib/navigation/list/list.component.mjs +0 -70
- package/esm2020/lib/navigation/navbar/navbar.component.mjs +0 -74
- package/esm2020/lib/navigation/navigation.module.mjs +0 -55
- package/esm2020/lib/navigation/searchbox/searchbox.component.mjs +0 -109
- package/esm2020/lib/navigation/toolbar/toolbar.component.mjs +0 -53
- package/esm2020/lib/ui.module.mjs +0 -47
- package/esm2020/public-api.mjs +0 -22
- package/fesm2015/factor_ec-ui.mjs +0 -1002
- package/fesm2015/factor_ec-ui.mjs.map +0 -1
- package/fesm2020/factor_ec-ui.mjs +0 -993
- package/fesm2020/factor_ec-ui.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/display/avatar/avatar.component.d.ts +0 -22
- package/lib/display/content/content.component.d.ts +0 -7
- package/lib/display/display.module.d.ts +0 -17
- package/lib/display/icon/icon.component.d.ts +0 -24
- package/lib/display/image/image.component.d.ts +0 -15
- package/lib/display/message/message.component.d.ts +0 -11
- package/lib/display/message.service.d.ts +0 -15
- package/lib/display/observe-intersecting.directive.d.ts +0 -16
- package/lib/display/progress/progress.component.d.ts +0 -15
- package/lib/display/progress.service.d.ts +0 -15
- package/lib/inputs/inputs.module.d.ts +0 -8
- package/lib/inputs/rating/rating.component.d.ts +0 -23
- package/lib/models/module-configuration.d.ts +0 -6
- package/lib/models/ui-configuration.d.ts +0 -7
- package/lib/navigation/list/list.component.d.ts +0 -21
- package/lib/navigation/navbar/navbar.component.d.ts +0 -23
- package/lib/navigation/navigation.module.d.ts +0 -15
- package/lib/navigation/searchbox/searchbox.component.d.ts +0 -34
- package/lib/navigation/toolbar/toolbar.component.d.ts +0 -18
- package/lib/ui.module.d.ts +0 -13
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Component, OnInit, ViewChild, ElementRef, forwardRef, Input, HostBinding, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'ft-searchbox',
|
|
6
|
+
templateUrl: './searchbox.component.html',
|
|
7
|
+
styleUrls: ['./searchbox.component.scss'],
|
|
8
|
+
providers: [
|
|
9
|
+
{
|
|
10
|
+
provide: NG_VALUE_ACCESSOR,
|
|
11
|
+
useExisting: forwardRef(() => SearchboxComponent),
|
|
12
|
+
multi: true
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
})
|
|
16
|
+
export class SearchboxComponent implements OnInit {
|
|
17
|
+
/**
|
|
18
|
+
* Clase o clases asignadas al componente
|
|
19
|
+
*/
|
|
20
|
+
@ViewChild('input', { static: false })
|
|
21
|
+
input!: ElementRef<any>;
|
|
22
|
+
@ViewChild('inputPlaceholder', { static: false })
|
|
23
|
+
inputPlaceholder!: ElementRef<any>;
|
|
24
|
+
disabled!: boolean;
|
|
25
|
+
private _value!: string;
|
|
26
|
+
private shown!: boolean;
|
|
27
|
+
@Input() placeholder!: string;
|
|
28
|
+
@Output() execute = new EventEmitter<string>();
|
|
29
|
+
@Output() showChange = new EventEmitter<boolean>();
|
|
30
|
+
|
|
31
|
+
@Input() class: string = '';
|
|
32
|
+
@HostBinding('class') get hostClasses(): string {
|
|
33
|
+
return [
|
|
34
|
+
'ft-searchbox',
|
|
35
|
+
this.class,
|
|
36
|
+
this.shown ? 'show' : ''
|
|
37
|
+
].join(' ');
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
onChange = (_: any) => { };
|
|
41
|
+
onTouched = (_: any) => { };
|
|
42
|
+
@Input()
|
|
43
|
+
set show(value: boolean) {
|
|
44
|
+
this.shown = value;
|
|
45
|
+
if (value) {
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
this.getNativeElement().focus();
|
|
48
|
+
}, 300);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
@Input()
|
|
52
|
+
set value(value: any) {
|
|
53
|
+
this._value = value || '';
|
|
54
|
+
this.getNativeElement().value = this._value;
|
|
55
|
+
this.onChange(this._value);
|
|
56
|
+
this.onTouched(this._value);
|
|
57
|
+
}
|
|
58
|
+
get value() {
|
|
59
|
+
return this._value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
constructor() { }
|
|
63
|
+
|
|
64
|
+
ngOnInit(): void {
|
|
65
|
+
}
|
|
66
|
+
closeSearch(): void {
|
|
67
|
+
this.showChange.emit(false);
|
|
68
|
+
}
|
|
69
|
+
getNativeElement() {
|
|
70
|
+
const input = this.placeholder ? this.inputPlaceholder : this.input;
|
|
71
|
+
return input.nativeElement;
|
|
72
|
+
}
|
|
73
|
+
registerOnChange(fn: any): void {
|
|
74
|
+
this.onChange = fn;
|
|
75
|
+
}
|
|
76
|
+
registerOnTouched(fn: any): void {
|
|
77
|
+
this.onTouched = fn;
|
|
78
|
+
}
|
|
79
|
+
setDisabledState(isDisabled: boolean): void {
|
|
80
|
+
this.disabled = isDisabled;
|
|
81
|
+
}
|
|
82
|
+
onSearch(event: SubmitEvent): void {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
this.getNativeElement().value = '';
|
|
85
|
+
this.execute.emit(this._value);
|
|
86
|
+
}
|
|
87
|
+
updateValue(event: any): void {
|
|
88
|
+
this.value = event.target.value;
|
|
89
|
+
}
|
|
90
|
+
writeValue(value: string): void {
|
|
91
|
+
this.value = value;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<div (ftObserveIntersecting)="setOverlapped($event)" [ftObserveIntersectingOptions]="rootMargin"></div>
|
|
2
|
+
<div class="content">
|
|
3
|
+
<div class="container p-2 p-sm-3 pb-md-3 pt-md-5 px-md-3 px-lg-5">
|
|
4
|
+
<div class="d-flex align-items-center">
|
|
5
|
+
<h5 class="title ml-2 ml-md-0 mb-0 mr-auto" *ngIf="!titleOptions; else titleForm">{{ title }}</h5>
|
|
6
|
+
<ng-container *ngFor="let option of actionOptions">
|
|
7
|
+
<button type="button" class="p-2" mat-button [ngClass]="option.class || ''" *ngIf="!option.children" (click)="option.click ? option.click($event) : null" title="{{ option.label }}">
|
|
8
|
+
<div class="d-flex align-items-center">
|
|
9
|
+
<ft-icon *ngIf="option.iconName" [name]="option.iconName" size="2"></ft-icon>
|
|
10
|
+
<div *ngIf="option.label" class="label d-none d-sm-inline-block ml-1">{{ option.label }}</div>
|
|
11
|
+
</div>
|
|
12
|
+
</button>
|
|
13
|
+
<ng-container *ngIf="option.children">
|
|
14
|
+
<button type="button" class="p-2" mat-button [matMenuTriggerFor]="menu" [ngClass]="option.class || ''" title="{{ option.label }}">
|
|
15
|
+
<div class="d-flex align-items-center">
|
|
16
|
+
<ft-icon *ngIf="option.iconName" [name]="option.iconName" size="2"></ft-icon>
|
|
17
|
+
<div *ngIf="option.label" class="label d-none d-sm-inline-block ml-1">{{ option.label }}</div>
|
|
18
|
+
</div>
|
|
19
|
+
</button>
|
|
20
|
+
<mat-menu #menu="matMenu">
|
|
21
|
+
<button mat-menu-item *ngFor="let childOption of option.children" (click)="childOption.click ? childOption.click($event): null">{{ childOption.label }}</button>
|
|
22
|
+
</mat-menu>
|
|
23
|
+
</ng-container>
|
|
24
|
+
</ng-container>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<ng-template #titleForm>
|
|
29
|
+
<button type="button" class="title p-2 pl-3 mr-auto" mat-button [matMenuTriggerFor]="titleMenu">
|
|
30
|
+
<div class="d-flex align-items-center">
|
|
31
|
+
<div class="label mr-1">{{ currentTitleOption.label }}</div>
|
|
32
|
+
<ft-icon name="angle-down" size="1"></ft-icon>
|
|
33
|
+
</div>
|
|
34
|
+
</button>
|
|
35
|
+
<mat-menu #titleMenu="matMenu">
|
|
36
|
+
<button class="mr-4" mat-menu-item [disabled]="option == currentTitleOption" *ngFor="let option of titleOptions" (click)="currentTitleOption = option; option.click ? option.click($event) : null">
|
|
37
|
+
<div class="d-flex align-items-center">
|
|
38
|
+
<ft-icon [name]="option == currentTitleOption? 'check' : ''" class="mr-1"></ft-icon>
|
|
39
|
+
<div>{{ option.label }}</div>
|
|
40
|
+
</div>
|
|
41
|
+
</button>
|
|
42
|
+
</mat-menu>
|
|
43
|
+
</ng-template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@import '../../scss/variables';
|
|
2
|
+
@import '../../scss/breakpoints';
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
z-index: var(--z-index, 980);
|
|
6
|
+
background-color: var(--background-color, #FFF);
|
|
7
|
+
transition: background-color 0.2s, box-shadow 0.2s;
|
|
8
|
+
display: block;
|
|
9
|
+
position: sticky;
|
|
10
|
+
top: -1px;
|
|
11
|
+
&.overlapped {
|
|
12
|
+
box-shadow: 0 0 1px 0 rgba(0,0,0,.14), 0 0 6px 0 rgba(0,0,0,.12);
|
|
13
|
+
}
|
|
14
|
+
@include media-breakpoint-up(md) {
|
|
15
|
+
top: -2rem;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
.content {
|
|
19
|
+
button {
|
|
20
|
+
min-width: 0;
|
|
21
|
+
.label {
|
|
22
|
+
line-height: initial;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.title {
|
|
26
|
+
font-size: 1.21rem;
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ToolbarComponent } from './toolbar.component';
|
|
4
|
+
|
|
5
|
+
describe('ToolbarComponent', () => {
|
|
6
|
+
let component: ToolbarComponent;
|
|
7
|
+
let fixture: ComponentFixture<ToolbarComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ ToolbarComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(ToolbarComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component, OnInit, Input, HostBinding } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { Action } from '../../models/action';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'ft-toolbar',
|
|
7
|
+
templateUrl: './toolbar.component.html',
|
|
8
|
+
styleUrls: ['./toolbar.component.scss']
|
|
9
|
+
})
|
|
10
|
+
export class ToolbarComponent implements OnInit {
|
|
11
|
+
@Input() actionOptions!: Action[];
|
|
12
|
+
@Input() currentTitleOption!: Action;
|
|
13
|
+
@Input() title!: string;
|
|
14
|
+
@Input() titleOptions!: Action[];
|
|
15
|
+
overlapped!: boolean;
|
|
16
|
+
rootMargin: any = { rootMargin: '0px 0px 0px 0px' };
|
|
17
|
+
|
|
18
|
+
@Input() class: string = '';
|
|
19
|
+
@HostBinding('class') get hostClasses(): string {
|
|
20
|
+
return [
|
|
21
|
+
'ft-toolbar',
|
|
22
|
+
this.class,
|
|
23
|
+
this.overlapped ? 'overlapped' : ''
|
|
24
|
+
].join(' ');
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
constructor() {
|
|
28
|
+
const breakpointSm = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-sm'));
|
|
29
|
+
if (window.innerWidth < breakpointSm) {
|
|
30
|
+
this.rootMargin = { rootMargin: '0px 0px 0px 0px' };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ngOnInit(): void {
|
|
35
|
+
if (this.titleOptions && !this.currentTitleOption) {
|
|
36
|
+
this.currentTitleOption = this.titleOptions[0];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
setOverlapped(overlapped: boolean): void {
|
|
40
|
+
this.overlapped = !overlapped;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Breakpoint viewport sizes and media queries.
|
|
2
|
+
//
|
|
3
|
+
// Breakpoints are defined as a map of (name: minimum width), order from small to large:
|
|
4
|
+
//
|
|
5
|
+
// (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)
|
|
6
|
+
//
|
|
7
|
+
// The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.
|
|
8
|
+
|
|
9
|
+
// Name of the next breakpoint, or null for the last breakpoint.
|
|
10
|
+
//
|
|
11
|
+
// >> breakpoint-next(sm)
|
|
12
|
+
// md
|
|
13
|
+
// >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
|
|
14
|
+
// md
|
|
15
|
+
// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))
|
|
16
|
+
// md
|
|
17
|
+
@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
|
|
18
|
+
$n: index($breakpoint-names, $name);
|
|
19
|
+
@return if($n != null and $n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Minimum breakpoint width. Null for the smallest (first) breakpoint.
|
|
23
|
+
//
|
|
24
|
+
// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
|
|
25
|
+
// 576px
|
|
26
|
+
@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
|
|
27
|
+
$min: map-get($breakpoints, $name);
|
|
28
|
+
@return if($min != 0, $min, null);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Maximum breakpoint width. Null for the largest (last) breakpoint.
|
|
32
|
+
// The maximum value is calculated as the minimum of the next one less 0.02px
|
|
33
|
+
// to work around the limitations of `min-` and `max-` prefixes and viewports with fractional widths.
|
|
34
|
+
// See https://www.w3.org/TR/mediaqueries-4/#mq-min-max
|
|
35
|
+
// Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.
|
|
36
|
+
// See https://bugs.webkit.org/show_bug.cgi?id=178261
|
|
37
|
+
//
|
|
38
|
+
// >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
|
|
39
|
+
// 767.98px
|
|
40
|
+
@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
|
|
41
|
+
$next: breakpoint-next($name, $breakpoints);
|
|
42
|
+
@return if($next, breakpoint-min($next, $breakpoints) - 0.02, null);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
|
|
46
|
+
// Useful for making responsive utilities.
|
|
47
|
+
//
|
|
48
|
+
// >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
|
|
49
|
+
// "" (Returns a blank string)
|
|
50
|
+
// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
|
|
51
|
+
// "-sm"
|
|
52
|
+
@function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {
|
|
53
|
+
@return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
|
|
57
|
+
// Makes the @content apply to the given breakpoint and wider.
|
|
58
|
+
@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
|
|
59
|
+
$min: breakpoint-min($name, $breakpoints);
|
|
60
|
+
@if $min {
|
|
61
|
+
@media (min-width: $min) {
|
|
62
|
+
@content;
|
|
63
|
+
}
|
|
64
|
+
} @else {
|
|
65
|
+
@content;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Media of at most the maximum breakpoint width. No query for the largest breakpoint.
|
|
70
|
+
// Makes the @content apply to the given breakpoint and narrower.
|
|
71
|
+
@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
|
|
72
|
+
$max: breakpoint-max($name, $breakpoints);
|
|
73
|
+
@if $max {
|
|
74
|
+
@media (max-width: $max) {
|
|
75
|
+
@content;
|
|
76
|
+
}
|
|
77
|
+
} @else {
|
|
78
|
+
@content;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Media that spans multiple breakpoint widths.
|
|
83
|
+
// Makes the @content apply between the min and max breakpoints
|
|
84
|
+
@mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
|
|
85
|
+
$min: breakpoint-min($lower, $breakpoints);
|
|
86
|
+
$max: breakpoint-max($upper, $breakpoints);
|
|
87
|
+
|
|
88
|
+
@if $min != null and $max != null {
|
|
89
|
+
@media (min-width: $min) and (max-width: $max) {
|
|
90
|
+
@content;
|
|
91
|
+
}
|
|
92
|
+
} @else if $max == null {
|
|
93
|
+
@include media-breakpoint-up($lower, $breakpoints) {
|
|
94
|
+
@content;
|
|
95
|
+
}
|
|
96
|
+
} @else if $min == null {
|
|
97
|
+
@include media-breakpoint-down($upper, $breakpoints) {
|
|
98
|
+
@content;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Media between the breakpoint's minimum and maximum widths.
|
|
104
|
+
// No minimum for the smallest breakpoint, and no maximum for the largest one.
|
|
105
|
+
// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
|
|
106
|
+
@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
|
|
107
|
+
$min: breakpoint-min($name, $breakpoints);
|
|
108
|
+
$max: breakpoint-max($name, $breakpoints);
|
|
109
|
+
|
|
110
|
+
@if $min != null and $max != null {
|
|
111
|
+
@media (min-width: $min) and (max-width: $max) {
|
|
112
|
+
@content;
|
|
113
|
+
}
|
|
114
|
+
} @else if $max == null {
|
|
115
|
+
@include media-breakpoint-up($name, $breakpoints) {
|
|
116
|
+
@content;
|
|
117
|
+
}
|
|
118
|
+
} @else if $min == null {
|
|
119
|
+
@include media-breakpoint-down($name, $breakpoints) {
|
|
120
|
+
@content;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ModuleWithProviders, NgModule } from '@angular/core';
|
|
3
|
+
import { DisplayModule } from './display/display.module';
|
|
4
|
+
|
|
5
|
+
import { InputsModule } from './inputs/inputs.module';
|
|
6
|
+
import { ModuleConfiguration } from './models/module-configuration';
|
|
7
|
+
import { NavigationModule } from './navigation/navigation.module';
|
|
8
|
+
|
|
9
|
+
@NgModule({
|
|
10
|
+
declarations: [
|
|
11
|
+
|
|
12
|
+
],
|
|
13
|
+
imports: [
|
|
14
|
+
CommonModule,
|
|
15
|
+
DisplayModule,
|
|
16
|
+
InputsModule,
|
|
17
|
+
NavigationModule
|
|
18
|
+
],
|
|
19
|
+
exports: [
|
|
20
|
+
DisplayModule,
|
|
21
|
+
InputsModule,
|
|
22
|
+
NavigationModule
|
|
23
|
+
]
|
|
24
|
+
})
|
|
25
|
+
export class UiModule {
|
|
26
|
+
public static forRoot(configuration?: ModuleConfiguration): ModuleWithProviders<UiModule> {
|
|
27
|
+
return {
|
|
28
|
+
ngModule: UiModule,
|
|
29
|
+
providers: [
|
|
30
|
+
{ provide: 'FactorUiConfiguration', useValue: configuration }
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/test.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
+
|
|
3
|
+
import 'zone.js';
|
|
4
|
+
import 'zone.js/testing';
|
|
5
|
+
import { getTestBed } from '@angular/core/testing';
|
|
6
|
+
import {
|
|
7
|
+
BrowserDynamicTestingModule,
|
|
8
|
+
platformBrowserDynamicTesting
|
|
9
|
+
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
+
|
|
11
|
+
declare const require: {
|
|
12
|
+
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
+
<T>(id: string): T;
|
|
14
|
+
keys(): string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// First, initialize the Angular testing environment.
|
|
19
|
+
getTestBed().initTestEnvironment(
|
|
20
|
+
BrowserDynamicTestingModule,
|
|
21
|
+
platformBrowserDynamicTesting(),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
// Then we find all the tests.
|
|
25
|
+
const context = require.context('./', true, /\.spec\.ts$/);
|
|
26
|
+
// And load the modules.
|
|
27
|
+
context.keys().forEach(context);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/lib",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"types": []
|
|
10
|
+
},
|
|
11
|
+
"exclude": [
|
|
12
|
+
"src/test.ts",
|
|
13
|
+
"**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/test.ts"
|
|
12
|
+
],
|
|
13
|
+
"include": [
|
|
14
|
+
"**/*.spec.ts",
|
|
15
|
+
"**/*.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
package/esm2020/factor_ec-ui.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yX2VjLXVpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvdWkvc3JjL2ZhY3Rvcl9lYy11aS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Component, HostBinding, Input } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "@factor_ec/utils";
|
|
4
|
-
import * as i2 from "@angular/common";
|
|
5
|
-
export class AvatarComponent {
|
|
6
|
-
constructor(colorService) {
|
|
7
|
-
this.colorService = colorService;
|
|
8
|
-
this.class = '';
|
|
9
|
-
}
|
|
10
|
-
set src(value) {
|
|
11
|
-
if (value && value.trim() != '') {
|
|
12
|
-
this._src = value;
|
|
13
|
-
let image = new Image();
|
|
14
|
-
image.src = value;
|
|
15
|
-
image.onload = () => {
|
|
16
|
-
if ("decode" in image) {
|
|
17
|
-
image.decode().then(() => {
|
|
18
|
-
this.loaded = true;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
console.error('Image.decode not available.');
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
set label(value) {
|
|
28
|
-
this._label = value;
|
|
29
|
-
this.initials = this.getInitials(value);
|
|
30
|
-
}
|
|
31
|
-
get backgroundColor() {
|
|
32
|
-
return this.color || this.colorService.hex(this._label);
|
|
33
|
-
}
|
|
34
|
-
get backgroundImage() {
|
|
35
|
-
return this._src ? `url(${this._src})` : '';
|
|
36
|
-
}
|
|
37
|
-
get hostClasses() {
|
|
38
|
-
return [
|
|
39
|
-
'ft-avatar',
|
|
40
|
-
this.class
|
|
41
|
-
].join(' ');
|
|
42
|
-
}
|
|
43
|
-
ngOnInit() {
|
|
44
|
-
}
|
|
45
|
-
getInitials(value) {
|
|
46
|
-
let allInitials = value.match(/\b\w/g) || [];
|
|
47
|
-
let initials = ((allInitials.shift() || '') + (allInitials.pop() || '')).toUpperCase();
|
|
48
|
-
return initials;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
AvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AvatarComponent, deps: [{ token: i1.ColorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
52
|
-
AvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.0", type: AvatarComponent, selector: "ft-avatar", inputs: { color: "color", class: "class", src: "src", label: "label" }, host: { properties: { "style.background-color": "this.backgroundColor", "style.background-image": "this.backgroundImage", "class": "this.hostClasses" } }, ngImport: i0, template: "<div *ngIf=\"!loaded\">{{ initials }}</div>\n", styles: [":host{--default-size: var(--size, 3rem);display:inline-flex;align-items:center;justify-content:center;color:#fff;background-size:cover;background-repeat:no-repeat;border-radius:calc(var(--default-size) / 2);font-size:calc(var(--default-size) - var(--default-size) * .6);min-width:var(--default-size);min-height:var(--default-size);cursor:default;-webkit-user-select:none;user-select:none}div{font-size:1em;line-height:1em}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
54
|
-
type: Component,
|
|
55
|
-
args: [{ selector: 'ft-avatar', template: "<div *ngIf=\"!loaded\">{{ initials }}</div>\n", styles: [":host{--default-size: var(--size, 3rem);display:inline-flex;align-items:center;justify-content:center;color:#fff;background-size:cover;background-repeat:no-repeat;border-radius:calc(var(--default-size) / 2);font-size:calc(var(--default-size) - var(--default-size) * .6);min-width:var(--default-size);min-height:var(--default-size);cursor:default;-webkit-user-select:none;user-select:none}div{font-size:1em;line-height:1em}\n"] }]
|
|
56
|
-
}], ctorParameters: function () { return [{ type: i1.ColorService }]; }, propDecorators: { color: [{
|
|
57
|
-
type: Input
|
|
58
|
-
}], class: [{
|
|
59
|
-
type: Input
|
|
60
|
-
}], src: [{
|
|
61
|
-
type: Input
|
|
62
|
-
}], label: [{
|
|
63
|
-
type: Input
|
|
64
|
-
}], backgroundColor: [{
|
|
65
|
-
type: HostBinding,
|
|
66
|
-
args: ['style.background-color']
|
|
67
|
-
}], backgroundImage: [{
|
|
68
|
-
type: HostBinding,
|
|
69
|
-
args: ['style.background-image']
|
|
70
|
-
}], hostClasses: [{
|
|
71
|
-
type: HostBinding,
|
|
72
|
-
args: ['class']
|
|
73
|
-
}] } });
|
|
74
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZhdGFyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3VpL3NyYy9saWIvZGlzcGxheS9hdmF0YXIvYXZhdGFyLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3VpL3NyYy9saWIvZGlzcGxheS9hdmF0YXIvYXZhdGFyLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsV0FBVyxFQUFFLEtBQUssRUFBVSxNQUFNLGVBQWUsQ0FBQzs7OztBQVF0RSxNQUFNLE9BQU8sZUFBZTtJQStDMUIsWUFDVSxZQUEwQjtRQUExQixpQkFBWSxHQUFaLFlBQVksQ0FBYztRQXhDcEMsVUFBSyxHQUFXLEVBQUUsQ0FBQztJQXlDZixDQUFDO0lBeENMLElBQ0ksR0FBRyxDQUFDLEtBQXlCO1FBQy9CLElBQUksS0FBSyxJQUFJLEtBQUssQ0FBQyxJQUFJLEVBQUUsSUFBRSxFQUFFLEVBQUU7WUFDN0IsSUFBSSxDQUFDLElBQUksR0FBRyxLQUFLLENBQUM7WUFDbEIsSUFBSSxLQUFLLEdBQUcsSUFBSSxLQUFLLEVBQUUsQ0FBQztZQUN4QixLQUFLLENBQUMsR0FBRyxHQUFHLEtBQUssQ0FBQztZQUNsQixLQUFLLENBQUMsTUFBTSxHQUFHLEdBQUcsRUFBRTtnQkFDbEIsSUFBSSxRQUFRLElB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Y2tncm91bmQtaW1hZ2UnKVxuICBnZXQgYmFja2dyb3VuZEltYWdlKCk6IHN0cmluZyB7XG4gICAgcmV0dXJuIHRoaXMuX3NyYyA/IGB1cmwoJHt0aGlzLl9zcmN9KWAgOiAnJztcbiAgfVxuICBASG9zdEJpbmRpbmcoJ2NsYXNzJylcbiAgZ2V0IGhvc3RDbGFzc2VzKCk6IHN0cmluZyB7XG4gICAgcmV0dXJuIFtcbiAgICAgICdmdC1hdmF0YXInLFxuICAgICAgdGhpcy5jbGFzc1xuICAgIF0uam9pbignICcpO1xuICB9XG5cbiAgY29uc3RydWN0b3IoXG4gICAgcHJpdmF0ZSBjb2xvclNlcnZpY2U6IENvbG9yU2VydmljZVxuICApIHsgfVxuXG4gIG5nT25Jbml0KCkge1xuXG4gIH1cbiAgZ2V0SW5pdGlhbHModmFsdWU6IHN0cmluZyk6IHN0cmluZyB7XG4gICAgbGV0IGFsbEluaXRpYWxzOiBzdHJpbmdbXSA9IHZhbHVlLm1hdGNoKC9cXGJcXHcvZykgfHwgW107XG4gICAgbGV0IGluaXRpYWxzOiBzdHJpbmcgPSAoKGFsbEluaXRpYWxzLnNoaWZ0KCkgfHwgJycpICsgKGFsbEluaXRpYWxzLnBvcCgpIHx8ICcnKSkudG9VcHBlckNhc2UoKTtcbiAgICByZXR1cm4gaW5pdGlhbHM7XG4gIH1cblxufVxuIiwiPGRpdiAqbmdJZj1cIiFsb2FkZWRcIj57eyBpbml0aWFscyB9fTwvZGl2PlxuIl19
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Component, Inject } from '@angular/core';
|
|
2
|
-
import { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "@angular/common";
|
|
5
|
-
export class ContentComponent {
|
|
6
|
-
constructor(data) {
|
|
7
|
-
this.data = data;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
ContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: ContentComponent, deps: [{ token: MAT_SNACK_BAR_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
11
|
-
ContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.0", type: ContentComponent, selector: "lib-content", ngImport: i0, template: "<ng-container [ngSwitch]=\"data.message?.type\">\n <div *ngSwitchCase=\"'html'\" [innerHTML]=\"data.message?.content\"></div>\n <ng-container *ngSwitchDefault>{{ data.message?.content }}</ng-container>\n</ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: ContentComponent, decorators: [{
|
|
13
|
-
type: Component,
|
|
14
|
-
args: [{ selector: 'lib-content', template: "<ng-container [ngSwitch]=\"data.message?.type\">\n <div *ngSwitchCase=\"'html'\" [innerHTML]=\"data.message?.content\"></div>\n <ng-container *ngSwitchDefault>{{ data.message?.content }}</ng-container>\n</ng-container>" }]
|
|
15
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
16
|
-
type: Inject,
|
|
17
|
-
args: [MAT_SNACK_BAR_DATA]
|
|
18
|
-
}] }]; } });
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGVudC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy91aS9zcmMvbGliL2Rpc3BsYXkvY29udGVudC9jb250ZW50LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4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