-
Notifications
You must be signed in to change notification settings - Fork 7
feat(oui-progress): progress component implementation #192
Conversation
@ganeshkumar1989 Is there a staging (not in the ticket) ? |
I have added the staging link @AxelPeter . The link is also available in the ticket :) |
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.
.oui-progress
style is outdated and need to be changed first because it'll impact the component design. Check the guidelines and specs, they have been updated last month :)
packages/oui-progress/README.md
Outdated
|
||
| Attribute | Type | Binding | One-time binding | Values | default | Description | | ||
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| type | String | @ | yes | `info`, `success`, `warning`, `error` | | Type of the progress component | |
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.
From the specs, this attribute should be only on children
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.
The parent and child are now combined to a single component
packages/oui-progress/README.md
Outdated
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| type | String | @ | yes | `info`, `success`, `warning`, `error` | | Type of the progress component | | ||
| max-value | Number | @? | yes | | 100 | The max value for the progress bar | | ||
| indeterminate | Boolean | <? | yes | | false | Enable/Disable indeterminate mode. When in this mode, the progress component shows an indefinite wait and the max-value would not have any effect. In this mode, the progress component should not have any other component in it | |
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.
Guidelines has changed since, this is not needed
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.
This has been removed
packages/oui-progress/README.md
Outdated
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | | ||
| type | String | @? | yes | `info`, `success`, `warning`, `error` | parent's type | Type of the progress bar. If not provided, takes the type of the parent | | ||
| value | Number | < | no | | | The current value for the progress bar | | ||
| label-align | String | @? | yes | `left`, `right` | right | The alignment of the label inside the progress bar | |
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.
No need, the value is always right aligned (see UI specs)
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.
This is removed :)
const widthPrecentage = (this.value * maxValuePercentage) / this.parent.maxValue; | ||
this.$element.addClass("oui-progress__bar"); | ||
this.$element.addClass(`oui-progress__bar_${this.type}`); | ||
this.$element.css("width", `${widthPrecentage}%`); |
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.
DOM manipulations need a $timeout wrap
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.
This is done :)
const maxValuePercentage = 100; | ||
const leftPrecentage = (this.value * maxValuePercentage) / this.parent.maxValue; | ||
this.$element.addClass("oui-progress__threshold"); | ||
this.$element.css("left", `${leftPrecentage}%`); |
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.
Same as above, $timeout :)
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.
This is done :)
Hello @ganeshkumar1989, |
Added progress component
updated to match the latest UI spec
881adfc
to
0c54d09
Compare
c6b0af6
to
c721346
Compare
c721346
to
fd0f641
Compare
UU-842
Added progress component
Staging link: http://feature_oui_progress_build.ui-kit.ovh/#!/oui-angular/progress
Linked To:
ovh/ovh-ui-kit#213
ovh-ux/ovh-ui-kit-documentation#112