@bodynarf/react.components 1.6.3 → 1.7.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/dist/bbr-components.js +1040 -0
- package/dist/bbr-components.umd.cjs +27 -0
- package/dist/components/accordion/component/index.d.ts +4 -0
- package/{components/anchor/index.js → dist/components/accordion/index.d.ts} +2 -2
- package/dist/components/accordion/types.d.ts +16 -0
- package/dist/components/anchor/component/index.d.ts +3 -0
- package/{components → dist/components}/anchor/components/anchorWithIcon/index.d.ts +3 -5
- package/{components → dist/components}/anchor/components/simpleAnchor/index.d.ts +3 -5
- package/{components/dropdown/index.js → dist/components/anchor/index.d.ts} +2 -2
- package/{components → dist/components}/anchor/types.d.ts +38 -39
- package/{components → dist/components}/button/component/index.d.ts +6 -9
- package/{components → dist/components}/button/components/buttonWithIcon/index.d.ts +3 -5
- package/{components → dist/components}/button/components/simpleButton/index.d.ts +3 -5
- package/{components/button/index.js → dist/components/button/index.d.ts} +2 -2
- package/{components → dist/components}/button/types.d.ts +36 -37
- package/dist/components/dropdown/component/index.d.ts +4 -0
- package/{components → dist/components}/dropdown/components/compact/index.d.ts +3 -5
- package/{components → dist/components}/dropdown/components/item/index.d.ts +13 -15
- package/{components → dist/components}/dropdown/components/label/index.d.ts +17 -18
- package/{components → dist/components}/dropdown/components/withLabel/index.d.ts +3 -5
- package/{components/icon/index.js → dist/components/dropdown/index.d.ts} +2 -2
- package/{components → dist/components}/dropdown/types.d.ts +45 -46
- package/{components → dist/components}/icon/component/index.d.ts +5 -8
- package/dist/components/icon/index.d.ts +2 -0
- package/{components → dist/components}/icon/types.d.ts +15 -16
- package/{components/index.js → dist/components/index.d.ts} +11 -10
- package/{components → dist/components}/paginator/component/index.d.ts +6 -8
- package/{components/paginator/index.js → dist/components/paginator/index.d.ts} +3 -3
- package/{components → dist/components}/paginator/types.d.ts +27 -28
- package/{components → dist/components}/paginator/utils.d.ts +9 -10
- package/{components → dist/components}/primitives/checkbox/component/index.d.ts +4 -7
- package/dist/components/primitives/checkbox/index.d.ts +2 -0
- package/{components → dist/components}/primitives/checkbox/types.d.ts +24 -25
- package/{components → dist/components}/primitives/date/component/index.d.ts +4 -6
- package/dist/components/primitives/date/index.d.ts +2 -0
- package/{components → dist/components}/primitives/date/types.d.ts +8 -9
- package/{components/primitives/index.js → dist/components/primitives/index.d.ts} +7 -7
- package/dist/components/primitives/multiline/component/index.d.ts +4 -0
- package/{components → dist/components}/primitives/multiline/components/multilineWithLabel/index.d.ts +4 -6
- package/{components → dist/components}/primitives/multiline/components/multilineWithoutLabel/index.d.ts +4 -6
- package/dist/components/primitives/multiline/index.d.ts +2 -0
- package/{components → dist/components}/primitives/multiline/types.d.ts +10 -11
- package/{components → dist/components}/primitives/number/component/index.d.ts +4 -6
- package/{components → dist/components}/primitives/number/components/withLabel/index.d.ts +4 -6
- package/{components → dist/components}/primitives/number/components/withoutLabel/index.d.ts +4 -6
- package/dist/components/primitives/number/index.d.ts +2 -0
- package/{components → dist/components}/primitives/number/types.d.ts +12 -13
- package/dist/components/primitives/password/component/index.d.ts +4 -0
- package/{components → dist/components}/primitives/password/components/withLabel/index.d.ts +3 -5
- package/{components → dist/components}/primitives/password/components/withoutLabel/index.d.ts +3 -5
- package/dist/components/primitives/password/index.d.ts +2 -0
- package/{components → dist/components}/primitives/password/types.d.ts +9 -10
- package/dist/components/primitives/text/component/index.d.ts +4 -0
- package/{components → dist/components}/primitives/text/components/textWithLabel/index.d.ts +4 -6
- package/{components → dist/components}/primitives/text/components/textWithoutLabel/index.d.ts +4 -6
- package/dist/components/primitives/text/index.d.ts +2 -0
- package/{components → dist/components}/primitives/text/types.d.ts +6 -7
- package/{components → dist/components}/primitives/types/baseProps.d.ts +29 -30
- package/{components/primitives/types/index.js → dist/components/primitives/types/index.d.ts} +3 -3
- package/{components → dist/components}/primitives/types/label.d.ts +13 -14
- package/{components/primitives/types/validation/index.js → dist/components/primitives/types/validation/index.d.ts} +2 -2
- package/{components → dist/components}/primitives/types/validation/state.d.ts +8 -9
- package/{components → dist/components}/primitives/types/validation/status.d.ts +9 -10
- package/{components → dist/components}/search/component/index.d.ts +3 -6
- package/dist/components/search/index.d.ts +2 -0
- package/{components → dist/components}/search/types.d.ts +26 -27
- package/{components → dist/components}/tabs/component/index.d.ts +31 -34
- package/{components → dist/components}/tabs/components/item/index.d.ts +11 -13
- package/dist/components/tabs/index.d.ts +2 -0
- package/{components → dist/components}/tabs/types.d.ts +42 -43
- package/{components → dist/components}/tag/component/index.d.ts +4 -7
- package/dist/components/tag/index.d.ts +2 -0
- package/{components → dist/components}/tag/types.d.ts +26 -27
- package/{components → dist/components}/types.d.ts +66 -67
- package/{hooks/index.js → dist/hooks/index.d.ts} +2 -2
- package/{hooks → dist/hooks}/useComponentOutsideClick.d.ts +10 -11
- package/{hooks → dist/hooks}/usePagination.d.ts +19 -20
- package/{index.js → dist/index.d.ts} +3 -3
- package/dist/style.css +1 -0
- package/{utils → dist/utils}/dataAttributes.d.ts +7 -8
- package/{utils → dist/utils}/formValidation.d.ts +15 -16
- package/{utils/index.js → dist/utils/index.d.ts} +2 -2
- package/package.json +45 -38
- package/common.scss +0 -3
- package/components/anchor/component/index.d.ts +0 -6
- package/components/anchor/component/index.d.ts.map +0 -1
- package/components/anchor/component/index.js +0 -20
- package/components/anchor/component/style.scss +0 -15
- package/components/anchor/components/anchorWithIcon/index.d.ts.map +0 -1
- package/components/anchor/components/anchorWithIcon/index.js +0 -16
- package/components/anchor/components/simpleAnchor/index.d.ts.map +0 -1
- package/components/anchor/components/simpleAnchor/index.js +0 -5
- package/components/anchor/index.d.ts +0 -3
- package/components/anchor/index.d.ts.map +0 -1
- package/components/anchor/types.d.ts.map +0 -1
- package/components/anchor/types.js +0 -1
- package/components/button/component/index.d.ts.map +0 -1
- package/components/button/component/index.js +0 -36
- package/components/button/component/style.scss +0 -12
- package/components/button/components/buttonWithIcon/index.d.ts.map +0 -1
- package/components/button/components/buttonWithIcon/index.js +0 -19
- package/components/button/components/simpleButton/index.d.ts.map +0 -1
- package/components/button/components/simpleButton/index.js +0 -5
- package/components/button/index.d.ts +0 -3
- package/components/button/index.d.ts.map +0 -1
- package/components/button/types.d.ts.map +0 -1
- package/components/button/types.js +0 -4
- package/components/dropdown/component/index.d.ts +0 -7
- package/components/dropdown/component/index.d.ts.map +0 -1
- package/components/dropdown/component/index.js +0 -15
- package/components/dropdown/component/style.scss +0 -120
- package/components/dropdown/components/compact/index.d.ts.map +0 -1
- package/components/dropdown/components/compact/index.js +0 -62
- package/components/dropdown/components/item/index.d.ts.map +0 -1
- package/components/dropdown/components/item/index.js +0 -6
- package/components/dropdown/components/label/index.d.ts.map +0 -1
- package/components/dropdown/components/label/index.js +0 -22
- package/components/dropdown/components/withLabel/index.d.ts.map +0 -1
- package/components/dropdown/components/withLabel/index.js +0 -83
- package/components/dropdown/index.d.ts +0 -3
- package/components/dropdown/index.d.ts.map +0 -1
- package/components/dropdown/types.d.ts.map +0 -1
- package/components/dropdown/types.js +0 -1
- package/components/icon/component/index.d.ts.map +0 -1
- package/components/icon/component/index.js +0 -23
- package/components/icon/component/style.scss +0 -21
- package/components/icon/index.d.ts +0 -3
- package/components/icon/index.d.ts.map +0 -1
- package/components/icon/types.d.ts.map +0 -1
- package/components/icon/types.js +0 -1
- package/components/index.d.ts +0 -11
- package/components/index.d.ts.map +0 -1
- package/components/paginator/component/index.d.ts.map +0 -1
- package/components/paginator/component/index.js +0 -47
- package/components/paginator/index.d.ts +0 -4
- package/components/paginator/index.d.ts.map +0 -1
- package/components/paginator/types.d.ts.map +0 -1
- package/components/paginator/types.js +0 -1
- package/components/paginator/utils.d.ts.map +0 -1
- package/components/paginator/utils.js +0 -18
- package/components/primitives/checkbox/component/index.d.ts.map +0 -1
- package/components/primitives/checkbox/component/index.js +0 -37
- package/components/primitives/checkbox/component/style.scss +0 -10
- package/components/primitives/checkbox/index.d.ts +0 -3
- package/components/primitives/checkbox/index.d.ts.map +0 -1
- package/components/primitives/checkbox/index.js +0 -2
- package/components/primitives/checkbox/types.d.ts.map +0 -1
- package/components/primitives/checkbox/types.js +0 -1
- package/components/primitives/date/component/index.d.ts.map +0 -1
- package/components/primitives/date/component/index.js +0 -48
- package/components/primitives/date/index.d.ts +0 -3
- package/components/primitives/date/index.d.ts.map +0 -1
- package/components/primitives/date/index.js +0 -2
- package/components/primitives/date/types.d.ts.map +0 -1
- package/components/primitives/date/types.js +0 -1
- package/components/primitives/index.d.ts +0 -8
- package/components/primitives/index.d.ts.map +0 -1
- package/components/primitives/multiline/component/index.d.ts +0 -7
- package/components/primitives/multiline/component/index.d.ts.map +0 -1
- package/components/primitives/multiline/component/index.js +0 -15
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +0 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.js +0 -45
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +0 -1
- package/components/primitives/multiline/components/multilineWithoutLabel/index.js +0 -27
- package/components/primitives/multiline/index.d.ts +0 -3
- package/components/primitives/multiline/index.d.ts.map +0 -1
- package/components/primitives/multiline/index.js +0 -2
- package/components/primitives/multiline/types.d.ts.map +0 -1
- package/components/primitives/multiline/types.js +0 -1
- package/components/primitives/number/component/index.d.ts.map +0 -1
- package/components/primitives/number/component/index.js +0 -14
- package/components/primitives/number/components/withLabel/index.d.ts.map +0 -1
- package/components/primitives/number/components/withLabel/index.js +0 -44
- package/components/primitives/number/components/withoutLabel/index.d.ts.map +0 -1
- package/components/primitives/number/components/withoutLabel/index.js +0 -26
- package/components/primitives/number/index.d.ts +0 -3
- package/components/primitives/number/index.d.ts.map +0 -1
- package/components/primitives/number/index.js +0 -2
- package/components/primitives/number/types.d.ts.map +0 -1
- package/components/primitives/number/types.js +0 -1
- package/components/primitives/password/component/index.d.ts +0 -7
- package/components/primitives/password/component/index.d.ts.map +0 -1
- package/components/primitives/password/component/index.js +0 -13
- package/components/primitives/password/component/style.scss +0 -16
- package/components/primitives/password/components/withLabel/index.d.ts.map +0 -1
- package/components/primitives/password/components/withLabel/index.js +0 -51
- package/components/primitives/password/components/withoutLabel/index.d.ts.map +0 -1
- package/components/primitives/password/components/withoutLabel/index.js +0 -33
- package/components/primitives/password/index.d.ts +0 -3
- package/components/primitives/password/index.d.ts.map +0 -1
- package/components/primitives/password/index.js +0 -2
- package/components/primitives/password/types.d.ts.map +0 -1
- package/components/primitives/password/types.js +0 -1
- package/components/primitives/text/component/index.d.ts +0 -7
- package/components/primitives/text/component/index.d.ts.map +0 -1
- package/components/primitives/text/component/index.js +0 -15
- package/components/primitives/text/components/textWithLabel/index.d.ts.map +0 -1
- package/components/primitives/text/components/textWithLabel/index.js +0 -44
- package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +0 -1
- package/components/primitives/text/components/textWithoutLabel/index.js +0 -26
- package/components/primitives/text/index.d.ts +0 -3
- package/components/primitives/text/index.d.ts.map +0 -1
- package/components/primitives/text/index.js +0 -2
- package/components/primitives/text/types.d.ts.map +0 -1
- package/components/primitives/text/types.js +0 -1
- package/components/primitives/types/baseProps.d.ts.map +0 -1
- package/components/primitives/types/baseProps.js +0 -1
- package/components/primitives/types/index.d.ts +0 -4
- package/components/primitives/types/index.d.ts.map +0 -1
- package/components/primitives/types/label.d.ts.map +0 -1
- package/components/primitives/types/label.js +0 -1
- package/components/primitives/types/validation/index.d.ts +0 -3
- package/components/primitives/types/validation/index.d.ts.map +0 -1
- package/components/primitives/types/validation/state.d.ts.map +0 -1
- package/components/primitives/types/validation/state.js +0 -2
- package/components/primitives/types/validation/status.d.ts.map +0 -1
- package/components/primitives/types/validation/status.js +0 -11
- package/components/search/component/index.d.ts.map +0 -1
- package/components/search/component/index.js +0 -37
- package/components/search/component/style.scss +0 -24
- package/components/search/index.d.ts +0 -3
- package/components/search/index.d.ts.map +0 -1
- package/components/search/index.js +0 -2
- package/components/search/types.d.ts.map +0 -1
- package/components/search/types.js +0 -1
- package/components/tabs/component/index.d.ts.map +0 -1
- package/components/tabs/component/index.js +0 -68
- package/components/tabs/component/style.scss +0 -12
- package/components/tabs/components/item/index.d.ts.map +0 -1
- package/components/tabs/components/item/index.js +0 -27
- package/components/tabs/index.d.ts +0 -3
- package/components/tabs/index.d.ts.map +0 -1
- package/components/tabs/index.js +0 -2
- package/components/tabs/types.d.ts.map +0 -1
- package/components/tabs/types.js +0 -34
- package/components/tag/component/index.d.ts.map +0 -1
- package/components/tag/component/index.js +0 -28
- package/components/tag/component/style.scss +0 -27
- package/components/tag/index.d.ts +0 -3
- package/components/tag/index.d.ts.map +0 -1
- package/components/tag/index.js +0 -2
- package/components/tag/types.d.ts.map +0 -1
- package/components/tag/types.js +0 -1
- package/components/types.d.ts.map +0 -1
- package/components/types.js +0 -31
- package/hooks/index.d.ts +0 -3
- package/hooks/index.d.ts.map +0 -1
- package/hooks/useComponentOutsideClick.d.ts.map +0 -1
- package/hooks/useComponentOutsideClick.js +0 -32
- package/hooks/usePagination.d.ts.map +0 -1
- package/hooks/usePagination.js +0 -28
- package/index.d.ts +0 -4
- package/index.d.ts.map +0 -1
- package/readme.md +0 -56
- package/tsconfig.tsbuildinfo +0 -1
- package/utils/dataAttributes.d.ts.map +0 -1
- package/utils/dataAttributes.js +0 -19
- package/utils/formValidation.d.ts.map +0 -1
- package/utils/formValidation.js +0 -35
- package/utils/index.d.ts +0 -3
- package/utils/index.d.ts.map +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault, isStringEmpty } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../..";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
/** Number component with label */
|
|
7
|
-
const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, step, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value) ? undefined : +event.target.value), [onValueChange]);
|
|
9
|
-
const id = name || generateGuid();
|
|
10
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
11
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
-
const elClassName = getClassName([
|
|
13
|
-
className,
|
|
14
|
-
elSizeClassName,
|
|
15
|
-
rounded === true ? "is-rounded" : "",
|
|
16
|
-
styleClassName,
|
|
17
|
-
"input",
|
|
18
|
-
]);
|
|
19
|
-
const inputContainerClassName = getClassName([
|
|
20
|
-
"control",
|
|
21
|
-
loading === true ? "is-loading" : "",
|
|
22
|
-
]);
|
|
23
|
-
const labelClassName = getClassName([
|
|
24
|
-
"label",
|
|
25
|
-
!label.horizontal ? elSizeClassName : "",
|
|
26
|
-
label.className
|
|
27
|
-
]);
|
|
28
|
-
if (label.horizontal) {
|
|
29
|
-
const labelContainerClassName = getClassName([
|
|
30
|
-
"field-label",
|
|
31
|
-
elSizeClassName,
|
|
32
|
-
label.horizontalContainerClassName
|
|
33
|
-
]);
|
|
34
|
-
const fieldContainerClassName = getClassName([
|
|
35
|
-
"field-body",
|
|
36
|
-
label.horizontalFieldContainerClassName
|
|
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 ?? 1 }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
39
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
|
|
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 ?? 1 }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
42
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
43
|
-
};
|
|
44
|
-
export default NumberWithLabel;
|
|
@@ -1 +0,0 @@
|
|
|
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,OAAO,CAAC;AAEpC,qCAAqC;AACrC,QAAA,MAAM,kBAAkB,qJAOrB,WAAW,KAAG,WA8ChB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../..";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
/** Number component without label */
|
|
7
|
-
const NumberWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, step, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(+event.target.value), [onValueChange]);
|
|
9
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
10
|
-
const elClassName = getClassName([
|
|
11
|
-
className,
|
|
12
|
-
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
13
|
-
rounded === true ? "is-rounded" : "",
|
|
14
|
-
styleClassName,
|
|
15
|
-
"input",
|
|
16
|
-
]);
|
|
17
|
-
const containerClassName = getClassName([
|
|
18
|
-
"control",
|
|
19
|
-
"bbr-input",
|
|
20
|
-
loading === true ? "is-loading" : "",
|
|
21
|
-
]);
|
|
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 ?? 1 }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
24
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
25
|
-
};
|
|
26
|
-
export default NumberWithoutLabel;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/number/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/number/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,kCAAkC;AAClC,MAAM,WAAW,WAAY,SAAQ,qBAAqB,CAAC,MAAM,CAAC;IAC9D,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;;MAIE;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
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,IAAI,CAAC;AAKnC,+BAA+B;AAC/B,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
-
import "./style.scss";
|
|
4
|
-
import PasswordWithLabel from "../components/withLabel";
|
|
5
|
-
import PasswordWithoutLabel from "../components/withoutLabel";
|
|
6
|
-
/** Password input component */
|
|
7
|
-
const Password = (props) => {
|
|
8
|
-
if (isNullOrUndefined(props.label)) {
|
|
9
|
-
return _jsx(PasswordWithoutLabel, { ...props });
|
|
10
|
-
}
|
|
11
|
-
return _jsx(PasswordWithLabel, { ...props });
|
|
12
|
-
};
|
|
13
|
-
export default Password;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/password/components/withLabel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,QAAA,MAAM,iBAAiB,uIAMpB,aAAa,KAAG,WAgIlB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import Icon from "../../../../icon";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
import { ElementSize } from "../../../..";
|
|
7
|
-
const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, label, placeholder, canShowPassword, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
-
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
10
|
-
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
11
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
13
|
-
const id = name || generateGuid();
|
|
14
|
-
const elClassName = getClassName([
|
|
15
|
-
className,
|
|
16
|
-
elSizeClassName,
|
|
17
|
-
rounded === true ? "is-rounded" : "",
|
|
18
|
-
styleClassName,
|
|
19
|
-
"bbr-password",
|
|
20
|
-
"input",
|
|
21
|
-
]);
|
|
22
|
-
const inputContainerClassName = getClassName([
|
|
23
|
-
"control",
|
|
24
|
-
loading === true ? "is-loading" : "",
|
|
25
|
-
canShowPassword ? "has-icons-right" : "",
|
|
26
|
-
"bbr-password__wrapper",
|
|
27
|
-
]);
|
|
28
|
-
const labelClassName = getClassName([
|
|
29
|
-
"label",
|
|
30
|
-
!label.horizontal ? elSizeClassName : "",
|
|
31
|
-
label.className
|
|
32
|
-
]);
|
|
33
|
-
if (label.horizontal) {
|
|
34
|
-
const labelContainerClassName = getClassName([
|
|
35
|
-
"field-label",
|
|
36
|
-
elSizeClassName,
|
|
37
|
-
label.horizontalContainerClassName
|
|
38
|
-
]);
|
|
39
|
-
const fieldContainerClassName = getClassName([
|
|
40
|
-
"field-body",
|
|
41
|
-
label.horizontalFieldContainerClassName
|
|
42
|
-
]);
|
|
43
|
-
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: [_jsxs("div", { className: inputContainerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", className: elClassName, placeholder: placeholder, disabled: disabled, onChange: onChange, name: id, id: id }), canShowPassword && !loading &&
|
|
44
|
-
_jsx("span", { className: `icon is-right ${elSizeClassName}`, onMouseEnter: onIconClick, onMouseLeave: onIconClick, title: "Show password", children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash", size: ElementSize.Medium }) })] }), isValidationDefined && validationMessages.length > 0 &&
|
|
45
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
|
|
46
|
-
}
|
|
47
|
-
return (_jsxs("div", { className: "bbr-input field", children: [_jsx("label", { className: labelClassName, htmlFor: id, children: label.caption }), _jsxs("div", { className: inputContainerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", className: elClassName, placeholder: placeholder, disabled: disabled, onChange: onChange, name: id, id: id }), canShowPassword && !loading &&
|
|
48
|
-
_jsx("span", { className: `icon is-right ${elSizeClassName}`, onMouseEnter: onIconClick, onMouseLeave: onIconClick, children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash", size: ElementSize.Medium }) })] }), isValidationDefined && validationMessages.length > 0 &&
|
|
49
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
50
|
-
};
|
|
51
|
-
export default PasswordWithLabel;
|
|
@@ -1 +0,0 @@
|
|
|
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,gIAMvB,aAAa,KAAG,WA4DlB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import Icon from "../../../../icon";
|
|
5
|
-
import { ElementSize } from "../../../..";
|
|
6
|
-
import { getValidationValues } from "../../../../../utils";
|
|
7
|
-
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, placeholder, canShowPassword, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
-
const [contentIsHidden, setContentIsHidden] = useState(true);
|
|
10
|
-
const onIconClick = useCallback(() => setContentIsHidden(state => !state), [setContentIsHidden]);
|
|
11
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
13
|
-
const id = name || generateGuid();
|
|
14
|
-
const elClassName = getClassName([
|
|
15
|
-
className,
|
|
16
|
-
elSizeClassName,
|
|
17
|
-
rounded === true ? "is-rounded" : "",
|
|
18
|
-
styleClassName,
|
|
19
|
-
"bbr-password",
|
|
20
|
-
"input",
|
|
21
|
-
]);
|
|
22
|
-
const containerClassName = getClassName([
|
|
23
|
-
"control",
|
|
24
|
-
"bbr-input",
|
|
25
|
-
loading === true ? "is-loading" : "",
|
|
26
|
-
canShowPassword ? "has-icons-right" : "",
|
|
27
|
-
"bbr-password__wrapper",
|
|
28
|
-
]);
|
|
29
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: containerClassName, children: [_jsx("input", { type: contentIsHidden ? "password" : "text", className: elClassName, placeholder: placeholder, disabled: disabled, onChange: onChange, name: id, id: id }), canShowPassword && !loading &&
|
|
30
|
-
_jsx("span", { className: `icon is-right ${elSizeClassName}`, onMouseEnter: onIconClick, onMouseLeave: onIconClick, children: _jsx(Icon, { name: contentIsHidden ? "eye" : "eye-slash", size: ElementSize.Medium }) })] }), isValidationDefined && validationMessages.length > 0 &&
|
|
31
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
32
|
-
};
|
|
33
|
-
export default PasswordWithoutLabel;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,oCAAoC;AACpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC;IACnG;;;MAGE;IACF,eAAe,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
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,IAAI,CAAC;AAK/B,8BAA8B;AAC9B,QAAA,MAAM,IAAI,UAAW,SAAS,KAAG,WAOhC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
-
import "../../../../common.scss";
|
|
4
|
-
import TextWithLabel from "../components/textWithLabel";
|
|
5
|
-
import TextWithoutLabel from "../components/textWithoutLabel";
|
|
6
|
-
/** Textual input component */
|
|
7
|
-
const Text = (props) => {
|
|
8
|
-
if (isNullOrUndefined(props.label)) {
|
|
9
|
-
return (_jsx(TextWithoutLabel, { ...props }));
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
return (_jsx(TextWithLabel, { ...props }));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export default Text;
|
|
@@ -1 +0,0 @@
|
|
|
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,OAAO,CAAC;AAElC,0CAA0C;AAC1C,QAAA,MAAM,aAAa,sJAMhB,SAAS,KAAG,WAwGd,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault, } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../..";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
/** Textual input with describing label */
|
|
7
|
-
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
-
const id = name || generateGuid();
|
|
10
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
11
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
-
const elClassName = getClassName([
|
|
13
|
-
className,
|
|
14
|
-
elSizeClassName,
|
|
15
|
-
rounded === true ? "is-rounded" : "",
|
|
16
|
-
styleClassName,
|
|
17
|
-
"input",
|
|
18
|
-
]);
|
|
19
|
-
const inputContainerClassName = getClassName([
|
|
20
|
-
"control",
|
|
21
|
-
loading === true ? "is-loading" : "",
|
|
22
|
-
]);
|
|
23
|
-
const labelClassName = getClassName([
|
|
24
|
-
"label",
|
|
25
|
-
!label.horizontal ? elSizeClassName : "",
|
|
26
|
-
label.className
|
|
27
|
-
]);
|
|
28
|
-
if (label.horizontal) {
|
|
29
|
-
const labelContainerClassName = getClassName([
|
|
30
|
-
"field-label",
|
|
31
|
-
elSizeClassName,
|
|
32
|
-
label.horizontalContainerClassName
|
|
33
|
-
]);
|
|
34
|
-
const fieldContainerClassName = getClassName([
|
|
35
|
-
"field-body",
|
|
36
|
-
label.horizontalFieldContainerClassName
|
|
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: "text", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
39
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }) })] }));
|
|
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: "text", className: elClassName, placeholder: placeholder, readOnly: readonly, disabled: disabled, defaultValue: defaultValue, onChange: onChange, onBlur: onBlur, name: id, id: id }) }), isValidationDefined && validationMessages.length > 0 &&
|
|
42
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
43
|
-
};
|
|
44
|
-
export default TextWithLabel;
|
|
@@ -1 +0,0 @@
|
|
|
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,OAAO,CAAC;AAElC,6CAA6C;AAC7C,QAAA,MAAM,gBAAgB,+IAMnB,SAAS,KAAG,WA6Cd,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import { ElementSize } from "../../../..";
|
|
5
|
-
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
/** Textual input without describing label */
|
|
7
|
-
const TextWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, }) => {
|
|
8
|
-
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
|
-
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
10
|
-
const elClassName = getClassName([
|
|
11
|
-
className,
|
|
12
|
-
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
13
|
-
rounded === true ? "is-rounded" : "",
|
|
14
|
-
styleClassName,
|
|
15
|
-
"input",
|
|
16
|
-
]);
|
|
17
|
-
const containerClassName = getClassName([
|
|
18
|
-
"control",
|
|
19
|
-
"bbr-input",
|
|
20
|
-
loading === true ? "is-loading" : "",
|
|
21
|
-
]);
|
|
22
|
-
const id = name || generateGuid();
|
|
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 &&
|
|
24
|
-
_jsx("p", { className: `help m-help ${styleClassName}`, children: validationMessages.join("\n") })] }));
|
|
25
|
-
};
|
|
26
|
-
export default TextWithoutLabel;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/text/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAE3C,sCAAsC;AACtC,MAAM,WAAW,SAAU,SAAQ,qBAAqB,CAAC,MAAM,CAAC;IAC5D,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseProps.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/types/baseProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1E,2CAA2C;AAC3C,MAAM,WAAW,qBAAqB,CAAC,MAAM,CAAE,SAAQ,gBAAgB;IACnE,8EAA8E;IAC9E,aAAa,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC,sCAAsC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,qBAAqB;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,+BAA+B;IAC/B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/types/label.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,MAAM,WAAW,UAAU;IACvB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAEhB,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;IAEpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,+DAA+D;IAC/D,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAEtC,+DAA+D;IAC/D,iCAAiC,CAAC,EAAE,MAAM,CAAC;CAC9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/types/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/types/validation/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC5B,qBAAqB;IACrB,MAAM,EAAE,gBAAgB,CAAC;IAEzB,8BAA8B;IAC9B,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/types/validation/status.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,oBAAY,gBAAgB;IACxB,uCAAuC;IACvC,IAAI,SAAS;IAEb,qBAAqB;IACrB,KAAK,UAAU;IAEf,gDAAgD;IAChD,OAAO,YAAY;CACtB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** Input component value validation status */
|
|
2
|
-
export var ValidationStatus;
|
|
3
|
-
(function (ValidationStatus) {
|
|
4
|
-
/** Validation wasn"t been performed */
|
|
5
|
-
ValidationStatus["None"] = "none";
|
|
6
|
-
/** Value is valid */
|
|
7
|
-
ValidationStatus["Valid"] = "valid";
|
|
8
|
-
/** Value is invalid due some validator check */
|
|
9
|
-
ValidationStatus["Invalid"] = "invalid";
|
|
10
|
-
})(ValidationStatus || (ValidationStatus = {}));
|
|
11
|
-
;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/search/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpC,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC3B,UAAU,EAAE,QAAQ,EAAE,OAAO,EAC7B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GACrC,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAwE3B"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState } from "react";
|
|
3
|
-
import { generateGuid, getClassName } from "@bodynarf/utils";
|
|
4
|
-
import "./style.scss";
|
|
5
|
-
import Button from "../../button";
|
|
6
|
-
/** Search component */
|
|
7
|
-
export default function Search({ searchType, onSearch, caption, name, defaultValue, size, isLoading, rounded, disabled, }) {
|
|
8
|
-
const [elementName] = useState(name || generateGuid());
|
|
9
|
-
const [searchValue, setSearchValue] = useState(defaultValue || "");
|
|
10
|
-
const onChange = useCallback((event) => {
|
|
11
|
-
const elementValue = event.target.value;
|
|
12
|
-
if (searchType === "byTyping") {
|
|
13
|
-
onSearch(elementValue);
|
|
14
|
-
}
|
|
15
|
-
setSearchValue(elementValue);
|
|
16
|
-
}, [onSearch, searchType]);
|
|
17
|
-
const onSearchButtonClick = useCallback(() => onSearch(searchValue), [onSearch, searchValue]);
|
|
18
|
-
const className = getClassName([
|
|
19
|
-
"bbr-search",
|
|
20
|
-
"control",
|
|
21
|
-
`is-${(size || "normal")}`,
|
|
22
|
-
isLoading === true ? "is-loading" : "",
|
|
23
|
-
searchType === "byButton" ? "is-expanded" : "",
|
|
24
|
-
]);
|
|
25
|
-
const inputClassName = getClassName([
|
|
26
|
-
"input",
|
|
27
|
-
"is-unselectable",
|
|
28
|
-
`is-${(size || "normal")}`,
|
|
29
|
-
rounded === true ? "is-rounded" : "",
|
|
30
|
-
]);
|
|
31
|
-
if (searchType === "byButton") {
|
|
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 }) })] }));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return (_jsx("div", { className: className, children: _jsx("input", { type: "search", name: elementName, defaultValue: searchValue, className: inputClassName, disabled: disabled, onChange: onChange, placeholder: caption }) }));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.bbr-search {
|
|
2
|
-
input[type="search"] {
|
|
3
|
-
transition: 0.15s ease-out;
|
|
4
|
-
transition-property: border-color, color, background-color;
|
|
5
|
-
|
|
6
|
-
&::placeholder {
|
|
7
|
-
user-select: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&::-webkit-input-placeholder {
|
|
11
|
-
transition: 0.15s ease-out color;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&::-webkit-search-cancel-button {
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
font-size: 1.25rem;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&.is-loading::after {
|
|
21
|
-
right: 1rem;
|
|
22
|
-
top: 0.725rem;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAEjC,kCAAkC;AAClC,MAAM,WAAW,WAAW;IACxB;;;;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,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,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;CACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
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,OAAO,CAAC;AAGtD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAGtD,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"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState, useEffect, useRef } from "react";
|
|
3
|
-
import { getClassName, isNullOrEmpty, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
|
-
import "./style.scss";
|
|
5
|
-
import { ElementSize } from "../..";
|
|
6
|
-
import { mapDataAttributes } from "../../../utils";
|
|
7
|
-
import { TabsPosition, TabsStyle } from "..";
|
|
8
|
-
import TabItemComponent from "../components/item";
|
|
9
|
-
/**
|
|
10
|
-
* Tabs panel
|
|
11
|
-
* @throws Items are empty
|
|
12
|
-
*/
|
|
13
|
-
const Tabs = ({ items, onActiveItemChange, defaultActive, size, position, style, fullWidth, className, title, data, }) => {
|
|
14
|
-
if (items.length === 0) {
|
|
15
|
-
throw new Error("Invalid configuration. Tab items must be defined");
|
|
16
|
-
}
|
|
17
|
-
const [activeItem, setActiveItem] = useState(defaultActive ?? items[0]);
|
|
18
|
-
const isFirstRun = useRef(true);
|
|
19
|
-
const onTabsClick = useCallback((container) => {
|
|
20
|
-
const closestTab = container.target.closest(".bbr-tabs__tab");
|
|
21
|
-
if (isNullOrUndefined(closestTab)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const itemId = closestTab.attributes.getNamedItem("data-item-id")?.value ?? "";
|
|
25
|
-
if (isNullOrEmpty(itemId)) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const item = items.find(({ id }) => id === itemId);
|
|
29
|
-
if (isNullOrUndefined(item) || item === activeItem) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
setActiveItem(item);
|
|
33
|
-
}, [activeItem, items]);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (isFirstRun.current) {
|
|
36
|
-
isFirstRun.current = false;
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
onActiveItemChange(activeItem);
|
|
40
|
-
}, [activeItem, onActiveItemChange]);
|
|
41
|
-
const elClassName = getClassName([
|
|
42
|
-
"bbr-tabs",
|
|
43
|
-
"tabs",
|
|
44
|
-
position ?? TabsPosition.left,
|
|
45
|
-
getSizeClassName(size, [ElementSize.Normal]),
|
|
46
|
-
style ?? TabsStyle.default,
|
|
47
|
-
fullWidth === true ? "is-fullwidth" : "",
|
|
48
|
-
className,
|
|
49
|
-
]);
|
|
50
|
-
const dataAttributes = isNullOrUndefined(data)
|
|
51
|
-
? undefined
|
|
52
|
-
: mapDataAttributes(data);
|
|
53
|
-
return (_jsx("nav", { className: elClassName, onClick: onTabsClick, title: title, ...dataAttributes, children: _jsx("ul", { children: items.map(item => _jsx(TabItemComponent, { item: item, activeItem: activeItem.id }, item.id)) }) }));
|
|
54
|
-
};
|
|
55
|
-
export default Tabs;
|
|
56
|
-
/**
|
|
57
|
-
* Get class name for specified size and constraints
|
|
58
|
-
* @param size Component size
|
|
59
|
-
* @param notAllowedSizes Sizes that not applicable to component
|
|
60
|
-
* @returns Class name for react element
|
|
61
|
-
*/
|
|
62
|
-
const getSizeClassName = (size, notAllowedSizes) => {
|
|
63
|
-
notAllowedSizes ??= [];
|
|
64
|
-
if (isNullOrUndefined(size) || notAllowedSizes.includes(size)) {
|
|
65
|
-
return "";
|
|
66
|
-
}
|
|
67
|
-
return `is-${size}`;
|
|
68
|
-
};
|