diff --git a/bower.json b/bower.json index bb8147d..df81584 100644 --- a/bower.json +++ b/bower.json @@ -10,7 +10,7 @@ "web-component", "polymer" ], - "main": "iron-dropdown.html", + "main": ["iron-dropdown.html", "iron-dropdown-lite.html"], "private": true, "repository": { "type": "git", diff --git a/demo/iron-dropdown-lite.html b/demo/iron-dropdown-lite.html new file mode 100644 index 0000000..f3f54d5 --- /dev/null +++ b/demo/iron-dropdown-lite.html @@ -0,0 +1,210 @@ + + + + + + + iron-dropdown-lite + + + + + + + + + + + + + +

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.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; +} diff --git a/iron-dropdown-lite.html b/iron-dropdown-lite.html new file mode 100644 index 0000000..4aebc8c --- /dev/null +++ b/iron-dropdown-lite.html @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/index.html b/test/index.html index 1080d00..6913864 100644 --- a/test/index.html +++ b/test/index.html @@ -18,8 +18,10 @@ 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +