@bodynarf/react.components 1.7.94 → 1.7.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/component/index.d.ts +0 -1
- package/components/accordion/component/index.d.ts.map +1 -1
- package/components/accordion/component/index.js +5 -5
- package/components/anchor/types.d.ts +1 -11
- package/components/anchor/types.d.ts.map +1 -1
- package/components/button/component/index.d.ts.map +1 -1
- package/components/button/component/index.js +6 -5
- package/components/button/types.d.ts +2 -1
- package/components/button/types.d.ts.map +1 -1
- package/components/dropdown/component/index.d.ts +1 -0
- package/components/dropdown/component/index.d.ts.map +1 -1
- package/components/dropdown/components/compact/index.d.ts.map +1 -1
- package/components/dropdown/components/compact/index.js +7 -7
- package/components/dropdown/components/withLabel/index.d.ts +1 -2
- package/components/dropdown/components/withLabel/index.d.ts.map +1 -1
- package/components/dropdown/components/withLabel/index.js +6 -6
- package/components/paginator/component/index.d.ts +1 -1
- package/components/paginator/component/index.d.ts.map +1 -1
- package/components/paginator/component/index.js +3 -3
- package/components/primitives/checkbox/component/index.d.ts +1 -2
- package/components/primitives/checkbox/component/index.d.ts.map +1 -1
- package/components/primitives/checkbox/component/index.js +7 -7
- package/components/primitives/checkbox/types.d.ts +1 -1
- package/components/primitives/checkbox/types.d.ts.map +1 -1
- package/components/primitives/color/component/index.d.ts +1 -0
- package/components/primitives/color/component/index.d.ts.map +1 -1
- package/components/primitives/color/components/withLabel/index.d.ts +1 -1
- package/components/primitives/color/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/color/components/withLabel/index.js +6 -5
- package/components/primitives/color/components/withoutLabel/index.d.ts +1 -1
- package/components/primitives/color/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/color/components/withoutLabel/index.js +6 -5
- package/components/primitives/color/types.d.ts +3 -15
- package/components/primitives/color/types.d.ts.map +1 -1
- package/components/primitives/date/component/index.js +3 -3
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts +0 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.js +4 -4
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts +0 -1
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithoutLabel/index.js +4 -4
- package/components/primitives/number/components/withLabel/index.d.ts +0 -1
- package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withLabel/index.js +5 -5
- package/components/primitives/number/components/withoutLabel/index.d.ts +0 -1
- package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withoutLabel/index.js +4 -4
- package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withLabel/index.js +3 -3
- package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withoutLabel/index.js +3 -3
- package/components/primitives/password/types.d.ts +2 -2
- package/components/primitives/password/types.d.ts.map +1 -1
- package/components/primitives/text/components/textWithLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithLabel/index.js +3 -3
- package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithoutLabel/index.js +3 -3
- package/components/search/component/index.d.ts.map +1 -1
- package/components/search/component/index.js +3 -3
- package/components/tabs/component/index.d.ts +0 -1
- package/components/tabs/component/index.d.ts.map +1 -1
- package/components/tabs/component/index.js +5 -5
- package/components/tag/component/index.d.ts.map +1 -1
- package/components/tag/component/index.js +3 -5
- package/package.json +1 -1
- package/readme.md +17 -11
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -4,22 +4,22 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Multiline textual input component without describing label*/
|
|
7
|
-
const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, rounded, loading, fixed, rows, }) => {
|
|
7
|
+
const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, rounded = false, loading = false, fixed = false, rows, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const id = name || generateGuid();
|
|
10
10
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
11
11
|
const elClassName = getClassName([
|
|
12
12
|
className,
|
|
13
13
|
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
14
|
-
rounded
|
|
14
|
+
rounded ? "is-rounded" : "",
|
|
15
15
|
styleClassName,
|
|
16
16
|
"textarea",
|
|
17
|
-
fixed
|
|
17
|
+
fixed ? "has-fixed-size" : "",
|
|
18
18
|
]);
|
|
19
19
|
const inputContainerClassName = getClassName([
|
|
20
20
|
"control",
|
|
21
21
|
"bbr-input",
|
|
22
|
-
loading
|
|
22
|
+
loading ? "is-loading" : "",
|
|
23
23
|
]);
|
|
24
24
|
return (_jsxs("div", { className: "field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("textarea", { className: elClassName, placeholder: placeholder, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, id: id, name: id, rows: rows }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
25
25
|
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { NumberProps } from "../../../number";
|
|
3
2
|
/** Number component with label */
|
|
4
3
|
declare const NumberWithLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, step, }: NumberProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,kCAAkC;AAClC,QAAA,MAAM,eAAe,4JAOlB,WAAW,KAAG,WA2GhB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName, getValueOrDefault, isStringEmpty } from "@b
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Number component with label */
|
|
7
|
-
const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, step, }) => {
|
|
7
|
+
const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, label, placeholder, onBlur, step = 1, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value) ? undefined : +event.target.value), [onValueChange]);
|
|
9
9
|
const id = name || generateGuid();
|
|
10
10
|
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
@@ -12,13 +12,13 @@ const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, vali
|
|
|
12
12
|
const elClassName = getClassName([
|
|
13
13
|
className,
|
|
14
14
|
elSizeClassName,
|
|
15
|
-
rounded
|
|
15
|
+
rounded ? "is-rounded" : "",
|
|
16
16
|
styleClassName,
|
|
17
17
|
"input",
|
|
18
18
|
]);
|
|
19
19
|
const inputContainerClassName = getClassName([
|
|
20
20
|
"control",
|
|
21
|
-
loading
|
|
21
|
+
loading ? "is-loading" : "",
|
|
22
22
|
]);
|
|
23
23
|
const labelClassName = getClassName([
|
|
24
24
|
"label",
|
|
@@ -35,10 +35,10 @@ const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, vali
|
|
|
35
35
|
"field-body",
|
|
36
36
|
label.horizontalFieldContainerClassName
|
|
37
37
|
]);
|
|
38
|
-
return (_jsxs("div", { className: "bbr-input field is-horizontal", children: [_jsx("div", { className: labelContainerClassName, children: _jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }) }), _jsx("div", { className: fieldContainerClassName, children: _jsxs("div", { className: "field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step
|
|
38
|
+
return (_jsxs("div", { className: "bbr-input field is-horizontal", children: [_jsx("div", { className: labelContainerClassName, children: _jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }) }), _jsx("div", { className: fieldContainerClassName, children: _jsxs("div", { className: "field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
39
39
|
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
|
|
40
40
|
}
|
|
41
|
-
return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step
|
|
41
|
+
return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
42
42
|
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
43
43
|
};
|
|
44
44
|
export default NumberWithLabel;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { NumberProps } from "../../../number";
|
|
3
2
|
/** Number component without label */
|
|
4
3
|
declare const NumberWithoutLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, step, }: NumberProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withoutLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withoutLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,qCAAqC;AACrC,QAAA,MAAM,kBAAkB,qJAOrB,WAAW,KAAG,WA8ChB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -4,23 +4,23 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Number component without label */
|
|
7
|
-
const NumberWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, step, }) => {
|
|
7
|
+
const NumberWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, placeholder, onBlur, step = 1, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(+event.target.value), [onValueChange]);
|
|
9
9
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
10
10
|
const elClassName = getClassName([
|
|
11
11
|
className,
|
|
12
12
|
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
13
|
-
rounded
|
|
13
|
+
rounded ? "is-rounded" : "",
|
|
14
14
|
styleClassName,
|
|
15
15
|
"input",
|
|
16
16
|
]);
|
|
17
17
|
const containerClassName = getClassName([
|
|
18
18
|
"control",
|
|
19
19
|
"bbr-input",
|
|
20
|
-
loading
|
|
20
|
+
loading ? "is-loading" : "",
|
|
21
21
|
]);
|
|
22
22
|
const id = name || generateGuid();
|
|
23
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "number", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id, step: step }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
24
24
|
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
25
25
|
};
|
|
26
26
|
export default NumberWithoutLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,QAAA,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,QAAA,MAAM,iBAAiB,uIAOpB,aAAa,KAAG,WAgIlB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
|
4
4
|
import { getValidationValues } from "../../../../../utils";
|
|
5
5
|
import { ElementSize } from "../../../..";
|
|
6
6
|
import Icon from "../../../../icon";
|
|
7
|
-
const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, label, placeholder, canShowPassword, }) => {
|
|
7
|
+
const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded = false, loading = false, label, placeholder, canShowPassword = false, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
10
10
|
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
@@ -14,14 +14,14 @@ const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, cla
|
|
|
14
14
|
const elClassName = getClassName([
|
|
15
15
|
className,
|
|
16
16
|
elSizeClassName,
|
|
17
|
-
rounded
|
|
17
|
+
rounded ? "is-rounded" : "",
|
|
18
18
|
styleClassName,
|
|
19
19
|
"bbr-password",
|
|
20
20
|
"input",
|
|
21
21
|
]);
|
|
22
22
|
const inputContainerClassName = getClassName([
|
|
23
23
|
"control",
|
|
24
|
-
loading
|
|
24
|
+
loading ? "is-loading" : "",
|
|
25
25
|
canShowPassword ? "has-icons-right" : "",
|
|
26
26
|
"bbr-password__wrapper",
|
|
27
27
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,QAAA,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,QAAA,MAAM,oBAAoB,gIAOvB,aAAa,KAAG,WA4DlB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
import Icon from "../../../../icon";
|
|
7
|
-
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, placeholder, canShowPassword, }) => {
|
|
7
|
+
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded = false, loading = false, placeholder, canShowPassword = false, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
10
10
|
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
@@ -14,7 +14,7 @@ const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name,
|
|
|
14
14
|
const elClassName = getClassName([
|
|
15
15
|
className,
|
|
16
16
|
elSizeClassName,
|
|
17
|
-
rounded
|
|
17
|
+
rounded ? "is-rounded" : "",
|
|
18
18
|
styleClassName,
|
|
19
19
|
"bbr-password",
|
|
20
20
|
"input",
|
|
@@ -22,7 +22,7 @@ const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name,
|
|
|
22
22
|
const containerClassName = getClassName([
|
|
23
23
|
"control",
|
|
24
24
|
"bbr-input",
|
|
25
|
-
loading
|
|
25
|
+
loading ? "is-loading" : "",
|
|
26
26
|
canShowPassword ? "has-icons-right" : "",
|
|
27
27
|
"bbr-password__wrapper",
|
|
28
28
|
]);
|
|
@@ -2,9 +2,9 @@ import { BaseInputElementProps } from "../..";
|
|
|
2
2
|
/** Password component props type */
|
|
3
3
|
export interface PasswordProps extends Omit<BaseInputElementProps<string>, "defaultValue" | "readonly"> {
|
|
4
4
|
/**
|
|
5
|
-
* Is icon "Show password" visible.
|
|
5
|
+
* Is clickable icon "Show password" visible.
|
|
6
6
|
* Will show password on click
|
|
7
7
|
*/
|
|
8
|
-
canShowPassword
|
|
8
|
+
canShowPassword?: boolean;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACnG;;;MAGE;IACF,eAAe,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACnG;;;MAGE;IACF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,0CAA0C;AAC1C,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,0CAA0C;AAC1C,QAAA,MAAM,aAAa,sJAOhB,SAAS,KAAG,WAwGd,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName, getValueOrDefault, } from "@bodynarf/utils"
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Textual input with describing label */
|
|
7
|
-
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, }) => {
|
|
7
|
+
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, label, placeholder, onBlur, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const id = name || generateGuid();
|
|
10
10
|
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
@@ -12,13 +12,13 @@ const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, valida
|
|
|
12
12
|
const elClassName = getClassName([
|
|
13
13
|
className,
|
|
14
14
|
elSizeClassName,
|
|
15
|
-
rounded
|
|
15
|
+
rounded ? "is-rounded" : "",
|
|
16
16
|
styleClassName,
|
|
17
17
|
"input",
|
|
18
18
|
]);
|
|
19
19
|
const inputContainerClassName = getClassName([
|
|
20
20
|
"control",
|
|
21
|
-
loading
|
|
21
|
+
loading ? "is-loading" : "",
|
|
22
22
|
]);
|
|
23
23
|
const labelClassName = getClassName([
|
|
24
24
|
"label",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithoutLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,6CAA6C;AAC7C,QAAA,MAAM,gBAAgB,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithoutLabel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,6CAA6C;AAC7C,QAAA,MAAM,gBAAgB,+IAOnB,SAAS,KAAG,WA6Cd,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -4,20 +4,20 @@ import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
|
4
4
|
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Textual input without describing label */
|
|
7
|
-
const TextWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, }) => {
|
|
7
|
+
const TextWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded = false, loading = false, placeholder, onBlur, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
10
10
|
const elClassName = getClassName([
|
|
11
11
|
className,
|
|
12
12
|
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
13
|
-
rounded
|
|
13
|
+
rounded ? "is-rounded" : "",
|
|
14
14
|
styleClassName,
|
|
15
15
|
"input",
|
|
16
16
|
]);
|
|
17
17
|
const containerClassName = getClassName([
|
|
18
18
|
"control",
|
|
19
19
|
"bbr-input",
|
|
20
|
-
loading
|
|
20
|
+
loading ? "is-loading" : "",
|
|
21
21
|
]);
|
|
22
22
|
const id = name || generateGuid();
|
|
23
23
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: containerClassName, children: _jsx("input", { className: elClassName, type: "text", placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/search/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAItB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,UAAU,EAAE,QAAQ,EAAE,OAAO,EAC7B,IAAI,EAAE,YAAY,EAClB,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/search/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAItB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,UAAU,EAAE,QAAQ,EAAE,OAAO,EAC7B,IAAI,EAAE,YAAY,EAClB,IAAI,EACJ,SAAiB,EAAE,OAAe,EAAE,QAAQ,GAC/C,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAyE3B"}
|
|
@@ -4,7 +4,7 @@ import { generateGuid, getClassName } from "@bodynarf/utils";
|
|
|
4
4
|
import "./style.scss";
|
|
5
5
|
import Button from "../../button";
|
|
6
6
|
/** Search component */
|
|
7
|
-
export default function Search({ searchType, onSearch, caption, name, defaultValue, size, isLoading, rounded, disabled, }) {
|
|
7
|
+
export default function Search({ searchType, onSearch, caption, name, defaultValue, size, isLoading = false, rounded = false, disabled, }) {
|
|
8
8
|
const [elementName] = useState(name || generateGuid());
|
|
9
9
|
const [searchValue, setSearchValue] = useState(defaultValue || "");
|
|
10
10
|
const onChange = useCallback((event) => {
|
|
@@ -19,14 +19,14 @@ export default function Search({ searchType, onSearch, caption, name, defaultVal
|
|
|
19
19
|
"bbr-search",
|
|
20
20
|
"control",
|
|
21
21
|
`is-${(size || "normal")}`,
|
|
22
|
-
isLoading
|
|
22
|
+
isLoading ? "is-loading" : "",
|
|
23
23
|
searchType === "byButton" ? "is-expanded" : "",
|
|
24
24
|
]);
|
|
25
25
|
const inputClassName = getClassName([
|
|
26
26
|
"input",
|
|
27
27
|
"is-unselectable",
|
|
28
28
|
`is-${(size || "normal")}`,
|
|
29
|
-
rounded
|
|
29
|
+
rounded ? "is-rounded" : "",
|
|
30
30
|
]);
|
|
31
31
|
if (searchType === "byButton") {
|
|
32
32
|
return (_jsxs("div", { className: "field has-addons", children: [_jsx("div", { className: className, children: _jsx("input", { type: "search", name: elementName, defaultValue: searchValue, className: inputClassName, disabled: disabled, onChange: onChange, placeholder: caption }) }), _jsx("div", { className: "control", children: _jsx(Button, { caption: "Search", type: "info", onClick: onSearchButtonClick, isLoading: isLoading, size: size }) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/component/index.tsx"],"names":[],"mappings":"AAIA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGhE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGxE,gCAAgC;AAChC,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IAC/C,WAAW;IACX,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAEtB,8CAA8C;IAC9C,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAE5C;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB,sBAAsB;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,QAAA,MAAM,IAAI,4GAMP,SAAS,KAAG,WA6Ed,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -10,11 +10,11 @@ import TabItemComponent from "../../tabs/components/item";
|
|
|
10
10
|
* Tabs panel
|
|
11
11
|
* @throws Items are empty
|
|
12
12
|
*/
|
|
13
|
-
const Tabs = ({ items, onActiveItemChange, defaultActive, size, position, style, fullWidth, className, title, data, }) => {
|
|
13
|
+
const Tabs = ({ items, onActiveItemChange, defaultActive = items[0], size, position = TabsPosition.left, style = TabsStyle.default, fullWidth = false, className, title, data, }) => {
|
|
14
14
|
if (items.length === 0) {
|
|
15
15
|
throw new Error("Invalid configuration. Tab items must be defined");
|
|
16
16
|
}
|
|
17
|
-
const [activeItem, setActiveItem] = useState(defaultActive
|
|
17
|
+
const [activeItem, setActiveItem] = useState(defaultActive);
|
|
18
18
|
const isFirstRun = useRef(true);
|
|
19
19
|
const onTabsClick = useCallback((container) => {
|
|
20
20
|
const closestTab = container.target.closest(".bbr-tabs__tab");
|
|
@@ -41,10 +41,10 @@ const Tabs = ({ items, onActiveItemChange, defaultActive, size, position, style,
|
|
|
41
41
|
const elClassName = getClassName([
|
|
42
42
|
"bbr-tabs",
|
|
43
43
|
"tabs",
|
|
44
|
-
position
|
|
44
|
+
position,
|
|
45
45
|
getSizeClassName(size, [ElementSize.Normal]),
|
|
46
|
-
style
|
|
47
|
-
fullWidth
|
|
46
|
+
style,
|
|
47
|
+
fullWidth ? "is-fullwidth" : "",
|
|
48
48
|
className,
|
|
49
49
|
]);
|
|
50
50
|
const dataAttributes = isNullOrUndefined(data)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tag/component/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,cAAc,CAAC;AAEtB,sBAAsB;AACtB,QAAA,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tag/component/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,cAAc,CAAC;AAEtB,sBAAsB;AACtB,QAAA,MAAM,GAAG,2FAQN,QAAQ,KAAG,WA+Bb,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -3,9 +3,7 @@ import { getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
|
3
3
|
import { ElementColor, ElementSize } from "../..";
|
|
4
4
|
import "./style.scss";
|
|
5
5
|
/** Single tag item */
|
|
6
|
-
const Tag = ({ content, size, style, rounded, lightColor, customColor, onClick, className, title, }) => {
|
|
7
|
-
size ??= ElementSize.Normal;
|
|
8
|
-
style ??= ElementColor.Default;
|
|
6
|
+
const Tag = ({ content, size = ElementSize.Normal, style = ElementColor.Default, rounded = false, lightColor = false, customColor, onClick, className, title, }) => {
|
|
9
7
|
if (!isNullOrUndefined(customColor)) {
|
|
10
8
|
style = ElementColor.Default;
|
|
11
9
|
}
|
|
@@ -14,8 +12,8 @@ const Tag = ({ content, size, style, rounded, lightColor, customColor, onClick,
|
|
|
14
12
|
"tag",
|
|
15
13
|
style === ElementColor.Default ? "" : `is-${style}`,
|
|
16
14
|
!isNullOrUndefined(customColor) ? "bbr-tag--custom" : "",
|
|
17
|
-
lightColor
|
|
18
|
-
rounded
|
|
15
|
+
lightColor && isNullOrUndefined(customColor) ? "is-light" : "",
|
|
16
|
+
rounded ? "is-rounded" : "",
|
|
19
17
|
size === ElementSize.Normal || size === ElementSize.Small ? "" : `is-${size}`,
|
|
20
18
|
isNullOrUndefined(onClick) ? "" : "bbr-tag--clickable",
|
|
21
19
|
className,
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -15,26 +15,30 @@ Small library with react components based on Bulma CSS framework <a href="
|
|
|
15
15
|
5. *(Optional)* To use **Checkbox** component - install [bulma-checkradio](https://www.npmjs.com/package/bulma-checkradio) and make sure you imported these styles in parent container
|
|
16
16
|
|
|
17
17
|
## Description
|
|
18
|
+
Mostly all components have root css class with `bbr-` prefix. BBR - Bodynarf Bulma React
|
|
18
19
|
|
|
19
|
-
Mostly all components have root class with `bbr-` prefix. BBR - Bodynarf Bulma React
|
|
20
20
|
### Simple components
|
|
21
21
|
Simple react components based on html elements.
|
|
22
22
|
|
|
23
|
+
#### Controls
|
|
24
|
+
- **Checkbox** - (*see p.5 of installation*) Checkbox component based on [bulma-checkradio](https://wikiki.github.io/form/checkradio)
|
|
23
25
|
- **ColorPicker** - control that allows picking color (with preview option)
|
|
24
|
-
- **Date** - date input
|
|
25
|
-
- **Multiline** - multiline text input
|
|
26
|
+
- **Date** - date input
|
|
27
|
+
- **Multiline** - multiline text input
|
|
28
|
+
- **Number** - number input with step
|
|
29
|
+
- **Password** - single line password input (requires icon, see icon component description)
|
|
26
30
|
- **Text** - single line text input;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
+
|
|
32
|
+
#### Components
|
|
33
|
+
- **Anchor** - simple anchor (link) component
|
|
34
|
+
- **Button** - button that allows user to interact with system by clicking it _(assume everyone knows what is button)_
|
|
31
35
|
- **Icon** - *see p.4 of installation*
|
|
32
|
-
- **
|
|
33
|
-
- **Checkbox** - (*see p.5 of installation*) Checkbox component based on [bulma-checkradio](https://wikiki.github.io/form/checkradio)
|
|
36
|
+
- **Tag** - small component stands for tag visualization
|
|
34
37
|
|
|
35
38
|
### Complex components
|
|
36
39
|
Complex components is set of components built via combining simple components or represent complex logical component
|
|
37
|
-
- **
|
|
40
|
+
- **Accordion** - Collapsible container that can hide some content inside
|
|
41
|
+
- **Dropdown** - custom dropdown component, based on html div elements & css (requires icon, see icon component description)
|
|
38
42
|
- **Paginator** - Pagination elements to navigate through paged list
|
|
39
43
|
|
|
40
44
|
Example:
|
|
@@ -50,8 +54,10 @@ Complex components is set of components built via combining simple components or
|
|
|
50
54
|
onPageChange={onPageChange}
|
|
51
55
|
/>
|
|
52
56
|
```
|
|
57
|
+
- **Search** - Search bar with optional button to perform search
|
|
58
|
+
- **Tabs** - Container for multi-content with option of switching displaying content without refreshing\scrolling page
|
|
53
59
|
|
|
54
60
|
### Hooks
|
|
55
61
|
|
|
56
|
-
- **useComponentOutsideClick** - Attach watcher for mouse clicks and
|
|
62
|
+
- **useComponentOutsideClick** - Attach watcher for mouse clicks and emit event when click was outside of component
|
|
57
63
|
- **usePagination** - Create a pagination config to easily manipulate with Paginator component
|