diff --git a/src/components/popover/popover.ios.scss b/src/components/popover/popover.ios.scss index 086fd02c880..7b27dab8752 100644 --- a/src/components/popover/popover.ios.scss +++ b/src/components/popover/popover.ios.scss @@ -11,6 +11,7 @@ $popover-ios-border-radius: 10px !default; $popover-ios-text-color: #000 !default; $popover-ios-background: #f3f3f3 !default; +$popover-ios-item-background: $popover-ios-background !default; $popover-ios-arrow-background: $popover-ios-background !default; @@ -25,6 +26,10 @@ $popover-ios-arrow-background: $popover-ios-background !default; background: $popover-ios-background; } +.popover-wrapper .item { + background-color: $popover-ios-item-background; +} + // Popover Arrow // ----------------------------------------- diff --git a/src/components/popover/popover.md.scss b/src/components/popover/popover.md.scss index 0c99afc308a..8d7888e78d1 100644 --- a/src/components/popover/popover.md.scss +++ b/src/components/popover/popover.md.scss @@ -4,12 +4,14 @@ // Material Design Popover // -------------------------------------------------- -$popover-md-min-width: 150px !default; +$popover-md-min-width: 200px !default; $popover-md-max-width: 270px !default; $popover-md-max-height: 90% !default; $popover-md-border-radius: 2px !default; $popover-md-text-color: #000 !default; + $popover-md-background: #fafafa !default; +$popover-md-item-background: $popover-md-background !default; .popover-wrapper { @@ -22,3 +24,7 @@ $popover-md-background: #fafafa !default; color: $popover-md-text-color; background: $popover-md-background; } + +.popover-wrapper .item { + background-color: $popover-md-item-background; +} diff --git a/src/components/popover/popover.wp.scss b/src/components/popover/popover.wp.scss index 8320527c387..802c816d9a7 100644 --- a/src/components/popover/popover.wp.scss +++ b/src/components/popover/popover.wp.scss @@ -4,12 +4,14 @@ // Windows Popover // -------------------------------------------------- -$popover-wp-min-width: 150px !default; +$popover-wp-min-width: 200px !default; $popover-wp-max-width: 270px !default; $popover-wp-max-height: 90% !default; $popover-wp-border-radius: 2px !default; $popover-wp-text-color: #000 !default; -$popover-wp-background: #fff !default; + +$popover-wp-background: #e6e6e6 !default; +$popover-wp-item-background: $popover-wp-background !default; .popover-wrapper { @@ -22,3 +24,7 @@ $popover-wp-background: #fff !default; color: $popover-wp-text-color; background: $popover-wp-background; } + +.popover-wrapper .item { + background-color: $popover-wp-item-background; +} diff --git a/src/components/popover/test/basic/e2e.ts b/src/components/popover/test/basic/e2e.ts new file mode 100644 index 00000000000..04dcbd7a7c5 --- /dev/null +++ b/src/components/popover/test/basic/e2e.ts @@ -0,0 +1,4 @@ + +it('should open list popover', function() { + element(by.css('.e2eOpenListPopover')).click(); +}); diff --git a/src/components/popover/test/basic/index.ts b/src/components/popover/test/basic/index.ts index dd1583703e5..2181d6f85b6 100644 --- a/src/components/popover/test/basic/index.ts +++ b/src/components/popover/test/basic/index.ts @@ -1,4 +1,113 @@ -import {App, Page, Popover, NavController} from '../../../../../src'; +import {ViewChild, ElementRef} from '@angular/core'; +import {App, Page, Popover, NavController, Content, NavParams} from '../../../../../src'; + + +@Page({ + template: ` + + + + + + + + + + + + + + + + + + + + + + + + + Athelas + + + + Charter + + + + Iowan + + + + Palatino + + + + San Francisco + + + + Seravek + + + + Times New Roman + + + + `, +}) +class PopoverRadioPage { + background: string = 'white'; + contentEle: any; + textEle: any; + fontFamily; + + colors = { + "white": { + "bg": "#fff", + "fg": "#000" + }, + "tan": { + "bg": "#f9f1e4", + "fg": "#000" + }, + "grey": { + "bg": "#4c4b50", + "fg": "#fff" + }, + "black": { + "bg": "#000", + "fg": "#fff" + }, + }; + + constructor(private navParams: NavParams) { + + } + + ngOnInit() { + if (this.navParams.data) { + this.contentEle = this.navParams.data.contentEle; + this.textEle = this.navParams.data.textEle; + } + } + + changeBackground(color) { + this.background = color; + this.contentEle.style.background = this.colors[color].bg; + this.textEle.style.color = this.colors[color].fg; + } + + changeFontSize(direction) { + this.textEle.style.fontSize = direction; + } + + changeFontFamily() { + if (this.fontFamily) this.textEle.style.fontFamily = this.fontFamily; + } +} @Page({ @@ -9,11 +118,10 @@ import {App, Page, Popover, NavController} from '../../../../../src'; - ` }) -class PopoverPage { +class PopoverListPage { } @@ -22,17 +130,29 @@ class PopoverPage { templateUrl: 'main.html' }) class E2EPage { + @ViewChild('popoverContent', {read: ElementRef}) content: ElementRef; + @ViewChild('popoverText', {read: ElementRef}) text: ElementRef; + popover: any; - constructor(private nav: NavController) {} + constructor(private nav: NavController) { - createPopover() { - this.popover = Popover.create(PopoverPage); } - presentPopover(ev) { - this.createPopover(); - this.nav.present(this.popover, { + presentListPopover(ev) { + let popover = Popover.create(PopoverListPage); + this.nav.present(popover, { + ev: ev + }); + } + + presentRadioPopover(ev) { + let popover = Popover.create(PopoverRadioPage, { + contentEle: this.content.nativeElement, + textEle: this.text.nativeElement + }); + + this.nav.present(popover, { ev: ev }); } @@ -49,3 +169,5 @@ class E2EApp { this.root = E2EPage; } } + +document.body.innerHTML += '' diff --git a/src/components/popover/test/basic/main.html b/src/components/popover/test/basic/main.html index fa926b4df51..345185a677d 100644 --- a/src/components/popover/test/basic/main.html +++ b/src/components/popover/test/basic/main.html @@ -1,35 +1,46 @@ - - Popover - - - + - +
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vel ipsum in purus mollis dictum eget vitae purus. Nulla ultrices est odio, a maximus velit pretium ac. Donec vel elementum mi. Proin elementum pulvinar neque, in lacinia nibh tempus auctor. Nam sapien velit, commodo ac nibh a, maximus ullamcorper nunc. Integer luctus tortor dignissim, dictum neque at, scelerisque purus. Vivamus nec erat vel magna posuere euismod. Sed ac augue eu tellus tincidunt fermentum eget sit amet nunc. Donec sit amet mi libero. Cras nunc arcu, ultrices nec sapien eu, convallis posuere libero. Pellentesque vulputate lacus eros, at lobortis lorem egestas et. Vestibulum tempus quam in efficitur lobortis. Maecenas consectetur consequat sem pharetra aliquet. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
+ +
Mauris ac ligula elit. Nulla pulvinar eget leo ut aliquet. Praesent sit amet luctus quam. Nam fringilla iaculis mi, ut maximus mauris molestie feugiat. Curabitur nec scelerisque elit. Nunc eu odio facilisis, tempor enim eget, venenatis sem. Sed vitae lorem vehicula, auctor orci ultrices, finibus mauris. Donec vitae pulvinar diam. Nulla luctus congue quam, sed lacinia arcu dictum a.
+ +
Morbi laoreet magna elit, id dapibus massa varius consequat. Praesent rhoncus nunc quam, eu mollis velit commodo ut. Etiam euismod elit mi, non auctor velit blandit ut. Aenean vitae pulvinar mi, ac pretium tellus. Morbi eu auctor sem, sollicitudin cursus felis. Praesent vestibulum velit sed eros iaculis ornare. Praesent diam diam, pellentesque eget scelerisque sed, bibendum ut risus. Sed sed fermentum sem. Integer vel justo felis. Proin eget quam est. In sit amet ipsum sagittis, convallis ipsum fringilla, interdum ante. Etiam vel tincidunt mauris. Nunc feugiat eros nunc, et vestibulum metus mollis et. Nullam eu viverra velit, id ultrices nisl. Donec non enim elementum, laoreet sapien id, feugiat tellus.
+ +
Sed pellentesque ipsum eget ante hendrerit maximus. Aliquam id venenatis nulla. Nullam in nibh at enim vestibulum ullamcorper. Nam felis dolor, lobortis vel est non, condimentum malesuada nisl. In metus sapien, malesuada at nulla in, pretium aliquam turpis. Quisque elementum purus mi, sed tristique turpis ultricies in. Donec feugiat dolor non ultricies ultricies. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin ut purus et diam porta cursus vitae semper mi. Donec fringilla tellus orci. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nunc vitae commodo sem. Duis vehicula quam sit amet imperdiet facilisis. Pellentesque eget dignissim neque, et scelerisque libero. Maecenas molestie metus sed orci cursus, in venenatis justo dapibus.
+ +

Aenean rhoncus urna at interdum blandit. Donec ac massa nec libero vehicula tincidunt. Sed sit amet hendrerit risus. Aliquam vitae vestibulum ipsum, non feugiat orci. Vivamus eu rutrum elit. Nulla dapibus tortor non dignissim pretium. Nulla in luctus turpis. Etiam non mattis tortor, at aliquet ex. Nunc ut ante varius, auctor dui vel, volutpat elit. Nunc laoreet augue sit amet ultrices porta. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum pellentesque lobortis est, ut tincidunt ligula mollis sit amet. In porta risus arcu, quis pellentesque dolor mattis non. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;

+
Popover - diff --git a/src/components/popover/test/basic/style.css b/src/components/popover/test/basic/style.css new file mode 100644 index 00000000000..5a9bae794c6 --- /dev/null +++ b/src/components/popover/test/basic/style.css @@ -0,0 +1,113 @@ +.text-to-change div { + margin: 10px auto; +} + +ion-row, +ion-col { + padding: 0; +} + +.text-button { + padding-left: 0; + text-align: center; + min-height: 20px; + line-height: 18px; +} + +.text-smaller { + font-size: 12px; +} + +.ios .text-smaller { + border-right: 1px solid #c8c7cc; +} + +.md .text-smaller { + border-right: 1px solid #dedede; +} + +.text-larger { + font-size: 16px; +} + +.row-dots { + text-align: center; +} + +.ios .row-dots { + border-bottom: 1px solid #c8c7cc; +} + +.md .row-dots { + border-bottom: 1px solid #dedede; +} + +.ios .dot { + border: 1px solid #c8c7cc; +} + +.md .dot { + border: 1px solid #dedede; +} + +.hairlines .text-smaller, +.hairlines .row-dots, +.hairlines .dot { + border-width: 0.55px; +} + +.row-dots .dot { + height: 30px; + width: 30px; + border-radius: 50%; + margin: 10px auto; +} + +.dot-white { + background-color: #fff; +} + +.dot-tan { + background-color: #f9f1e4; +} + +.dot-grey { + background-color: #4c4b50; +} + +.dot-black { + background-color: #000; +} + +.dot.selected { + border-width: 2px; + border-color: #327eff; +} + +.text-athelas { + font-family: "Athelas"; +} + +.text-charter { + font-family: "Charter"; +} + +.text-iowan { + font-family: "Iowan"; +} + +.text-palatino { + font-family: "Palatino"; +} + +.text-san-francisco { + font-family: "San Francisco"; +} + +.text-seravek { + font-family: "Seravek"; +} + +.text-times-new-roman { + font-family: "Times New Roman"; +}