@polymer/iron-resizable-behavior
Advanced tools
Comparing version 3.0.0-pre.12 to 3.0.0-pre.13
@@ -1,5 +0,1 @@ | ||
import { IronResizableBehavior } from '../../iron-resizable-behavior.js'; | ||
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js'; | ||
import { html } from '@polymer/polymer/lib/utils/html-tag.js'; | ||
/** | ||
@@ -14,2 +10,6 @@ @license | ||
*/ | ||
import { IronResizableBehavior } from '../../iron-resizable-behavior.js'; | ||
import { Polymer } from '../../../polymer/lib/legacy/polymer-fn.js'; | ||
import { html } from '../../../polymer/lib/utils/html-tag.js'; | ||
Polymer({ | ||
@@ -28,22 +28,11 @@ _template: html` | ||
is: 'x-puck', | ||
behaviors: [IronResizableBehavior], | ||
behaviors: [ | ||
IronResizableBehavior | ||
], | ||
properties: { | ||
x: { | ||
type: Number, | ||
value: 0 | ||
}, | ||
x: {type: Number, value: 0}, | ||
y: { | ||
type: Number, | ||
value: 0 | ||
} | ||
y: {type: Number, value: 0} | ||
}, | ||
listeners: { | ||
'iron-resize': '_onIronResize' | ||
}, | ||
listeners: {'iron-resize': '_onIronResize'}, | ||
@@ -69,3 +58,2 @@ attached: function() { | ||
}); | ||
Polymer({ | ||
@@ -87,6 +75,3 @@ _template: html` | ||
is: 'x-app', | ||
behaviors: [ | ||
IronResizableBehavior | ||
] | ||
behaviors: [IronResizableBehavior] | ||
}); |
@@ -1,5 +0,33 @@ | ||
import '@polymer/polymer/polymer-legacy.js'; | ||
import { useShadow } from '@polymer/polymer/lib/utils/settings.js'; | ||
import { dom } from '@polymer/polymer/lib/legacy/polymer.dom.js'; | ||
/** | ||
@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 | ||
*/ | ||
import '../polymer/polymer-legacy.js'; | ||
import { useShadow } from '../polymer/lib/utils/settings.js'; | ||
import { dom } from '../polymer/lib/legacy/polymer.dom.js'; | ||
/** | ||
* `IronResizableBehavior` is a behavior that can be used in Polymer elements to | ||
* coordinate the flow of resize events between "resizers" (elements that | ||
*control the size or hidden state of their children) and "resizables" (elements | ||
*that need to be notified when they are resized or un-hidden by their parents | ||
*in order to take action on their new measurements). | ||
* | ||
* Elements that perform measurement should add the `IronResizableBehavior` | ||
*behavior to their element definition and listen for the `iron-resize` event on | ||
*themselves. This event will be fired when they become showing after having | ||
*been hidden, when they are resized explicitly by another resizable, or when | ||
*the window has been resized. | ||
* | ||
* Note, the `iron-resize` event is non-bubbling. | ||
* | ||
* @polymerBehavior Polymer.IronResizableBehavior | ||
* @demo demo/index.html | ||
**/ | ||
export const IronResizableBehavior = { | ||
@@ -10,6 +38,3 @@ properties: { | ||
*/ | ||
_parentResizable: { | ||
type: Object, | ||
observer: '_parentResizableChanged' | ||
}, | ||
_parentResizable: {type: Object, observer: '_parentResizableChanged'}, | ||
@@ -20,6 +45,3 @@ /** | ||
*/ | ||
_notifyingDescendant: { | ||
type: Boolean, | ||
value: false | ||
} | ||
_notifyingDescendant: {type: Boolean, value: false} | ||
}, | ||
@@ -100,3 +122,5 @@ | ||
*/ | ||
resizerShouldNotify: function(element) { return true; }, | ||
resizerShouldNotify: function(element) { | ||
return true; | ||
}, | ||
@@ -118,6 +142,3 @@ _onDescendantIronResize: function(event) { | ||
_fireResize: function() { | ||
this.fire('iron-resize', null, { | ||
node: this, | ||
bubbles: false | ||
}); | ||
this.fire('iron-resize', null, {node: this, bubbles: false}); | ||
}, | ||
@@ -160,25 +181,27 @@ | ||
}, | ||
_requestResizeNotifications: function() { | ||
if (!this.isAttached) | ||
return; | ||
// NOTE(valdrin) In CustomElements v1 with native HTMLImports, the order | ||
// of imports affects the order of `attached` callbacks (see webcomponents/custom-elements#15). | ||
// This might cause a child to notify parents too early (as the parent | ||
// still has to be upgraded), resulting in a parent not able to keep track | ||
// of the `_interestedResizables`. To solve this, we wait for the document | ||
// to be done loading before firing the event. | ||
// of imports affects the order of `attached` callbacks (see | ||
// webcomponents/custom-elements#15). This might cause a child to notify | ||
// parents too early (as the parent still has to be upgraded), resulting in | ||
// a parent not able to keep track of the `_interestedResizables`. To solve | ||
// this, we wait for the document to be done loading before firing the | ||
// event. | ||
if (document.readyState === 'loading') { | ||
var _requestResizeNotifications = this._requestResizeNotifications.bind(this); | ||
document.addEventListener('readystatechange', function readystatechanged() { | ||
document.removeEventListener('readystatechange', readystatechanged); | ||
_requestResizeNotifications(); | ||
}); | ||
var _requestResizeNotifications = | ||
this._requestResizeNotifications.bind(this); | ||
document.addEventListener( | ||
'readystatechange', function readystatechanged() { | ||
document.removeEventListener('readystatechange', readystatechanged); | ||
_requestResizeNotifications(); | ||
}); | ||
} else { | ||
this.fire('iron-request-resize-notifications', null, { | ||
node: this, | ||
bubbles: true, | ||
cancelable: true | ||
}); | ||
this.fire( | ||
'iron-request-resize-notifications', | ||
null, | ||
{node: this, bubbles: true, cancelable: true}); | ||
@@ -188,5 +211,5 @@ if (!this._parentResizable) { | ||
this.notifyResize(); | ||
} | ||
} | ||
} | ||
} | ||
}; |
@@ -18,10 +18,12 @@ { | ||
"bower": "^1.8.0", | ||
"@polymer/iron-component-page": "3.0.0-pre.12", | ||
"wct-browser-legacy": "0.0.1-pre.11", | ||
"@webcomponents/webcomponentsjs": "^1.0.0" | ||
"webmat": "^0.2.0", | ||
"@polymer/iron-component-page": "^3.0.0-pre.13", | ||
"wct-browser-legacy": "^0.0.1-pre.11", | ||
"@webcomponents/webcomponentsjs": "^2.0.0-0" | ||
}, | ||
"scripts": { | ||
"update-types": "bower install && gen-typescript-declarations --deleteExisting --outDir ." | ||
"update-types": "bower install && gen-typescript-declarations --deleteExisting --outDir .", | ||
"format": "webmat && npm run update-types" | ||
}, | ||
"version": "3.0.0-pre.12", | ||
"version": "3.0.0-pre.13", | ||
"resolutions": { | ||
@@ -36,4 +38,4 @@ "inherits": "2.0.3", | ||
"dependencies": { | ||
"@polymer/polymer": "3.0.0-pre.12" | ||
"@polymer/polymer": "^3.0.0-pre.13" | ||
} | ||
} |
@@ -1,7 +0,1 @@ | ||
import { IronResizableBehavior } from '../iron-resizable-behavior.js'; | ||
import './x-resizer-parent.js'; | ||
import './x-resizable.js'; | ||
import { Polymer as Polymer$0 } from '@polymer/polymer/lib/legacy/polymer-fn.js'; | ||
import { html } from '@polymer/polymer/lib/utils/html-tag.js'; | ||
/** | ||
@@ -16,2 +10,8 @@ @license | ||
*/ | ||
import { IronResizableBehavior } from '../iron-resizable-behavior.js'; | ||
import './x-resizer-parent.js'; | ||
import './x-resizable.js'; | ||
import { Polymer as Polymer$0 } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
import { html } from '../../polymer/lib/utils/html-tag.js'; | ||
Polymer$0({ | ||
@@ -23,5 +23,3 @@ | ||
behaviors: [ | ||
IronResizableBehavior | ||
], | ||
behaviors: [IronResizableBehavior], | ||
@@ -33,3 +31,2 @@ resizerShouldNotify: function(el) { | ||
}); | ||
Polymer$0({ | ||
@@ -44,3 +41,2 @@ _template: html` | ||
}); | ||
Polymer$0({ | ||
@@ -76,13 +72,7 @@ _template: html` | ||
/** @polymerBehavior */ | ||
export const ObserveIronResizeBehavior = { | ||
properties: { | ||
ironResizeCount: { | ||
type: Number, | ||
value: 0 | ||
} | ||
}, | ||
properties: {ironResizeCount: {type: Number, value: 0}}, | ||
listeners: { | ||
'iron-resize': '_incrementIronResizeCount' | ||
}, | ||
listeners: {'iron-resize': '_incrementIronResizeCount'}, | ||
@@ -101,6 +91,4 @@ _incrementIronResizeCount: function() { | ||
behaviors: [ | ||
IronResizableBehavior, | ||
ObserveIronResizeBehavior | ||
] | ||
behaviors: | ||
[IronResizableBehavior, ObserveIronResizeBehavior] | ||
}); | ||
@@ -115,6 +103,4 @@ Polymer$0({ | ||
behaviors: [ | ||
IronResizableBehavior, | ||
ObserveIronResizeBehavior | ||
] | ||
behaviors: | ||
[IronResizableBehavior, ObserveIronResizeBehavior] | ||
}); |
@@ -1,4 +0,1 @@ | ||
import { IronResizableBehavior } from '../iron-resizable-behavior.js'; | ||
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js'; | ||
/** | ||
@@ -13,2 +10,5 @@ @license | ||
*/ | ||
import { IronResizableBehavior } from '../iron-resizable-behavior.js'; | ||
import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
Polymer({ | ||
@@ -18,6 +18,4 @@ | ||
behaviors: [ | ||
IronResizableBehavior | ||
] | ||
behaviors: [IronResizableBehavior] | ||
}); |
@@ -1,4 +0,1 @@ | ||
import { IronResizableBehavior } from '../iron-resizable-behavior.js'; | ||
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js'; | ||
/** | ||
@@ -13,2 +10,5 @@ @license | ||
*/ | ||
import { IronResizableBehavior } from '../iron-resizable-behavior.js'; | ||
import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
Polymer({ | ||
@@ -18,6 +18,4 @@ | ||
behaviors: [ | ||
IronResizableBehavior | ||
] | ||
behaviors: [IronResizableBehavior] | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
36318
6
406
+ Added@polymer/polymer@3.5.1(transitive)
- Removed@polymer/polymer@3.0.0-pre.12(transitive)
- Removed@webcomponents/webcomponentsjs@1.3.3(transitive)