|
1 | | -# integralui-web-progressbar |
| 1 | +# IntegralUI Web - ProgressBar, v22.2 |
| 2 | + |
| 3 | +IntegralUI Web - ProgressBar is a native Web Component that visualize the progression of an operation. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +<b>Note</b> This component is part of [IntegralUI Web](https://github.com/lidorsystems/integralui-web.git) library. |
| 8 | + |
| 9 | +Here is a brief overview of what is included: |
| 10 | + |
| 11 | + |
| 12 | +## Components |
| 13 | + |
| 14 | +[ProgressBar](https://www.lidorsystems.com/products/web/studio/samples/#/progressbar) - Visualize the progression of an operation |
| 15 | + |
| 16 | + |
| 17 | +## Services |
| 18 | + |
| 19 | +<b>Common</b> - Includes a set of common functions usable in most applications |
| 20 | + |
| 21 | + |
| 22 | +## Dependencies |
| 23 | + |
| 24 | +IntegralUI Web is built on top of [LitElement](https://github.com/Polymer/lit-element). All necessary files from that library are already included in the /external subfolder of this repository. |
| 25 | + |
| 26 | + |
| 27 | +## DEMO |
| 28 | + |
| 29 | +[Online QuickStart App](https://www.lidorsystems.com/products/web/studio/samples/) - An online demo of ProgressBar component is included |
| 30 | + |
| 31 | + |
| 32 | +## Installation |
| 33 | + |
| 34 | +Install the repository by running |
| 35 | + |
| 36 | +```bash |
| 37 | +npm install https://github.com/lidorsystems/integralui-web-progressbar.git |
| 38 | +``` |
| 39 | + |
| 40 | +or directly from NPM |
| 41 | + |
| 42 | +```bash |
| 43 | +npm i integralui-web-progressbar |
| 44 | +``` |
| 45 | + |
| 46 | + |
| 47 | +## How to Use |
| 48 | + |
| 49 | +<b>Note</b> A detailed information is available here: [How to Use IntegralUI Web Components](https://www.lidorsystems.com/help/integralui/web-components/introduction/installation/). Explains how to setup and use components for each framework: Angular, React or Vanilla JavaScript. |
| 50 | + |
| 51 | +In general, you need to open your application and add a reference to a component you want to use. For example, if you are using the IntegralUI ProgressBar component:</p> |
| 52 | + |
| 53 | +### Angular |
| 54 | + |
| 55 | +```bash |
| 56 | +import 'integralui-web-progressbar/components/integralui.progressbar.js'; |
| 57 | + |
| 58 | +@Component({ |
| 59 | + selector: '', |
| 60 | + templateUrl: './progressbar-overview.html', |
| 61 | + styleUrls: ['./progressbar-overview.css'] |
| 62 | +}) |
| 63 | +export class ProgressBarOverviewSample { |
| 64 | + public ctrlSize: any = { width: 300 }; |
| 65 | + public progressValue1: number = 50; |
| 66 | +} |
| 67 | +``` |
| 68 | +
|
| 69 | +Then, place the component in HTML using its tag. Here is an example: |
| 70 | +
|
| 71 | +
|
| 72 | +```bash |
| 73 | +<div class="sample-block" id="progressbar-overview"> |
| 74 | + <iui-progressbar id="progress-1" [allowAnimation]="true" [size]="ctrlSize" [value]="progressValue1"></iui-progressbar> |
| 75 | +</div> |
| 76 | +``` |
| 77 | +
|
| 78 | +Depending on current version of TypeScript, you may need to add some settings in tsconfig.json, under "angularCompilerOptions": |
| 79 | +
|
| 80 | +```bash |
| 81 | +"angularCompilerOptions": { |
| 82 | + |
| 83 | + . . . |
| 84 | + |
| 85 | + "suppressImplicitAnyIndexErrors": true, // solves implicit any values |
| 86 | + "noImplicitAny": false, // solves angular could not find a declaration file for module implicitly has an 'any' type |
| 87 | + "strictNullChecks": false // solves type null is not assignable to type |
| 88 | + |
| 89 | +} |
| 90 | +``` |
| 91 | +
|
| 92 | +
|
| 93 | +### React |
| 94 | +
|
| 95 | +Currently [ReactJS doesn't have full support for Web Components](https://custom-elements-everywhere.com/#react). Mainly because of the way data is passed to the component via attributes and their own synthetic event system. For this reason, you can use available wrappers located under /wrappers directory, which are ReactJS components that provide all public API from an IntegralUI component.</p> |
| 96 | +
|
| 97 | +```bash |
| 98 | +import IntegralUIProgressBarComponent from 'integralui-web-progressbar/wrappers/react.integralui.progressbar.js'; |
| 99 | +``` |
| 100 | +
|
| 101 | +Then, place the component in HTML using its tag. Here is an example: |
| 102 | +
|
| 103 | +```bash |
| 104 | +class ProgressBarOverview extends Component { |
| 105 | +
|
| 106 | + constructor(props){ |
| 107 | + super(props); |
| 108 | +
|
| 109 | + this.state = { |
| 110 | + ctrlSize: { width: 300 }, |
| 111 | + isAnimationAllowed: true, |
| 112 | + progressValue1: 50 |
| 113 | + } |
| 114 | + } |
| 115 | +
|
| 116 | + render() { |
| 117 | + return ( |
| 118 | + <div className="sample-block" id="progressbar-overview"> |
| 119 | + <IntegralUIProgressBarComponent id="progress-1" allowAnimation={this.state.isAnimationAllowed} size={this.state.ctrlSize} value={this.state.progressValue1}></IntegralUIProgressBarComponent> |
| 120 | + </div> |
| 121 | + ); |
| 122 | + } |
| 123 | +} |
| 124 | +``` |
| 125 | +
|
| 126 | +
|
| 127 | +### Vanilla JavaScript |
| 128 | +
|
| 129 | +```bash |
| 130 | +<script type="module" src="integralui-web-progressbar/components/integralui.progressbar.js"></script> |
| 131 | +``` |
| 132 | +
|
| 133 | +Then, place the component in HTML using its tag. Here is an example: |
| 134 | +
|
| 135 | +```bash |
| 136 | +<div class="sample-block"> |
| 137 | + <iui-progressbar id="progress-1" allow-animation="true" value="50"></iui-progressbar> |
| 138 | +</div> |
| 139 | +``` |
| 140 | +
|
| 141 | +## How to Change Appearance |
| 142 | +
|
| 143 | +To modify the ProgressBar appearance, you can use CSS custom properties: |
| 144 | +
|
| 145 | +```bash |
| 146 | +iui-progressbar { |
| 147 | + --progressbar-border: 0; |
| 148 | + --progressbar-margin: 7px 0; |
| 149 | + --progressbar-padding: 0; |
| 150 | +
|
| 151 | + --progressbar-track-border-width: 0; |
| 152 | + --progressbar-track-border-radius: 15px; |
| 153 | + --progressbar-label-border-radius: 0 15px 15px 0; |
| 154 | +} |
| 155 | +[id="progress-1"] { |
| 156 | + --progressbar-content-background: #cc2b2b; |
| 157 | + --progressbar-content-border-radius: 15px; |
| 158 | + --progressbar-content-height: 12px; |
| 159 | +} |
| 160 | +``` |
| 161 | +
|
| 162 | +## QuickStart App |
| 163 | +
|
| 164 | +There is a demo application with source code that contains samples for each component included in the IntegralUI Web library. It can help you to get started quickly with learning about the components and write tests immediatelly. |
| 165 | +
|
| 166 | +From [IntegralUI Web - QuickStart](https://github.com/lidorsystems/integralui-web-quickstart) you can download a demo app for Angular, AngularJS, React and Vanilla JavaScript. A detailed information about each of these quick-start demos is available in ReadMe file, located in the root folder of the demo app. |
| 167 | +
|
| 168 | +
|
| 169 | +## License Information |
| 170 | +
|
| 171 | +You are FREE to use this product to develop Internet and Intranet web sites, web applications and other products, with no-charge. |
| 172 | +
|
| 173 | +This project has been released under the IntegralUI Web Lite License, and may not be used except in compliance with the License. |
| 174 | +A copy of the License should have been installed in the product's root installation directory or it can be found here: [License Agreement](https://www.lidorsystems.com/products/web/lite/integralui-web-lite-license-agreement.pdf). |
| 175 | +
|
| 176 | +This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. |
0 commit comments