sling-web-component-loader
Advanced tools
Comparing version 0.17.0 to 1.3.0
{ | ||
"name": "sling-web-component-loader", | ||
"version": "0.17.0", | ||
"description": "", | ||
"main": "dist/cjs/index.js", | ||
"jsnext:main": "dist/es/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"version": "1.3.0", | ||
"description": "Sling Web Component Loader", | ||
"module": "src/index.js", | ||
"main": "dist/cjs/es6/index.js", | ||
"jsnext:main": "dist/es/es6/index.js", | ||
"browser": "dist/iife/es6/index.js", | ||
"author": "Stone Pagamentos", | ||
"dependencies": { | ||
"sling-web-framework": "^0.17.0", | ||
"sling-web-helpers": "^0.17.0" | ||
"sling-framework": "^1.3.0", | ||
"sling-helpers": "^1.3.0" | ||
} | ||
} |
@@ -6,29 +6,43 @@ # sling-web-component-loader | ||
This component renders a card element with the merchant contacts information within. It table basic components as content wrapper. | ||
## Install | ||
## Usage | ||
This is how you set the loader into the business component script structure | ||
In the business component script, the RENDER method must be made as show below: | ||
```js | ||
render() { | ||
return html` | ||
<div className="business-component loading_${this.loading > 0}"> | ||
<sling-loader loading="${this.loading > 0}"></sling-loader> | ||
... other components | ||
</div> | ||
`; | ||
} | ||
``` | ||
npm instal sling-web-component-loader | ||
``` | ||
The mapStateToProps function must include the LOADING property, which is used to map the state of the component | ||
API requests and responses and trigger the render changes. | ||
## Tag | ||
```js | ||
export const mapStateToProps = state => ({ | ||
apidata: // ...component data store node | ||
loading: state.globalReducer.loaders[instanceName], | ||
}); | ||
```HTML | ||
<sling-loader></sling-loader> | ||
``` | ||
## Project Wiki: | ||
https://stonepayments.atlassian.net/wiki/spaces/APICLIENTE | ||
## Dependencies | ||
* **sling-framework** | ||
* **sling-helpers** | ||
## Attributes and properties | ||
|Name|Type|Default Values|ReflectToAttribute|Observer|callSdk| | ||
|:--|:--|:--|:--:|:--|:--:| | ||
|loading|Boolean||:heavy_check_mark:| | ||
### Description | ||
|Name|Description| | ||
|:---|:---| | ||
|loading |Boolean that defines if the loader will be displayed.| | ||
## Events | ||
This component have no event. | ||
## Examples | ||
All component examples can be emulated using the `npm start sling-web-component-loader` command. | ||
### Use | ||
```HTML | ||
<sling-loader loading></sling-loader> | ||
``` |
@@ -1,2 +0,2 @@ | ||
import { SlingElement, html } from '../../node_modules/sling-web-framework/src/index.js'; | ||
import { SlingElement, html } from 'sling-framework'; | ||
@@ -20,3 +20,3 @@ export class Loader extends SlingElement { | ||
<style> | ||
@import url('../sling-web-component-loader/src/index.css'); | ||
@import url('sling-web-component-loader/src/index.css'); | ||
</style> | ||
@@ -23,0 +23,0 @@ <div className="${className}"> |
@@ -1,4 +0,33 @@ | ||
/* eslint-disable */ | ||
import { registerComponent } from 'sling-helpers'; | ||
import { Loader } from './Loader.js'; | ||
// TODO Write me! | ||
registerComponent('sling-loader', Loader); | ||
let $loader; | ||
describe('Loader', () => { | ||
beforeEach(() => { | ||
$loader = document.createElement('sling-loader'); | ||
document.body.appendChild($loader); | ||
}); | ||
afterEach(() => { | ||
document.body.removeChild($loader); | ||
$loader = undefined; | ||
}); | ||
it('Should reflect "loading" attribute to property ', () => { | ||
$loader.setAttribute('loading', ''); | ||
expect($loader.hasAttribute('loading')).to.be.true; | ||
}); | ||
it('Should reflect "loading" property to attribute ', (done) => { | ||
$loader.loading = false; | ||
setTimeout(() => { | ||
expect($loader.hasAttribute('loading')).to.be.false; | ||
done(); | ||
}); | ||
}); | ||
}); |
@@ -1,4 +0,4 @@ | ||
import { domHelper } from '../node_modules/sling-web-helpers/src/index.js'; | ||
import { registerComponent } from 'sling-helpers'; | ||
import { Loader } from './component/Loader.js'; | ||
domHelper.registerComponent('sling-loader', Loader); | ||
registerComponent('sling-loader', Loader); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
475036
19
11707
1
48
1
+ Addedsling-framework@^1.3.0
+ Addedsling-helpers@^1.3.0
+ Addedis-plain-object@2.0.4(transitive)
+ Addedisobject@3.0.1(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedsling-framework@1.12.5(transitive)
+ Addedsling-helpers@1.12.5(transitive)
+ Addedtimm@1.7.1(transitive)
- Removedsling-web-framework@^0.17.0
- Removedsling-web-helpers@^0.17.0
- Removed@babel/runtime@7.26.0(transitive)
- Removedimask@3.4.0(transitive)
- Removedredux@4.2.1(transitive)
- Removedredux-thunk@2.4.2(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedsling-web-component-sdk-connect@0.17.0(transitive)
- Removedsling-web-framework@0.17.0(transitive)
- Removedsling-web-helpers@0.17.0(transitive)
- Removedsling-web-sdk@0.17.0(transitive)
- Removedsling-web-storage@0.17.0(transitive)