Skip to content

Commit

Permalink
Merge branch 'development' into fix-typeahead-accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloff200 committed Jan 14, 2020
2 parents 86b32a0 + 243d3b8 commit 19c6fcd
Show file tree
Hide file tree
Showing 24 changed files with 510 additions and 33 deletions.
20 changes: 20 additions & 0 deletions cypress/full/popover_page_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,24 @@ describe('Popover demo page test suite', () => {
popover.isPopoverDismiss(popoverContext);
});
});

describe('Popover with delay', () => {
const delayPopover = popover.exampleDemosArr.delayPopover;
it('when user clicks on "Popover with 0.5sec delay", then popover-container appear', () => {
cy.viewport(1440, 900);
popover.clickOnDemoMenu('Popover with delay');
popover.clickOnBtn(delayPopover);
popover.isPopoverAppears(delayPopover);
popover.isPopoverVisible(delayPopover);
});

it('when user clicks on "Popover with 0.5sec delay" again, then popover-container disappeared', () => {
cy.viewport(1440, 900);
popover.clickOnDemoMenu('Popover with delay');
popover.clickOnBtn(delayPopover);
popover.isPopoverAppears(delayPopover);
popover.clickOnBtn(delayPopover);
popover.isPopoverDismiss(delayPopover);
});
});
});
3 changes: 2 additions & 1 deletion cypress/support/popover.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class PopoverPo extends BaseComponent {
triggerIsOpen: 'demo-popover-trigger-by-isopen',
componentLevelStyling: 'demo-popover-styling-local',
customClass: 'demo-popover-class',
popoverContext: 'demo-popover-context'
popoverContext: 'demo-popover-context',
delayPopover: 'demo-popover-delay'
};

isPopoverPlacementCorrect(baseSelector: string, placement: string) {
Expand Down
8 changes: 7 additions & 1 deletion demo/src/app/common/discover/discover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class DiscoverComponent {
link: 'https://www.lumeer.io/'
},
{
logo: 'https://user-images.githubusercontent.com/663563/57700709-ceca2800-765a-11e9-9484-a7a9bb1e6485.png',
logo: 'https://user-images.githubusercontent.com/663563/70622944-3eb68600-1c1d-11ea-82d3-7ccbd75befe8.png',
name: 'Sustainablebuildings',
description: 'SaaS product that give users insight in their power, gas consumption and other data',
link: 'https://sustainablebuildings.nl'
Expand Down Expand Up @@ -46,6 +46,12 @@ export class DiscoverComponent {
name: 'DeveloperHub',
description: 'DeveloperHub.io - Hosted Documentation Portals for Product And API Docs',
link: 'https://developerhub.io'
},
{
logo: 'https://i.ytimg.com/vi/Em6PAkViyU4/maxresdefault.jpg',
name: 'Trovimap',
description: 'Trovimap - Houses / Apartments / Locals for sale or rent',
link: 'https://trovimap.com/'
}
];
}
4 changes: 2 additions & 2 deletions demo/src/app/components/+datepicker/demo-datepicker.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { BsDatepickerModule, DatepickerModule } from 'ngx-bootstrap/datepicker';

import {
arLocale, bgLocale, caLocale, csLocale, daLocale, deLocale, enGbLocale, esDoLocale, esLocale, esUsLocale, etLocale, frLocale, heLocale,
hiLocale, hrLocale, fiLocale, glLocale, huLocale, idLocale, itLocale, jaLocale, koLocale, ltLocale, lvLocale, mnLocale, nbLocale,
hiLocale, hrLocale, fiLocale, glLocale, huLocale, idLocale, itLocale, jaLocale, kaLocale, koLocale, ltLocale, lvLocale, mnLocale, nbLocale,
nlBeLocale, nlLocale, plLocale, ptBrLocale, ruLocale, roLocale, skLocale, slLocale, svLocale, thLocale, trLocale, viLocale,
zhCnLocale, ukLocale
} from 'ngx-bootstrap/locale';
Expand All @@ -22,7 +22,7 @@ import { DEMO_COMPONENTS } from './demos';

const locales = [
arLocale, bgLocale, caLocale, csLocale, daLocale, deLocale, enGbLocale, esDoLocale, esLocale, esUsLocale, etLocale, frLocale,
heLocale, hiLocale, hrLocale, fiLocale, glLocale, huLocale, idLocale, itLocale, jaLocale, koLocale, ltLocale, lvLocale, mnLocale,
heLocale, hiLocale, hrLocale, fiLocale, glLocale, huLocale, idLocale, itLocale, jaLocale, kaLocale, koLocale, ltLocale, lvLocale, mnLocale,
nbLocale, nlBeLocale, nlLocale, plLocale, ptBrLocale, ruLocale, roLocale, skLocale, slLocale, svLocale, thLocale,
trLocale, ukLocale, viLocale, zhCnLocale
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
formControlName="dateRange"
#daterangepicker="bsDaterangepicker"
bsDaterangepicker
[bsConfig]="{ rangeInputFormat: 'MMMM Do YYYY, h:mm:ss a' }">
[bsConfig]="{ rangeInputFormat : 'MMMM Do YYYY, h:mm:ss a', dateInputFormat: 'MMMM Do YYYY, h:mm:ss a', showWeekNumbers: false }">
</div>
<div class="col-xs-12 col-12 col-md-3 form-group">
<button class="btn btn-success" (click)="daterangepicker.toggle()" [attr.aria-expanded]="daterangepicker.isOpen" type="button">Date Range Picker</button>
Expand Down
3 changes: 2 additions & 1 deletion demo/src/app/components/+popover/demos/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export function getPopoverConfig(): PopoverConfig {
return Object.assign(new PopoverConfig(), {
placement: 'right',
container: 'body',
triggers: 'focus'
triggers: 'focus',
delay: 500
});
}

Expand Down
5 changes: 5 additions & 0 deletions demo/src/app/components/+popover/demos/delay/delay.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<button type="button" class="btn btn-primary"
popover="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." [delay]="500">
Popover with 0.5sec delay
</button>

7 changes: 7 additions & 0 deletions demo/src/app/components/+popover/demos/delay/delay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Component } from '@angular/core';

@Component({
selector: 'demo-popover-delay',
templateUrl: './delay.html'
})
export class DemoPopoverDelayComponent {}
2 changes: 2 additions & 0 deletions demo/src/app/components/+popover/demos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { DemoPopoverConfigComponent } from './config/config';
import { DemoPopoverContainerComponent } from './container/container';
import { DemoPopoverContextComponent } from './popover-context/popover-context';
import { DemoPopoverCustomContentComponent } from './custom-content/custom-content';
import { DemoPopoverDelayComponent } from './delay/delay';
import { DemoPopoverDismissComponent } from './dismiss/dismiss';
import { DemoPopoverDynamicComponent } from './dynamic/dynamic';
import { DemoPopoverDynamicHtmlComponent } from './dynamic-html/dynamic-html';
Expand All @@ -26,6 +27,7 @@ export const DEMO_COMPONENTS = [
DemoPopoverContainerComponent,
DemoPopoverContextComponent,
DemoPopoverCustomContentComponent,
DemoPopoverDelayComponent,
DemoPopoverDismissComponent,
DemoPopoverDynamicComponent,
DemoPopoverDynamicHtmlComponent,
Expand Down
11 changes: 10 additions & 1 deletion demo/src/app/components/+popover/popover-section.list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { DemoPopoverConfigComponent } from './demos/config/config';
import { DemoPopoverContainerComponent } from './demos/container/container';
import { DemoPopoverContextComponent } from './demos/popover-context/popover-context';
import { DemoPopoverCustomContentComponent } from './demos/custom-content/custom-content';
import { DemoPopoverDelayComponent } from './demos/delay/delay';
import { DemoPopoverDismissComponent } from './demos/dismiss/dismiss';
import { DemoPopoverDynamicComponent } from './demos/dynamic/dynamic';
import { DemoPopoverDynamicHtmlComponent } from './demos/dynamic-html/dynamic-html';
Expand Down Expand Up @@ -52,7 +53,7 @@ export const demoComponentContent: ContentSection[] = [
anchor: 'placement',
component: require('!!raw-loader!./demos/placement/placement.ts'),
html: require('!!raw-loader!./demos/placement/placement.html'),
description: `<p>Four positioning options are available: <code>top</code>, <code>right</code>,
description: `<p>Four positioning options are available: <code>top</code>, <code>right</code>,
<code>bottom</code>, and <code>left</code>.
Besides that, <code>auto</code> option may be used to detect a position that fits the component on screen.</p>`,
outlet: DemoPopoverPlacementComponent
Expand Down Expand Up @@ -177,6 +178,14 @@ export const demoComponentContent: ContentSection[] = [
component: require('!!raw-loader!./demos/popover-context/popover-context.ts'),
html: require('!!raw-loader!./demos/popover-context/popover-context.html'),
outlet: DemoPopoverContextComponent
},
{
title: 'Popover with delay',
anchor: 'popover-delay',
component: require('!!raw-loader!./demos/delay/delay.ts'),
html: require('!!raw-loader!./demos/delay/delay.html'),
description: `<p>Click on the button to see popover delayed for 0,5 second </p>`,
outlet: DemoPopoverDelayComponent
}
]
},
Expand Down
11 changes: 11 additions & 0 deletions demo/src/ng-api-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,12 @@ export const ngdoc: any = {
"defaultValue": "click",
"type": "string",
"description": "<p>Specifies events that should trigger. Supports a space separated list of\nevent names.</p>\n"
},
{
"name": "delay",
"defaultValue": "0",
"type": "number",
"description": "<p>delay before showing the popover</p>\n"
}
]
},
Expand All @@ -2649,6 +2655,11 @@ export const ngdoc: any = {
"type": "string",
"description": "<p>Css class for popover container</p>\n"
},
{
"name": "delay",
"type": "number",
"description": "<p>Delay before showing the popover</p>\n"
},
{
"name": "isOpen",
"type": "boolean",
Expand Down
20 changes: 20 additions & 0 deletions docs/spec/popover/popover.examples.popover-with-delay.use-case.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
9.17: Popover with delay example
==================================
**Primary Actor**: User

**Scope**: Ngx-bootstrap DEMO / BS version 3&4

**Goal**:

Main success scenario:
----------------------
1. User opens Popover demo page
2. User clicks on Popover with delay sub-menu
3. User see button "Popover with 0.5sec delay"
4. When user clicks on "Popover with 0.5sec delay", then popover-container appear above the button with 0.5sec delay
5. When user clicks on "Popover with 0.5sec delay" again, then popover-container disappeared
6. Template src should be written with [delay]="500"

Variations:
-----------
2*. User scroll to Popover with delay sub-menu
90 changes: 90 additions & 0 deletions src/chronos/i18n/ka.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// tslint:disable:comment-format binary-expression-operand-order max-line-length
// tslint:disable:no-bitwise prefer-template cyclomatic-complexity
// tslint:disable:no-shadowed-variable switch-default prefer-const
// tslint:disable:one-variable-per-declaration newline-before-return

import { LocaleData } from '../locale/locale.class';

//! moment.js locale configuration
//! locale : Georgian [ka]
//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili
//! author : Levan Tskipuri : https://github.com/tskipa

export const kaLocale: LocaleData = {
abbr: 'ka',
months : {
format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_'),
standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_')
},
monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
weekdays : {
standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
isFormat: /(|)/
},
weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendar : {
sameDay : '[დღეს] LT[-ზე]',
nextDay : '[ხვალ] LT[-ზე]',
lastDay : '[გუშინ] LT[-ზე]',
nextWeek : '[შემდეგ] dddd LT[-ზე]',
lastWeek : '[წინა] dddd LT-ზე',
sameElse : 'L'
},
relativeTime : {
future(s: number): string {
var st = s.toString();
return (/(|||)/).test(st) ?
st.replace(/$/, 'ში') :
st + 'ში';
},
past(s: number): string {
var st = s.toString();
if ((/(||||)/).test(st)) {
return st.replace(/(|)$/, 'ის წინ');
}
if ((//).test(st)) {
return st.replace(/$/, 'წლის წინ');
}
},
s : 'რამდენიმე წამი',
ss : '%d წამი',
m : 'წუთი',
mm : '%d წუთი',
h : 'საათი',
hh : '%d საათი',
d : 'დღე',
dd : '%d დღე',
M : 'თვე',
MM : '%d თვე',
y : 'წელი',
yy : '%d წელი'
},
dayOfMonthOrdinalParse: /0|1-|-\d{1,2}|\d{1,2}-/,
ordinal(_num: number, _period: string): string {
const num = Number(_num);
if (num === 0) {
return num.toString();
}
if (num === 1) {
return num + '-ლი';
}
if ((num < 20) || (num <= 100 && (num % 20 === 0)) || (num % 100 === 0)) {
return 'მე-' + num;
}
return num + '-ე';
},
week : {
dow : 1,
doy : 4
}
};
1 change: 1 addition & 0 deletions src/chronos/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export { hrLocale } from './i18n/hr';
export { idLocale } from './i18n/id';
export { itLocale } from './i18n/it';
export { jaLocale } from './i18n/ja';
export { kaLocale } from './i18n/ka';
export { koLocale } from './i18n/ko';
export { ltLocale } from './i18n/lt';
export { lvLocale } from './i18n/lv';
Expand Down
Loading

0 comments on commit 19c6fcd

Please sign in to comment.