From 86b4a49f8de510a07f764596f2d9d1bfd24f1b7f Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Mon, 18 Mar 2019 15:59:19 -0700 Subject: [PATCH 1/5] RTL label fix --- paper-dropdown-menu-icons.d.ts | 5 +- paper-dropdown-menu-light.d.ts | 8 +- paper-dropdown-menu-light.html | 1 + paper-dropdown-menu-shared-styles.d.ts | 5 +- paper-dropdown-menu-shared-styles.html | 6 + paper-dropdown-menu.d.ts | 10 +- paper-dropdown-menu.html | 504 ++++++++++++------------- 7 files changed, 280 insertions(+), 259 deletions(-) diff --git a/paper-dropdown-menu-icons.d.ts b/paper-dropdown-menu-icons.d.ts index 17a5186..e25db6c 100644 --- a/paper-dropdown-menu-icons.d.ts +++ b/paper-dropdown-menu-icons.d.ts @@ -2,11 +2,14 @@ * DO NOT EDIT * * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations + * https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations * * To modify these typings, edit the source file(s): * paper-dropdown-menu-icons.html */ + +// tslint:disable:variable-name Describing an API that's defined elsewhere. + /// diff --git a/paper-dropdown-menu-light.d.ts b/paper-dropdown-menu-light.d.ts index d94bd08..6f4044e 100644 --- a/paper-dropdown-menu-light.d.ts +++ b/paper-dropdown-menu-light.d.ts @@ -2,12 +2,16 @@ * DO NOT EDIT * * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations + * https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations * * To modify these typings, edit the source file(s): * paper-dropdown-menu-light.html */ + +// tslint:disable:variable-name Describing an API that's defined elsewhere. +// tslint:disable:no-any describes the API as best we are able today + /// /// /// @@ -89,7 +93,7 @@ * }; * */ -interface PaperDropdownMenuLightElement extends Polymer.Element, Polymer.IronButtonState, Polymer.IronControlState, Polymer.PaperRippleBehavior, Polymer.IronFormElementBehavior, Polymer.IronValidatableBehavior { +interface PaperDropdownMenuLightElement extends Polymer.IronButtonState, Polymer.IronControlState, Polymer.PaperRippleBehavior, Polymer.IronFormElementBehavior, Polymer.IronValidatableBehavior, Polymer.LegacyElementMixin, HTMLElement { keyBindings: object; /** diff --git a/paper-dropdown-menu-light.html b/paper-dropdown-menu-light.html index 022befe..7c4b015 100644 --- a/paper-dropdown-menu-light.html +++ b/paper-dropdown-menu-light.html @@ -182,6 +182,7 @@ label:dir(rtl) { padding-right: 0px; padding-left: 20px; + text-align: right; } :host([no-label-float]) label { diff --git a/paper-dropdown-menu-shared-styles.d.ts b/paper-dropdown-menu-shared-styles.d.ts index b0af86e..0a17950 100644 --- a/paper-dropdown-menu-shared-styles.d.ts +++ b/paper-dropdown-menu-shared-styles.d.ts @@ -2,11 +2,14 @@ * DO NOT EDIT * * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations + * https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations * * To modify these typings, edit the source file(s): * paper-dropdown-menu-shared-styles.html */ + +// tslint:disable:variable-name Describing an API that's defined elsewhere. + /// diff --git a/paper-dropdown-menu-shared-styles.html b/paper-dropdown-menu-shared-styles.html index ddd2ec1..6f9c64f 100644 --- a/paper-dropdown-menu-shared-styles.html +++ b/paper-dropdown-menu-shared-styles.html @@ -36,6 +36,12 @@ @apply --paper-dropdown-menu; } + :host(:dir(rtl)) { + text-align: right; + + @apply --paper-dropdown-menu; + } + :host([disabled]) { @apply --paper-dropdown-menu-disabled; } diff --git a/paper-dropdown-menu.d.ts b/paper-dropdown-menu.d.ts index e4eea2f..b4e092d 100644 --- a/paper-dropdown-menu.d.ts +++ b/paper-dropdown-menu.d.ts @@ -2,12 +2,16 @@ * DO NOT EDIT * * This file was automatically generated by - * https://github.com/Polymer/gen-typescript-declarations + * https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations * * To modify these typings, edit the source file(s): * paper-dropdown-menu.html */ + +// tslint:disable:variable-name Describing an API that's defined elsewhere. +// tslint:disable:no-any describes the API as best we are able today + /// /// /// @@ -73,7 +77,7 @@ * style mixins and custom properties to style the internal input and menu button * respectively. */ -interface PaperDropdownMenuElement extends Polymer.Element, Polymer.IronButtonState, Polymer.IronControlState, Polymer.IronFormElementBehavior, Polymer.IronValidatableBehavior { +interface PaperDropdownMenuElement extends Polymer.IronButtonState, Polymer.IronControlState, Polymer.IronFormElementBehavior, Polymer.IronValidatableBehavior, Polymer.LegacyElementMixin, HTMLElement { keyBindings: object; /** @@ -177,7 +181,7 @@ interface PaperDropdownMenuElement extends Polymer.Element, Polymer.IronButtonSt /** * The content element that is contained by the dropdown menu, if any. - * + * */ readonly contentElement: any; attached(): void; diff --git a/paper-dropdown-menu.html b/paper-dropdown-menu.html index 8bc8a83..515fbc7 100644 --- a/paper-dropdown-menu.html +++ b/paper-dropdown-menu.html @@ -125,258 +125,258 @@ From 8206ec6f686f7fbb13ae19e405c5eb9deeabd22e Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Mon, 18 Mar 2019 15:59:26 -0700 Subject: [PATCH 2/5] add demo --- demo/index.html | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/demo/index.html b/demo/index.html index 47fb4d2..a693ee7 100644 --- a/demo/index.html +++ b/demo/index.html @@ -20,7 +20,7 @@ - + @@ -35,7 +35,7 @@ display: flex; }; } - + paper-tabs { width: 400px; } @@ -76,6 +76,29 @@

This is a plain paper-dropdown-menu

+

Supports RTL

+ + + +

You can pre-select a value using the selected attribute