-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc generation #86
Merged
Merged
Doc generation #86
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b03b3ab
Implemented automatic release version and changelog generation
fragsalat 2868ef0
feat(documentation): Fixed api doc generation, added doc for dropdown…
fragsalat 92060a5
fix(documentation): Fixed API generation to only generate one file pe…
fragsalat cff822d
Merge branch 'master' of github.com:wholesale-design-system/component…
fragsalat b167e89
Merge branch 'master' into doc-generation
fragsalat 4573649
Moved document linting into separate task
fragsalat adafaec
feat(documentation): Added new doc for date picker and notification
fragsalat dd73931
Merge branch 'master' of github.com:wholesale-design-system/component…
fragsalat 87b21f8
Set real email
fragsalat 3e599ae
Fixed PR feedback, removed obsolete docs folder
fragsalat 9ad94c9
fix(date-picker): Made changing format of date picker only global pos…
fragsalat 2f8532b
fix(documentation): Changed dropdown disabled documentation
fragsalat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Date Picker | ||
|
||
## Simple date picker | ||
A date picker consist in general of an input element and a picker dialog which appears when the input | ||
is focused and gives the user the ability to select a date in a natural way. Our date picker is a complete | ||
component which comes with all of these. As with all of our components the changes are propagated via | ||
custom change events which contains details about the selected date as object and pre-formatted string. | ||
Like a common input element you can set the `placeholder` and `value` attribute while the value has to be | ||
a date string which is parsable by `Date.parse()` or which matches the value in the `format` attribute if specified. | ||
|
||
<ws-date-picker placeholder="Select a date" change.delegate="log('Date1 changed', $event)"></ws-date-picker> | ||
```html | ||
<ws-date-picker placeholder="Select a date" id="date1"></ws-date-picker> | ||
<script> | ||
document.getElementById('date1').addEventListener('change', event => console.log('Date1 changed', event)); | ||
</script> | ||
``` | ||
|
||
## Formatting dates | ||
If you have a localized website or simply have a global date format you want to use, you can change the | ||
formatting of the date picker component by calling the static method `setFormat` on `WSDatePicker` class. | ||
The pattern for the format follows the rules of the [flatpickr](https://chmln.github.io/flatpickr/formatting/). | ||
For instance `Y-m-d` will result in the date `2017-06-04` which will be displayed in the input and passed | ||
through the change event. | ||
|
||
```html | ||
<script> | ||
WSDatePicker.setFormat('Y-m-d'); | ||
</script> | ||
<ws-date-picker value="2017-06-04"></ws-date-picker> | ||
``` | ||
|
||
## Custom options | ||
Since our date picker is based on the flatpickr you can configure it like the flatpickr by passing an | ||
object through the `options` attribute. All possible options can be found [here](https://chmln.github.io/flatpickr/options/). | ||
|
||
<ws-date-picker value="2017-06-15" format="Y-m-d" options.bind="{minDate: '2017-06-01', maxDate: '2017-06-24'}"></ws-date-picker> | ||
```html | ||
<ws-date-picker | ||
value="2017-06-15" | ||
options='{"minDate": "2017-06-01", "maxDate": "2017-06-24"}'> | ||
</ws-date-picker> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Notification | ||
|
||
## Setup | ||
Because the notifications are elements which should be displayed on top of everything and relative to the window | ||
you have to add the tag `<ws-notification></ws-notification>` to the most root container you can add. | ||
So either document body or the application root depending on your setup. This notification element is | ||
just the holder / list of notifications. | ||
|
||
## Creating notifications | ||
To create a notification you have to publish a custom event to the window containing the relevant data. | ||
The type of the event has to be `ws-notification-open` and the details has to be an object containing: | ||
- **title**: string, required | ||
- **description**: string, optional | ||
- **type**: string, oneOf: info|error|warning|success, default: info | ||
- **lifetime**: number, milliseconds until disappearing, default: 2147483647 | ||
|
||
<button class="mod-small" id="notification1" click.delegate="notification({title: 'Do you want to stay logged in?', type: 'info', lifetime: 5000})">Show notification</button> | ||
```html | ||
<button class="mod-small" id="notification1">Show notification</button> | ||
<script type="text/javascript"> | ||
document.getElementById('notification1').addEventListener('click', event => { | ||
window.dispatchEvent(new CustomEvent('ws-notification-open', {detail: {title: 'Do you want to stay logged in?', type: 'info', lifetime: 5000}})); | ||
}); | ||
</script> | ||
``` | ||
|
||
## Options | ||
Here you can try out the different combinations of the options you can provide to the notification. | ||
<div class="row collapse"> | ||
<div class="column small-6"> | ||
<label>Title</label> | ||
<input type="text" placeholder="Title" value="Some title" ref="navTitle" /> | ||
</div> | ||
<div class="column small-6"> | ||
<label>Description</label> | ||
<input type="text" placeholder="Title" ref="navDescription" /> | ||
</div> | ||
<div class="column small-6"> | ||
<label>Type</label> | ||
<select ref="navType"> | ||
<option value="info">Info</option> | ||
<option value="success">Success</option> | ||
<option value="warning">Warning</option> | ||
<option value="error">Error</option> | ||
</select> | ||
</div> | ||
<div class="column small-6"> | ||
<label>Lifetime</label> | ||
<input type="number" placeholder="Title" value="5000" ref="navLifetime" /> | ||
</div> | ||
</div></br> | ||
<button class="mod-small" click.delegate="notification({title: navTitle.value, description: navDescription.value, type: navType.value, lifetime: navLifetime.value})">Show notification</button> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use different PRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say, in the future something like "tech-fabric@zalando.de" where all engineers working with it are subscribed ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said you can create such a user if you want :D
I don't know where to store the credentials in a secure way so that also peoples after us get the access.