@bodynarf/react.components 1.10.0 → 1.11.0
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/bodynarf-react.components-1.10.1.tgz +0 -0
- package/bodynarf-react.components-1.11.0.tgz +0 -0
- package/components/breadcrumbs/component/index.js +3 -3
- package/components/breadcrumbs/types.d.ts +7 -2
- package/components/breadcrumbs/types.d.ts.map +1 -1
- package/components/file/component/index.d.ts +6 -0
- package/components/file/component/index.d.ts.map +1 -0
- package/components/file/component/index.js +48 -0
- package/components/file/component/styles.scss +107 -0
- package/components/file/index.d.ts +3 -0
- package/components/file/index.d.ts.map +1 -0
- package/components/file/index.js +2 -0
- package/components/file/types.d.ts +27 -0
- package/components/file/types.d.ts.map +1 -0
- package/components/file/types.js +1 -0
- package/components/primitives/checkbox/component/index.d.ts +1 -1
- package/components/primitives/checkbox/component/index.d.ts.map +1 -1
- package/components/primitives/checkbox/component/index.js +9 -6
- package/components/primitives/checkbox/types.d.ts +1 -1
- package/components/primitives/checkbox/types.d.ts.map +1 -1
- package/components/primitives/color/components/picker/index.d.ts +1 -1
- package/components/primitives/color/components/picker/index.d.ts.map +1 -1
- package/components/primitives/color/components/picker/index.js +5 -5
- 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 +2 -2
- 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 +2 -2
- package/components/primitives/date/component/index.d.ts +1 -1
- package/components/primitives/date/component/index.d.ts.map +1 -1
- package/components/primitives/date/component/index.js +2 -2
- package/components/primitives/internal/componentWithLabel/index.d.ts +4 -4
- package/components/primitives/internal/componentWithLabel/index.d.ts.map +1 -1
- package/components/primitives/internal/componentWithLabel/index.js +8 -4
- package/components/primitives/multiline/components/withLabel/index.d.ts +1 -1
- package/components/primitives/multiline/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/withLabel/index.js +2 -2
- package/components/primitives/multiline/components/withoutLabel/index.d.ts +1 -1
- package/components/primitives/multiline/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/withoutLabel/index.js +2 -2
- package/components/primitives/number/components/withLabel/index.d.ts +1 -1
- package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withLabel/index.js +2 -2
- package/components/primitives/number/components/withoutLabel/index.d.ts +1 -1
- package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withoutLabel/index.js +2 -2
- package/components/primitives/password/components/withLabel/index.d.ts +1 -1
- package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withLabel/index.js +2 -2
- package/components/primitives/password/components/withoutLabel/index.d.ts +1 -1
- package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/password/components/withoutLabel/index.js +2 -2
- package/components/primitives/text/components/withLabel/index.d.ts +1 -1
- package/components/primitives/text/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/withLabel/index.js +2 -2
- package/components/primitives/text/components/withoutLabel/index.d.ts +1 -1
- package/components/primitives/text/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/withoutLabel/index.js +2 -2
- package/components/search/component/index.d.ts +1 -1
- package/components/search/component/index.d.ts.map +1 -1
- package/components/search/component/index.js +4 -5
- package/components/search/types.d.ts +6 -2
- package/components/search/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/readme.md +5 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/types/baseInputElementProps.d.ts +6 -0
- package/types/baseInputElementProps.d.ts.map +1 -1
- package/types/labelConfiguration.d.ts +3 -2
- package/types/labelConfiguration.d.ts.map +1 -1
- package/bodynarf-react.components-1.10.0.tgz +0 -0
|
@@ -5,7 +5,7 @@ import { ElementSize } from "../../../../../types";
|
|
|
5
5
|
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
6
|
import InternalHint from "../../../internal/hint";
|
|
7
7
|
/** Multiline textual input component without describing label*/
|
|
8
|
-
const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, name = generateGuid(), placeholder, onBlur, size = ElementSize.Normal, style, loading = false, fixed = false, rows, className, title, data, hint, }) => {
|
|
8
|
+
const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, name = generateGuid(), placeholder, onBlur, size = ElementSize.Normal, style, loading = false, fixed = false, autoFocus = false, rows, className, title, data, hint, }) => {
|
|
9
9
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
10
10
|
const elClassName = getClassName([
|
|
11
11
|
className,
|
|
@@ -22,6 +22,6 @@ const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, n
|
|
|
22
22
|
const dataAttributes = isNullOrUndefined(data)
|
|
23
23
|
? undefined
|
|
24
24
|
: mapDataAttributes(data);
|
|
25
|
-
return (_jsxs("div", { className: "bbr-field field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("textarea", { id: name, name: name, rows: rows, onBlur: onBlur, onChange: onChange, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
25
|
+
return (_jsxs("div", { className: "bbr-field field", children: [_jsx("div", { className: inputContainerClassName, children: _jsx("textarea", { id: name, name: name, rows: rows, onBlur: onBlur, onChange: onChange, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
26
|
};
|
|
27
27
|
export default MultilineWithoutLabel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NumberProps } from "../..";
|
|
3
3
|
/** Number component with label */
|
|
4
|
-
declare const NumberWithLabel: ({ onValueChange, defaultValue, validationState, name, label, placeholder, size, style, rounded, loading, readonly, disabled, onBlur, step, className, title, data, hint, }: NumberProps) => JSX.Element;
|
|
4
|
+
declare const NumberWithLabel: ({ onValueChange, defaultValue, validationState, name, label, placeholder, size, style, rounded, loading, readonly, disabled, autoFocus, onBlur, step, className, title, data, hint, }: NumberProps) => JSX.Element;
|
|
5
5
|
export default NumberWithLabel;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withLabel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,kCAAkC;AAClC,QAAA,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withLabel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,kCAAkC;AAClC,QAAA,MAAM,eAAe,0LAWlB,WAAW,KAAG,WAwDhB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
|
6
6
|
import ComponentWithLabel from "../../../internal/componentWithLabel";
|
|
7
7
|
import InternalHint from "../../../internal/hint";
|
|
8
8
|
/** Number component with label */
|
|
9
|
-
const NumberWithLabel = ({ onValueChange, defaultValue, validationState, name = generateGuid(), label, placeholder, size = ElementSize.Normal, style, rounded = false, loading = false, readonly = false, disabled = false, onBlur, step = 1, className, title, data, hint, }) => {
|
|
9
|
+
const NumberWithLabel = ({ onValueChange, defaultValue, validationState, name = generateGuid(), label, placeholder, size = ElementSize.Normal, style, rounded = false, loading = false, readonly = false, disabled = false, autoFocus = false, onBlur, step = 1, className, title, data, hint, }) => {
|
|
10
10
|
const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value) ? undefined : +event.target.value), [onValueChange]);
|
|
11
11
|
const elClassName = getClassName([
|
|
12
12
|
className,
|
|
@@ -22,6 +22,6 @@ const NumberWithLabel = ({ onValueChange, defaultValue, validationState, name =
|
|
|
22
22
|
const dataAttributes = isNullOrUndefined(data)
|
|
23
23
|
? undefined
|
|
24
24
|
: mapDataAttributes(data);
|
|
25
|
-
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", id: name, name: name, step: step, onBlur: onBlur, onChange: onChange, readOnly: readonly, disabled: disabled, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
25
|
+
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "number", id: name, name: name, step: step, onBlur: onBlur, onChange: onChange, readOnly: readonly, disabled: disabled, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
26
|
};
|
|
27
27
|
export default NumberWithLabel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NumberProps } from "../..";
|
|
3
3
|
/** Number component without label */
|
|
4
|
-
declare const NumberWithoutLabel: ({ onValueChange, defaultValue, validationState, name, size, style, readonly, disabled, rounded, loading, placeholder, onBlur, step, className, title, data, hint, }: NumberProps) => JSX.Element;
|
|
4
|
+
declare const NumberWithoutLabel: ({ onValueChange, defaultValue, validationState, name, size, style, readonly, disabled, autoFocus, rounded, loading, placeholder, onBlur, step, className, title, data, hint, }: NumberProps) => JSX.Element;
|
|
5
5
|
export default NumberWithoutLabel;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,qCAAqC;AACrC,QAAA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/number/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,qCAAqC;AACrC,QAAA,MAAM,kBAAkB,mLAYrB,WAAW,KAAG,WAsDhB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { ElementSize } from "../../../../../types";
|
|
|
5
5
|
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
6
|
import InternalHint from "../../../internal/hint";
|
|
7
7
|
/** Number component without label */
|
|
8
|
-
const NumberWithoutLabel = ({ onValueChange, defaultValue, validationState, name = generateGuid(), size, style, readonly = false, disabled = false, rounded = false, loading = false, placeholder, onBlur, step = 1, className, title, data, hint, }) => {
|
|
8
|
+
const NumberWithoutLabel = ({ onValueChange, defaultValue, validationState, name = generateGuid(), size, style, readonly = false, disabled = false, autoFocus = false, rounded = false, loading = false, placeholder, onBlur, step = 1, className, title, data, hint, }) => {
|
|
9
9
|
const onChange = useCallback((event) => onValueChange(+event.target.value), [onValueChange]);
|
|
10
10
|
const elClassName = getClassName([
|
|
11
11
|
className,
|
|
@@ -22,6 +22,6 @@ const NumberWithoutLabel = ({ onValueChange, defaultValue, validationState, name
|
|
|
22
22
|
const dataAttributes = isNullOrUndefined(data)
|
|
23
23
|
? undefined
|
|
24
24
|
: mapDataAttributes(data);
|
|
25
|
-
return (_jsxs("div", { className: "bbr-field field", children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "number", id: name, name: name, step: step, onBlur: onBlur, onChange: onChange, readOnly: readonly, disabled: disabled, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
25
|
+
return (_jsxs("div", { className: "bbr-field field", children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "number", id: name, name: name, step: step, onBlur: onBlur, onChange: onChange, readOnly: readonly, disabled: disabled, autoFocus: autoFocus, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
26
|
};
|
|
27
27
|
export default NumberWithoutLabel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PasswordProps } from "../..";
|
|
3
|
-
declare const PasswordWithLabel: ({ onValueChange, validationState, name, size, style, rounded, loading, disabled, canShowPassword, label, placeholder, className, title, data, hint, }: PasswordProps) => JSX.Element;
|
|
3
|
+
declare const PasswordWithLabel: ({ onValueChange, validationState, name, size, style, rounded, loading, autoFocus, disabled, canShowPassword, label, placeholder, className, title, data, hint, }: PasswordProps) => JSX.Element;
|
|
4
4
|
export default PasswordWithLabel;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,iBAAiB,qKAUpB,aAAa,KAAG,WAsElB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
|
6
6
|
import Icon from "../../../../icon";
|
|
7
7
|
import ComponentWithLabel from "../../../internal/componentWithLabel";
|
|
8
8
|
import InternalHint from "../../../internal/hint";
|
|
9
|
-
const PasswordWithLabel = ({ onValueChange, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, disabled = false, canShowPassword = false, label, placeholder, className, title, data, hint, }) => {
|
|
9
|
+
const PasswordWithLabel = ({ onValueChange, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, autoFocus = false, disabled = false, canShowPassword = false, label, placeholder, className, title, data, hint, }) => {
|
|
10
10
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
11
11
|
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
12
12
|
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
@@ -28,7 +28,7 @@ const PasswordWithLabel = ({ onValueChange, validationState, name = generateGuid
|
|
|
28
28
|
const dataAttributes = isNullOrUndefined(data)
|
|
29
29
|
? undefined
|
|
30
30
|
: mapDataAttributes(data);
|
|
31
|
-
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsxs("div", { className: inputContainerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", id: name, name: name, disabled: disabled, onChange: onChange, className: elClassName, placeholder: placeholder, title: title, ...dataAttributes }), canShowPassword && !loading &&
|
|
31
|
+
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsxs("div", { className: inputContainerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", id: name, name: name, disabled: disabled, onChange: onChange, className: elClassName, placeholder: placeholder, autoFocus: autoFocus, title: title, ...dataAttributes }), canShowPassword && !loading &&
|
|
32
32
|
_jsx("span", { onClick: onIconClick, title: "Show password", className: `icon is-right ${elSizeClassName}`, children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash", size: ElementSize.Medium }) })] }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
33
33
|
};
|
|
34
34
|
export default PasswordWithLabel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PasswordProps } from "../..";
|
|
3
|
-
declare const PasswordWithoutLabel: ({ onValueChange, disabled, validationState, name, size, style, rounded, loading, placeholder, canShowPassword, className, title, data, hint, }: PasswordProps) => JSX.Element;
|
|
3
|
+
declare const PasswordWithoutLabel: ({ onValueChange, disabled, validationState, name, size, style, rounded, loading, autoFocus, placeholder, canShowPassword, className, title, data, hint, }: PasswordProps) => JSX.Element;
|
|
4
4
|
export default PasswordWithoutLabel;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,oBAAoB,8JAUvB,aAAa,KAAG,WAqElB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { ElementSize } from "../../../../../types";
|
|
|
5
5
|
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
6
|
import Icon from "../../../../icon";
|
|
7
7
|
import InternalHint from "../../../internal/hint";
|
|
8
|
-
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, placeholder, canShowPassword = false, className, title, data, hint, }) => {
|
|
8
|
+
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, autoFocus = false, placeholder, canShowPassword = false, className, title, data, hint, }) => {
|
|
9
9
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
10
10
|
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
11
11
|
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
@@ -28,7 +28,7 @@ const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name =
|
|
|
28
28
|
const dataAttributes = isNullOrUndefined(data)
|
|
29
29
|
? undefined
|
|
30
30
|
: mapDataAttributes(data);
|
|
31
|
-
return (_jsxs("div", { className: "bbr-field field", children: [_jsxs("div", { className: containerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", id: name, name: name, disabled: disabled, onChange: onChange, className: elClassName, placeholder: placeholder, title: title, ...dataAttributes }), canShowPassword && !loading &&
|
|
31
|
+
return (_jsxs("div", { className: "bbr-field field", children: [_jsxs("div", { className: containerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", id: name, name: name, disabled: disabled, onChange: onChange, className: elClassName, placeholder: placeholder, autoFocus: autoFocus, title: title, ...dataAttributes }), canShowPassword && !loading &&
|
|
32
32
|
_jsx("span", { onClick: onIconClick, title: "Show password", className: `icon is-right ${elSizeClassName}`, children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash", size: ElementSize.Medium }) })] }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
33
33
|
};
|
|
34
34
|
export default PasswordWithoutLabel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextProps } from "../..";
|
|
3
3
|
/** Textual input with describing label */
|
|
4
|
-
declare const TextWithLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, size, style, rounded, loading, label, placeholder, onBlur, className, title, data, hint, }: TextProps) => JSX.Element;
|
|
4
|
+
declare const TextWithLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, size, style, rounded, loading, autoFocus, label, placeholder, onBlur, className, title, data, hint, }: TextProps) => JSX.Element;
|
|
5
5
|
export default TextWithLabel;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/withLabel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,0CAA0C;AAC1C,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/withLabel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,0CAA0C;AAC1C,QAAA,MAAM,aAAa,oLAUhB,SAAS,KAAG,WAsDd,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
|
6
6
|
import InternalHint from "../../../internal/hint";
|
|
7
7
|
import ComponentWithLabel from "../../../internal/componentWithLabel";
|
|
8
8
|
/** Textual input with describing label */
|
|
9
|
-
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, label, placeholder, onBlur, className, title, data, hint, }) => {
|
|
9
|
+
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, autoFocus = false, label, placeholder, onBlur, className, title, data, hint, }) => {
|
|
10
10
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
11
11
|
const elClassName = getClassName([
|
|
12
12
|
className,
|
|
@@ -22,6 +22,6 @@ const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, valida
|
|
|
22
22
|
const dataAttributes = isNullOrUndefined(data)
|
|
23
23
|
? undefined
|
|
24
24
|
: mapDataAttributes(data);
|
|
25
|
-
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "text", id: name, name: name, onBlur: onBlur, readOnly: readonly, disabled: disabled, onChange: onChange, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
25
|
+
return (_jsxs(ComponentWithLabel, { id: name, size: size, label: label, children: [_jsx("div", { className: inputContainerClassName, children: _jsx("input", { type: "text", id: name, name: name, onBlur: onBlur, readOnly: readonly, disabled: disabled, onChange: onChange, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, autoFocus: autoFocus, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
26
|
};
|
|
27
27
|
export default TextWithLabel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextProps } from "../..";
|
|
3
3
|
/** Textual input without describing label */
|
|
4
|
-
declare const TextWithoutLabel: ({ onValueChange, defaultValue, validationState, readonly, disabled, name, size, style, rounded, loading, placeholder, onBlur, className, title, data, hint, }: TextProps) => JSX.Element;
|
|
4
|
+
declare const TextWithoutLabel: ({ onValueChange, defaultValue, validationState, readonly, disabled, name, size, style, rounded, loading, autoFocus, placeholder, onBlur, className, title, data, hint, }: TextProps) => JSX.Element;
|
|
5
5
|
export default TextWithoutLabel;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,6CAA6C;AAC7C,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,6CAA6C;AAC7C,QAAA,MAAM,gBAAgB,6KAWnB,SAAS,KAAG,WAqDd,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { ElementSize } from "../../../../../types";
|
|
|
5
5
|
import { getStyleClassName, mapDataAttributes } from "../../../../../utils";
|
|
6
6
|
import InternalHint from "../../../internal/hint";
|
|
7
7
|
/** Textual input without describing label */
|
|
8
|
-
const TextWithoutLabel = ({ onValueChange, defaultValue, validationState, readonly = false, disabled = false, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, placeholder, onBlur, className, title, data, hint, }) => {
|
|
8
|
+
const TextWithoutLabel = ({ onValueChange, defaultValue, validationState, readonly = false, disabled = false, name = generateGuid(), size = ElementSize.Normal, style, rounded = false, loading = false, autoFocus = false, placeholder, onBlur, className, title, data, hint, }) => {
|
|
9
9
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
10
10
|
const elClassName = getClassName([
|
|
11
11
|
className,
|
|
@@ -22,6 +22,6 @@ const TextWithoutLabel = ({ onValueChange, defaultValue, validationState, readon
|
|
|
22
22
|
const dataAttributes = isNullOrUndefined(data)
|
|
23
23
|
? undefined
|
|
24
24
|
: mapDataAttributes(data);
|
|
25
|
-
return (_jsxs("div", { className: "bbr-field field", children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "text", id: name, name: name, onBlur: onBlur, readOnly: readonly, disabled: disabled, onChange: onChange, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
25
|
+
return (_jsxs("div", { className: "bbr-field field", children: [_jsx("div", { className: containerClassName, children: _jsx("input", { type: "text", id: name, name: name, onBlur: onBlur, readOnly: readonly, disabled: disabled, onChange: onChange, className: elClassName, placeholder: placeholder, defaultValue: defaultValue, autoFocus: autoFocus, title: title, ...dataAttributes }) }), _jsx(InternalHint, { hint: hint, validationState: validationState })] }));
|
|
26
26
|
};
|
|
27
27
|
export default TextWithoutLabel;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import "./style.scss";
|
|
3
3
|
import { SearchProps } from "..";
|
|
4
4
|
/** Search component */
|
|
5
|
-
export default function Search({ searchType, onSearch, caption,
|
|
5
|
+
export default function Search({ searchType, onSearch, caption, defaultValue, size, isLoading, rounded, disabled, autoFocus, className, title, data, }: SearchProps): JSX.Element;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/search/component/index.tsx"],"names":[],"mappings":";AAQA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAEjC,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,UAAU,EAAE,QAAQ,EAAE,OAAO,EAC7B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/search/component/index.tsx"],"names":[],"mappings":";AAQA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAEjC,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,UAAU,EAAE,QAAQ,EAAE,OAAO,EAC7B,YAAiB,EACjB,IAAyB,EACzB,SAAiB,EAAE,OAAe,EAAE,QAAgB,EACpD,SAAiB,EAEjB,SAAS,EAAE,KAAK,EAAE,IAAI,GACzB,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAuF3B"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
4
|
import { ElementSize } from "../../../types";
|
|
5
5
|
import { mapDataAttributes } from "../../../utils";
|
|
6
6
|
import Button from "../../button";
|
|
7
7
|
import "./style.scss";
|
|
8
8
|
/** Search component */
|
|
9
|
-
export default function Search({ searchType, onSearch, caption,
|
|
10
|
-
const [elementName] = useState(name);
|
|
9
|
+
export default function Search({ searchType, onSearch, caption, defaultValue = "", size = ElementSize.Normal, isLoading = false, rounded = false, disabled = false, autoFocus = false, className, title, data, }) {
|
|
11
10
|
const [searchValue, setSearchValue] = useState(defaultValue);
|
|
12
11
|
const onChange = useCallback((event) => {
|
|
13
12
|
const elementValue = event.target.value;
|
|
@@ -35,7 +34,7 @@ export default function Search({ searchType, onSearch, caption, name = generateG
|
|
|
35
34
|
? undefined
|
|
36
35
|
: mapDataAttributes(data);
|
|
37
36
|
if (searchType === "byButton") {
|
|
38
|
-
return (_jsxs("div", { className: "field has-addons", children: [_jsx("div", { className: elClassName, children: _jsx("input", { type: "search",
|
|
37
|
+
return (_jsxs("div", { className: "field has-addons", children: [_jsx("div", { className: elClassName, children: _jsx("input", { type: "search", disabled: disabled, onChange: onChange, placeholder: caption, autoFocus: autoFocus, defaultValue: searchValue, className: inputClassName, title: title, ...dataAttributes }) }), _jsx("div", { className: "control", children: _jsx(Button, { type: "info", size: size, caption: "Search", disabled: disabled, isLoading: isLoading, onClick: onSearchButtonClick }) })] }));
|
|
39
38
|
}
|
|
40
|
-
return (_jsx("div", { className: elClassName, children: _jsx("input", { type: "search",
|
|
39
|
+
return (_jsx("div", { className: elClassName, children: _jsx("input", { type: "search", disabled: disabled, onChange: onChange, placeholder: caption, autoFocus: autoFocus, defaultValue: searchValue, className: inputClassName, title: title, ...dataAttributes }) }));
|
|
41
40
|
}
|
|
@@ -13,8 +13,6 @@ export interface SearchProps extends BaseElementProps {
|
|
|
13
13
|
onSearch: (searchPattern: string) => void;
|
|
14
14
|
/** Initial search value */
|
|
15
15
|
defaultValue?: string;
|
|
16
|
-
/** Control name. If empty - will be replaced by random guid */
|
|
17
|
-
name?: string;
|
|
18
16
|
/** Size of search bar */
|
|
19
17
|
size?: ElementSize;
|
|
20
18
|
/** Should search bar be rounded */
|
|
@@ -23,5 +21,11 @@ export interface SearchProps extends BaseElementProps {
|
|
|
23
21
|
disabled?: boolean;
|
|
24
22
|
/** Should loading icon be displayed in search bar */
|
|
25
23
|
isLoading?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Set focus on search field after render
|
|
26
|
+
*
|
|
27
|
+
* !NOTE! Only 1 element at page can have this flag
|
|
28
|
+
*/
|
|
29
|
+
autoFocus?: boolean;
|
|
26
30
|
}
|
|
27
31
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,kCAAkC;AAClC,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD;;;;MAIE;IACF,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;IAEpC,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAE1C,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,kCAAkC;AAClC,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD;;;;MAIE;IACF,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;IAEpC,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAE1C,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,yBAAyB;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bodynarf/react.components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Artem",
|
|
6
6
|
"email": "bodynar@gmail.com"
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"build_transfer": "npm run build && npm run transfer",
|
|
29
29
|
"prepublish": "npm run build_transfer && cd dist && npm pack",
|
|
30
30
|
"publish_pkg": "npm run build_transfer && cd dist && npm publish --access=public",
|
|
31
|
-
"lint": "npx eslint src/**/*.ts src/**/*.tsx"
|
|
31
|
+
"lint": "npx eslint src/**/*.ts src/**/*.tsx",
|
|
32
|
+
"prep_dev": "copyfiles src/**/*.* demo/src/components"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@types/react": "^18.0.11",
|
package/readme.md
CHANGED
|
@@ -43,9 +43,10 @@ Simple react components based on html elements.
|
|
|
43
43
|
### Complex components
|
|
44
44
|
Complex components is set of components built via combining simple components or represent complex logical component
|
|
45
45
|
- **Accordion** - Collapsible container that can hide some content inside
|
|
46
|
-
- **Dropdown** -
|
|
46
|
+
- **Dropdown** - Custom dropdown component, based on html div elements & css (requires icon, see icon component description)
|
|
47
|
+
- **Multiselect** - Dropdown with option to select several records
|
|
47
48
|
- **Paginator** - Pagination elements to navigate through paged list
|
|
48
|
-
|
|
49
|
+
|
|
49
50
|
Example:
|
|
50
51
|
```tsx
|
|
51
52
|
const [{ currentPage, pagesCount, onPageChange }, paginate] = usePagination(items.length, ITEMS_PER_PAGE);
|
|
@@ -61,8 +62,9 @@ Complex components is set of components built via combining simple components or
|
|
|
61
62
|
```
|
|
62
63
|
- **Search** - Search bar with optional button to perform search
|
|
63
64
|
- **Tabs** - Container for multi-content with option of switching displaying content without refreshing\scrolling page
|
|
64
|
-
|
|
65
|
+
|
|
65
66
|
### Hooks
|
|
66
67
|
|
|
67
68
|
- **useComponentOutsideClick** - Attach watcher for mouse clicks and emit event when click was outside of component
|
|
68
69
|
- **usePagination** - Create a pagination config to easily manipulate with Paginator component
|
|
70
|
+
- **useUnmount** - Handle component unmounting event. Useful as component cleanup fn
|