diff --git a/projects/truly-ui/src/components/card/card.scss b/projects/truly-ui/src/components/card/card.scss
new file mode 100644
index 000000000..b78ae27d2
--- /dev/null
+++ b/projects/truly-ui/src/components/card/card.scss
@@ -0,0 +1,27 @@
+.ui-wrapper-card {
+ background: #fff;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ place-content: flex-start;
+ flex-flow: column;
+ border-radius: 5px;
+ transition: border-color, box-shadow 300ms linear;
+ box-sizing: border-box;
+
+ &:hover {
+ border-color: rgba(0,0,0,.09);
+ box-shadow: 0 2px 8px rgba(0,0,0,.09);
+ }
+
+ @keyframes infinitePulse {
+ 0% {
+ transform: scale(1, 1);
+ }
+ 100% {
+ transform: scale(1.2, 1.2);
+ opacity: 0.3;
+ }
+ }
+
+}
diff --git a/projects/truly-ui/src/components/card/card.ts b/projects/truly-ui/src/components/card/card.ts
new file mode 100644
index 000000000..699176ff4
--- /dev/null
+++ b/projects/truly-ui/src/components/card/card.ts
@@ -0,0 +1,38 @@
+/*
+ MIT License
+
+ Copyright (c) 2018 Temainfo Software
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+import { Component, OnInit, Input } from '@angular/core';
+
+@Component({
+ selector: 'tl-card',
+ templateUrl: './card.html',
+ styleUrls: ['./card.scss'],
+})
+export class TlCard implements OnInit {
+
+ @Input() color = 'basic';
+
+ constructor() {}
+
+ ngOnInit() {}
+
+}
diff --git a/projects/truly-ui/src/components/card/index.ts b/projects/truly-ui/src/components/card/index.ts
new file mode 100644
index 000000000..9791e98d9
--- /dev/null
+++ b/projects/truly-ui/src/components/card/index.ts
@@ -0,0 +1,30 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { TlCard } from './card';
+import { IconsModule } from '../icons/index';
+import { TlCardBody } from './parts/card-body/card-body';
+import { TlCardHeader } from './parts/card-header/card-header';
+import { TlCardFooter } from './parts/card-footer/card-footer';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ IconsModule,
+ FormsModule
+ ],
+ declarations: [
+ TlCard,
+ TlCardBody,
+ TlCardFooter,
+ TlCardHeader
+ ],
+ exports: [
+ TlCard,
+ TlCardHeader,
+ TlCardFooter,
+ TlCardBody
+ ]
+})
+export class CardModule {}
diff --git a/projects/truly-ui/src/components/card/parts/card-body/card-body.html b/projects/truly-ui/src/components/card/parts/card-body/card-body.html
new file mode 100644
index 000000000..db90fee48
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-body/card-body.html
@@ -0,0 +1,3 @@
+
+
+
diff --git a/projects/truly-ui/src/components/card/parts/card-body/card-body.scss b/projects/truly-ui/src/components/card/parts/card-body/card-body.scss
new file mode 100644
index 000000000..a472b156d
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-body/card-body.scss
@@ -0,0 +1,12 @@
+:host {
+ width: 100%;
+ position: relative;
+}
+
+.ui-card-body {
+ width: 100%;
+ height: 100%;
+ padding: 10px;
+ box-sizing: border-box;
+}
+
diff --git a/projects/truly-ui/src/components/card/parts/card-body/card-body.ts b/projects/truly-ui/src/components/card/parts/card-body/card-body.ts
new file mode 100644
index 000000000..6b7e36b55
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-body/card-body.ts
@@ -0,0 +1,35 @@
+
+
+ /*
+ MIT License
+
+ Copyright (c) 2019 Temainfo Sistemas
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+ import { Component } from '@angular/core';
+
+ @Component({
+ selector: 'tl-card-body',
+ templateUrl: './card-body.html',
+ styleUrls: ['./card-body.scss'],
+ })
+ export class TlCardBody {
+
+ constructor() {}
+
+ }
diff --git a/projects/truly-ui/src/components/card/parts/card-footer/card-footer.html b/projects/truly-ui/src/components/card/parts/card-footer/card-footer.html
new file mode 100644
index 000000000..bf2ad2b4c
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-footer/card-footer.html
@@ -0,0 +1,3 @@
+
diff --git a/projects/truly-ui/src/components/card/parts/card-footer/card-footer.scss b/projects/truly-ui/src/components/card/parts/card-footer/card-footer.scss
new file mode 100644
index 000000000..6488b7412
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-footer/card-footer.scss
@@ -0,0 +1,15 @@
+:host {
+ width: 100%;
+ position: relative;
+}
+
+.ui-card-footer {
+ width: 100%;
+ height: 50px;
+ font-size: 1.5em;
+ border-top: 0;
+ box-sizing: border-box;
+ tl-icon {
+ padding: 0 20px;
+ }
+}
diff --git a/projects/truly-ui/src/components/card/parts/card-footer/card-footer.ts b/projects/truly-ui/src/components/card/parts/card-footer/card-footer.ts
new file mode 100644
index 000000000..25b26bc84
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-footer/card-footer.ts
@@ -0,0 +1,35 @@
+
+
+ /*
+ MIT License
+
+ Copyright (c) 2019 Temainfo Sistemas
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+ import { Component } from '@angular/core';
+
+ @Component({
+ selector: 'tl-card-footer',
+ templateUrl: './card-footer.html',
+ styleUrls: ['./card-footer.scss'],
+ })
+ export class TlCardFooter {
+
+ constructor() {}
+
+ }
diff --git a/projects/truly-ui/src/components/card/parts/card-header/card-header.html b/projects/truly-ui/src/components/card/parts/card-header/card-header.html
new file mode 100644
index 000000000..674f84328
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-header/card-header.html
@@ -0,0 +1,3 @@
+
+
+
diff --git a/projects/truly-ui/src/components/card/parts/card-header/card-header.scss b/projects/truly-ui/src/components/card/parts/card-header/card-header.scss
new file mode 100644
index 000000000..6e5222c03
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-header/card-header.scss
@@ -0,0 +1,13 @@
+:host {
+ width: 100%;
+ position: relative;
+}
+
+.ui-card-header {
+ width: 100%;
+ position: relative;
+ min-height: 100px;
+ overflow: hidden;
+ box-sizing: border-box;
+}
+
diff --git a/projects/truly-ui/src/components/card/parts/card-header/card-header.ts b/projects/truly-ui/src/components/card/parts/card-header/card-header.ts
new file mode 100644
index 000000000..677f4118b
--- /dev/null
+++ b/projects/truly-ui/src/components/card/parts/card-header/card-header.ts
@@ -0,0 +1,35 @@
+
+
+ /*
+ MIT License
+
+ Copyright (c) 2019 Temainfo Sistemas
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+ import { Component } from '@angular/core';
+
+ @Component({
+ selector: 'tl-card-header',
+ templateUrl: './card-header.html',
+ styleUrls: ['./card-header.scss'],
+ })
+ export class TlCardHeader {
+
+ constructor() {}
+
+ }
diff --git a/projects/truly-ui/src/components/clockpicker/services/clockpicker.service.ts b/projects/truly-ui/src/components/clockpicker/services/clockpicker.service.ts
index 70e27f7e4..7c06965d0 100644
--- a/projects/truly-ui/src/components/clockpicker/services/clockpicker.service.ts
+++ b/projects/truly-ui/src/components/clockpicker/services/clockpicker.service.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/core/classes/datasource-list.ts b/projects/truly-ui/src/components/core/classes/datasource-list.ts
index 284a346e4..e9e6c4d54 100644
--- a/projects/truly-ui/src/components/core/classes/datasource-list.ts
+++ b/projects/truly-ui/src/components/core/classes/datasource-list.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -76,6 +76,11 @@ export class DataSourceList extends DataSource {
this.arrayTotal = Array.from( { length: length || this.totalLength } );
}
+ public resetPages() {
+ this.fetchedPages = new Set();
+ this.fetchedPages.add(0);
+ }
+
private setProprieties(config) {
Object.keys(config).forEach((value) => {
this[value] = config[value];
@@ -89,8 +94,8 @@ export class DataSourceList extends DataSource {
public setData(data: Array) {
this.cachedData = data;
this.arrayTotal.splice(this.currentPage * this.pageSize, this.pageSize,
- ...data);
- this.dataStream.next(this.arrayTotal);
+ ...data);
+ this.dataStream.next( this.arrayTotal );
}
private getPageForIndex( index: number ): number {
diff --git a/projects/truly-ui/src/components/core/components/filter/filter-container.ts b/projects/truly-ui/src/components/core/components/filter/filter-container.ts
index a443eee6d..cbdb110ae 100644
--- a/projects/truly-ui/src/components/core/components/filter/filter-container.ts
+++ b/projects/truly-ui/src/components/core/components/filter/filter-container.ts
@@ -26,6 +26,8 @@ import {
import { Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
+import * as objectPath from 'object-path';
+
@Component( {
selector: 'tl-filter-container',
template: `
@@ -80,7 +82,7 @@ export class TlFilterContainer implements AfterContentInit, OnDestroy {
}
const filtered = [];
this.source.forEach( ( value ) => {
- if ( String( value[ this.searchBy ].toLowerCase() ).indexOf( String( searchTerm.toLowerCase().trim() ) ) > -1 ) {
+ if ( String( objectPath.get( value, this.searchBy ).toLowerCase() ).indexOf( String( searchTerm.toLowerCase().trim() ) ) > -1 ) {
filtered.push( value );
}
} );
diff --git a/projects/truly-ui/src/components/core/directives/itemSelected/item-selected.directive.ts b/projects/truly-ui/src/components/core/directives/itemSelected/item-selected.directive.ts
index 2d3577d63..db6646a55 100644
--- a/projects/truly-ui/src/components/core/directives/itemSelected/item-selected.directive.ts
+++ b/projects/truly-ui/src/components/core/directives/itemSelected/item-selected.directive.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/core/directives/overlay-animation.ts b/projects/truly-ui/src/components/core/directives/overlay-animation.ts
index 05fb47e2d..5353e9864 100644
--- a/projects/truly-ui/src/components/core/directives/overlay-animation.ts
+++ b/projects/truly-ui/src/components/core/directives/overlay-animation.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/core/enums/actions-modal.ts b/projects/truly-ui/src/components/core/enums/actions-modal.ts
index 33980a1eb..e226253ca 100644
--- a/projects/truly-ui/src/components/core/enums/actions-modal.ts
+++ b/projects/truly-ui/src/components/core/enums/actions-modal.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/core/helper/check-element-on-list.ts b/projects/truly-ui/src/components/core/helper/check-element-on-list.ts
index 10a385cc8..259cfc0b9 100644
--- a/projects/truly-ui/src/components/core/helper/check-element-on-list.ts
+++ b/projects/truly-ui/src/components/core/helper/check-element-on-list.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/core/helper/elvis.ts b/projects/truly-ui/src/components/core/helper/elvis.ts
new file mode 100644
index 000000000..9226edb61
--- /dev/null
+++ b/projects/truly-ui/src/components/core/helper/elvis.ts
@@ -0,0 +1,8 @@
+/**
+ * Undefined-safe function to access the property given by path parameter
+ * @param object The object to read from
+ * @param path The path to the property
+ */
+export function elvis(object: any, path: string): any | undefined {
+ return path ? path.split('.').reduce((value, key) => value && value[key], object) : object;
+}
diff --git a/projects/truly-ui/src/components/core/interfaces/datasource-list.interface.ts b/projects/truly-ui/src/components/core/interfaces/datasource-list.interface.ts
index b0aeda60f..c13d62255 100644
--- a/projects/truly-ui/src/components/core/interfaces/datasource-list.interface.ts
+++ b/projects/truly-ui/src/components/core/interfaces/datasource-list.interface.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/core/services/menu.service.ts b/projects/truly-ui/src/components/core/services/menu.service.ts
index e5e95d996..2fc98030c 100644
--- a/projects/truly-ui/src/components/core/services/menu.service.ts
+++ b/projects/truly-ui/src/components/core/services/menu.service.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/core/styles/theming/_components.scss b/projects/truly-ui/src/components/core/styles/theming/_components.scss
index fcf068171..60433219c 100644
--- a/projects/truly-ui/src/components/core/styles/theming/_components.scss
+++ b/projects/truly-ui/src/components/core/styles/theming/_components.scss
@@ -6,6 +6,7 @@
@import "../../../button/button-theme";
@import "../../../buttongroup/buttongroup-theme";
@import "../../../dropdownicon/dropdownicon-theme";
+@import "../../../card/card-theme";
@import "../../../calendar/calendar-theme";
@import "../../../chatlist/chatlist-theme";
@import "../../../checkbox/checkbox-theme";
@@ -61,6 +62,7 @@
@include tl-button-group-theme($theme);
@include tl-button-theme($theme);
@include tl-dropdown-icon-theme($theme);
+ @include tl-card-theme($theme);
@include tl-calendar-theme($theme);
@include tl-chatlist-theme($theme);
@include tl-checkbox-theme($theme);
diff --git a/projects/truly-ui/src/components/core/styles/theming/_main.scss b/projects/truly-ui/src/components/core/styles/theming/_main.scss
index bfcc92ebb..36c5d862a 100644
--- a/projects/truly-ui/src/components/core/styles/theming/_main.scss
+++ b/projects/truly-ui/src/components/core/styles/theming/_main.scss
@@ -8,6 +8,7 @@
@include tl-badge-theme($theme);
@include tl-button-theme($theme);
@include tl-calendar-theme($theme);
+ @include tl-card-theme($theme);
@include tl-colorpicker-theme($theme);
@include tl-colorpicker-content-theme($theme);
@include tl-colorpicker-input-theme($theme);
diff --git a/projects/truly-ui/src/components/core/tokens/configuration.token.ts b/projects/truly-ui/src/components/core/tokens/configuration.token.ts
index 8dedea0da..562610f9f 100644
--- a/projects/truly-ui/src/components/core/tokens/configuration.token.ts
+++ b/projects/truly-ui/src/components/core/tokens/configuration.token.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/datepicker/datepicker.html b/projects/truly-ui/src/components/datepicker/datepicker.html
index 7f851ac53..315bd12b0 100644
--- a/projects/truly-ui/src/components/datepicker/datepicker.html
+++ b/projects/truly-ui/src/components/datepicker/datepicker.html
@@ -9,6 +9,8 @@
(keypress)="handleDateChange()"
(clear)="onClearInput($event)"
[iconAfter]="iconAfter"
+ date
+ [formatDate]="formatDate"
[textAlign]="textAlign"
[labelPlacement]="labelPlacement"
[readonly]="readonly ? true : null"
diff --git a/projects/truly-ui/src/components/datepicker/datepicker.ts b/projects/truly-ui/src/components/datepicker/datepicker.ts
index adf9fd31f..fb5cd33f5 100644
--- a/projects/truly-ui/src/components/datepicker/datepicker.ts
+++ b/projects/truly-ui/src/components/datepicker/datepicker.ts
@@ -53,6 +53,8 @@ export class TlDatePicker extends ElementBase implements OnInit, AfterVi
@Input() labelPlacement = 'left';
+ @Input() formatDate = 'dd.mm.yyyy';
+
@Input() readonly = false;
@Input() disabled = false;
@@ -73,7 +75,7 @@ export class TlDatePicker extends ElementBase implements OnInit, AfterVi
@ViewChild( TlCalendar ) calendar;
- @ViewChild( TlInput ) tlinput;
+ @ViewChild( TlInput ) tlInput: TlInput;
@ViewChild( 'calendarContent' ) calendarContent;
@@ -85,8 +87,6 @@ export class TlDatePicker extends ElementBase implements OnInit, AfterVi
public iconAfter = '';
- public formatDate = '';
-
public trigger;
public year = new Date().getFullYear();
@@ -103,6 +103,7 @@ export class TlDatePicker extends ElementBase implements OnInit, AfterVi
ngOnInit() {
this.handleDateChange();
+ this.setDateMask();
if ( this.iconCalendar ) {
this.iconAfter = 'ion-calendar';
}
@@ -112,6 +113,17 @@ export class TlDatePicker extends ElementBase implements OnInit, AfterVi
this.validateDateDirective();
}
+ setDateMask() {
+ this.tlInput.mask = this.getMask();
+ }
+
+ getMask() {
+ const format = this.formatDate.toLowerCase();
+ const dd = format.replace('dd', '00');
+ const mm = dd.replace('mm', '00');
+ return mm.replace('yyyy', '0000');
+ }
+
validateDateDirective() {
let hasDate = false;
for ( const item of this.datePicker.nativeElement.attributes ) {
@@ -145,7 +157,6 @@ export class TlDatePicker extends ElementBase implements OnInit, AfterVi
this.setValue( $event );
this.setDateValues($event);
this.handleAutoClose();
- this.tlinput.input.nativeElement.focus();
}
setDateValues($event) {
diff --git a/projects/truly-ui/src/components/datepicker/index.ts b/projects/truly-ui/src/components/datepicker/index.ts
index 31f2317fa..c5a94463b 100644
--- a/projects/truly-ui/src/components/datepicker/index.ts
+++ b/projects/truly-ui/src/components/datepicker/index.ts
@@ -31,6 +31,7 @@ import { InputModule } from '../input/index';
import { TlDatePickerContent } from './datepicker-content/datepicker-content';
import { OverlayModule } from '@angular/cdk/overlay';
import { PortalModule } from '@angular/cdk/portal';
+import { DateModule } from '../date/index';
@NgModule( {
imports: [
@@ -40,6 +41,7 @@ import { PortalModule } from '@angular/cdk/portal';
FormsModule,
OverlayModule,
PortalModule,
+ DateModule,
InputModule
],
declarations: [
diff --git a/projects/truly-ui/src/components/dropdownlist/dropdownlist-theme.scss b/projects/truly-ui/src/components/dropdownlist/dropdownlist-theme.scss
index 0661b9b92..0b102df2e 100644
--- a/projects/truly-ui/src/components/dropdownlist/dropdownlist-theme.scss
+++ b/projects/truly-ui/src/components/dropdownlist/dropdownlist-theme.scss
@@ -8,11 +8,11 @@
.ui-dropdown-box {
- > .ui-dropdown-icon.ng-invalid {
+ .ui-dropdown-icon.ng-invalid {
color: rgba(map-deep-get($danger, "default", "background"), 0.5) !important;
}
- > .ui-dropdown-wrapper {
+ .ui-dropdown {
background: map-deep-get($basic, "default", "background");
border: 1px solid map-deep-get($basic, "default", "border");
diff --git a/projects/truly-ui/src/components/dropdownlist/dropdownlist.html b/projects/truly-ui/src/components/dropdownlist/dropdownlist.html
index 0e99da6e4..549d00c46 100644
--- a/projects/truly-ui/src/components/dropdownlist/dropdownlist.html
+++ b/projects/truly-ui/src/components/dropdownlist/dropdownlist.html
@@ -1,26 +1,34 @@
-
diff --git a/projects/truly-ui/src/components/editor/interfaces/toolbar-config.ts b/projects/truly-ui/src/components/editor/interfaces/toolbar-config.ts
index e8864bb27..8c8a413fa 100644
--- a/projects/truly-ui/src/components/editor/interfaces/toolbar-config.ts
+++ b/projects/truly-ui/src/components/editor/interfaces/toolbar-config.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/editor/model/toolbar-config.model.ts b/projects/truly-ui/src/components/editor/model/toolbar-config.model.ts
index 672095cbd..791ec69bc 100644
--- a/projects/truly-ui/src/components/editor/model/toolbar-config.model.ts
+++ b/projects/truly-ui/src/components/editor/model/toolbar-config.model.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/form/form-submit.directive.ts b/projects/truly-ui/src/components/form/form-submit.directive.ts
index 83f20435b..c5b44c34e 100644
--- a/projects/truly-ui/src/components/form/form-submit.directive.ts
+++ b/projects/truly-ui/src/components/form/form-submit.directive.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/form/form.html b/projects/truly-ui/src/components/form/form.html
index 7e46e1a27..a21b54f2e 100644
--- a/projects/truly-ui/src/components/form/form.html
+++ b/projects/truly-ui/src/components/form/form.html
@@ -1,4 +1,9 @@
+
+
+
+
+
diff --git a/projects/truly-ui/src/components/overlaylist/overlay-list.scss b/projects/truly-ui/src/components/overlaylist/overlay-list.scss
index f84d0d945..04784ffbc 100644
--- a/projects/truly-ui/src/components/overlaylist/overlay-list.scss
+++ b/projects/truly-ui/src/components/overlaylist/overlay-list.scss
@@ -106,6 +106,14 @@ $default-outline: none;
}
}
+.group-list {
+ .group-description {
+ font-weight: 600;
+ color: #ababab;
+ padding: 0 5px;
+ }
+}
+
.default-option {
padding: 0 5px;
> i {
diff --git a/projects/truly-ui/src/components/overlaylist/overlay-list.ts b/projects/truly-ui/src/components/overlaylist/overlay-list.ts
index d243a6e25..9af7f1fbd 100644
--- a/projects/truly-ui/src/components/overlaylist/overlay-list.ts
+++ b/projects/truly-ui/src/components/overlaylist/overlay-list.ts
@@ -21,24 +21,33 @@
*/
import {
Component, EventEmitter, OnInit, Output, Input, ViewChild, ElementRef, ViewChildren, QueryList,
- AfterViewInit, SimpleChanges, OnChanges, Renderer2,
+ AfterViewInit, SimpleChanges, OnChanges, Renderer2, OnDestroy,
} from '@angular/core';
import { ActiveDescendantKeyManager, FocusKeyManager } from '@angular/cdk/a11y';
-import { KeyEvent } from '../core/enums/key-events';
import { TlListItem } from './list-item/list-item';
import { TlInput } from '../input/input';
import { I18nService } from '../i18n/i18n.service';
import { ListItemInterface } from '../dropdownlist/interfaces/list-item';
import { scrollIntoView } from '../core/helper/scrollIntoView';
+import * as path from 'object-path';
+import { Subscription } from 'rxjs';
@Component( {
selector: 'tl-overlay-list',
templateUrl: './overlay-list.html',
styleUrls: [ './overlay-list.scss' ],
} )
-export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
+export class TlOverlayList implements OnInit, AfterViewInit, OnChanges, OnDestroy {
- @Input( 'datasource' ) datasource = [];
+ @Input( 'datasource' )
+ set dataSource(data) {
+ this._datasource = data;
+ this.getFilteredData();
+ }
+
+ get dataSource() {
+ return this._datasource;
+ }
@Input( 'searchOnList' ) searchOnList = false;
@@ -52,7 +61,9 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
@Input( 'keyText' ) keyText = 'text';
- @Input() keyIcon = 'icon';
+ @Input( 'groupBy' ) groupBy = null;
+
+ @Input( 'keyIcon' ) keyIcon = 'icon';
@Input( 'icon' ) icon = null;
@@ -90,11 +101,24 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
public notFound = false;
+ public groups = [];
+
+ public unGrouped = [];
+
+ public objectPath = path;
+
+ private _datasource = [];
+
+ private numberItems = 0;
+
+ private subscription = new Subscription();
+
get emptyList() {
return this.i18n.getLocale().OverlayList.emptyList;
}
- constructor( private renderer: Renderer2, private i18n: I18nService ) {}
+ constructor( private renderer: Renderer2,
+ private i18n: I18nService ) {}
ngOnInit() {
}
@@ -105,22 +129,69 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
this.keyManager.withWrap();
this.handleActiveItem();
this.handleModelOption();
+ this.getFilteredData();
+ }
+
+ getFilteredData() {
+ this.groups = [];
+ this.unGrouped = [];
+ if (!this.groupBy) {
+ this.unGrouped = this.dataSource;
+ return;
+ }
+ this.dataSource.forEach( ( value ) => {
+ if (!this.objectPath.get(value, this.groupBy)) {
+ this.unGrouped = this.getItemsGroup(this.objectPath.get(value, this.groupBy));
+ return;
+ }
+ if ( !this.existGroup( this.objectPath.get(value, this.groupBy) ) ) {
+ this.groups.push( {
+ description: this.objectPath.get(value, this.groupBy),
+ items: this.getItemsGroup( this.objectPath.get(value, this.groupBy) )
+ } );
+ }
+ } );
+ }
+
+ existGroup( group ) {
+ for ( const item of this.groups ) {
+ if ( item.description === group ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ getItemsGroup( group ) {
+ const filter = this.dataSource.filter( ( item ) => this.objectPath.get(item, this.groupBy) === group);
+ this.numberItems += filter.length;
+ return filter;
}
handleCustomInputEvents() {
if (this.customInput) {
this.handleInputFocus();
- this.renderer.listen( this.customInput, 'keydown', ($event) => {
- if (this.isKeyCodeEnter($event) && this.hasDataOnDataSource()) {
+
+ this.subscription.add(this.renderer.listen( this.customInput, 'keydown.enter', () => {
+ if (this.hasDataOnDataSource()) {
this.emitSelectOption();
}
- this.handleKeyEvents($event);
- });
+ }));
+
+ this.subscription.add(this.renderer.listen( this.customInput, 'keydown.arrowdown', () => {
+ this.keyManager.setNextItemActive();
+ this.handleScrollIntoView();
+ }));
+
+ this.subscription.add(this.renderer.listen( this.customInput, 'keydown.arrowup', () => {
+ this.keyManager.setPreviousItemActive();
+ this.handleScrollIntoView();
+ }));
}
}
handleInputFocus() {
- if (this.searchOnList) {
+ if (this.searchOnList && !this.customFocus) {
setTimeout(() => {
this.tlInput.setFocus();
}, 1);
@@ -128,11 +199,7 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
}
hasDataOnDataSource() {
- return this.datasource.length > 0;
- }
-
- isKeyCodeEnter($event) {
- return $event.keyCode === KeyEvent.ENTER;
+ return this.dataSource.length > 0;
}
handleActiveItem() {
@@ -153,18 +220,12 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
setActiveItem(index: number) {
this.removeSelectedAll();
this.keyManager.setActiveItem(index);
- this.handleScrollIntoView();
}
removeSelectedAll() {
this.items.forEach((item) => item.selected = false);
}
- handleKeyEvents( $event: KeyboardEvent ) {
- this.keyManager.onKeydown( $event );
- this.handleScrollIntoView();
- }
-
handleScrollIntoView() {
if (this.keyManager.activeItem) {
scrollIntoView(this.keyManager.activeItem.element.nativeElement);
@@ -187,9 +248,9 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
this.findByLetter.emit($event.key);
}
- handleClickOption( index: number, $event ) {
+ handleClickOption( $event, item: TlListItem ) {
this.stopEvent($event);
- this.keyManager.setActiveItem( index );
+ this.keyManager.setActiveItem( item );
this.emitSelectOption();
}
@@ -211,10 +272,11 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
keydownSearch( $event ) {
this.search.emit( $event.target.value );
+ this.unGrouped = [];
}
setNotFound() {
- this.notFound = this.datasource.length === 0;
+ this.notFound = this.dataSource.length === 0;
}
ngOnChanges(changes: SimpleChanges ) {
@@ -227,5 +289,10 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges {
this.handleModelOption();
}
}
+
+ ngOnDestroy() {
+ this.subscription.unsubscribe();
+ }
+
}
diff --git a/projects/truly-ui/src/components/panelgroup/panelgroup.ts b/projects/truly-ui/src/components/panelgroup/panelgroup.ts
index 338ae714e..7db43dc08 100644
--- a/projects/truly-ui/src/components/panelgroup/panelgroup.ts
+++ b/projects/truly-ui/src/components/panelgroup/panelgroup.ts
@@ -41,7 +41,7 @@ export class TlPanelGroup implements AfterViewInit {
@Input() customTemplate: TemplateRef;
- @Input() fontSizeCaption = '1em';
+ @Input() fontSizeCaption = '12px';
@Input() showButtonAction = false;
diff --git a/projects/truly-ui/src/components/permissions/parts/directives/permission-group.directive.ts b/projects/truly-ui/src/components/permissions/parts/directives/permission-group.directive.ts
index 750bfab30..dc846ce0d 100644
--- a/projects/truly-ui/src/components/permissions/parts/directives/permission-group.directive.ts
+++ b/projects/truly-ui/src/components/permissions/parts/directives/permission-group.directive.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/permissions/parts/interfaces/permission-dataconfig.interface.ts b/projects/truly-ui/src/components/permissions/parts/interfaces/permission-dataconfig.interface.ts
index 068fdf8ca..023096191 100644
--- a/projects/truly-ui/src/components/permissions/parts/interfaces/permission-dataconfig.interface.ts
+++ b/projects/truly-ui/src/components/permissions/parts/interfaces/permission-dataconfig.interface.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/permissions/parts/models/permission.model.ts b/projects/truly-ui/src/components/permissions/parts/models/permission.model.ts
index fa0c8cba9..6d9f12482 100644
--- a/projects/truly-ui/src/components/permissions/parts/models/permission.model.ts
+++ b/projects/truly-ui/src/components/permissions/parts/models/permission.model.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/popupmenu/parts/popupmenu-item.ts b/projects/truly-ui/src/components/popupmenu/parts/popupmenu-item.ts
index 7e25f059b..e1ac6a2ec 100644
--- a/projects/truly-ui/src/components/popupmenu/parts/popupmenu-item.ts
+++ b/projects/truly-ui/src/components/popupmenu/parts/popupmenu-item.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/popupmenu/popupmenu.ts b/projects/truly-ui/src/components/popupmenu/popupmenu.ts
index 69db1caa5..8b9c9131e 100644
--- a/projects/truly-ui/src/components/popupmenu/popupmenu.ts
+++ b/projects/truly-ui/src/components/popupmenu/popupmenu.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/progressbar/progressbar.html b/projects/truly-ui/src/components/progressbar/progressbar.html
index 646d0a968..26e50554e 100644
--- a/projects/truly-ui/src/components/progressbar/progressbar.html
+++ b/projects/truly-ui/src/components/progressbar/progressbar.html
@@ -1,5 +1,5 @@
-
+
{{getProgressDescription()}} %({{position}} {{unit}} / {{max}} {{unit}})
diff --git a/projects/truly-ui/src/components/progressbar/progressbar.scss b/projects/truly-ui/src/components/progressbar/progressbar.scss
index 133e8f17f..db7ece58f 100644
--- a/projects/truly-ui/src/components/progressbar/progressbar.scss
+++ b/projects/truly-ui/src/components/progressbar/progressbar.scss
@@ -5,6 +5,10 @@
box-sizing: border-box;
}
+.border-rounded {
+ border-radius: 10px;
+}
+
.ui-progressbar {
width: 100%;
}
diff --git a/projects/truly-ui/src/components/progressbar/progressbar.ts b/projects/truly-ui/src/components/progressbar/progressbar.ts
index 9c8458603..00c17f027 100644
--- a/projects/truly-ui/src/components/progressbar/progressbar.ts
+++ b/projects/truly-ui/src/components/progressbar/progressbar.ts
@@ -40,6 +40,8 @@ export class TlProgressBar implements OnInit, OnChanges {
@Input() height = '15px';
+ @Input() shape: 'default' | 'rounded' = 'rounded';
+
@Input() progressInfo: 'none' | 'percentage' | 'detailed' = 'percentage';
@Input() mode: 'determinate' | 'indeterminate' = 'determinate';
diff --git a/projects/truly-ui/src/components/schedule/i18n/schedule-i18n.ts b/projects/truly-ui/src/components/schedule/i18n/schedule-i18n.ts
new file mode 100644
index 000000000..4cc505037
--- /dev/null
+++ b/projects/truly-ui/src/components/schedule/i18n/schedule-i18n.ts
@@ -0,0 +1,37 @@
+/*
+ *
+ * MIT License
+ *
+ * Copyright (c) 2019 Temainfo Sistemas
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ * /
+ */
+export const ScheduleI18n = {
+ views: {
+ day: 'Day',
+ week: 'Week',
+ month: 'Month',
+ workWeek: 'Work Week',
+ dayList: 'Day List',
+ weekList: 'Week List',
+ },
+ buttons: {
+ addEvent: 'Add Event'
+ },
+ scaleNotFound: 'Scale Not Exists'
+};
diff --git a/projects/truly-ui/src/components/schedule/index.ts b/projects/truly-ui/src/components/schedule/index.ts
index 2ff0670ed..f709cc582 100644
--- a/projects/truly-ui/src/components/schedule/index.ts
+++ b/projects/truly-ui/src/components/schedule/index.ts
@@ -14,6 +14,8 @@ import { BlockUIModule } from '../blockui/index';
import { ButtonModule } from '../button/index';
import { ButtonGroupModule } from '../buttongroup/index';
import { GenerateEventsService } from './services/generate-events.service';
+import { WorkScaleService } from './services/work-scale.service';
+import { EventService } from './services/event.service';
@NgModule({
@@ -36,7 +38,9 @@ import { GenerateEventsService } from './services/generate-events.service';
TlSchedule,
],
providers: [
- GenerateEventsService
+ GenerateEventsService,
+ WorkScaleService,
+ EventService
]
})
export class ScheduleModule {}
diff --git a/projects/truly-ui/src/components/schedule/parts/heading/heading.component.html b/projects/truly-ui/src/components/schedule/parts/heading/heading.component.html
index df909178c..0ed341d07 100644
--- a/projects/truly-ui/src/components/schedule/parts/heading/heading.component.html
+++ b/projects/truly-ui/src/components/schedule/parts/heading/heading.component.html
@@ -4,7 +4,7 @@
@@ -22,6 +22,6 @@
-
+
diff --git a/projects/truly-ui/src/components/schedule/parts/heading/heading.component.ts b/projects/truly-ui/src/components/schedule/parts/heading/heading.component.ts
index 788c206c2..deaf861f9 100644
--- a/projects/truly-ui/src/components/schedule/parts/heading/heading.component.ts
+++ b/projects/truly-ui/src/components/schedule/parts/heading/heading.component.ts
@@ -1,5 +1,6 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ViewType } from '../../types/view.type';
+import { ScheduleI18n } from '../../i18n/schedule-i18n';
@Component({
selector: 'tl-schedule-heading',
@@ -14,6 +15,8 @@ export class HeadingComponent implements OnInit {
@Input() currentDate = new Date();
+ @Input() texts = ScheduleI18n;
+
@Output() changeView = new EventEmitter();
@Output() changeDate = new EventEmitter();
diff --git a/projects/truly-ui/src/components/schedule/schedule.html b/projects/truly-ui/src/components/schedule/schedule.html
index c01338c71..07247fac8 100644
--- a/projects/truly-ui/src/components/schedule/schedule.html
+++ b/projects/truly-ui/src/components/schedule/schedule.html
@@ -3,6 +3,7 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
diff --git a/projects/truly-ui/src/components/schedule/schedule.scss b/projects/truly-ui/src/components/schedule/schedule.scss
index 53a0f8ea5..e7fa11d22 100644
--- a/projects/truly-ui/src/components/schedule/schedule.scss
+++ b/projects/truly-ui/src/components/schedule/schedule.scss
@@ -14,6 +14,7 @@
.ui-schedule-body {
border: 1px solid #D6D6D6;
box-sizing: content-box;
- overflow-x: auto;
+ overflow-x: hidden;
+ overflow-y: visible;
position: relative;
}
diff --git a/projects/truly-ui/src/components/schedule/schedule.ts b/projects/truly-ui/src/components/schedule/schedule.ts
index 19a82082b..d19cea6fa 100644
--- a/projects/truly-ui/src/components/schedule/schedule.ts
+++ b/projects/truly-ui/src/components/schedule/schedule.ts
@@ -25,6 +25,11 @@ import {
import { ScheduleDataSource } from './types/datasource.type';
import { StatusType } from './types/status.type';
import { ViewType } from './types/view.type';
+import { SlotSettingsType } from './types/slot-settings.type';
+import { WorkScaleType } from './types/work-scale.type';
+import { WorkScaleService } from './services/work-scale.service';
+import { EventService } from './services/event.service';
+import { ScheduleI18n } from './i18n/schedule-i18n';
@Component( {
selector: 'tl-schedule',
@@ -44,36 +49,21 @@ export class TlSchedule implements OnInit, OnChanges {
@Input() height = '550px';
- @Input() duration = 30;
+ @Input() slotSettings: SlotSettingsType = new SlotSettingsType( 2, 43);
- @Input() showNowIndicator = false;
-
- @Input() slatHightRows = 43;
+ @Input() workScale: WorkScaleType | WorkScaleType[] = new WorkScaleType( '08:00', '18:00', 30 );
- @Input() slatNumberRows = 2;
+ @Input() showNowIndicator = false;
- @Input('events') set events( events: ScheduleDataSource[] ) {
- this._events = [...events].sort(( a, b ) => a.date.start - b.date.start );
- this._events = JSON.parse( JSON.stringify(this._events) );
- }
- get events () {
- return this._events;
- }
+ @Input() texts = ScheduleI18n;
- @Input('startDayHour') set startDayHour( hours: string ) {
- this._startDayHour = hours;
- this.startDayMilliseconds = this.transformHourToMileseconds( hours );
- }
- get startDayHour () {
- return this._startDayHour;
- }
-
- @Input('endDayHour') set setEndDayHour( hours: string ) {
- this._endDayHour = hours;
- this.endDayMilliseconds = this.transformHourToMileseconds( hours );
- }
- get endDayHour () {
- return this._endDayHour;
+ @Input('events') set events( events: ScheduleDataSource[]) {
+ if ( !events) {
+ this._events = [];
+ } else {
+ this._events = [...events].sort(( a, b ) => a.date.start - b.date.start );
+ this._events = JSON.parse( JSON.stringify(this._events) );
+ }
}
@Output() changeView = new EventEmitter();
@@ -92,43 +82,29 @@ export class TlSchedule implements OnInit, OnChanges {
@Output() newEventClick = new EventEmitter();
- public startDayMilliseconds: number;
-
- public endDayMilliseconds: number;
-
public slatNumberRowsAsArray: Array;
- public eventsOfDay: ScheduleDataSource[];
+ public existsScale = false;
private _events: ScheduleDataSource[];
- private _startDayHour: string;
-
- private _endDayHour: string;
+ get events(): ScheduleDataSource[] {
+ return this._events;
+ }
- constructor( private changeDetection: ChangeDetectorRef ) {}
+ constructor(
+ public workScaleService: WorkScaleService,
+ private changeDetection: ChangeDetectorRef,
+ private eventService: EventService
+ ) {}
ngOnInit() {
this.convertSlarNumberToArray();
- this.getEventsOfDay();
this.changeDetection.detectChanges();
}
ngOnChanges( changes: SimpleChanges ) {
-
- if ( changes['events'] !== undefined ) {
- if ( !changes[ 'events' ].firstChange ) {
- this.refreshStartAndEndDay();
- this.getEventsOfDay();
- }
- }
-
- if ( changes['currentDate'] !== undefined ) {
- if ( ! changes['currentDate'].firstChange) {
- this.refreshStartAndEndDay();
- this.getEventsOfDay();
- }
- }
+ this.existsScale = this.workScaleService.exitsWorkScale( this.workScale );
this.changeDetection.detectChanges();
}
@@ -139,39 +115,14 @@ export class TlSchedule implements OnInit, OnChanges {
onChangeDate($event) {
this.currentDate = new Date( $event.year, $event.month, $event.day);
- this.refreshStartAndEndDay();
- this.getEventsOfDay();
+ this.workScaleService.currentDate = new Date( $event.year, $event.month, $event.day);
+ this.eventService.getEventsOfDay();
this.changeDate.emit( $event );
this.changeDetection.detectChanges();
}
- private transformHourToMileseconds( fullHour: string ) {
- const hourSplited = fullHour.split(':');
-
- const hours = Number(hourSplited[0]);
- const minutes = Number(hourSplited[1]);
- const year = this.currentDate.getFullYear();
- const month = this.currentDate.getMonth();
- const date = this.currentDate.getDate();
-
- return new Date(year, month, date, hours, minutes).getTime();
- }
-
- private refreshStartAndEndDay() {
- this.endDayMilliseconds = this.transformHourToMileseconds( this.endDayHour );
- this.startDayMilliseconds = this.transformHourToMileseconds( this.startDayHour );
- }
-
-
- private getEventsOfDay() {
- if ( this.events === undefined ) { return []; }
- this.eventsOfDay = this.events.filter( ( event ) => {
- return ( event.date.start >= this.startDayMilliseconds ) && ( event.date.end <= this.endDayMilliseconds );
- });
- }
-
private convertSlarNumberToArray() {
- this.slatNumberRowsAsArray = Array( this.slatNumberRows );
+ this.slatNumberRowsAsArray = Array( this.slotSettings.slotCount );
this.changeDetection.detectChanges();
}
}
diff --git a/projects/truly-ui/src/components/schedule/services/event.service.ts b/projects/truly-ui/src/components/schedule/services/event.service.ts
new file mode 100644
index 000000000..f77f65524
--- /dev/null
+++ b/projects/truly-ui/src/components/schedule/services/event.service.ts
@@ -0,0 +1,28 @@
+import { EventEmitter, Injectable } from '@angular/core';
+import { WorkScaleService } from './work-scale.service';
+import { ScheduleDataSource } from '../types/datasource.type';
+
+@Injectable()
+export class EventService {
+
+ public eventsOfDay: ScheduleDataSource[];
+
+ public events: ScheduleDataSource[];
+
+ public updateEvents = new EventEmitter();
+
+ constructor( private workScaleService: WorkScaleService ) { }
+
+ loadEvents( events: ScheduleDataSource[] ) {
+ this.events = events;
+ this.updateEvents.emit( this.events );
+ }
+
+ getEventsOfDay() {
+ // if ( this.events === undefined ) { return []; }
+ // this.eventsOfDay = this.events.filter( ( event ) => {
+ // return ( event.date.start >= this.workScaleService.startDayMilliseconds )
+ // && ( event.date.end <= this.workScaleService.endDayMilliseconds );
+ // });
+ }
+}
diff --git a/projects/truly-ui/src/components/schedule/services/generate-events.service.ts b/projects/truly-ui/src/components/schedule/services/generate-events.service.ts
index 1cf36b3f8..c7123b887 100644
--- a/projects/truly-ui/src/components/schedule/services/generate-events.service.ts
+++ b/projects/truly-ui/src/components/schedule/services/generate-events.service.ts
@@ -1,5 +1,9 @@
-import { Injectable } from '@angular/core';
+import { Injectable, QueryList } from '@angular/core';
import { Cluster, Graph, Node } from '../types/graph';
+import { elvis } from '../../core/helper/elvis';
+import { ScheduleDataSource } from '../types/datasource.type';
+
+const WIDTH_SCROLL = 17;
@Injectable()
export class GenerateEventsService {
@@ -12,24 +16,76 @@ export class GenerateEventsService {
private originalEvents = [];
- private startDayMilliseconds = 0;
+ private workScaleInMileseconds = [];
- private endDayMilliseconds = 0;
+ private scheduleSlats: QueryList;
constructor() {}
- with( events ) {
- this.originalEvents = JSON.parse( JSON.stringify(events) );
- this.events = events;
- this.transformDateToPixel();
- return this.generateEvents();
+ with( events: ScheduleDataSource[] ) {
+ if ( this.scheduleSlats ) {
+ if ( events.length > 0 && this.scheduleSlats.length > 0 ) {
+ this.originalEvents = JSON.parse( JSON.stringify( events ) );
+ events = JSON.parse( JSON.stringify( events ) );
+
+ this.events = events;
+ this.transformDateToPixel();
+ return this.generateEvents();
+ }
+ }
+
+ }
+
+ initializeArray( workScaleInMileseconds, scheduleSlats: QueryList ) {
+ if ( scheduleSlats && scheduleSlats) {
+ if ( scheduleSlats.length > 0 && workScaleInMileseconds.length > 0 ) {
+ this.workScaleInMileseconds = workScaleInMileseconds;
+ this.scheduleSlats = scheduleSlats;
+
+ this.heightSchedule = this.scheduleSlats.first.nativeElement.offsetHeight + this.scheduleSlats.last.nativeElement.offsetHeight;
+ this.widthSchedule = this.scheduleSlats.first.nativeElement.offsetWidth - WIDTH_SCROLL;
+ }
+ }
+ }
+
+ private transformDateToPixel() {
+ for ( let i = 0; i <= this.events.length - 1; i++) {
+ this.events[i].date = Object.assign({}, {
+ start: Math.round(this.convertMillisecondsToPixel( this.events[i].date.start )),
+ end: Math.round(this.convertMillisecondsToPixel( this.events[i].date.end ))
+ });
+ }
}
- initialize( startDayMilliseconds, endDayMilliseconds, heightSchedule, widthSchedule ) {
- this.startDayMilliseconds = startDayMilliseconds;
- this.endDayMilliseconds = endDayMilliseconds;
- this.heightSchedule = heightSchedule;
- this.widthSchedule = widthSchedule;
+ private convertMillisecondsToPixel(date = new Date().getTime()) {
+ let heightBody;
+ let startDayMilliseconds;
+ let endDayMilliseconds;
+ let converted;
+ let currentDate;
+ let position = -1;
+ let offsetHeight = 0;
+
+ this.workScaleInMileseconds.forEach(( item, index, array) => {
+ if ( date > this.workScaleInMileseconds[index].start ) {
+ position++;
+ const slotObject = this.scheduleSlats.find( (slot, idx) => idx === ( index - 1));
+ offsetHeight = offsetHeight + elvis(slotObject, 'nativeElement.offsetHeight') || 0;
+ }
+ });
+
+ if ( position < 0 && offsetHeight <= 0) {
+ return -1000;
+ }
+
+ startDayMilliseconds = Math.floor(this.workScaleInMileseconds[position].start / 100000 );
+ endDayMilliseconds = Math.floor(this.workScaleInMileseconds[position].end / 100000 );
+ heightBody = this.scheduleSlats.find( (item, idx) => idx === position).nativeElement.offsetHeight;
+ date = Math.floor(date / 100000 );
+ currentDate = date - startDayMilliseconds;
+ converted = ( heightBody * currentDate ) / ( endDayMilliseconds - startDayMilliseconds);
+
+ return converted > heightBody ? -1000 : ( converted + offsetHeight );
}
private generateEvents() {
@@ -37,22 +93,24 @@ export class GenerateEventsService {
const histogram = this.createHistogram();
const graph = this.createTheGraph( histogram );
this.setClusterWidth( graph );
- this.setNodesPosition(graph);
+ this.setNodesPosition( graph );
for ( const nodeId in graph.nodes ) {
if ( graph.nodes.hasOwnProperty(nodeId) ) {
- const node = graph.nodes[nodeId];
- const event = {
- positions: {
- id: node.id,
- top: node.start,
- left: node.position * node.cluster.width,
- height: node.end + 1 - node.start,
- width: node.cluster.width
- },
- data: this.originalEvents.filter(( e ) => parseInt(e.value, 10) === node.id )[0]
- };
- eventsWithPositioning.push(event);
+ if ( graph.nodes[nodeId].cluster ) {
+ const node = graph.nodes[nodeId];
+ const event = {
+ positions: {
+ id: node.id,
+ top: node.start,
+ left: node.position * node.cluster.width,
+ height: node.end - node.start,
+ width: node.cluster.width
+ },
+ data: this.originalEvents.filter(( e ) => e.value === node.id )[0]
+ };
+ eventsWithPositioning.push(event);
+ }
}
}
return eventsWithPositioning;
@@ -69,10 +127,11 @@ export class GenerateEventsService {
// setting which events occurs at each minute
this.events.forEach( (event) => {
for ( let i = event.date.start; i <= event.date.end - 1; i++ ) {
- minutes[i].push(parseInt((event.value), 10));
+ if ( minutes[i] ) {
+ minutes[i].push(event.value);
+ }
}
});
-
return minutes;
}
@@ -82,7 +141,7 @@ export class GenerateEventsService {
// creating the nodes
this.events.forEach( (event) => {
- const node = new Node(parseInt(event.value, 10), event.date.start, event.date.end - 1);
+ const node = new Node(event.value, event.date.start, event.date.end);
nodeMap[node.id] = node;
});
@@ -94,11 +153,14 @@ export class GenerateEventsService {
minutes.forEach( (minute, index, arrayMinutes ) => {
if (minute.length > 0) {
- if ( ( minute[0] !== arrayMinutes[index - 1][0] ) && ( minute.length !== arrayMinutes[index - 1].length ) && cluster) {
- graph.clusters.push(cluster);
- cluster = null;
+ if ( arrayMinutes[index - 1] ) {
+ if ( ( minute[0] !== arrayMinutes[index - 1][0] ) && ( minute.length !== arrayMinutes[index - 1].length ) && cluster) {
+ graph.clusters.push(cluster);
+ cluster = null;
+ }
}
+
cluster = cluster || new Cluster();
minute.forEach( ( eventId ) => {
if (!cluster.nodes[eventId]) {
@@ -136,7 +198,6 @@ export class GenerateEventsService {
});
graph.nodes = nodeMap;
-
return graph;
}
@@ -182,21 +243,5 @@ export class GenerateEventsService {
});
}
- private transformDateToPixel() {
- for ( let i = 0; i <= this.events.length - 1; i++) {
- this.events[i].date = Object.assign({}, {
- start: Math.round(this.convertMillisecondsToPixel( this.events[i].date.start )),
- end: Math.round(this.convertMillisecondsToPixel( this.events[i].date.end ))
- });
- }
- }
-
- convertMillisecondsToPixel(date = new Date().getTime()) {
- const heightBody = this.heightSchedule;
- const currentDate = date - this.startDayMilliseconds;
- const converted = ( heightBody * currentDate ) / ( this.endDayMilliseconds - this.startDayMilliseconds);
-
- return converted > heightBody ? -1000 : converted;
- }
}
diff --git a/projects/truly-ui/src/components/schedule/services/work-scale.service.ts b/projects/truly-ui/src/components/schedule/services/work-scale.service.ts
new file mode 100644
index 000000000..69caef854
--- /dev/null
+++ b/projects/truly-ui/src/components/schedule/services/work-scale.service.ts
@@ -0,0 +1,101 @@
+import { EventEmitter, Injectable } from '@angular/core';
+import { WorkScaleType } from '../types/work-scale.type';
+
+@Injectable()
+export class WorkScaleService {
+
+ public workScale: WorkScaleType[];
+
+ public currentDate = new Date();
+
+ public timesCollection: Array>;
+
+ public workScaleInMileseconds = [];
+
+ public updateScale = new EventEmitter();
+
+ constructor( ) {}
+
+ reload( workScale: WorkScaleType | WorkScaleType[] ) {
+ this.setWorkScale( workScale );
+ this.createWorkScaleMileseconds();
+ this.generateTimes();
+ }
+
+ exitsWorkScale ( workScale ) {
+ return workScale && (
+ ( workScale as WorkScaleType ).hasOwnProperty('interval') ||
+ ( workScale as Array ).length > 0
+ );
+ }
+
+ private setWorkScale( workScale: WorkScaleType | WorkScaleType[] ) {
+
+ if ( !this.exitsWorkScale( workScale ) ) {
+ return this.workScale = [];
+ }
+
+ if ( ( workScale as WorkScaleType ).hasOwnProperty('interval') ) {
+ return this.workScale = new Array(1).fill( workScale as WorkScaleType);
+ }
+
+ if ( ( workScale as Array ).length > 0 ) {
+ this.workScale = workScale as WorkScaleType[];
+ }
+
+ }
+
+ private createWorkScaleMileseconds() {
+
+ this.workScaleInMileseconds = [];
+
+ if ( (this.workScale as Array).length > 0 ) {
+ (this.workScale as Array).forEach(( value: WorkScaleType, index, array) => {
+ if ( array.length > 0 ) {
+ this.workScaleInMileseconds.push({
+ start: this.transformHourToMileseconds( value.start ),
+ end: this.transformHourToMileseconds( value.end ),
+ interval: value.interval
+ });
+ }
+ });
+ }
+
+ }
+
+
+ private transformHourToMileseconds( fullHour: string ) {
+ const hourSplited = fullHour.split(':');
+
+ const hours = Number(hourSplited[0]);
+ const minutes = Number(hourSplited[1]);
+ const year = this.currentDate.getFullYear();
+ const month = this.currentDate.getMonth();
+ const date = this.currentDate.getDate();
+
+ return new Date(year, month, date, hours, minutes).getTime();
+ }
+
+
+ private generateTimes() {
+ const MIN_TO_MILLESECOND = 60000;
+ this.timesCollection = new Array>( (this.workScaleInMileseconds as Array).length ).fill([]);
+
+ if ( (this.workScaleInMileseconds as Array).length > 0 ) {
+ (this.workScaleInMileseconds as Array).forEach(( value , index, array) => {
+ let currentHour_ms = value.start;
+ let nextHourBreak_ms = value.start;
+
+ while ( currentHour_ms < value.end ) {
+ if ( currentHour_ms === nextHourBreak_ms ) {
+ this.timesCollection[index] = [...this.timesCollection[index], new Date(nextHourBreak_ms) ] ;
+ nextHourBreak_ms = nextHourBreak_ms + (value.interval * MIN_TO_MILLESECOND);
+ }
+ currentHour_ms++;
+ }
+ });
+ }
+
+ this.updateScale.emit( this.timesCollection );
+ }
+}
diff --git a/projects/truly-ui/src/components/schedule/types/block-dates.type.ts b/projects/truly-ui/src/components/schedule/types/block-dates.type.ts
new file mode 100644
index 000000000..fa695ceaf
--- /dev/null
+++ b/projects/truly-ui/src/components/schedule/types/block-dates.type.ts
@@ -0,0 +1,26 @@
+/*
+ MIT License
+
+ Copyright (c) 2019 Temainfo Sistemas
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+export class BlockDatesType {
+ start: string;
+ end: string;
+}
diff --git a/projects/truly-ui/src/components/schedule/types/datasource.type.ts b/projects/truly-ui/src/components/schedule/types/datasource.type.ts
index 407702ab4..9eb5dfd29 100644
--- a/projects/truly-ui/src/components/schedule/types/datasource.type.ts
+++ b/projects/truly-ui/src/components/schedule/types/datasource.type.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/schedule/types/graph.ts b/projects/truly-ui/src/components/schedule/types/graph.ts
index 5ade79e9f..058f545fb 100644
--- a/projects/truly-ui/src/components/schedule/types/graph.ts
+++ b/projects/truly-ui/src/components/schedule/types/graph.ts
@@ -10,7 +10,7 @@ export class Cluster {
}
export class Node {
- id = 0;
+ id = '';
start = 0;
end = 0;
neighbours = {};
diff --git a/projects/truly-ui/src/components/schedule/types/slot-settings.type.ts b/projects/truly-ui/src/components/schedule/types/slot-settings.type.ts
new file mode 100644
index 000000000..98bf04265
--- /dev/null
+++ b/projects/truly-ui/src/components/schedule/types/slot-settings.type.ts
@@ -0,0 +1,28 @@
+/*
+ MIT License
+
+ Copyright (c) 2019 Temainfo Sistemas
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+export class SlotSettingsType {
+ constructor(
+ public slotCount: number,
+ public slotHight: number
+ ) {}
+}
diff --git a/projects/truly-ui/src/components/schedule/types/status.type.ts b/projects/truly-ui/src/components/schedule/types/status.type.ts
index 9163b0c77..06ea1962d 100644
--- a/projects/truly-ui/src/components/schedule/types/status.type.ts
+++ b/projects/truly-ui/src/components/schedule/types/status.type.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/schedule/types/view.type.ts b/projects/truly-ui/src/components/schedule/types/view.type.ts
index 0247e44d3..ac4621b6d 100644
--- a/projects/truly-ui/src/components/schedule/types/view.type.ts
+++ b/projects/truly-ui/src/components/schedule/types/view.type.ts
@@ -1,7 +1,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/truly-ui/src/components/schedule/types/work-scale.type.ts b/projects/truly-ui/src/components/schedule/types/work-scale.type.ts
new file mode 100644
index 000000000..448f3ab0c
--- /dev/null
+++ b/projects/truly-ui/src/components/schedule/types/work-scale.type.ts
@@ -0,0 +1,29 @@
+/*
+ MIT License
+
+ Copyright (c) 2019 Temainfo Sistemas
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+export class WorkScaleType {
+ constructor(
+ public start: string,
+ public end: string,
+ public interval: number
+ ) {}
+}
diff --git a/projects/truly-ui/src/components/schedule/views/day-list/day-list.component.html b/projects/truly-ui/src/components/schedule/views/day-list/day-list.component.html
index f0b3e20d9..c7a117f1f 100644
--- a/projects/truly-ui/src/components/schedule/views/day-list/day-list.component.html
+++ b/projects/truly-ui/src/components/schedule/views/day-list/day-list.component.html
@@ -1,13 +1,13 @@
+
-
+
{{time | date: 'HH'}}:{{time | date: 'mm'}}
-
-
+
+ (dblclick)="rowDbClick( time, index, timesIndex )">
diff --git a/src/app/components/calendar/calendardemo.component.ts b/src/app/components/calendar/calendardemo.component.ts
index 38f8d3ac8..b6e5c2984 100644
--- a/src/app/components/calendar/calendardemo.component.ts
+++ b/src/app/components/calendar/calendardemo.component.ts
@@ -25,9 +25,9 @@ import * as json from './calendardemo-dataproperties.json';
import * as jsonEvts from './calendardemo.dataevents.json';
@Component( {
- selector : 'app-calendar',
- templateUrl : './calendardemo.component.html',
- styleUrls : [ './calendardemo.component.scss' ]
+ selector: 'app-calendar',
+ templateUrl: './calendardemo.component.html',
+ styleUrls: [ './calendardemo.component.scss' ]
} )
export class CalendarDemoComponent {
@@ -35,13 +35,25 @@ export class CalendarDemoComponent {
public dataEvents;
+ public month = new Date().getMonth();
+
+ public day = new Date().getDate();
+
+ public year = new Date().getFullYear();
+
+ public status = [
+ { id: '1', date: new Date( this.year, this.month, this.day + 3 ), total: 50, current: 15 },
+ { id: '2', date: new Date( this.year, this.month, this.day + 5 ), total: 50, current: 40 },
+ { id: '3', date: new Date( this.year, this.month, this.day + 10 ), total: 50, current: 10 },
+ ];
+
constructor() {
this.dataTableProperties = json.dataProperties;
this.dataEvents = jsonEvts.dataEvents;
}
- onSelect($event) {
- console.log($event);
+ onSelect( $event ) {
+ console.log( $event );
}
}
diff --git a/src/app/components/card/carddemo-dataproperties.json.ts b/src/app/components/card/carddemo-dataproperties.json.ts
new file mode 100644
index 000000000..6ffc02ef3
--- /dev/null
+++ b/src/app/components/card/carddemo-dataproperties.json.ts
@@ -0,0 +1,30 @@
+/*
+ MIT License
+
+ Copyright (c) 2018 Temainfo Software
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+export const dataProperties = [
+ {
+ name: 'text',
+ type: 'string',
+ default: 'null',
+ description: 'Displays a text.',
+ options: 'any text'
+ },
+];
diff --git a/src/app/components/card/carddemo-routing.module.ts b/src/app/components/card/carddemo-routing.module.ts
new file mode 100644
index 000000000..0e4eba9bc
--- /dev/null
+++ b/src/app/components/card/carddemo-routing.module.ts
@@ -0,0 +1,37 @@
+/*
+MIT License
+
+Copyright (c) 2018 Temainfo Software
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import { NgModule } from '@angular/core';
+import { RouterModule } from '@angular/router';
+import { CardDemoComponent } from './carddemo.component';
+
+@NgModule({
+ imports: [
+ RouterModule.forChild( [
+ { path: '', component: CardDemoComponent }
+ ])
+ ],
+ exports: [
+ RouterModule
+ ]
+})
+export class CardDemoRoutingModule {}
diff --git a/src/app/components/card/carddemo.component.html b/src/app/components/card/carddemo.component.html
new file mode 100644
index 000000000..5e4356790
--- /dev/null
+++ b/src/app/components/card/carddemo.component.html
@@ -0,0 +1,69 @@
+
+
+ The Truly-UI Card are styles for actions in forms, dialogs, and more with support for multiple sizes, states
+ and many properties for customization
+
+
+
+
+
+
+
+
Basic
+
+
+
+
+
+
+ William Aguera
+ Developer
+
+
+ heart
+
+
+
+
+
+ RG
+ 12.575.659.12-2
+
+
+ CPF
+ 078.880.369-70
+
+
+ Data Nascimento
+ 22/05/1994
+
+
+ Estado Civil
+ Solteiro
+
+
+ Genero
+ Masculino
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/components/card/carddemo.component.scss b/src/app/components/card/carddemo.component.scss
new file mode 100644
index 000000000..2620f3c61
--- /dev/null
+++ b/src/app/components/card/carddemo.component.scss
@@ -0,0 +1,67 @@
+.header {
+ padding: 20px;
+ align-items: center;
+ place-content: flex-start;
+ display: flex;
+ background: #11998e;
+ background: -webkit-linear-gradient(to right, #11998e, #66cc99);
+ background: linear-gradient(to right, #11998e, #66cc99);
+}
+
+.ui-icons {
+ position: absolute;
+ right: 20px;
+ top: 20px;
+ color: #609280;
+ font-size: 1.5em;
+}
+.ui-img-pulse {
+ position: absolute;
+ display: flex;
+ width: 80px;
+ height: 80px;
+ border-radius: 50%;
+ border: 7px solid #fff;
+ align-items: center;
+ place-content: center;
+ opacity: 0;
+ animation: infinitePulse 1s infinite;
+ animation-direction: alternate;
+}
+.ui-card-img {
+ width: 80px;
+ height: 80px;
+ border-radius: 50%;
+ border: 3px solid #ffffff59;
+}
+.ui-info {
+ display: flex;
+ flex-flow: column;
+ padding: 0 10px;
+ color: #fff;
+ span {
+ &:first-child {
+ font-weight: 600;
+ font-size: 18px;
+ }
+ }
+}
+.ui-info-item {
+ display: flex;
+ align-items: center;
+ place-content: space-between;
+ padding: 5px 0;
+ border-bottom: 1px dashed #6c9;
+ span {
+ &:first-child {
+ font-weight: 600;
+ color: #8c8989;
+ }
+ &:last-child {
+ font-size: 16px;
+ font-weight: 600;
+ color: #505050;
+ }
+ }
+}
+
diff --git a/src/app/components/card/carddemo.component.ts b/src/app/components/card/carddemo.component.ts
new file mode 100644
index 000000000..05e646b09
--- /dev/null
+++ b/src/app/components/card/carddemo.component.ts
@@ -0,0 +1,43 @@
+/*
+ MIT License
+
+ Copyright (c) 2018 Temainfo Software
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+import { Component } from '@angular/core';
+
+import * as json from './carddemo-dataproperties.json';
+import * as jsonEvts from './carddemo.dataevents.json';
+
+@Component( {
+selector : 'app-card-demo',
+templateUrl : './carddemo.component.html',
+styleUrls : [ './carddemo.component.scss' ],
+} )
+export class CardDemoComponent {
+
+ public dataTableProperties;
+
+ public dataEvents;
+
+ constructor() {
+ this.dataTableProperties = json.dataProperties;
+ this.dataEvents = jsonEvts.dataEvents;
+ }
+}
+
diff --git a/src/app/components/card/carddemo.dataevents.json.ts b/src/app/components/card/carddemo.dataevents.json.ts
new file mode 100644
index 000000000..8b207f93c
--- /dev/null
+++ b/src/app/components/card/carddemo.dataevents.json.ts
@@ -0,0 +1,33 @@
+/*
+ MIT License
+
+ Copyright (c) 2018 Temainfo Software
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+export const dataEvents = [
+ {
+ name: 'selected',
+ parameters: [
+ {
+ event: 'selected',
+ description: 'Action Selected'
+ }
+ ],
+ description: 'Callback to invoke when toogle event.',
+ },
+];
diff --git a/src/app/components/card/carddemo.module.ts b/src/app/components/card/carddemo.module.ts
new file mode 100644
index 000000000..e7d14051c
--- /dev/null
+++ b/src/app/components/card/carddemo.module.ts
@@ -0,0 +1,36 @@
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { NgModule } from '@angular/core';
+
+import { HighlightJsModule } from 'ngx-highlight-js';
+
+import { CardDemoRoutingModule } from './carddemo-routing.module';
+import { CardDemoComponent } from './carddemo.component';
+import { CardModule } from '../../../../projects/truly-ui/src/components/card';
+import { ShowcaseCardModule } from '../../shared/components/showcase-card/showcase-card.module';
+import { ShowcaseTablePropertiesModule } from '../../shared/components/showcase-table-properties/showcase-table-properties.module';
+import { ShowcaseTableEventsModule } from '../../shared/components/showcase-table-events/showcase-table-events.module';
+import { ShowcaseHeaderModule } from '../../shared/components/showcase-header/showcase-header.module';
+import { IconsModule } from '../../../../projects/truly-ui/src/components/icons/index';
+
+@NgModule({
+ declarations: [
+ CardDemoComponent
+ ],
+ imports: [
+ CardDemoRoutingModule,
+ CardModule,
+ CommonModule,
+ IconsModule,
+ FormsModule,
+ HighlightJsModule,
+ ShowcaseCardModule,
+ ShowcaseTablePropertiesModule,
+ ShowcaseTableEventsModule,
+ ShowcaseHeaderModule
+ ],
+ exports: [
+ CardDemoComponent
+ ]
+})
+export class CardDemoModule {}
diff --git a/src/app/components/datepicker/datepickerdemo-dataproperties.json.ts b/src/app/components/datepicker/datepickerdemo-dataproperties.json.ts
index 308e44606..01430ccba 100644
--- a/src/app/components/datepicker/datepickerdemo-dataproperties.json.ts
+++ b/src/app/components/datepicker/datepickerdemo-dataproperties.json.ts
@@ -34,6 +34,13 @@ export const dataProperties = [
description: 'Create a label together with Input Element',
options: 'any text'
},
+ {
+ name: 'formatDate',
+ type: 'string',
+ default: 'dd.mm.yyyy',
+ description: 'The format of date',
+ options: 'dd.mm.yyyy | mm.dd.yyyy | yyyy.mm.dd'
+ },
{
name: 'labelSize',
type: 'string',
diff --git a/src/app/components/dropdownlist/dropdownlistdemo-dataevents.json.ts b/src/app/components/dropdownlist/dropdownlistdemo-dataevents.json.ts
new file mode 100644
index 000000000..f68ef4d93
--- /dev/null
+++ b/src/app/components/dropdownlist/dropdownlistdemo-dataevents.json.ts
@@ -0,0 +1,6 @@
+export const dataProperties = [
+ {
+ name: 'selectItem',
+ description: 'Dispatched when items is selected.',
+ },
+];
diff --git a/src/app/components/dropdownlist/dropdownlistdemo-dataproperties.json.ts b/src/app/components/dropdownlist/dropdownlistdemo-dataproperties.json.ts
index 281a4e077..2fe186175 100644
--- a/src/app/components/dropdownlist/dropdownlistdemo-dataproperties.json.ts
+++ b/src/app/components/dropdownlist/dropdownlistdemo-dataproperties.json.ts
@@ -9,17 +9,40 @@ export const dataProperties = [
{
name: 'keyText',
type: 'string',
- default: 'text',
+ default: 'null',
description: 'Sets the data item field that represents the item text.',
options: 'any text'
},
+ {
+ name: 'identifier',
+ type: 'string',
+ default: 'null',
+ description: 'String key used to compare values when model mode is string.',
+ options: 'any text'
+ },
+ {
+ name: 'modelMode',
+ type: 'string',
+ default: 'object',
+ description: 'Operating mode of model values, some servers uses ID hash of value' +
+ ' fields and others the object itself. The model mode is used to compare value of models' +
+ ' with dropdown dataSource when angular is loading the form values.',
+ options: 'string | object'
+ },
{
name: 'keyValue',
type: 'string',
- default: 'value',
+ default: 'null',
description: 'Sets the data item field that represents the item value.',
options: 'any text'
},
+ {
+ name: 'groupBy',
+ type: 'string',
+ default: 'null',
+ description: 'Key that would be used to group items',
+ options: 'any text'
+ },
{
name: 'icon',
type: 'string',
@@ -44,7 +67,7 @@ export const dataProperties = [
{
name: 'labelSize',
type: 'string',
- default: '100',
+ default: '100px',
description: 'Sets the label width.',
options: 'px | % | em'
},
@@ -65,7 +88,7 @@ export const dataProperties = [
{
name: 'width',
type: 'string',
- default: '87px',
+ default: '120px',
description: 'Sets the width of Dropdown List.',
options: 'px | % | em'
},
@@ -76,10 +99,24 @@ export const dataProperties = [
description: 'Handle if will have input search or not',
options: 'true | false'
},
+ {
+ name: 'defaultOption',
+ type: 'boolean',
+ default: 'false',
+ description: 'Handle if will have the null option',
+ options: 'true | false'
+ },
+ {
+ name: 'debounceTime',
+ type: 'boolean',
+ default: '200',
+ description: 'Delay of time used on searching',
+ options: 'number'
+ },
{
name: 'placeholder',
type: 'string',
- default: 'null',
+ default: 'Select item',
description: 'Display a help text on dropdown list.',
options: 'any text'
},
diff --git a/src/app/components/dropdownlist/dropdownlistdemo.component.html b/src/app/components/dropdownlist/dropdownlistdemo.component.html
index 191e6d9c6..96cec819e 100644
--- a/src/app/components/dropdownlist/dropdownlistdemo.component.html
+++ b/src/app/components/dropdownlist/dropdownlistdemo.component.html
@@ -87,7 +87,7 @@
Placeholder
Label
Label
-
Height
+
Custom Height
Height
-
Width + Filter
+
Custom Width + Filter
@@ -170,9 +171,10 @@
Required
Simple Data
-
-
+
+
+
+
+
+
GroupBy
+
+
+
+
+
+
+
Custom With Icon
+
+
+
+
@@ -208,18 +251,14 @@
Simple Data
-
Use DropdownList As Simple Array
+
Use DropdownList As Simple Array
There's TWO ways to use DropdownList, the first one is using an Simple Array of Objects, passing only the data that
you want to. For Example:
-
Use DropdownList As Complex Array
+
Use DropdownList As Complex Array
The other one is a Complex Array of Objects where you must pass a pattern to the component.
Note: The Keys inside those objects can be custom, referenced through the properties.
diff --git a/src/app/components/form/modal/form-modal/form-modal.component.ts b/src/app/components/form/modal/form-modal/form-modal.component.ts
index 817480e0d..9a52586b3 100644
--- a/src/app/components/form/modal/form-modal/form-modal.component.ts
+++ b/src/app/components/form/modal/form-modal/form-modal.component.ts
@@ -27,6 +27,7 @@ export class FormModalComponent {
nickname: new FormControl('', Validators.required),
email: new FormControl('', [Validators.email, Validators.required]),
description: new FormControl('', [Validators.required, Validators.minLength(8)]),
+ gender: new FormControl('', Validators.required),
user: new FormControl('', Validators.required),
password: new FormControl('', [
Validators.required,
diff --git a/src/app/components/form/modal/modal-options-table.ts b/src/app/components/form/modal/modal-options-table.ts
index ecb44d3c2..3d395f44b 100644
--- a/src/app/components/form/modal/modal-options-table.ts
+++ b/src/app/components/form/modal/modal-options-table.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/app/components/form/smart/modal-config-table.ts b/src/app/components/form/smart/modal-config-table.ts
index 15ce7bf50..3b467abc4 100644
--- a/src/app/components/form/smart/modal-config-table.ts
+++ b/src/app/components/form/smart/modal-config-table.ts
@@ -3,7 +3,7 @@
/*
MIT License
- Copyright (c) 2017 Temainfo Sistemas
+ Copyright (c) 2019 Temainfo Sistemas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/app/components/listbox/listboxdemo-events.json.ts b/src/app/components/listbox/listboxdemo-events.json.ts
index 7885137f4..5736c926f 100644
--- a/src/app/components/listbox/listboxdemo-events.json.ts
+++ b/src/app/components/listbox/listboxdemo-events.json.ts
@@ -5,23 +5,6 @@ export const events = [
},
{
name: 'selectItem',
- description: 'Dispatched when an element of the list is selected, navigating through it.',
- },
- {
- name: 'clickAddNew',
- description: 'Dispatched when element Add New is clicked.',
- },
- {
- name: 'lazyLoad',
- description: 'Dispatched when listBox in LazyMode and tries to get more data.',
- },
- {
- name: 'filterData',
- parameters: [
- {
- event: 'Array', description: 'Filtered data',
- },
- ],
- description: 'Dispatched when listBox is filtered.',
+ description: 'Dispatched when key enter is pressed.',
},
];
diff --git a/src/app/components/loader/loaderdemo-dataproperties.json.ts b/src/app/components/loader/loaderdemo-dataproperties.json.ts
new file mode 100644
index 000000000..7f505dcf6
--- /dev/null
+++ b/src/app/components/loader/loaderdemo-dataproperties.json.ts
@@ -0,0 +1,37 @@
+/*
+ MIT License
+
+ Copyright (c) 2018 Temainfo Software
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+export const dataProperties = [
+ {
+ name: 'color',
+ type: 'string',
+ default: '#ccc',
+ description: 'HEX color of spinner',
+ options: 'HEX color'
+ },
+ {
+ name: 'strokeWidth',
+ type: 'string',
+ default: '#ccc',
+ description: 'Width of spinner stroke',
+ options: 'CSS measure'
+ },
+];
diff --git a/src/app/components/loader/loaderdemo-routing.module.ts b/src/app/components/loader/loaderdemo-routing.module.ts
new file mode 100644
index 000000000..1f8f26543
--- /dev/null
+++ b/src/app/components/loader/loaderdemo-routing.module.ts
@@ -0,0 +1,37 @@
+/*
+MIT License
+
+Copyright (c) 2018 Temainfo Software
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import { NgModule } from '@angular/core';
+import { RouterModule } from '@angular/router';
+import { LoaderDemoComponent } from './loaderdemo.component';
+
+@NgModule({
+ imports: [
+ RouterModule.forChild( [
+ { path: '', component: LoaderDemoComponent }
+ ])
+ ],
+ exports: [
+ RouterModule
+ ]
+})
+export class LoaderDemoRoutingModule {}
diff --git a/src/app/components/loader/loaderdemo.component.html b/src/app/components/loader/loaderdemo.component.html
new file mode 100644
index 000000000..41da4507d
--- /dev/null
+++ b/src/app/components/loader/loaderdemo.component.html
@@ -0,0 +1,42 @@
+
+
+ The Truly-UI Loader are styles for actions in forms, dialogs, and more with support for multiple sizes, states
+ and many properties for customization
+
+
+
+
+
+
+
+
Basic
+
+
+
+
+
+
+
Stroke Width
+
+
+
+
+
+
+
Custom Color
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/components/loader/loaderdemo.component.scss b/src/app/components/loader/loaderdemo.component.scss
new file mode 100644
index 000000000..beeb60214
--- /dev/null
+++ b/src/app/components/loader/loaderdemo.component.scss
@@ -0,0 +1,4 @@
+.loader-box {
+ width: 100px;
+ height: 100px;
+}
diff --git a/src/app/components/loader/loaderdemo.component.ts b/src/app/components/loader/loaderdemo.component.ts
new file mode 100644
index 000000000..f65f8b788
--- /dev/null
+++ b/src/app/components/loader/loaderdemo.component.ts
@@ -0,0 +1,43 @@
+/*
+ MIT License
+
+ Copyright (c) 2018 Temainfo Software
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+import { Component } from '@angular/core';
+
+import * as json from './loaderdemo-dataproperties.json';
+import * as jsonEvts from './loaderdemo.dataevents.json';
+
+@Component( {
+selector : 'app-loader',
+templateUrl : './loaderdemo.component.html',
+styleUrls : [ './loaderdemo.component.scss' ],
+} )
+export class LoaderDemoComponent {
+
+ public dataTableProperties;
+
+ public dataEvents;
+
+ constructor() {
+ this.dataTableProperties = json.dataProperties;
+ this.dataEvents = jsonEvts.dataEvents;
+ }
+}
+
diff --git a/src/app/components/loader/loaderdemo.dataevents.json.ts b/src/app/components/loader/loaderdemo.dataevents.json.ts
new file mode 100644
index 000000000..8b207f93c
--- /dev/null
+++ b/src/app/components/loader/loaderdemo.dataevents.json.ts
@@ -0,0 +1,33 @@
+/*
+ MIT License
+
+ Copyright (c) 2018 Temainfo Software
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+export const dataEvents = [
+ {
+ name: 'selected',
+ parameters: [
+ {
+ event: 'selected',
+ description: 'Action Selected'
+ }
+ ],
+ description: 'Callback to invoke when toogle event.',
+ },
+];
diff --git a/src/app/components/loader/loaderdemo.module.ts b/src/app/components/loader/loaderdemo.module.ts
new file mode 100644
index 000000000..77da48292
--- /dev/null
+++ b/src/app/components/loader/loaderdemo.module.ts
@@ -0,0 +1,34 @@
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { NgModule } from '@angular/core';
+
+import { HighlightJsModule } from 'ngx-highlight-js';
+
+import { LoaderDemoRoutingModule } from './loaderdemo-routing.module';
+import { LoaderDemoComponent } from './loaderdemo.component';
+import { LoaderModule } from '../../../../projects/truly-ui/src/components/loader';
+import { ShowcaseCardModule } from '../../shared/components/showcase-card/showcase-card.module';
+import { ShowcaseTablePropertiesModule } from '../../shared/components/showcase-table-properties/showcase-table-properties.module';
+import { ShowcaseTableEventsModule } from '../../shared/components/showcase-table-events/showcase-table-events.module';
+import { ShowcaseHeaderModule } from '../../shared/components/showcase-header/showcase-header.module';
+
+@NgModule({
+ declarations: [
+ LoaderDemoComponent
+ ],
+ imports: [
+ LoaderDemoRoutingModule,
+ LoaderModule,
+ CommonModule,
+ FormsModule,
+ HighlightJsModule,
+ ShowcaseCardModule,
+ ShowcaseTablePropertiesModule,
+ ShowcaseTableEventsModule,
+ ShowcaseHeaderModule
+ ],
+ exports: [
+ LoaderDemoComponent
+ ]
+})
+export class LoaderDemoModule {}
diff --git a/src/app/components/progressbar/progressbardemo-dataproperties.json.ts b/src/app/components/progressbar/progressbardemo-dataproperties.json.ts
index 56bf4e175..b411bc0f6 100644
--- a/src/app/components/progressbar/progressbardemo-dataproperties.json.ts
+++ b/src/app/components/progressbar/progressbardemo-dataproperties.json.ts
@@ -62,6 +62,13 @@ export const dataProperties = [
description: 'Type of info shown.',
options: 'percentage | detailed | none'
},
+ {
+ name: 'shape',
+ type: 'string',
+ default: 'default',
+ description: 'Shape of progress bar, default or rounded',
+ options: 'default | rounded'
+ },
{
name: 'mode',
type: 'string',
diff --git a/src/app/components/schedule/overview/scheduledemo-overview.component.html b/src/app/components/schedule/overview/scheduledemo-overview.component.html
index 6591ccf10..5afa2b399 100644
--- a/src/app/components/schedule/overview/scheduledemo-overview.component.html
+++ b/src/app/components/schedule/overview/scheduledemo-overview.component.html
@@ -13,14 +13,14 @@
Basic
diff --git a/src/app/components/schedule/overview/scheduledemo-overview.component.ts b/src/app/components/schedule/overview/scheduledemo-overview.component.ts
index cc1f6b0fc..576b9ee98 100644
--- a/src/app/components/schedule/overview/scheduledemo-overview.component.ts
+++ b/src/app/components/schedule/overview/scheduledemo-overview.component.ts
@@ -19,10 +19,12 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
-import { Component, ChangeDetectorRef } from '@angular/core';
+import { Component, ChangeDetectorRef, Input } from '@angular/core';
import * as json from './scheduledemo-overview-dataproperties.json';
import * as jsonEvts from './scheduledemo-overview.dataevents.json';
+import { SlotSettingsType } from '../../../../../projects/truly-ui/src/components/schedule/types/slot-settings.type';
+import { WorkScaleType } from '../../../../../projects/truly-ui/src/components/schedule/types/work-scale.type';
@Component( {
selector : 'app-schedule',
@@ -31,18 +33,19 @@ import * as jsonEvts from './scheduledemo-overview.dataevents.json';
} )
export class ScheduleDemoOverviewComponent {
+ public slotSettings: SlotSettingsType = new SlotSettingsType( 2, 40);
+
+ public workScale: WorkScaleType | WorkScaleType[] = new WorkScaleType( '08:00', '18:00', 30 );
+
public dataTableProperties;
public dataEvents;
public dataSource = [];
- public statusConfig = {
- attended : { status : 'attended', color : '#90ED5D', description : 'Attended' },
- missed: { status : 'missed', color : '#FF385C', description : 'Missed' },
- notmet: { status : 'notmet', color : '#1d8bff', description : 'Not Met' }
- };
+ public statusConfig = {};
+ // public data = [];
public data = [
{
value: '1',
@@ -50,7 +53,7 @@ export class ScheduleDemoOverviewComponent {
detail: 'Consulta | Particular',
status: 'missed',
allday: false,
- date: { start: new Date().getTime() - 3600000 , end: new Date().getTime() - 1800000}
+ date: { start: new Date(new Date().setHours(8, 0)).getTime() , end: new Date( new Date().setHours(8, 30) ).getTime() }
},
{
value: '2',
@@ -58,7 +61,7 @@ export class ScheduleDemoOverviewComponent {
detail: 'Consulta | Particular',
status: 'attended',
allday: false,
- date: { start: new Date().getTime() , end: new Date().getTime() + 1800000 }
+ date: { start: new Date(new Date().setHours(8, 30)).getTime() , end: new Date(new Date().setHours(9, 0 )).getTime() }
},
{
value: '3',
@@ -66,7 +69,7 @@ export class ScheduleDemoOverviewComponent {
detail: 'Consulta | Particular',
allday: false,
status: 'attended',
- date: { start: new Date().getTime() , end: new Date().getTime() + 1800000 }
+ date: { start: new Date(new Date().setHours(9, 0)).getTime() , end: new Date(new Date().setHours(9, 30 )).getTime() }
},
{
value: '4',
@@ -74,16 +77,16 @@ export class ScheduleDemoOverviewComponent {
detail: 'Consulta | Unimed',
allday: false,
status: 'missed',
- date: { start: new Date().getTime() - 1800000 , end: new Date().getTime() + 1800000 }
- },
- {
- value: '5',
- title: 'Jerson Algo - 5',
- detail: 'Consulta | Unimed',
- allday: false,
- status: 'attended',
- date: { start: new Date().getTime() - 1800000 , end: new Date().getTime() + 1800000 }
+ date: { start: new Date(new Date().setHours(8, 30)).getTime() , end: new Date(new Date().setHours(9, 30 )).getTime() }
},
+ // {
+ // value: '5',
+ // title: 'Jerson Algo - 5',
+ // detail: 'Consulta | Unimed',
+ // allday: false,
+ // status: 'attended',
+ // date: { start: new Date(new Date().setHours(9, 30)).getTime() , end: new Date(new Date().setHours(10, 0 )).getTime() }
+ // },
{
value: '6',
title: 'Maicon Aguera - 6',
@@ -186,7 +189,7 @@ export class ScheduleDemoOverviewComponent {
detail: 'Consulta | Copel',
allday: false,
status: 'attended',
- date: { start: new Date().getTime() + 5400000 , end: new Date().getTime() + 10800000 }
+ date: { start: new Date(new Date().setHours(13, 30)).getTime() , end: new Date(new Date().setHours(14, 0 )).getTime() }
},
{
value: '19',
@@ -194,8 +197,32 @@ export class ScheduleDemoOverviewComponent {
detail: 'Consulta | Copel',
allday: false,
status: 'notmet',
- date: { start: new Date().getTime() + 5400000 , end: new Date().getTime() + 7200000 }
- }
+ date: { start: new Date(new Date().setHours(13, 30)).getTime() , end: new Date(new Date().setHours(14, 0)).getTime() }
+ },
+ {
+ value: '20',
+ title: 'Jaisson Buccio - 20',
+ detail: 'Consulta | Copel',
+ allday: false,
+ status: 'attended',
+ date: { start: new Date(new Date().setHours(14, 0)).getTime() , end: new Date(new Date().setHours(14, 30 )).getTime() }
+ },
+ {
+ value: '21',
+ title: 'Jaisson Buccio - 21',
+ detail: 'Consulta | Copel',
+ allday: false,
+ status: 'notmet',
+ date: { start: new Date(new Date().setHours(14, 0)).getTime() , end: new Date(new Date().setHours(14, 30)).getTime() }
+ },
+ {
+ value: '22',
+ title: 'Jaisson Buccio - 22',
+ detail: 'Consulta | Copel',
+ allday: false,
+ status: 'notmet',
+ date: { start: new Date(new Date().setHours(14, 30)).getTime() , end: new Date(new Date().setHours(15, 0)).getTime() }
+ }
];
constructor( private change: ChangeDetectorRef ) {
@@ -203,6 +230,15 @@ export class ScheduleDemoOverviewComponent {
this.dataEvents = jsonEvts.dataEvents;
setTimeout(() => {
+
+ this.getWorkScale().then(( workScale: WorkScaleType | WorkScaleType[] ) => {
+ this.workScale = workScale;
+ });
+
+ this.getStatusConfig().then(( statusConfig ) => {
+ this.statusConfig = statusConfig;
+ });
+
this.getDataSource()
.then((data: Array) => {
this.dataSource = data;
@@ -211,12 +247,46 @@ export class ScheduleDemoOverviewComponent {
}, 3000);
}
+ getStatusConfig() {
+ return new Promise((resolve) => {
+ resolve( {
+ attended : { status : 'attended', color : '#90ED5D', description : 'Attended' },
+ missed: { status : 'missed', color : '#FF385C', description : 'Missed' },
+ notmet: { status : 'notmet', color : '#1d8bff', description : 'Not Met' }
+ } );
+ });
+ }
+
+
+ getWorkScale() {
+ return new Promise((resolve) => {
+ resolve( new WorkScaleType( '08:00', '18:00', 30 ) );
+ });
+ }
+
getDataSource() {
return new Promise((resolve) => {
resolve(this.data);
});
}
+ onNewEventClick( event ) {
+ const id = Math.floor((Math.random() * 100) + 1).toString(10);
+ this.dataSource = [...this.dataSource, {
+ value: id,
+ title: 'William Aguera - ' + id,
+ detail: 'Consulta | Particular',
+ status: 'missed',
+ allday: false,
+ date: {
+ start: new Date(new Date().setHours(14, 30)).getTime() ,
+ end: new Date( new Date().setHours(15, 0) ).getTime()
+ }
+ }];
+
+ console.log( 'NEW DATA: ', this.dataSource);
+ }
+
onEventDbClick( event ) {
console.log('EVENT CLICK: ', event);
}
diff --git a/src/app/components/time-available-picker/time-available-pickerdemo-dataproperties.json.ts b/src/app/components/time-available-picker/time-available-pickerdemo-dataproperties.json.ts
index f2c163592..fc7e08646 100644
--- a/src/app/components/time-available-picker/time-available-pickerdemo-dataproperties.json.ts
+++ b/src/app/components/time-available-picker/time-available-pickerdemo-dataproperties.json.ts
@@ -22,10 +22,17 @@
export const dataProperties = [
{
name: 'availableTimes',
- type: 'Array',
+ type: 'Array',
default: 'null',
description: 'Array of available times.',
- options: 'Array'
+ options: 'Array'
+ },
+ {
+ name: 'width',
+ type: 'number',
+ default: '300',
+ description: 'The Box width.',
+ options: 'number pixels'
},
{
name: 'color',
@@ -43,9 +50,9 @@ export const dataProperties = [
},
{
name: 'value',
- type: 'Array',
+ type: 'Array',
default: 'null',
description: 'Value of selected times',
- options: 'Array'
+ options: 'Array'
},
];
diff --git a/src/app/components/time-available-picker/time-available-pickerdemo.component.ts b/src/app/components/time-available-picker/time-available-pickerdemo.component.ts
index 58069b5f4..6bc77794f 100644
--- a/src/app/components/time-available-picker/time-available-pickerdemo.component.ts
+++ b/src/app/components/time-available-picker/time-available-pickerdemo.component.ts
@@ -36,21 +36,41 @@ export class TimeAvailablePickerDemoComponent {
public dataEvents;
public data = [
- new Date( 1999, 1, 1, 10, 45 ),
- new Date( 1999, 1, 1, 8, 32 ),
- new Date( 1999, 1, 1, 14, 10 ),
- new Date( 1999, 1, 1, 20, 30 ),
- new Date( 1999, 1, 1, 19, 17 ),
- new Date( 1999, 1, 1, 18, 15 ),
- new Date( 1999, 1, 1, 18, 35 ),
- new Date( 1999, 1, 1, 19, 0 ),
- new Date( 1999, 1, 1, 14, 30 ),
- new Date( 1999, 1, 1, 16, 30 ),
+ {
+ start: new Date( 1999, 1, 1, 8, 0 ),
+ end: new Date( 1999, 1, 1, 8, 30 ),
+ },
+ {
+ start: new Date( 1999, 1, 1, 8, 30 ),
+ end: new Date( 1999, 1, 1, 9, 0 ),
+ },
+ {
+ start: new Date( 1999, 1, 1, 9, 0 ),
+ end: new Date( 1999, 1, 1, 9, 30 ),
+ },
+ {
+ start: new Date( 1999, 1, 1, 9, 30 ),
+ end: new Date( 1999, 1, 1, 10, 0 ),
+ },
+ {
+ start: new Date( 1999, 1, 1, 10, 0 ),
+ end: new Date( 1999, 1, 1, 10, 30 ),
+ },
+ {
+ start: new Date( 1999, 1, 1, 10, 30 ),
+ end: new Date( 1999, 1, 1, 11, 0 ),
+ },
+ {
+ start: new Date( 1999, 1, 1, 11, 0 ),
+ end: new Date( 1999, 1, 1, 11, 30 ),
+ },
];
public value = [
- new Date( 1999, 1, 1, 19, 17 ),
- new Date( 1999, 1, 1, 18, 15 ),
+ {
+ start: new Date( 1999, 1, 1, 11, 0 ),
+ end: new Date( 1999, 1, 1, 11, 30 ),
+ },
];
constructor() {
diff --git a/src/app/components/tooltip/tooltipdemo-dataproperties.json.ts b/src/app/components/tooltip/tooltipdemo-dataproperties.json.ts
index 3ba025ecb..bbf593f89 100644
--- a/src/app/components/tooltip/tooltipdemo-dataproperties.json.ts
+++ b/src/app/components/tooltip/tooltipdemo-dataproperties.json.ts
@@ -19,12 +19,12 @@ export const data = [
type: 'string',
default: 'left',
description: 'Position place of the Tooltip',
- options: 'top | right | bottom | left'
+ options: 'left-top | left-center | left-bottom | right-top | right-center | right-bottom | top-center | bottom-center'
},
{
name: 'tooltip.color',
type: 'string',
- default: '#000',
+ default: '#242525',
description: 'Hex Color for background color',
options: 'Hex | RGBA'
},
diff --git a/src/app/components/tooltip/tooltipdemo.component.html b/src/app/components/tooltip/tooltipdemo.component.html
index 0a3c0d435..ef4c29a51 100644
--- a/src/app/components/tooltip/tooltipdemo.component.html
+++ b/src/app/components/tooltip/tooltipdemo.component.html
@@ -9,56 +9,54 @@