From cf10520521426e7967dbb9c1309db8faad782257 Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Fri, 11 Jan 2019 17:11:00 -0800 Subject: [PATCH 1/5] create dropdown lite --- iron-dropdown-lite.html | 484 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 484 insertions(+) create mode 100644 iron-dropdown-lite.html diff --git a/iron-dropdown-lite.html b/iron-dropdown-lite.html new file mode 100644 index 0000000..63060f6 --- /dev/null +++ b/iron-dropdown-lite.html @@ -0,0 +1,484 @@ + + + + + + + + + + + + + + + \ No newline at end of file From e959112cd89925439c0a888a3848ba531d1e7e9c Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Fri, 11 Jan 2019 17:11:10 -0800 Subject: [PATCH 2/5] add tests for iron-dropdown-lite --- test/index.html | 2 + test/iron-dropdown-lite.html | 560 +++++++++++++++++++++++++++++++++++ 2 files changed, 562 insertions(+) create mode 100644 test/iron-dropdown-lite.html diff --git a/test/index.html b/test/index.html index 1080d00..f0de1c1 100644 --- a/test/index.html +++ b/test/index.html @@ -20,6 +20,8 @@ WCT.loadSuites([ 'iron-dropdown.html?wc-shadydom=true&wc-ce=true', // shady 'iron-dropdown.html?dom=shadow', // shadow + 'iron-dropdown-lite.html?wc-shadydom=true&wc-ce=true', // shady + 'iron-dropdown-lite.html?dom=shadow', // shadow ]); diff --git a/test/iron-dropdown-lite.html b/test/iron-dropdown-lite.html new file mode 100644 index 0000000..2c15bc2 --- /dev/null +++ b/test/iron-dropdown-lite.html @@ -0,0 +1,560 @@ + + + + + + + iron-dropdown-lite basic tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 017f1ecbac99b46872d62fc14e669a211f3dc50c Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Fri, 11 Jan 2019 17:12:48 -0800 Subject: [PATCH 3/5] run update types --- iron-dropdown-lite.d.ts | 186 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 iron-dropdown-lite.d.ts diff --git a/iron-dropdown-lite.d.ts b/iron-dropdown-lite.d.ts new file mode 100644 index 0000000..16c494b --- /dev/null +++ b/iron-dropdown-lite.d.ts @@ -0,0 +1,186 @@ +/** + * DO NOT EDIT + * + * This file was automatically generated by + * https://github.com/Polymer/gen-typescript-declarations + * + * To modify these typings, edit the source file(s): + * iron-dropdown-lite.html + */ + +/// +/// +/// +/// + +/** + * `` is a generalized element that is useful when you have + * hidden content (`dropdown-content`) that is revealed due to some change in + * state that should cause it to do so. + * + * Note that this is a low-level element intended to be used as part of other + * composite elements that cause dropdowns to be revealed. + * + * Examples of elements that might be implemented using an `iron-dropdown` + * include comboboxes, menubuttons, selects. The list goes on. + * + * The `` element exposes attributes that allow the position + * of the `dropdown-content` relative to the `dropdown-trigger` to be + * configured. + * + * + *
Hello!
+ *
+ * + * In the above example, the `
` assigned to the `dropdown-content` slot will be + * hidden until the dropdown element has `opened` set to true, or when the `open` + * method is called on the element. + * + * ### Changes in 2.0 + * - Removed the private property `_focusTarget` which was deprecated. + * - Distribution moved from the `class="dropdown-content"` to `slot="dropdown-content"`. + * - `` animations are not based on the deprecated `neon-animation` component, and use CSS keyframe animations + * + * ### Animations + * + * Set the `entry-animation` and/or `exit-animation` attributes to add an animation when the dialog + * is opened or closed. Included in the component are: + * - fade-in-animation + * - fade-out-animation + * - scale-up-animation + * - scale-down-animation + * + * These animations are not based on the deprecated `neon-animation` component, and use CSS keyframe animations. + * This change reduces code size, and uses the platform. You can implement custom entry/exit animations using + * CSS keyframe animations; define the animation keyframes, a CSS class for the animation, and assign the class to the `entry/exit-animation`, e.g. + * + * + * + * + *
Hello!
+ *
+ */ +interface IronDropdownLiteElement extends Polymer.Element, Polymer.IronControlState, Polymer.IronA11yKeysBehavior, Polymer.IronOverlayBehavior { + + /** + * The orientation against which to align the dropdown content + * horizontally relative to the dropdown trigger. + * Overridden from `Polymer.IronFitBehavior`. + */ + horizontalAlign: string|null|undefined; + + /** + * The orientation against which to align the dropdown content + * vertically relative to the dropdown trigger. + * Overridden from `Polymer.IronFitBehavior`. + */ + verticalAlign: string|null|undefined; + + /** + * The class defining the entry animation. + */ + entryAnimation: string|null|undefined; + + /** + * The class defining the exit animation. + */ + exitAnimation: string|null|undefined; + + /** + * Deprecated, use `entryAnimation` and `exitAnimation` instead. + * `iron-dropdown` doesn't depend anymore on `neon-animation`, and this + * property is kept here to not break bindings. Setting it won't have + * effects on the animation. + */ + animationConfig: object|null|undefined; + + /** + * Deprecated, use `entryAnimation` instead. + * `iron-dropdown` doesn't depend anymore on `neon-animation`, and this + * property is kept here to not break bindings. Setting it won't have + * effects on the animation. + */ + openAnimationConfig: object|null|undefined; + + /** + * Deprecated, use `exitAnimation` instead. + * `iron-dropdown` doesn't depend anymore on `neon-animation`, and this + * property is kept here to not break bindings. Setting it won't have + * effects on the animation. + */ + closeAnimationConfig: object|null|undefined; + + /** + * If provided, this will be the element that will be focused when + * the dropdown opens. + */ + focusTarget: object|null|undefined; + + /** + * Set to true to disable animations when opening and closing the + * dropdown. + */ + noAnimations: boolean|null|undefined; + + /** + * By default, the dropdown will constrain scrolling on the page + * to itself when opened. + * Set to true in order to prevent scroll from being constrained + * to the dropdown when it opens. + * This property is a shortcut to set `scrollAction` to lock or refit. + * Prefer directly setting the `scrollAction` property. + */ + allowOutsideScroll: boolean|null|undefined; + + /** + * The element that is contained by the dropdown, if any. + * + */ + readonly containedElement: any; + ready(): void; + attached(): void; + detached(): void; + + /** + * `iron-dropdown` doesn't depend anymore on `neon-animation`. + * This method was previously inherited from `Polymer.NeonAnimatableBehavior`, + * now is a no-op. + */ + cancelAnimation(): void; + + /** + * `iron-dropdown` doesn't depend anymore on `neon-animation`. + * This method was previously inherited from `Polymer.NeonAnimatableBehavior`, + * now is a no-op. + */ + playAnimation(type?: string, cookie?: object): void; + + /** + * `iron-dropdown` doesn't depend anymore on `neon-animation`. + * This method was previously inherited from `Polymer.NeonAnimatableBehavior`, + * now is a no-op. + */ + getAnimationConfig(type: any): any; +} + +interface HTMLElementTagNameMap { + "iron-dropdown-lite": IronDropdownLiteElement; +} From 0cc8322650ca5aca8304f4d39a60b2f28ba11671 Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Fri, 11 Jan 2019 17:12:57 -0800 Subject: [PATCH 4/5] format iron-dropdown-lite --- iron-dropdown-lite.html | 549 +++++++++++++++++++--------------------- test/index.html | 4 +- 2 files changed, 266 insertions(+), 287 deletions(-) diff --git a/iron-dropdown-lite.html b/iron-dropdown-lite.html index 63060f6..820a693 100644 --- a/iron-dropdown-lite.html +++ b/iron-dropdown-lite.html @@ -158,327 +158,306 @@ \ No newline at end of file diff --git a/test/index.html b/test/index.html index f0de1c1..6913864 100644 --- a/test/index.html +++ b/test/index.html @@ -18,8 +18,8 @@ + + + + + + + + + + + +

Basic

+ + + + +

Alignment

+ + + + +

Scroll actions

+ + + + +

Content

+ + + + + + + + + \ No newline at end of file diff --git a/demo/x-select-lite.html b/demo/x-select-lite.html new file mode 100644 index 0000000..1b6da41 --- /dev/null +++ b/demo/x-select-lite.html @@ -0,0 +1,72 @@ + + + + + + + + \ No newline at end of file diff --git a/iron-dropdown-lite.html b/iron-dropdown-lite.html index 820a693..4aebc8c 100644 --- a/iron-dropdown-lite.html +++ b/iron-dropdown-lite.html @@ -79,7 +79,7 @@
Hello!
-@demo demo/index.html +@demo demo/iron-dropdown-lite.html -->