@polymer/iron-fit-behavior
Advanced tools
Comparing version 3.0.0-pre.6 to 3.0.0-pre.7
@@ -1,4 +0,5 @@ | ||
import '../../polymer/polymer.js'; | ||
import '../iron-fit-behavior.js'; | ||
import { html } from '../../polymer/polymer.js'; | ||
import { IronFitBehavior } from '../iron-fit-behavior.js'; | ||
import '../../paper-styles/color.js'; | ||
import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
/** | ||
@@ -14,3 +15,3 @@ @license | ||
Polymer({ | ||
_template: Polymer.html` | ||
_template: html` | ||
<style> | ||
@@ -29,4 +30,4 @@ :host { | ||
behaviors: [ | ||
Polymer.IronFitBehavior | ||
IronFitBehavior | ||
] | ||
}); |
import '../polymer/polymer.js'; | ||
/** | ||
`Polymer.IronFitBehavior` fits an element in another element using `max-height` and `max-width`, and | ||
optionally centers it in the window or another element. | ||
import { dom } from '../polymer/lib/legacy/polymer.dom.js'; | ||
The element will only be sized and/or positioned if it has not already been sized and/or positioned | ||
by CSS. | ||
export const IronFitBehavior = { | ||
CSS properties | Action | ||
-----------------------------|------------------------------------------- | ||
`position` set | Element is not centered horizontally or vertically | ||
`top` or `bottom` set | Element is not vertically centered | ||
`left` or `right` set | Element is not horizontally centered | ||
`max-height` set | Element respects `max-height` | ||
`max-width` set | Element respects `max-width` | ||
`Polymer.IronFitBehavior` can position an element into another element using | ||
`verticalAlign` and `horizontalAlign`. This will override the element's css position. | ||
<div class="container"> | ||
<iron-fit-impl vertical-align="top" horizontal-align="auto"> | ||
Positioned into the container | ||
</iron-fit-impl> | ||
</div> | ||
Use `noOverlap` to position the element around another element without overlapping it. | ||
<div class="container"> | ||
<iron-fit-impl no-overlap vertical-align="auto" horizontal-align="auto"> | ||
Positioned around the container | ||
</iron-fit-impl> | ||
</div> | ||
Use `horizontalOffset, verticalOffset` to offset the element from its `positionTarget`; | ||
`Polymer.IronFitBehavior` will collapse these in order to keep the element | ||
within `fitInto` boundaries, while preserving the element's CSS margin values. | ||
<div class="container"> | ||
<iron-fit-impl vertical-align="top" vertical-offset="20"> | ||
With vertical offset | ||
</iron-fit-impl> | ||
</div> | ||
@demo demo/index.html | ||
@polymerBehavior | ||
*/ | ||
/** | ||
@license | ||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
*/ | ||
Polymer.IronFitBehavior = { | ||
properties: { | ||
@@ -221,3 +168,3 @@ | ||
get _defaultPositionTarget() { | ||
var parent = Polymer.dom(this).parentNode; | ||
var parent = dom(this).parentNode; | ||
@@ -224,0 +171,0 @@ if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { |
{ | ||
"name": "@polymer/iron-fit-behavior", | ||
"flat": true, | ||
"version": "3.0.0-pre.6", | ||
"version": "3.0.0-pre.7", | ||
"description": "Fits an element inside another element", | ||
@@ -21,7 +21,7 @@ "contributors": [ | ||
"dependencies": { | ||
"@polymer/polymer": "^3.0.0-pre.6" | ||
"@polymer/polymer": "^3.0.0-pre.7" | ||
}, | ||
"devDependencies": { | ||
"@polymer/iron-component-page": "^3.0.0-pre.6", | ||
"@polymer/iron-demo-helpers": "^3.0.0-pre.6", | ||
"@polymer/iron-component-page": "^3.0.0-pre.7", | ||
"@polymer/iron-demo-helpers": "^3.0.0-pre.7", | ||
"wct-browser-legacy": "0.0.1-pre.11", | ||
@@ -28,0 +28,0 @@ "@webcomponents/webcomponentsjs": "^1.0.0" |
@@ -1,3 +0,4 @@ | ||
import '../../polymer/polymer.js'; | ||
import '../iron-fit-behavior.js'; | ||
import { html } from '../../polymer/polymer.js'; | ||
import { IronFitBehavior } from '../iron-fit-behavior.js'; | ||
import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
/** | ||
@@ -13,3 +14,3 @@ @license | ||
Polymer({ | ||
_template: Polymer.html` | ||
_template: html` | ||
<style> | ||
@@ -29,4 +30,4 @@ :host { | ||
behaviors: [ | ||
Polymer.IronFitBehavior | ||
IronFitBehavior | ||
] | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14
84376
650