Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mikerodonnell89 committed Jun 18, 2019
2 parents 6ef95ed + 479b2ee commit 01be2ab
Show file tree
Hide file tree
Showing 16 changed files with 431 additions and 118 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="0.5.3-rc.41"></a>
## [0.5.3-rc.41](https://github.com/SAP/fundamental-ngx/compare/v0.5.3-rc.40...v0.5.3-rc.41) (2019-06-18)


### Bug Fixes

* paging error is now a devmode warning ([#942](https://github.com/SAP/fundamental-ngx/issues/942)) ([41e01f1](https://github.com/SAP/fundamental-ngx/commit/41e01f1))



<a name="0.5.3-rc.40"></a>
## [0.5.3-rc.40](https://github.com/SAP/fundamental-ngx/compare/v0.5.3-rc.39...v0.5.3-rc.40) (2019-06-18)


### Bug Fixes

* Add timepicker formating following datepicker ([#894](https://github.com/SAP/fundamental-ngx/issues/894)) ([f417a5b](https://github.com/SAP/fundamental-ngx/commit/f417a5b))



<a name="0.5.3-rc.39"></a>
## [0.5.3-rc.39](https://github.com/SAP/fundamental-ngx/compare/v0.5.3-rc.38...v0.5.3-rc.39) (2019-06-18)



<a name="0.5.3-rc.38"></a>
## [0.5.3-rc.38](https://github.com/SAP/fundamental-ngx/compare/v0.5.3-rc.37...v0.5.3-rc.38) (2019-06-17)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<form [formGroup]="customForm">
<ul fd-list>
<li fd-list-item>
<fd-list-checkbox formControlName="listItem1">List Item 1</fd-list-checkbox>
</li>
<li fd-list-item>
<fd-list-checkbox formControlName="listItem2">List Item 2</fd-list-checkbox>
</li>
<li fd-list-item>
<fd-list-checkbox formControlName="listItem3">List Item 3</fd-list-checkbox>
</li>
<li fd-list-item>
<fd-list-checkbox formControlName="listItem4">List Item 4</fd-list-checkbox>
</li>
</ul>
</form>
<br />

List Item 1: {{ customForm.controls.listItem1.value }} <br />
List Item 2: {{ customForm.controls.listItem2.value }} <br />
List Item 3: {{ customForm.controls.listItem3.value }} <br />
List Item 4: {{ customForm.controls.listItem4.value }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';

@Component({
selector: 'fd-list-checkbox-form-example',
templateUrl: './list-checkbox-form-example.component.html'
})
export class ListCheckboxFormExampleComponent {
customForm = new FormGroup({
listItem1: new FormControl(false),
listItem2: new FormControl(false),
listItem3: new FormControl(false),
listItem4: new FormControl(false)
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ <h2>Action List</h2>
<separator></separator>

<h2>Single Select List</h2>
<description>Some lists may require the user to only select one item. In those cases, a radio button is the best-fitting input. There is no formal support for this feature, though an example on how to accomplish it is provided below.</description>
<description>Some lists may require the user to only select one item. In those cases, a radio button is the best-fitting
input. There is no formal support for this feature, though an example on how to accomplish it is provided below.
</description>
<component-example [name]="'ex3'">
<fd-single-select-example></fd-single-select-example>
<fd-single-select-example></fd-single-select-example>
</component-example>
<code-example [code]="listSingleSelectHtml" [language]="'HTML'"></code-example>
<code-example [code]="listSingleSelectTs" [language]="'typescript'"></code-example>
Expand All @@ -36,9 +38,21 @@ <h2>Checkbox List</h2>
<separator></separator>

<h2>Infinite Scroll List</h2>
<description>It is possible to implement an infinite scroll function using the fdInfiniteScroll directive. It allows you to load more data as the user scrolls down the parent element. It is important to remember that the <code>InfiniteScrollModule</code> is required for this feature.</description>
<description>It is possible to implement an infinite scroll function using the fdInfiniteScroll directive. It allows you
to load more data as the user scrolls down the parent element. It is important to remember that the
<code>InfiniteScrollModule</code> is required for this feature.</description>
<component-example [name]="'ex5'">
<fd-list-infinite-scroll-example></fd-list-infinite-scroll-example>
<fd-list-infinite-scroll-example></fd-list-infinite-scroll-example>
</component-example>
<code-example [code]="infiniteScrollCodeHTML" [language]="'HTML'"></code-example>
<code-example [code]="infiniteScrollCodeTS" [language]="'typescript'"></code-example>

<separator></separator>

<h2>Checkbox List in Form</h2>
<description>It is possible to use the fd-list-checkbox component within Angular Reactive Forms</description>
<component-example [name]="'ex6'">
<fd-list-checkbox-form-example></fd-list-checkbox-form-example>
</component-example>
<code-example [code]="listCheckboxFormHtml" [language]="'HTML'"></code-example>
<code-example [code]="listCheckboxFormTs" [language]="'typescript'"></code-example>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import * as infiniteScrollSrcHtml from '!raw-loader!./examples/list-infinite-scr
import * as infiniteScrollSrcTs from '!raw-loader!./examples/list-infinite-scroll-example.component.ts';
import * as listSingleHtml from '!raw-loader!./examples/list-single-select-example.component.html';
import * as listSingleTs from '!raw-loader!./examples/list-single-select-example.component.ts';
import * as listCheckboxFormHtmlSrc from '!raw-loader!./examples/list-checkbox-form-example.component.html';
import * as listCheckboxFormTsSrc from '!raw-loader!./examples/list-checkbox-form-example.component.ts';

@Component({
selector: 'app-list',
Expand Down Expand Up @@ -690,6 +692,12 @@ export class ListDocsComponent implements OnInit {

infiniteScrollCodeTS = infiniteScrollSrcTs;

listCheckboxFormHtml = listCheckboxFormHtmlSrc;

listCheckboxFormTs = listCheckboxFormTsSrc;



constructor(private schemaFactory: SchemaFactoryService) {
this.schema = this.schemaFactory.getComponent('list');
}
Expand All @@ -698,5 +706,5 @@ export class ListDocsComponent implements OnInit {
this.data = data;
}

ngOnInit() {}
ngOnInit() { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<fd-time-picker [allowNull]="false"
[(ngModel)]="timeObject"></fd-time-picker>
<br />
Selected Time: {{timeObject.hour}}h {{timeObject.minute}}m {{timeObject.second}}s
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import { Component, Injectable } from '@angular/core';
import { TimeFormatParser } from '../../../../../../library/src/lib/time-picker/format/time-parser';
import { TimeObject } from '../../../../../../library/src/lib/time/time-object';


@Injectable()
export class TimeFormatDashes extends TimeFormatParser {

public parse(value: string, displaySeconds: boolean = true, meridian?: boolean): TimeObject {
const time = new TimeObject();
let regexp;
if (!meridian) {
if (displaySeconds) {
regexp = new RegExp(
'\^([0-1]?[0-9]|2[0-3])' +
'h' +
'([0-5][0-9])(' +
'm' +
'[0-5][0-9])' +
's\$'
);
} else {
regexp = new RegExp('\^([0-1]?[0-9]|2[0-3])' +
'h' +
'([0-5][0-9])(' +
'm\$'
);
}
if (regexp.test(value)) {
const minutes = value.split('h')[1].split('m')[0];
time.hour = parseInt(value.split('h')[0], 10);
time.minute = parseInt(minutes, 10);
if (displaySeconds) {
time.second = parseInt(value.split('m')[1], 10);
}
return time;
} else {
return null;
}
} else if (meridian) {
if (displaySeconds) {


regexp = new RegExp(
'\^([0-1]?[0-9]|2[0-3])' +
'h' +
'([0-5][0-9])(' +
'm' +
'[0-5][0-9])' +
's' +
' [APap][mM]\$'
);
} else {
regexp = new RegExp('\^([0-1]?[0-9]|2[0-3])' +
'h' +
'([0-5][0-9])(' +
'm' +
' [APap][mM]\$'
);
}
if (regexp.test(value)) {
const period = value.split(' ')[1];
const _time = value.split(' ')[0];

const minutes = _time.split('h')[1].split('m')[0];
time.hour = parseInt(_time.split('h')[0], 10);
time.minute = parseInt(minutes, 10);
if (displaySeconds) {
time.second = parseInt(_time.split('m')[1], 10);
}
if (( period === 'pm' || period === 'PM' ) && time.hour < 12) {
time.hour = time.hour + 12;
} else if ( (period === 'am' || period === 'AM') && time.hour === 12 ) {
time.hour = 0;
}
return time;
} else {
return null;
}
}
}

/**
* Takes in a time object and returns the string representation.
* @param time TimeObject to convert to a string.
* @param meridian boolean to define if TimeObject should be treated as a meridian.
*/
public format(time: TimeObject, meridian?: boolean): string {
let formattedHour, formattedMinute, formattedSecond;
let formattedTime;
let formattedMeridian;
if (time.hour !== null) {
if (meridian) {
if (time.hour === 0) {
formattedHour = 12;
formattedMeridian = 'am';
} else if (time.hour > 12) {
formattedHour = time.hour - 12;
formattedMeridian = 'pm';
} else if (time.hour === 12) {
formattedHour = 12;
formattedMeridian = 'pm';
} else {
formattedHour = time.hour;
formattedMeridian = 'am';
}
} else {
formattedHour = time.hour;
}
}
if (time.minute !== null) {
formattedMinute = time.minute < 10 ? '0' + time.minute : time.minute;
}

if (time.second !== null) {
formattedSecond = time.second < 10 ? '0' + time.second : time.second;
}
if (formattedHour || formattedHour === 0) {
formattedTime = formattedHour + 'h';
if (formattedMinute || formattedMinute === '00') {
formattedTime = formattedTime + formattedMinute + 'm';
if (formattedSecond || formattedSecond === '00') {
formattedTime = formattedTime + formattedSecond + 's';
}
}
}
if (formattedMeridian && formattedTime) {
formattedTime += ' ' + formattedMeridian
}

return formattedTime;
}
}


@Component({
selector: 'fd-time-picker-other-delimiter-example',
templateUrl: './time-picker-other-delimiter-example.component.html',
providers: [
{
provide: TimeFormatParser,
useClass: TimeFormatDashes
}
]
})
export class TimePickerOtherDelimiterExampleComponent {
timeObject = { hour: 12, minute: 0, second: 0 };
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,20 @@ <h2>Null Validity</h2>
</component-example>
<code-example [code]="nullTimePickerHtml" [language]="'HTML'"></code-example>

<separator></separator>
<h2>Formating</h2>
<description>Providing a custom format for time is possible through providing service</description>
<component-example [name]="'ex7'">
<fd-time-picker-other-delimiter-example></fd-time-picker-other-delimiter-example>
</component-example>
<code-example [code]="otherFormatTimePickerHtml" [language]="'HTML'"></code-example>
<code-example [code]="otherFormatTimePickerTs" [language]="'typescript'"></code-example>

<separator></separator>
<h2>Time Picker in Form</h2>
<description>The time-picker component may also be used together with Angular reactive forms.</description>
<component-example [name]="'ex7'">
<fd-time-picker-form-example></fd-time-picker-form-example>
</component-example>
<code-example [code]="timePickerFormHtml" [language]="'HTML'"></code-example>
<code-example [code]="timePickerFormTs" [language]="'Typescript'"></code-example>
<code-example [code]="timePickerFormTs" [language]="'Typescript'"></code-example>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import * as timePickerDisabledSrc from '!raw-loader!./examples/time-picker-disab
import * as timePickerNoSecondsSrc from '!raw-loader!./examples/time-picker-no-seconds-example.component.html';
import * as timePickerCompactSrc from '!raw-loader!./examples/time-picker-compact-example.component.html';
import * as timePickerNullSrc from '!raw-loader!./examples/time-picker-allow-null-example.component.html';
import * as timePickerOtherDelimiterSrc from '!raw-loader!./examples/time-picker-other-delimiter-example.component.html';
import * as timePickerOtherDelimiterTsSrc from '!raw-loader!./examples/time-picker-other-delimiter-example.component.ts';
import * as timePickerFormHtmlSrc from '!raw-loader!./examples/time-picker-form-example.component.html';
import * as timePickerFormTsSrc from '!raw-loader!./examples/time-picker-form-example.component.ts'
import * as timePickerFormTsSrc from '!raw-loader!./examples/time-picker-form-example.component.ts';

@Component({
selector: 'app-time-picker',
Expand All @@ -20,6 +22,9 @@ export class TimePickerDocsComponent {
disabledTimePickerHtml = timePickerDisabledSrc;
compactTimePickerHtml = timePickerCompactSrc;
nullTimePickerHtml = timePickerNullSrc;
otherFormatTimePickerHtml = timePickerOtherDelimiterSrc;
otherFormatTimePickerTs = timePickerOtherDelimiterTsSrc;

timePickerFormHtml = timePickerFormHtmlSrc;
timePickerFormTs = timePickerFormTsSrc;

Expand Down
8 changes: 6 additions & 2 deletions docs/app/documentation/documentation.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ import {
TimePickerDisabledExampleComponent,
TimePickerNoSecondsExampleComponent,
TimePickerCompactExampleComponent,
TimePickerAllowNullExampleComponent
TimePickerAllowNullExampleComponent,

} from './component-docs/time-picker/examples/time-picker-examples.component';
import { TimePickerFormExampleComponent } from './component-docs/time-picker/examples/time-picker-form-example.component';
import { ToggleDocsComponent } from './component-docs/toggle/toggle-docs.component';
Expand All @@ -211,6 +212,7 @@ import { DisabledToggleExampleComponent } from './component-docs/toggle/examples
import { ToggleBindingExampleComponent } from './component-docs/toggle/examples/toggle-binding-example/toggle-binding-example.component';
import { ToggleFormsExampleComponent } from './component-docs/toggle/examples/toggle-form-example/toggle-forms-example.component';
import { ListInfiniteScrollExampleComponent } from './component-docs/list/examples/list-infinite-scroll-example.component';
import { ListCheckboxFormExampleComponent } from './component-docs/list/examples/list-checkbox-form-example.component';
import { DropdownInfiniteScrollExampleComponent } from './component-docs/dropdown/examples/dropdown-infinite-scroll-example.component';
import { ModalInModalComponent } from './component-docs/modal/examples/stackable-modals/modal-in-modal.component';
import { ModalInModalSecondComponent } from './component-docs/modal/examples/stackable-modals/modal-in-modal-second.component';
Expand Down Expand Up @@ -321,9 +323,9 @@ import { DatePickerAllowNullExampleComponent } from './component-docs/date-picke
import { TimeFormExampleComponent } from './component-docs/time/examples/time-form-example.component';
import { TableResponsiveExampleComponent } from './component-docs/table/examples/table-responsive-example.component';
import { DatePickerPositionExampleComponent } from './component-docs/date-picker/examples/date-picker-position-example.component';
import { TimePickerOtherDelimiterExampleComponent } from './component-docs/time-picker/examples/time-picker-other-delimiter-example.component';
import { DatetimeFormatExampleComponent } from './component-docs/datetime-picker/examples/datetime-format-example/datetime-format-example.component';


export function highlightJsFactory() {
return hljs;
}
Expand Down Expand Up @@ -452,6 +454,7 @@ export function highlightJsFactory() {
ListCheckboxExampleComponent,
ListExampleComponent,
ListInfiniteScrollExampleComponent,
ListCheckboxFormExampleComponent,
ListSingleSelectExampleComponent,
MenuExampleComponent,
MenuGroupExampleComponent,
Expand Down Expand Up @@ -521,6 +524,7 @@ export function highlightJsFactory() {
TimePickerDisabledExampleComponent,
TimePickerNoSecondsExampleComponent,
TimePickerCompactExampleComponent,
TimePickerOtherDelimiterExampleComponent,
TimePickerAllowNullExampleComponent,
TimePickerFormExampleComponent,
ComboboxInputDocsComponent,
Expand Down
2 changes: 1 addition & 1 deletion library/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fundamental-ngx",
"version": "0.5.3-rc.38",
"version": "0.5.3-rc.41",
"description": "SAP Fiori Fundamentals, implemented in Angular",
"license": "Apache-2.0",
"homepage": "https://sap.github.io/fundamental-ngx/home",
Expand Down

0 comments on commit 01be2ab

Please sign in to comment.