@bruit/component
Advanced tools
Comparing version 0.2.11 to 0.2.12
/*! | ||
* Built with http://stenciljs.com | ||
* 2018-11-07T11:29:34 | ||
* 2018-11-07T13:37:46 | ||
*/ | ||
@@ -5,0 +5,0 @@ (function(win, doc, namespace, fsNamespace, resourcesUrl, appCore, appCoreSsr, appCorePolyfilled, hydratedCssClass, components) { |
@@ -31,3 +31,3 @@ import { Api } from './api'; | ||
this.data = [ | ||
...formData.map(ff => ({ type: ff.type, value: ff.value, label: ff.label })), | ||
...formData.map(ff => ({ type: ff.type, value: ff.value, label: ff.label, id: ff.id })), | ||
...data, | ||
@@ -34,0 +34,0 @@ ...dataFromFn |
@@ -31,3 +31,9 @@ import { ComponentConfig } from '../config/config'; | ||
this.form = config.form.map((field, index) => { | ||
field.id = field.id || index + '-' + field.type; //TODO use field.label.replace(\s,'-').toLowerCase() instead of field.type | ||
field.id = | ||
field.id.trim().toLowerCase() || | ||
`${index}-${field.label | ||
.trim() | ||
.replace(/[^A-Za-z\s]/g, '') | ||
.replace(/\s+/g, '-') | ||
.toLowerCase()}`; | ||
return field; | ||
@@ -110,5 +116,14 @@ }); | ||
} | ||
//TODO add control of unicity of IDs | ||
// control of unicity of IDs | ||
if (form | ||
.map(field => field.id) | ||
.filter(id => !!id) | ||
.find((id, index, a) => a.indexOf(id) === index)) { | ||
return { | ||
code: 4, | ||
text: 'form field must have unique id' | ||
}; | ||
} | ||
return; | ||
} | ||
} |
{ | ||
"name": "@bruit/component", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"description": "send your feedbacks with bruit.io", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -16,2 +16,11 @@ <p align="center"> | ||
</p> | ||
<p align="center"> | ||
available on | ||
</p> | ||
<p align="center"> | ||
<img alt="html/js" src="https://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" height="40px"> | ||
<img alt="Angular" src="https://angular.io/assets/images/logos/angular/angular.svg" height="45px"> | ||
<img alt="React" src="https://camo.githubusercontent.com/98a9b62f324b8a13275cc57dc4293f0ee315f85f/68747470733a2f2f73616e6473746f726d2e64652f5f5265736f75726365732f50657273697374656e742f333238353431366538353033623263383335346333323162636436393063663535306238623264332f52656163742d4c6f676f2e737667" height="35px"> | ||
<img alt="Ember" src="https://upload.wikimedia.org/wikipedia/fr/6/69/Ember.js_Logo_and_Mascot.png" height="35px"> | ||
</p> | ||
@@ -28,3 +37,3 @@ Bruit is a webComponent for user review ... | ||
**[Usage](#usage)**<br> | ||
**[Configuration](#BrtConfig)**<br> | ||
**[Configuration](#Configuration)**<br> | ||
**[BrtConfig](#BrtConfig)**<br> | ||
@@ -43,3 +52,3 @@ **[BrtField](#BrtField)**<br> | ||
```bash | ||
npm install @moventes/bruit --save | ||
npm install @bruit/component --save | ||
``` | ||
@@ -50,3 +59,3 @@ | ||
```html | ||
<script src="https://unpkg.com/@moventes/bruit/dist/bruit.js"></script> | ||
<script src="https://unpkg.com/@bruit/component/dist/bruit.js"></script> | ||
``` | ||
@@ -53,0 +62,0 @@ |
Sorry, the diff of this file is too big to display
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
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
641877
12780
224