├── .bowerrc ├── .gitignore ├── .npmignore ├── .yo-rc.json ├── README.md ├── animations ├── fade-in-slide-from-left-animation.html ├── fade-in-slide-from-right-animation.html ├── fade-out-slide-left-animation.html └── fade-out-slide-right-animation.html ├── bower.json ├── demo ├── index.html └── paper-stepper-sandbox │ ├── index.html │ └── paper-stepper-sandbox.html ├── hero.svg ├── index.html ├── paper-step.html ├── paper-stepper.html ├── step-horizontal-label.html ├── step-label-behavior.html ├── step-label-shared-styles.html ├── step-vertical-label.html └── test ├── basic-test.html └── index.html /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components" 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | -------------------------------------------------------------------------------- /.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-polymer": { 3 | "ghUser": "Zecat" 4 | } 5 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # paper-stepper 2 | 3 | 4 | Paper-stepper is an element made with [Polymer](polymer-project.org/1.0/) to easily create a stepper with respect to the [material specification](https://www.google.com/design/spec/components/steppers.html). 5 | 6 | 7 | > Steppers display progress through a sequence by breaking it up into multiple logical and numbered steps. They may also be used for navigation. 8 | 9 | ## demo & doc 10 | 11 | See [component page](http://zecat.github.io/paper-stepper) 12 | 13 | ## installation 14 | 15 | `bower install -S Zecat/paper-stepper#v2.0-beta.5` 16 | 17 | ## Basic use 18 | 19 | ```html 20 | 21 | content step 1 22 | content step 2 23 | content step 3 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /animations/fade-in-slide-from-left-animation.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 46 | -------------------------------------------------------------------------------- /animations/fade-in-slide-from-right-animation.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 46 | -------------------------------------------------------------------------------- /animations/fade-out-slide-left-animation.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 46 | -------------------------------------------------------------------------------- /animations/fade-out-slide-right-animation.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 46 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "paper-stepper", 3 | "version": "2.0-beta.5", 4 | "authors": [ 5 | "Zecat " 6 | ], 7 | "description": "Material paper-stepper element.", 8 | "keywords": [ 9 | "web-component", 10 | "polymer", 11 | "seed" 12 | ], 13 | "main": "paper-stepper.html", 14 | "license": "http://polymer.github.io/LICENSE.txt", 15 | "homepage": "https://github.com/zecat/paper-stepper/", 16 | "ignore": [ 17 | "/.*", 18 | "/test/" 19 | ], 20 | "dependencies": { 21 | "polymer": "Polymer/polymer#^1.2.0", 22 | "paper-button": "PolymerElements/paper-button#^1.0.11", 23 | "iron-icons": "PolymerElements/iron-icons#^1.1.3", 24 | "paper-styles": "PolymerElements/paper-styles#^1.1.4", 25 | "paper-ripple": "PolymerElements/paper-ripple#^1.0.5", 26 | "iron-selector": "PolymerElements/iron-selector#^1.3.0", 27 | "iron-icon": "PolymerElements/iron-icon#^1.0.8", 28 | "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.3.1", 29 | "neon-animation": "PolymerElements/neon-animation#^1.1.1", 30 | "iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^1.0.5", 31 | "iron-collapse": "PolymerElements/iron-collapse#^1.2.0" 32 | }, 33 | "devDependencies": { 34 | "paper-input": "PolymerElements/paper-input#^1.1.10", 35 | "paper-material": "PolymerElements/paper-material#^1.0.6", 36 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", 37 | "web-component-tester": "*", 38 | "iron-form": "PolymerElements/iron-form#^1.0.16", 39 | "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.2", 40 | "paper-toggle-button": "PolymerElements/paper-toggle-button#^1.2.0", 41 | "app-layout": "PolymerElements/app-layout#^0.10.2", 42 | "paper-menu": "PolymerElements/paper-menu#^1.2.2", 43 | "iron-scroll-spy": "Zecat/iron-scroll-spy#^2.1.0", 44 | "paper-item": "PolymerElements/paper-item#^1.2.1", 45 | "paper-toast": "PolymerElements/paper-toast#^1.3.0", 46 | "paper-checkbox": "PolymerElements/paper-checkbox#^1.4.0" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | Paper-stepper Demo 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 132 | 133 | 134 | 135 | 136 | Description 137 | Configuration 138 | Validation 139 | Layout 140 | Buttons 141 | Styling 142 | Selection 143 | Animations 144 | Events 145 | Methods 146 | Binding 147 | Extra 148 | Sandbox 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 |
157 |

Description

158 |

Paper-stepper is an element made with Polymer with respect to the material specifications.

159 |

Steppers display progress through a sequence by breaking it up into multiple logical and numbered steps. They may also be used for navigation.

160 |

Spec recommendation: Avoid using steppers to break up sections in a short form, or multiple times on one page and don’t embed steppers within steppers.

161 |

Start using now bower install -S Zecat/paper-stepper#v2.0-beta.5

162 |

Note, it is still a beta release, attributes and methods might change suddenly.

163 |
164 |
165 |

Configuration

166 |

Paper-stepper is a container for paper-step's. Give a label to your steps, once the user tap the primary button, the step is saved and the stepper progress. He can come back to update a saved step if it has editable attribute set.

167 |
    168 |
  • Editable steps allow users to return later to edit a step. These are ideal for workflows that involve editing steps within a session.
  • 169 |
  • Non-editable steps should be used when the users cannot edit a step later and when step editing poses a distraction risk to form completion.
  • 170 |
171 | 172 | 180 | 181 |

Include any content you want in a step, simply ensure that the contents for each step are responsive and don’t embed steppers within steppers. If the content overflow, the step will be scrollable.

182 | 183 | 200 | 201 |

The stepper is non-linear by default, which allow users to enter a multi-step flow at any point whereas a linear stepper requires users to complete one step in order to move on to the next.

202 | 203 | 211 | 212 |

optional steps don't bloc the progression in linear stepper [Missing feature]. You can configure the text displayed which default to "optional" with optional-text attribute.

213 | 214 | 222 | 223 |
224 |
225 |

Validation

226 |

Paper-step implement IronValidatableBehavior. Override _getValidity() method on a step to create your own validation logique.

227 | 228 | 251 | 252 |
253 |
254 |

Layout

255 |

Paper-stepper is horizontal by default. Horizontal steppers are ideal when the contents of one step depend on an earlier step. Avoid using long step names in horizontal steppers.

256 |

The alternative label take effect in horizontal layout and allows slightly longer labels.

257 | 258 | 266 | 267 |

Use the vertical layout for narrow screen sizes, when your labels are too long or when you have too many steps. It is ideal for mobile.

268 | 269 | 277 | 278 |

If you specify --paper-stepper-vertical-responsive-width, the stepper manage the vertical attribute itself. When the width of the stepper (not the viewport width!) is inferior to the variable, the vertical layout is use.

279 |

For performance reason, the responsive check is debounced according to responsive-check-frequence which default to 200ms.

280 |

Resize your window to see the effect.

281 | 282 | 302 | 303 |
304 |
305 |

Buttons

306 |
    307 |
  • Set has-back-button if you want a back button, the back action send you to the previous sibling selectable step and is disabled if this step doesn't exist.
  • 308 |
  • Set has-skip-button if you want a skip button. The skip action loops around the steps to find the next selectable unsaved step. If this step doesn't exist, the button is disabled.
  • 309 |
310 | 311 | 318 | 319 |

You can configure the text of the above buttons with back-text and skip-text attributes.

320 |

The text of the primary button correspond to continue-text attribute by default, update-text if the step is saved and finish-text if it is the last unsaved step. Texts are capitalized within the buttons.

321 | 322 | 329 | 330 |
331 |
332 |

Styling

333 |

In vertical layout, the height of the stepper depends on his steps and in an opened horizontal stepper, it defaults to 450px.

334 |

Use the following variables instead of setting 'height' and 'max-height', they allow to configure the stepper and its steps depending on the layout.

335 |

Stepper CSS variables

336 |
    337 |
  • --paper-stepper-horizontal-opened-height : the height of paper stepper in horizontal layout when it is opened, default to 450px.
  • 338 |
  • --paper-stepper-vertical-max-height: the max height of the vertical stepper, not defined by default.
  • 339 |
  • --paper-stepper-horizontal-opening-transition-duration: the horizontal stepper opening transition duration, default to 500ms.
  • 340 |
341 | 342 | 363 | 364 |

Steps CSS variables

365 |
    366 |
  • --paper-vertical-step-transition-duration: the vertical step opening transition duration, default to 500ms.
  • 367 |
  • --paper-vertical-step-max-height: the max-height of the content of your step, default to 400px.
  • 368 |
369 | 370 | 386 | 387 |
388 |
389 |

Selection

390 |

Paper-stepper implement IronSelectableBehavior. By default, selected reflet the selected index (the first step has index 0). Give a default value to selected for the step to be opened when the user land on the stepper.

391 |

Note: The behavior is slightly modified to only allow the selection of selectable steps.

392 | 393 | 401 | 402 |

You can use attr-for-selected for selected to reflect an attribute on your step.

403 | 404 | 420 | 421 |
422 |
423 |

Animations

424 |

You can define animations between steps in horizontal layout. Import your animations and set

425 |
    426 |
  • horizontal-higher-entry-animation
  • 427 |
  • horizontal-lower-entry-animation
  • 428 |
  • horizontal-higher-exit-animation
  • 429 |
  • horizontal-lower-exit-animation
  • 430 |
431 |

to the name of the wanted animation, directly on paper-stepper or on a specific paper-step.

432 | 433 | 446 | 447 |
448 |
449 |

Events

450 |
    451 |
  • paper-stepper-completed is fired from the stepper when all the steps are saved.
  • 452 |
  • paper-step-saved is fired from a step when it become saved.
  • 453 |
  • paper-step-updated is fired from a step it is saved again.
  • 454 |
455 | 456 | 474 | 475 |
476 |
477 |

Methods

478 | 479 | 512 | 513 |
514 |
515 |

Binding

516 |

You can bind these attributes to be notified of changes about the stepper and its steps.

517 | 518 | 540 | 541 |
542 |
543 |

Extra

544 |

In horizontal layout, labels are overflow ellipsis and will be revealed on hover. For long labels, prefer use alternative label or vertical layout.

545 | 546 | 554 | 555 | 556 |

By-product: This demo is made with iron-scroll-spy, fork!

557 | 558 |
559 |
560 |

Sandbox

561 |

Change on an attribute will be immediately reflected.

562 | 563 | 564 |
565 |
566 |
567 | 579 | 580 | 581 | 582 | -------------------------------------------------------------------------------- /demo/paper-stepper-sandbox/index.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | Paper-stepper Demo 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /demo/paper-stepper-sandbox/paper-stepper-sandbox.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 77 | 105 | 106 | -------------------------------------------------------------------------------- /hero.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /paper-step.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 160 | 161 | 524 | 525 | -------------------------------------------------------------------------------- /paper-stepper.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 103 | 104 | 193 | 194 | 730 | 731 | -------------------------------------------------------------------------------- /step-horizontal-label.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 98 | 116 | 117 | -------------------------------------------------------------------------------- /step-label-behavior.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 59 | -------------------------------------------------------------------------------- /step-label-shared-styles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 76 | 77 | -------------------------------------------------------------------------------- /step-vertical-label.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 64 | 81 | 82 | -------------------------------------------------------------------------------- /test/basic-test.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 | --------------------------------------------------------------------------------