1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-06-15 13:36:35 +02:00

Compare commits

...

15 Commits

Author SHA1 Message Date
c114579b7f Merge branch 'dev' into 'master'
Release 1.2.0

See merge request turris/reforis/foris-js!28
2019-10-24 13:52:35 +00:00
22b2bc9c09 Merge branch 'release-1.2.0' into 'dev'
Release 1.2.0

See merge request turris/reforis/foris-js!27

[skip ci]
2019-10-24 11:54:36 +00:00
cab2cfa068 Release 1.2.0 2019-10-24 13:47:25 +02:00
a137a0d4cf Merge branch 'dev' into 'master'
Release 1.1.1

See merge request turris/reforis/foris-js!26
2019-10-24 11:24:57 +00:00
54cf7e3c06 Merge branch 'master' into dev 2019-10-24 10:47:13 +02:00
18eb28f368 Merge branch 'radio-checkbox-whitespace' into 'dev'
Radio checkbox whitespace

See merge request turris/reforis/foris-js!25

[skip ci]
2019-10-24 08:12:39 +00:00
88f3836485 Radio checkbox whitespace 2019-10-24 08:12:39 +00:00
a88fbf63e9 Merge branch 'shell-quotes' into 'dev'
Added quotes to shell variables

See merge request turris/reforis/foris-js!23
2019-10-15 08:50:53 +00:00
ff9e8fdeb1 Added quotes to shell variables 2019-10-15 10:10:33 +02:00
8cd4ac8b44 Merge branch 'ws-connection-closed' into 'dev'
Download button

See merge request turris/reforis/foris-js!22
2019-10-11 14:11:14 +00:00
760e6d9243 Download button 2019-10-11 14:11:14 +00:00
2429f4662c Merge branch '5-versioning' into 'dev'
Changed beta versioning procedure

Closes #5

See merge request turris/reforis/foris-js!21
2019-10-11 08:25:06 +00:00
b320e6a860 Changed beta versioning procedure 2019-10-11 10:15:53 +02:00
1e3e9433ec Merge branch 'client-configuration' into 'dev'
Client configuration

See merge request turris/reforis/foris-js!20
2019-10-10 15:25:00 +00:00
e3a795e40d Client configuration 2019-10-10 15:25:00 +00:00
8 changed files with 30 additions and 41 deletions

View File

@ -35,6 +35,8 @@ lint:
test:
npm test
test-js-update-snapshots:
npm test -- -u
create-messages:
pybabel extract -F babel.cfg -o ./translations/forisjs.pot .

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "foris",
"version": "1.1.0",
"version": "1.2.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "foris",
"version": "1.1.0",
"version": "1.2.0",
"description": "Set of components and utils for Foris and its plugins.",
"author": "CZ.NIC, z.s.p.o.",
"repository": {
@ -73,7 +73,6 @@
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage --colors",
"test:update-snapshots": "jest -u",
"docs": "npx styleguidist build ",
"docs:watch": "styleguidist server"
},

View File

@ -32,8 +32,8 @@ export function CheckBox({
}) {
const uid = useUID();
return (
<div className={useDefaultSize ? formFieldsSize : ""} style={{ marginBottom: "1rem" }}>
<div className="custom-control custom-checkbox" style={{ marginBottom: "0" }}>
<div className={`form-group ${useDefaultSize ? formFieldsSize : ""}`.trim()}>
<div className="custom-control custom-checkbox ">
<input
className="custom-control-input"
type="checkbox"
@ -42,9 +42,9 @@ export function CheckBox({
{...props}
/>
<label className="custom-control-label" htmlFor={uid} style={helpText ? { marginBottom: "0" } : null}>{label}</label>
<label className="custom-control-label" htmlFor={uid}>{label}</label>
{helpText && <small className="form-text text-muted">{helpText}</small>}
</div>
{helpText ? <small className="form-text text-muted">{helpText}</small> : null}
</div>
);
}

View File

@ -52,16 +52,10 @@ export function RadioSet({
});
return (
<div className={`form-group ${formFieldsSize}`} style={{ marginBottom: "1rem" }}>
{label
? (
<label className="col-12" htmlFor={uid} style={{ paddingLeft: "0" }}>
{label}
</label>
)
: null}
<div className={`form-group ${formFieldsSize}`}>
{label && <label htmlFor={uid} className="d-block">{label}</label>}
{radios}
{helpText ? <small className="form-text text-muted">{helpText}</small> : null}
{helpText && <small className="form-text text-muted">{helpText}</small>}
</div>
);
}
@ -77,7 +71,7 @@ function Radio({
}) {
return (
<>
<div className="custom-control custom-radio custom-control-inline">
<div className={`custom-control custom-radio ${!helpText ? "custom-control-inline" : ""}`.trim()}>
<input
id={id}
className="custom-control-input"
@ -86,8 +80,8 @@ function Radio({
{...props}
/>
<label className="custom-control-label" htmlFor={id}>{label}</label>
{helpText && <small className="form-text text-muted mt-0 mb-3">{helpText}</small>}
</div>
{helpText ? <small className="form-text text-muted">{helpText}</small> : null}
</>
);
}

View File

@ -2,6 +2,8 @@ Set of radio Bootstrap component input with label and predefined sizes and struc
All additional `props` are passed to the `<input type="number">` HTML component.
Unless `helpText` is set for one of the options they are displayed inline.
```js
import {useState} from 'react';
const CHOICES=[

View File

@ -2,12 +2,10 @@
exports[`<Checkbox/> Render checkbox 1`] = `
<div
class="col-sm-12 offset-lg-1 col-lg-10"
style="margin-bottom: 1rem;"
class="form-group col-sm-12 offset-lg-1 col-lg-10"
>
<div
class="custom-control custom-checkbox"
style="margin-bottom: 0px;"
class="custom-control custom-checkbox "
>
<input
checked=""
@ -18,27 +16,24 @@ exports[`<Checkbox/> Render checkbox 1`] = `
<label
class="custom-control-label"
for="1"
style="margin-bottom: 0px;"
>
Test label
</label>
<small
class="form-text text-muted"
>
Some help text
</small>
</div>
<small
class="form-text text-muted"
>
Some help text
</small>
</div>
`;
exports[`<Checkbox/> Render uncheked checkbox 1`] = `
<div
class="col-sm-12 offset-lg-1 col-lg-10"
style="margin-bottom: 1rem;"
class="form-group col-sm-12 offset-lg-1 col-lg-10"
>
<div
class="custom-control custom-checkbox"
style="margin-bottom: 0px;"
class="custom-control custom-checkbox "
>
<input
class="custom-control-input"
@ -48,15 +43,14 @@ exports[`<Checkbox/> Render uncheked checkbox 1`] = `
<label
class="custom-control-label"
for="1"
style="margin-bottom: 0px;"
>
Test label
</label>
<small
class="form-text text-muted"
>
Some help text
</small>
</div>
<small
class="form-text text-muted"
>
Some help text
</small>
</div>
`;

View File

@ -3,12 +3,10 @@
exports[`<RadioSet/> Render radio set 1`] = `
<div
class="form-group col-sm-12 offset-lg-1 col-lg-10"
style="margin-bottom: 1rem;"
>
<label
class="col-12"
class="d-block"
for="1"
style="padding-left: 0px;"
>
Radios set label
</label>