@bodynarf/react.components 1.7.632 → 1.8.1
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/common.scss +4 -0
- 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/components/anchorWithIcon/index.d.ts +0 -1
- package/components/anchor/components/anchorWithIcon/index.d.ts.map +1 -1
- package/components/anchor/components/simpleAnchor/index.d.ts +0 -1
- package/components/anchor/components/simpleAnchor/index.d.ts.map +1 -1
- 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/components/buttonWithIcon/index.d.ts +0 -1
- package/components/button/components/buttonWithIcon/index.d.ts.map +1 -1
- package/components/button/components/simpleButton/index.d.ts +0 -1
- package/components/button/components/simpleButton/index.d.ts.map +1 -1
- package/components/button/types.d.ts +2 -1
- package/components/button/types.d.ts.map +1 -1
- package/components/dropdown/component/index.d.ts +0 -1
- package/components/dropdown/component/index.d.ts.map +1 -1
- package/components/dropdown/component/style.scss +3 -3
- package/components/dropdown/components/compact/index.d.ts +1 -2
- package/components/dropdown/components/compact/index.d.ts.map +1 -1
- package/components/dropdown/components/compact/index.js +14 -11
- 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 +6 -0
- package/components/primitives/color/component/index.d.ts.map +1 -0
- package/components/primitives/color/component/index.js +10 -0
- package/components/primitives/color/component/style.scss +21 -0
- package/components/primitives/color/components/picker/index.d.ts +37 -0
- package/components/primitives/color/components/picker/index.d.ts.map +1 -0
- package/components/primitives/color/components/picker/index.js +16 -0
- package/components/primitives/color/components/withLabel/index.d.ts +6 -0
- package/components/primitives/color/components/withLabel/index.d.ts.map +1 -0
- package/components/primitives/color/components/withLabel/index.js +48 -0
- package/components/primitives/color/components/withoutLabel/index.d.ts +6 -0
- package/components/primitives/color/components/withoutLabel/index.d.ts.map +1 -0
- package/components/primitives/color/components/withoutLabel/index.js +35 -0
- package/components/primitives/color/index.d.ts +3 -0
- package/components/primitives/color/index.d.ts.map +1 -0
- package/components/primitives/color/index.js +2 -0
- package/components/primitives/color/types.d.ts +19 -0
- package/components/primitives/color/types.d.ts.map +1 -0
- package/components/primitives/color/types.js +1 -0
- package/components/primitives/date/component/index.d.ts +0 -1
- package/components/primitives/date/component/index.d.ts.map +1 -1
- package/components/primitives/date/component/index.js +6 -6
- package/components/primitives/index.d.ts +1 -0
- package/components/primitives/index.d.ts.map +1 -1
- package/components/primitives/index.js +1 -0
- package/components/primitives/multiline/component/index.d.ts +0 -1
- package/components/primitives/multiline/component/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts +1 -2
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.js +3 -4
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts +1 -2
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithoutLabel/index.js +3 -4
- package/components/primitives/multiline/types.d.ts +1 -1
- package/components/primitives/multiline/types.d.ts.map +1 -1
- package/components/primitives/number/component/index.d.ts +0 -1
- package/components/primitives/number/component/index.d.ts.map +1 -1
- 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/component/index.d.ts +0 -1
- package/components/primitives/password/component/index.d.ts.map +1 -1
- package/components/primitives/password/components/withLabel/index.d.ts +0 -1
- 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 +0 -1
- 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/component/index.d.ts +0 -1
- package/components/primitives/text/component/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithLabel/index.d.ts +0 -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 +0 -1
- 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 +4 -4
- 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/tabs/components/item/index.d.ts +0 -1
- package/components/tabs/components/item/index.d.ts.map +1 -1
- package/components/tag/component/index.d.ts +0 -1
- package/components/tag/component/index.d.ts.map +1 -1
- package/components/tag/component/index.js +3 -5
- package/package.json +7 -4
- package/readme.md +22 -12
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { generateGuid, getClassName, hexToRgb, isNullOrUndefined, rgbToHex, whiteHex } from "@bodynarf/utils";
|
|
4
|
+
import { getValidationValues, mapDataAttributes } from "../../../../..";
|
|
5
|
+
import ColorPickerControl from "../picker";
|
|
6
|
+
/** Color picker component with form label */
|
|
7
|
+
function ColorPickerWithLabel({ className, title, showPreview, name, defaultValue, validationState, onValueChange, data, disabled = false, rounded = false, label, }) {
|
|
8
|
+
const defaultColor = isNullOrUndefined(defaultValue)
|
|
9
|
+
? whiteHex
|
|
10
|
+
: rgbToHex(defaultValue);
|
|
11
|
+
const [value, setValue] = useState(defaultColor);
|
|
12
|
+
const onChange = useCallback((event) => setValue(event.target.value), [setValue]);
|
|
13
|
+
useEffect(() => onValueChange?.call(undefined, hexToRgb(value)), [onValueChange, value]);
|
|
14
|
+
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(undefined, validationState);
|
|
15
|
+
const elClassName = getClassName([
|
|
16
|
+
className,
|
|
17
|
+
styleClassName,
|
|
18
|
+
rounded ? "is-rounded" : "",
|
|
19
|
+
"input",
|
|
20
|
+
]);
|
|
21
|
+
const inputContainerClassName = getClassName([
|
|
22
|
+
"control",
|
|
23
|
+
"bbr-input",
|
|
24
|
+
showPreview ? "column" : "",
|
|
25
|
+
]);
|
|
26
|
+
const dataAttributes = isNullOrUndefined(data)
|
|
27
|
+
? undefined
|
|
28
|
+
: mapDataAttributes(data);
|
|
29
|
+
const id = name || generateGuid();
|
|
30
|
+
const labelClassName = getClassName([
|
|
31
|
+
"label",
|
|
32
|
+
label.className
|
|
33
|
+
]);
|
|
34
|
+
if (label.horizontal) {
|
|
35
|
+
const labelContainerClassName = getClassName([
|
|
36
|
+
"field-label",
|
|
37
|
+
"is-normal",
|
|
38
|
+
label.horizontalContainerClassName
|
|
39
|
+
]);
|
|
40
|
+
const fieldContainerClassName = getClassName([
|
|
41
|
+
"field-body",
|
|
42
|
+
label.horizontalFieldContainerClassName
|
|
43
|
+
]);
|
|
44
|
+
return (_jsxs("div", { className: "bbr-color-picker 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: _jsx("div", { className: "field", children: _jsx(ColorPickerControl, { containerClassName: inputContainerClassName, className: elClassName, disabled: disabled, showPreview: showPreview, defaultColor: defaultColor, onValueChange: onChange, value: value, id: id, title: title, dataAttributes: dataAttributes, isValidationDefined: isValidationDefined, validationMessages: validationMessages, styleClassName: styleClassName }) }) })] }));
|
|
45
|
+
}
|
|
46
|
+
return (_jsxs("div", { className: "bbr-color-picker bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsx(ColorPickerControl, { containerClassName: inputContainerClassName, className: elClassName, disabled: disabled, showPreview: showPreview, defaultColor: defaultColor, onValueChange: onChange, value: value, id: id, title: title, dataAttributes: dataAttributes, isValidationDefined: isValidationDefined, validationMessages: validationMessages, styleClassName: styleClassName })] }));
|
|
47
|
+
}
|
|
48
|
+
export default ColorPickerWithLabel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColorPickerProps } from "../..";
|
|
3
|
+
/** Color picker component without form label */
|
|
4
|
+
declare function ColorPickerWithoutLabel({ className, title, showPreview, name, defaultValue, validationState, onValueChange, data, disabled, rounded, }: ColorPickerProps): JSX.Element;
|
|
5
|
+
export default ColorPickerWithoutLabel;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/color/components/withoutLabel/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAGzC,gDAAgD;AAChD,iBAAS,uBAAuB,CAAC,EAC7B,SAAS,EAAE,KAAK,EAChB,WAAW,EACX,IAAI,EACJ,YAAY,EAAE,eAAe,EAC7B,aAAa,EACb,IAAI,EACJ,QAAgB,EAAE,OAAe,GACpC,EAAE,gBAAgB,eA+ElB;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { generateGuid, getClassName, hexToRgb, isNullOrUndefined, rgbToHex, whiteHex } from "@bodynarf/utils";
|
|
4
|
+
import { getValidationValues, mapDataAttributes } from "../../../../..";
|
|
5
|
+
import ColorPickerControl from "../picker";
|
|
6
|
+
/** Color picker component without form label */
|
|
7
|
+
function ColorPickerWithoutLabel({ className, title, showPreview, name, defaultValue, validationState, onValueChange, data, disabled = false, rounded = false, }) {
|
|
8
|
+
const defaultColor = isNullOrUndefined(defaultValue)
|
|
9
|
+
? whiteHex
|
|
10
|
+
: rgbToHex(defaultValue);
|
|
11
|
+
const [value, setValue] = useState(defaultColor);
|
|
12
|
+
const onChange = useCallback((event) => setValue(event.target.value), [setValue]);
|
|
13
|
+
useEffect(() => onValueChange?.call(undefined, hexToRgb(value)), [onValueChange, value]);
|
|
14
|
+
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(undefined, validationState);
|
|
15
|
+
const elClassName = getClassName([
|
|
16
|
+
className,
|
|
17
|
+
styleClassName,
|
|
18
|
+
rounded ? "is-rounded" : "",
|
|
19
|
+
"input",
|
|
20
|
+
]);
|
|
21
|
+
const containerClassName = getClassName([
|
|
22
|
+
"control",
|
|
23
|
+
"bbr-input",
|
|
24
|
+
showPreview ? "column" : "",
|
|
25
|
+
]);
|
|
26
|
+
const dataAttributes = isNullOrUndefined(data)
|
|
27
|
+
? undefined
|
|
28
|
+
: mapDataAttributes(data);
|
|
29
|
+
const id = name || generateGuid();
|
|
30
|
+
if (showPreview) {
|
|
31
|
+
return (_jsx("div", { className: "bbr-color-picker", children: _jsx(ColorPickerControl, { containerClassName: containerClassName, className: elClassName, disabled: disabled, showPreview: showPreview, defaultColor: defaultColor, onValueChange: onChange, value: value, id: id, title: title, dataAttributes: dataAttributes, isValidationDefined: isValidationDefined, validationMessages: validationMessages, styleClassName: styleClassName }) }));
|
|
32
|
+
}
|
|
33
|
+
return (_jsx("div", { className: "bbr-color-picker", children: _jsx(ColorPickerControl, { containerClassName: containerClassName, className: elClassName, disabled: disabled, showPreview: showPreview, defaultColor: defaultColor, onValueChange: onChange, value: value, id: id, title: title, dataAttributes: dataAttributes, isValidationDefined: isValidationDefined, validationMessages: validationMessages, styleClassName: styleClassName }) }));
|
|
34
|
+
}
|
|
35
|
+
export default ColorPickerWithoutLabel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/color/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
import { Color } from "@bodynarf/utils";
|
|
3
|
+
import { BaseInputElementProps } from "../../..";
|
|
4
|
+
/** Color picker props type */
|
|
5
|
+
export interface ColorPickerProps extends Omit<BaseInputElementProps<Color>, "style" | "loading" | "size" | "readonly" | "placeholder"> {
|
|
6
|
+
/**
|
|
7
|
+
* Show text with color preview.
|
|
8
|
+
* If set - outlined button-like element on the right will be rendered
|
|
9
|
+
*/
|
|
10
|
+
showPreview?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Color picker custom css properties */
|
|
13
|
+
export interface ColorPickerCssProperties extends CSSProperties {
|
|
14
|
+
/** Selected color to use as background color */
|
|
15
|
+
"--color-picker__background-color": string;
|
|
16
|
+
/** Color of text to contrast with background color */
|
|
17
|
+
"--color-picker__color": string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/color/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAE7C,8BAA8B;AAC9B,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EACvE,OAAO,GAAG,SAAS,GACjB,MAAM,GAAG,UAAU,GAAG,aAAa,CACxC;IACG;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,yCAAyC;AACzC,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC3D,gDAAgD;IAChD,kCAAkC,EAAE,MAAM,CAAC;IAE3C,sDAAsD;IACtD,uBAAuB,EAAE,MAAM,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/date/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/date/component/index.tsx"],"names":[],"mappings":"AAIA,OAAO,yBAAyB,CAAC;AAKjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,2BAA2B;AAC3B,QAAA,MAAM,UAAU,wIAMb,SAAS,KAAG,WA4Gd,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -5,7 +5,7 @@ import "../../../../common.scss";
|
|
|
5
5
|
import { ElementSize } from "../../..";
|
|
6
6
|
import { getValidationValues } from "../../../../utils";
|
|
7
7
|
/** Date input component */
|
|
8
|
-
const DatePicker = ({ defaultValue, onValueChange, readonly, disabled, validationState, name, size, className, rounded, loading, style, label, onBlur }) => {
|
|
8
|
+
const DatePicker = ({ defaultValue, onValueChange, readonly, disabled, validationState, name, size, className, rounded = false, loading = false, style, label, onBlur }) => {
|
|
9
9
|
const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value)
|
|
10
10
|
? undefined
|
|
11
11
|
: new Date(event.target.value)), [onValueChange]);
|
|
@@ -16,14 +16,14 @@ const DatePicker = ({ defaultValue, onValueChange, readonly, disabled, validatio
|
|
|
16
16
|
className,
|
|
17
17
|
elSizeClassName,
|
|
18
18
|
styleClassName,
|
|
19
|
-
rounded
|
|
19
|
+
rounded ? "is-rounded" : "",
|
|
20
20
|
"input",
|
|
21
21
|
]);
|
|
22
22
|
const inputContainerClassName = getClassName([
|
|
23
23
|
"control",
|
|
24
|
-
loading
|
|
24
|
+
loading ? "is-loading" : "",
|
|
25
25
|
]);
|
|
26
|
-
const
|
|
26
|
+
const stringifiedDefValue = defaultValue?.toISOString().split("T")[0];
|
|
27
27
|
const labelClassName = getClassName([
|
|
28
28
|
"label",
|
|
29
29
|
!label.horizontal ? elSizeClassName : "",
|
|
@@ -39,10 +39,10 @@ const DatePicker = ({ defaultValue, onValueChange, readonly, disabled, validatio
|
|
|
39
39
|
"field-body",
|
|
40
40
|
label.horizontalFieldContainerClassName
|
|
41
41
|
]);
|
|
42
|
-
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: "date", className: elClassName, readOnly: readonly, disabled: disabled, defaultValue:
|
|
42
|
+
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: "date", className: elClassName, readOnly: readonly, disabled: disabled, defaultValue: stringifiedDefValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
43
43
|
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
|
|
44
44
|
}
|
|
45
|
-
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: "date", className: elClassName, readOnly: readonly, disabled: disabled, defaultValue:
|
|
45
|
+
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: "date", className: elClassName, readOnly: readonly, disabled: disabled, defaultValue: stringifiedDefValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
46
46
|
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
47
47
|
};
|
|
48
48
|
export default DatePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/multiline/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/multiline/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,wCAAwC;AACxC,QAAA,MAAM,SAAS,UAAW,cAAc,KAAG,WAQ1C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { MultilineProps } from "../../../multiline";
|
|
3
2
|
/** Multiline textual input component with describing label */
|
|
4
|
-
declare const MultilineWithLabel: ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style,
|
|
3
|
+
declare const MultilineWithLabel: ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style, loading, label, placeholder, fixed, rows, onBlur }: MultilineProps) => JSX.Element;
|
|
5
4
|
export default MultilineWithLabel;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,8DAA8D;AAC9D,QAAA,MAAM,kBAAkB,yJAOrB,cAAc,KAAG,WAwGnB,CAAC;AAEF,eAAe,kBAAkB,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
|
/** Multiline textual input component with describing label */
|
|
7
|
-
const MultilineWithLabel = ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style,
|
|
7
|
+
const MultilineWithLabel = ({ defaultValue, onValueChange, validationState, readonly, disabled, name, className, size, style, loading = false, label, placeholder, fixed = false, rows, 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,14 +12,13 @@ const MultilineWithLabel = ({ defaultValue, onValueChange, validationState, read
|
|
|
12
12
|
const elClassName = getClassName([
|
|
13
13
|
className,
|
|
14
14
|
elSizeClassName,
|
|
15
|
-
rounded === true ? "is-rounded" : "",
|
|
16
15
|
styleClassName,
|
|
17
16
|
"textarea",
|
|
18
|
-
fixed
|
|
17
|
+
fixed ? "has-fixed-size" : "",
|
|
19
18
|
]);
|
|
20
19
|
const inputContainerClassName = getClassName([
|
|
21
20
|
"control",
|
|
22
|
-
loading
|
|
21
|
+
loading ? "is-loading" : "",
|
|
23
22
|
]);
|
|
24
23
|
const labelClassName = getClassName([
|
|
25
24
|
"label",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { MultilineProps } from "../../../multiline";
|
|
3
2
|
/** Multiline textual input component without describing label*/
|
|
4
|
-
declare const MultilineWithoutLabel: ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style,
|
|
3
|
+
declare const MultilineWithoutLabel: ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, loading, fixed, rows, }: MultilineProps) => JSX.Element;
|
|
5
4
|
export default MultilineWithoutLabel;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithoutLabel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/multiline/components/multilineWithoutLabel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,gEAAgE;AAChE,QAAA,MAAM,qBAAqB,+HAMxB,cAAc,KAAG,WA0CnB,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -4,22 +4,21 @@ 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,
|
|
7
|
+
const MultilineWithoutLabel = ({ onValueChange, defaultValue, validationState, name, placeholder, onBlur, className, size, style, 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 === true ? "is-rounded" : "",
|
|
15
14
|
styleClassName,
|
|
16
15
|
"textarea",
|
|
17
|
-
fixed
|
|
16
|
+
fixed ? "has-fixed-size" : "",
|
|
18
17
|
]);
|
|
19
18
|
const inputContainerClassName = getClassName([
|
|
20
19
|
"control",
|
|
21
20
|
"bbr-input",
|
|
22
|
-
loading
|
|
21
|
+
loading ? "is-loading" : "",
|
|
23
22
|
]);
|
|
24
23
|
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
24
|
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseInputElementProps } from "../..";
|
|
2
2
|
/** Multiline textual input component props type */
|
|
3
|
-
export interface MultilineProps extends BaseInputElementProps<string> {
|
|
3
|
+
export interface MultilineProps extends Omit<BaseInputElementProps<string>, "rounded"> {
|
|
4
4
|
/** Is input should be resizable */
|
|
5
5
|
fixed?: boolean;
|
|
6
6
|
/** Number of initial rows count */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/multiline/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,mDAAmD;AACnD,MAAM,WAAW,cAAe,SAAQ,qBAAqB,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/multiline/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,mDAAmD;AACnD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAClF,mCAAmC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/number/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/number/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,6BAA6B;AAC7B,QAAA,MAAM,MAAM,UAAW,WAAW,KAAG,WAOpC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -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/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/password/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,+BAA+B;AAC/B,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PasswordProps } from "../../../password";
|
|
3
2
|
declare const PasswordWithLabel: ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, label, placeholder, canShowPassword, }: PasswordProps) => JSX.Element;
|
|
4
3
|
export default PasswordWithLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":"
|
|
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,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PasswordProps } from "../../../password";
|
|
3
2
|
declare const PasswordWithoutLabel: ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, placeholder, canShowPassword, }: PasswordProps) => JSX.Element;
|
|
4
3
|
export default PasswordWithoutLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withoutLabel/index.tsx"],"names":[],"mappings":"
|
|
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/component/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/text/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,8BAA8B;AAC9B,QAAA,MAAM,IAAI,UAAW,SAAS,KAAG,WAOhC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TextProps } from "../../../text";
|
|
3
2
|
/** Textual input with describing label */
|
|
4
3
|
declare const TextWithLabel: ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, }: TextProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithLabel/index.tsx"],"names":[],"mappings":"
|
|
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",
|