Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Commit 5acef41

Browse files
author
Kevin Manson
committed
feat(loader): add new component
1 parent 713e2f6 commit 5acef41

17 files changed

+262
-15
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
],
1010
"repository": "ovh-ux/ovh-ui-angular",
1111
"main": "./packages/oui-angular/dist/oui-angular.js",
12-
"webpack": "packages/oui-angular/src/index.js",
12+
"browser": "./packages/oui-angular/dist/oui-angular.js",
13+
"module": "packages/oui-angular/src/index.js",
1314
"scripts": {
1415
"bootstrap": "lerna bootstrap",
1516
"wipe": "lerna clean",

packages/oui-angular/dist/oui-angular.js

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oui-angular/dist/oui-angular.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oui-angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"@oui-angular/checkbox": "^1.0.0",
1414
"@oui-angular/message": "^1.0.0",
1515
"@oui-angular/radio": "^1.0.0",
16-
"@oui-angular/radio-group": "^1.0.0"
16+
"@oui-angular/radio-group": "^1.0.0",
17+
"@oui-angular/loader": "^1.0.0"
1718
},
1819
"devDependencies": {
1920
"babel-cli": "^6.24.1",

packages/oui-angular/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import '@oui-angular/checkbox/src'
22
import '@oui-angular/radio/src'
33
import '@oui-angular/radio-group/src'
44
import '@oui-angular/message/src'
5+
import '@oui-angular/loader/src'
56

67
angular.module('oui', [
78
'oui.checkbox',
89
'oui.radio',
910
'oui.radio-group',
10-
'oui.message'
11+
'oui.message',
12+
'oui.loader'
1113
])

packages/oui-angular/src/index.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ loadTests(require.context('../../oui-checkbox/src/', true, /.*((\.spec)|(index))
22
loadTests(require.context('../../oui-message/src/', true, /.*((\.spec)|(index))$/))
33
loadTests(require.context('../../oui-radio/src/', true, /.*((\.spec)|(index))$/))
44
loadTests(require.context('../../oui-radio-group/src/', true, /.*((\.spec)|(index))$/))
5+
loadTests(require.context('../../oui-loader/src/', true, /.*((\.spec)|(index))$/))
56

67
function loadTests (context) {
78
context.keys().forEach(context)

packages/oui-loader/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
dist/
3+
coverage/
4+
*.log
5+
yarn.lock

packages/oui-loader/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Loader
2+
3+
<component-status cx-design="partial" ux="rc"></component-status>
4+
5+
## Usage
6+
7+
### Small
8+
```html:preview
9+
<oui-loader size="s"></oui-loader>
10+
```
11+
12+
By default, small loader is the only one displayed as an inline element.
13+
14+
### Medium
15+
```html:preview
16+
<oui-loader size="m"></oui-loader>
17+
```
18+
19+
### Big
20+
```html:preview
21+
<oui-loader size="l"></oui-loader>
22+
```
23+
24+
### Inline
25+
```html:preview
26+
<oui-loader size="m" inline="true"></oui-loader>
27+
```
28+
29+
| Name | Type | Values | Default | Description |
30+
| ---- | ---- | ---- | ---- | ---- |
31+
| `size` | String | s, m, l | m | Loader size |
32+
| `inline` | Boolean | | `false` (`true` for small loader) | Inline display |

packages/oui-loader/karma.conf.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { configure as configureKarma } from '../../build/karma.single.conf'
2+
3+
module.exports = (config) => {
4+
const karmaConfig = configureKarma(__dirname)
5+
6+
karmaConfig.files.unshift(require.resolve('angular-mocks'))
7+
karmaConfig.files.unshift(require.resolve('angular'))
8+
karmaConfig.webpack.devtool = 'inline-source-map'
9+
10+
config.set({
11+
...karmaConfig
12+
})
13+
}

packages/oui-loader/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "@oui-angular/loader",
3+
"version": "1.0.0",
4+
"main": "dist/component.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"build": "rimraf dist && webpack --progress --colors --hide-modules --config webpack.config.babel.js",
8+
"karma:watch": "cross-env NODE_ENV=test babel-node $(npm bin)/karma start karma.conf.js --watch",
9+
"karma:chrome": "cross-env NODE_ENV=test babel-node $(npm bin)/karma start karma.conf.js --browsers Chromium",
10+
"karma": "cross-env NODE_ENV=test babel-node $(npm bin)/karma start karma.conf.js --reporters spec,coverage-istanbul --single-run",
11+
"webdriver:update": "webdriver-manager update",
12+
"protractor": "babel-node $(yarn bin)/protractor",
13+
"test": "yarn karma && yarn protractor"
14+
},
15+
"dependencies": {
16+
"angular": "^1.6.5"
17+
},
18+
"devDependencies": {
19+
"babel-cli": "^6.24.1",
20+
"cross-env": "^3.2.4",
21+
"karma": "^1.7.0",
22+
"protractor": "^4.0.14",
23+
"rimraf": "^2.6.1",
24+
"webpack": "^1.15.0"
25+
},
26+
"engines": {
27+
"node": ">= 6.9.0",
28+
"npm": ">= 3.10.0",
29+
"yarn": ">= 0.17.0"
30+
}
31+
}

0 commit comments

Comments
 (0)