@polymer/paper-dialog-behavior
Advanced tools
Comparing version 3.0.0-pre.3 to 3.0.0-pre.4
@@ -1,7 +0,8 @@ | ||
import '../../polymer/polymer.js'; | ||
import '../paper-dialog-behavior.js'; | ||
import { html } from '../../polymer/polymer.js'; | ||
import { PaperDialogBehavior } from '../paper-dialog-behavior.js'; | ||
import '../paper-dialog-shared-styles.js'; | ||
import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
Polymer({ | ||
_template: Polymer.html` | ||
_template: html` | ||
<style include="paper-dialog-shared-styles"></style> | ||
@@ -14,4 +15,4 @@ <slot></slot> | ||
behaviors: [ | ||
Polymer.PaperDialogBehavior | ||
PaperDialogBehavior | ||
] | ||
}); |
{ | ||
"name": "@polymer/paper-dialog-behavior", | ||
"flat": true, | ||
"version": "3.0.0-pre.3", | ||
"version": "3.0.0-pre.4", | ||
"description": "Implements a behavior used for material design dialogs", | ||
@@ -22,17 +22,17 @@ "contributors": "The Polymer Authors", | ||
"dependencies": { | ||
"@polymer/iron-overlay-behavior": "^3.0.0-pre.3", | ||
"@polymer/paper-styles": "^3.0.0-pre.3", | ||
"@polymer/polymer": "^3.0.0-pre.3" | ||
"@polymer/iron-overlay-behavior": "^3.0.0-pre.4", | ||
"@polymer/paper-styles": "^3.0.0-pre.4", | ||
"@polymer/polymer": "^3.0.0-pre.4" | ||
}, | ||
"devDependencies": { | ||
"@polymer/iron-component-page": "^3.0.0-pre.3", | ||
"@polymer/iron-demo-helpers": "^3.0.0-pre.3", | ||
"@polymer/iron-test-helpers": "^3.0.0-pre.3", | ||
"@polymer/paper-button": "^3.0.0-pre.3", | ||
"@polymer/paper-dialog-scrollable": "^3.0.0-pre.3", | ||
"@polymer/paper-dropdown-menu": "^3.0.0-pre.3", | ||
"@polymer/paper-icon-button": "^3.0.0-pre.3", | ||
"@polymer/paper-item": "^3.0.0-pre.3", | ||
"@polymer/paper-listbox": "^3.0.0-pre.3", | ||
"wct-browser-legacy": "0.0.1-pre.11", | ||
"@polymer/iron-component-page": "^3.0.0-pre.4", | ||
"@polymer/iron-demo-helpers": "^3.0.0-pre.4", | ||
"@polymer/iron-test-helpers": "^3.0.0-pre.4", | ||
"@polymer/paper-button": "^3.0.0-pre.4", | ||
"@polymer/paper-dialog-scrollable": "^3.0.0-pre.4", | ||
"@polymer/paper-dropdown-menu": "^3.0.0-pre.4", | ||
"@polymer/paper-icon-button": "^3.0.0-pre.4", | ||
"@polymer/paper-item": "^3.0.0-pre.4", | ||
"@polymer/paper-listbox": "^3.0.0-pre.4", | ||
"wct-browser-legacy": "0.0.1-pre.10", | ||
"@webcomponents/webcomponentsjs": "^1.0.0" | ||
@@ -39,0 +39,0 @@ }, |
import '../polymer/polymer.js'; | ||
import '../iron-overlay-behavior/iron-overlay-behavior.js'; | ||
import { IronOverlayBehavior } from '../iron-overlay-behavior/iron-overlay-behavior.js'; | ||
import { dom } from '../polymer/lib/legacy/polymer.dom.js'; | ||
/** | ||
Use `Polymer.PaperDialogBehavior` and `paper-dialog-shared-styles.html` to implement a Material Design | ||
dialog. | ||
export const PaperDialogBehaviorImpl = { | ||
For example, if `<paper-dialog-impl>` implements this behavior: | ||
<paper-dialog-impl> | ||
<h2>Header</h2> | ||
<div>Dialog body</div> | ||
<div class="buttons"> | ||
<paper-button dialog-dismiss>Cancel</paper-button> | ||
<paper-button dialog-confirm>Accept</paper-button> | ||
</div> | ||
</paper-dialog-impl> | ||
`paper-dialog-shared-styles.html` provide styles for a header, content area, and an action area for buttons. | ||
Use the `<h2>` tag for the header and the `buttons` class for the action area. You can use the | ||
`paper-dialog-scrollable` element (in its own repository) if you need a scrolling content area. | ||
Use the `dialog-dismiss` and `dialog-confirm` attributes on interactive controls to close the | ||
dialog. If the user dismisses the dialog with `dialog-confirm`, the `closingReason` will update | ||
to include `confirmed: true`. | ||
### Accessibility | ||
This element has `role="dialog"` by default. Depending on the context, it may be more appropriate | ||
to override this attribute with `role="alertdialog"`. | ||
If `modal` is set, the element will prevent the focus from exiting the element. | ||
It will also ensure that focus remains in the dialog. | ||
@hero hero.svg | ||
@demo demo/index.html | ||
@polymerBehavior Polymer.PaperDialogBehavior | ||
*/ | ||
Polymer.PaperDialogBehaviorImpl = { | ||
hostAttributes: { | ||
@@ -116,3 +82,3 @@ 'role': 'dialog', | ||
// from the root target until this (excluded). | ||
var path = Polymer.dom(event).path; | ||
var path = dom(event).path; | ||
for (var i = 0, l = path.indexOf(this); i < l; i++) { | ||
@@ -131,3 +97,2 @@ var target = path[i]; | ||
/** @polymerBehavior */ | ||
Polymer.PaperDialogBehavior = [Polymer.IronOverlayBehavior, Polymer.PaperDialogBehaviorImpl]; | ||
export const PaperDialogBehavior = [IronOverlayBehavior, PaperDialogBehaviorImpl]; |
@@ -1,5 +0,6 @@ | ||
import '../../polymer/polymer.js'; | ||
import { html } from '../../polymer/polymer.js'; | ||
import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
Polymer({ | ||
_template: Polymer.html` | ||
_template: html` | ||
<button dialog-dismiss="" id="dismiss">dismiss</button> | ||
@@ -6,0 +7,0 @@ <button dialog-confirm="" id="confirm">confirm</button> |
@@ -1,7 +0,8 @@ | ||
import '../../polymer/polymer.js'; | ||
import '../paper-dialog-behavior.js'; | ||
import { html } from '../../polymer/polymer.js'; | ||
import { PaperDialogBehavior } from '../paper-dialog-behavior.js'; | ||
import '../paper-dialog-shared-styles.js'; | ||
import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js'; | ||
Polymer({ | ||
_template: Polymer.html` | ||
_template: html` | ||
<style include="paper-dialog-shared-styles"></style> | ||
@@ -14,4 +15,4 @@ <slot></slot> | ||
behaviors: [ | ||
Polymer.PaperDialogBehavior | ||
PaperDialogBehavior | ||
] | ||
}); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
47878
260