@bodynarf/react.components 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/anchor/components/anchorWithIcon/index.js +5 -5
- package/components/anchor/index.d.ts +3 -3
- package/components/anchor/index.d.ts.map +1 -1
- package/components/anchor/index.js +7 -7
- package/components/anchor/types.d.ts +2 -2
- package/components/anchor/types.d.ts.map +1 -1
- package/components/button/components/buttonWithIcon/index.d.ts +1 -1
- package/components/button/components/buttonWithIcon/index.js +5 -5
- package/components/button/components/simpleButton/index.d.ts +1 -1
- package/components/button/index.d.ts +3 -3
- package/components/button/index.d.ts.map +1 -1
- package/components/button/index.js +9 -9
- package/components/button/types.d.ts +1 -1
- package/components/dropdown/components/compact/index.d.ts +0 -1
- package/components/dropdown/components/compact/index.d.ts.map +1 -1
- package/components/dropdown/components/compact/index.js +3 -3
- package/components/dropdown/components/label/index.d.ts +1 -1
- package/components/dropdown/components/label/index.js +1 -1
- 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 +7 -7
- package/components/dropdown/index.d.ts +4 -5
- package/components/dropdown/index.d.ts.map +1 -1
- package/components/dropdown/index.js +4 -4
- package/components/icon/icon.scss +7 -4
- package/components/icon/index.d.ts +3 -3
- package/components/icon/index.d.ts.map +1 -1
- package/components/icon/index.js +8 -6
- package/components/index.d.ts +10 -0
- package/components/index.d.ts.map +1 -0
- package/components/index.js +9 -0
- package/components/paginator/index.d.ts +2 -2
- package/components/paginator/index.d.ts.map +1 -1
- package/components/paginator/index.js +4 -4
- package/components/primitives/checkbox/index.d.ts +2 -2
- package/components/primitives/checkbox/index.d.ts.map +1 -1
- package/components/primitives/date/index.d.ts +1 -1
- package/components/primitives/date/index.d.ts.map +1 -1
- package/components/primitives/date/index.js +2 -2
- package/components/primitives/index.d.ts +5 -5
- package/components/primitives/index.js +5 -5
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithLabel/index.js +2 -2
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +1 -1
- package/components/primitives/multiline/components/multilineWithoutLabel/index.js +2 -2
- package/components/primitives/multiline/index.d.ts +1 -1
- package/components/primitives/multiline/index.d.ts.map +1 -1
- package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withLabel/index.js +2 -2
- package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
- package/components/primitives/number/components/withoutLabel/index.js +2 -2
- package/components/primitives/number/index.d.ts +1 -0
- package/components/primitives/number/index.d.ts.map +1 -1
- package/components/primitives/password/components/withLabel/index.js +2 -2
- package/components/primitives/password/components/withoutLabel/index.js +2 -2
- package/components/primitives/password/index.d.ts +2 -2
- package/components/primitives/password/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithLabel/index.js +2 -2
- package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +1 -1
- package/components/primitives/text/components/textWithoutLabel/index.js +2 -2
- package/components/primitives/text/index.d.ts +1 -1
- package/components/primitives/text/index.d.ts.map +1 -1
- package/components/primitives/types/baseProps.d.ts +4 -4
- package/components/primitives/types/baseProps.d.ts.map +1 -1
- package/components/primitives/types/index.d.ts +3 -4
- package/components/primitives/types/index.d.ts.map +1 -1
- package/components/primitives/types/index.js +3 -4
- package/components/search/index.d.ts +3 -3
- package/components/search/index.js +14 -14
- package/components/tag/index.d.ts +4 -5
- package/components/tag/index.d.ts.map +1 -1
- package/components/tag/index.js +6 -6
- package/components/types.d.ts +29 -3
- package/components/types.d.ts.map +1 -1
- package/components/types.js +31 -1
- package/hooks/index.d.ts +2 -2
- package/hooks/index.js +2 -2
- package/hooks/useComponentOutsideClick.js +2 -2
- package/package.json +2 -2
- package/utils/formValidation.d.ts +3 -3
- package/utils/formValidation.d.ts.map +1 -1
- package/utils/formValidation.js +1 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/multiline/index.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/multiline/index.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAK3C,mDAAmD;AACnD,oBAAY,cAAc,GAAG,qBAAqB,CAAC,MAAM,CAAC,GAAG;IACzD,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,CAAC;AAEF,wCAAwC;AACxC,QAAA,MAAM,SAAS,UAAW,cAAc,KAAG,WAQ1C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -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,OAAO,CAAC;AAEpC,kCAAkC;AAClC,QAAA,MAAM,eAAe,4JAOlB,WAAW,KAAG,WA2GhB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { generateGuid, getClassName, getValueOrDefault, isStringEmpty } from "@bodynarf/utils";
|
|
4
|
-
import {
|
|
4
|
+
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Number component with label */
|
|
7
7
|
const NumberWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, step, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(isStringEmpty(event.target.value) ? undefined : +event.target.value), [onValueChange]);
|
|
9
9
|
const id = name || generateGuid();
|
|
10
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size,
|
|
10
|
+
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
11
11
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
12
|
const elClassName = getClassName([
|
|
13
13
|
className,
|
|
@@ -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,OAAO,CAAC;AAEpC,qCAAqC;AACrC,QAAA,MAAM,kBAAkB,qJAOrB,WAAW,KAAG,WA6ChB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import {
|
|
4
|
+
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Number component without label */
|
|
7
7
|
const NumberWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, step, }) => {
|
|
@@ -9,7 +9,7 @@ const NumberWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, v
|
|
|
9
9
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
10
10
|
const elClassName = getClassName([
|
|
11
11
|
className,
|
|
12
|
-
"is-{0}".format(getValueOrDefault(size,
|
|
12
|
+
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
13
13
|
rounded === true ? "is-rounded" : "",
|
|
14
14
|
styleClassName,
|
|
15
15
|
"input",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/number/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAK3C,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;AAED,6BAA6B;AAC7B,QAAA,MAAM,MAAM,UAAW,WAAW,KAAG,WAOpC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/number/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAK3C,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;AAED,6BAA6B;AAC7B,QAAA,MAAM,MAAM,UAAW,WAAW,KAAG,WAOpC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -3,13 +3,13 @@ import { useCallback, useState } from "react";
|
|
|
3
3
|
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
4
|
import Icon from "../../../../icon";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
|
-
import {
|
|
6
|
+
import { ElementSize } from "../../../..";
|
|
7
7
|
const PasswordWithLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, label, placeholder, canShowPassword, }) => {
|
|
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]);
|
|
11
11
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size,
|
|
12
|
+
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
13
13
|
const id = name || generateGuid();
|
|
14
14
|
const elClassName = getClassName([
|
|
15
15
|
className,
|
|
@@ -2,14 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useCallback, useState } from "react";
|
|
3
3
|
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
4
|
import Icon from "../../../../icon";
|
|
5
|
-
import {
|
|
5
|
+
import { ElementSize } from "../../../..";
|
|
6
6
|
import { getValidationValues } from "../../../../../utils";
|
|
7
7
|
const PasswordWithoutLabel = ({ onValueChange, disabled, validationState, name, className, size, style, rounded, loading, placeholder, canShowPassword, }) => {
|
|
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]);
|
|
11
11
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size,
|
|
12
|
+
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
13
13
|
const id = name || generateGuid();
|
|
14
14
|
const elClassName = getClassName([
|
|
15
15
|
className,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./style.scss";
|
|
2
|
-
import { BaseInputElementProps } from "
|
|
2
|
+
import { BaseInputElementProps } from "..";
|
|
3
3
|
/** Password component props type */
|
|
4
|
-
export interface PasswordProps extends Omit<BaseInputElementProps<string>,
|
|
4
|
+
export interface PasswordProps extends Omit<BaseInputElementProps<string>, "defaultValue" | "readonly"> {
|
|
5
5
|
/**
|
|
6
6
|
* Is icon "Show password" visible.
|
|
7
7
|
* Will show password on click
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/password/index.tsx"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAK3C,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;AAED,+BAA+B;AAC/B,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -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,OAAO,CAAC;AAElC,0CAA0C;AAC1C,QAAA,MAAM,aAAa,sJAMhB,SAAS,KAAG,WAwGd,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { generateGuid, getClassName, getValueOrDefault, } from "@bodynarf/utils";
|
|
4
|
-
import {
|
|
4
|
+
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Textual input with describing label */
|
|
7
7
|
const TextWithLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, label, placeholder, onBlur, }) => {
|
|
8
8
|
const onChange = useCallback((event) => onValueChange(event.target.value), [onValueChange]);
|
|
9
9
|
const id = name || generateGuid();
|
|
10
|
-
const elSizeClassName = "is-{0}".format(getValueOrDefault(size,
|
|
10
|
+
const elSizeClassName = "is-{0}".format(getValueOrDefault(size, ElementSize.Normal));
|
|
11
11
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
12
12
|
const elClassName = getClassName([
|
|
13
13
|
className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/primitives/text/components/textWithoutLabel/index.tsx"],"names":[],"mappings":"
|
|
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,WA4Cd,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { generateGuid, getClassName, getValueOrDefault } from "@bodynarf/utils";
|
|
4
|
-
import {
|
|
4
|
+
import { ElementSize } from "../../../..";
|
|
5
5
|
import { getValidationValues } from "../../../../../utils";
|
|
6
6
|
/** Textual input without describing label */
|
|
7
7
|
const TextWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, validationState, name, className, size, style, rounded, loading, placeholder, onBlur, }) => {
|
|
@@ -9,7 +9,7 @@ const TextWithoutLabel = ({ onValueChange, readonly, disabled, defaultValue, val
|
|
|
9
9
|
const [isValidationDefined, styleClassName, validationMessages] = getValidationValues(style, validationState);
|
|
10
10
|
const elClassName = getClassName([
|
|
11
11
|
className,
|
|
12
|
-
"is-{0}".format(getValueOrDefault(size,
|
|
12
|
+
"is-{0}".format(getValueOrDefault(size, ElementSize.Normal)),
|
|
13
13
|
rounded === true ? "is-rounded" : "",
|
|
14
14
|
styleClassName,
|
|
15
15
|
"input",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../common.scss";
|
|
2
|
-
import { BaseInputElementProps } from "
|
|
2
|
+
import { BaseInputElementProps } from "..";
|
|
3
3
|
/** Text input conponent props type */
|
|
4
4
|
export declare type TextProps = BaseInputElementProps<string> & {
|
|
5
5
|
/** Focus out event handler */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/text/index.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/text/index.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAK3C,sCAAsC;AACtC,oBAAY,SAAS,GAAG,qBAAqB,CAAC,MAAM,CAAC,GAAG;IACpD,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,8BAA8B;AAC9B,QAAA,MAAM,IAAI,UAAW,SAAS,KAAG,WAOhC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseElementProps } from "../../types";
|
|
1
|
+
import { InputLabel, ValidationState } from ".";
|
|
2
|
+
import { BaseElementProps, ElementColor, ElementSize } from "../../types";
|
|
3
3
|
/** Base properties for input components */
|
|
4
4
|
export declare type BaseInputElementProps<TValue> = BaseElementProps & {
|
|
5
5
|
/** Value change handler. Changed value must be stored outside of component */
|
|
@@ -15,13 +15,13 @@ export declare type BaseInputElementProps<TValue> = BaseElementProps & {
|
|
|
15
15
|
/** Should be component int read only mode. Selecting is allowed */
|
|
16
16
|
readonly?: boolean;
|
|
17
17
|
/** Component size */
|
|
18
|
-
size?:
|
|
18
|
+
size?: ElementSize;
|
|
19
19
|
/** Label configuration */
|
|
20
20
|
label?: InputLabel;
|
|
21
21
|
/** Displaying loading state of component as spinner in right end of component */
|
|
22
22
|
loading?: boolean;
|
|
23
23
|
/** Style. Colors the border */
|
|
24
|
-
style?:
|
|
24
|
+
style?: ElementColor;
|
|
25
25
|
/** Name of element. Required for form elements */
|
|
26
26
|
name?: string;
|
|
27
27
|
/** Current validation state */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseProps.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/types/baseProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
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,oBAAY,qBAAqB,CAAC,MAAM,IAAI,gBAAgB,GAAG;IAC3D,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,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,4 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from './validation';
|
|
1
|
+
export * from "./baseProps";
|
|
2
|
+
export * from "./label";
|
|
3
|
+
export * from "./validation";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import { ElementSize } from
|
|
2
|
+
import "./search.scss";
|
|
3
|
+
import { ElementSize } from "../types";
|
|
4
4
|
export declare type SearchProps = {
|
|
5
5
|
/**
|
|
6
6
|
* Search type: by typing, starts from minimum characters to search
|
|
7
7
|
* or by clicking on button next to search bar.
|
|
8
8
|
* Default `is byTyping`
|
|
9
9
|
*/
|
|
10
|
-
searchType:
|
|
10
|
+
searchType: "byTyping" | "byButton";
|
|
11
11
|
/** Search caption */
|
|
12
12
|
caption: string;
|
|
13
13
|
/** Search handler */
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState } from
|
|
3
|
-
import { generateGuid, getClassName } from
|
|
4
|
-
import
|
|
5
|
-
import Button from
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { generateGuid, getClassName } from "@bodynarf/utils";
|
|
4
|
+
import "./search.scss";
|
|
5
|
+
import Button from "../button";
|
|
6
6
|
/** Search component */
|
|
7
7
|
export default function Search({ searchType, onSearch, caption, name, defaultValue, size, isLoading, rounded, disabled, }) {
|
|
8
8
|
const [elementName] = useState(name || generateGuid());
|
|
9
|
-
const [searchValue, setSearchValue] = useState(defaultValue ||
|
|
9
|
+
const [searchValue, setSearchValue] = useState(defaultValue || "");
|
|
10
10
|
const onChange = useCallback((event) => {
|
|
11
11
|
const elementValue = event.target.value;
|
|
12
|
-
if (searchType ===
|
|
12
|
+
if (searchType === "byTyping") {
|
|
13
13
|
onSearch(elementValue);
|
|
14
14
|
}
|
|
15
15
|
setSearchValue(elementValue);
|
|
@@ -18,20 +18,20 @@ export default function Search({ searchType, onSearch, caption, name, defaultVal
|
|
|
18
18
|
const className = getClassName([
|
|
19
19
|
"bbr-search",
|
|
20
20
|
"control",
|
|
21
|
-
`is-${(size ||
|
|
22
|
-
isLoading === true ?
|
|
23
|
-
searchType ===
|
|
21
|
+
`is-${(size || "normal")}`,
|
|
22
|
+
isLoading === true ? "is-loading" : "",
|
|
23
|
+
searchType === "byButton" ? "is-expanded" : "",
|
|
24
24
|
]);
|
|
25
25
|
const inputClassName = getClassName([
|
|
26
26
|
"input",
|
|
27
27
|
"is-unselectable",
|
|
28
|
-
`is-${(size ||
|
|
29
|
-
rounded === true ?
|
|
28
|
+
`is-${(size || "normal")}`,
|
|
29
|
+
rounded === true ? "is-rounded" : "",
|
|
30
30
|
]);
|
|
31
|
-
if (searchType ===
|
|
32
|
-
return (_jsxs("div", { className: "field has-addons", children: [_jsx("div", { className: className, children: _jsx("input", { type:
|
|
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
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
return (_jsx("div", { className: className, children: _jsx("input", { type:
|
|
35
|
+
return (_jsx("div", { className: className, children: _jsx("input", { type: "search", name: elementName, defaultValue: searchValue, className: inputClassName, disabled: disabled, onChange: onChange, placeholder: caption }) }));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BaseElementProps } from "../types";
|
|
1
|
+
import { ElementColor, ElementSize, BaseElementProps } from "..";
|
|
3
2
|
import "./style.scss";
|
|
4
3
|
/** Tag item prop types */
|
|
5
4
|
interface TagProps extends BaseElementProps {
|
|
@@ -7,11 +6,11 @@ interface TagProps extends BaseElementProps {
|
|
|
7
6
|
content: string;
|
|
8
7
|
/**
|
|
9
8
|
* Element size.
|
|
10
|
-
* `Small` isn
|
|
9
|
+
* `Small` isn"t allowed
|
|
11
10
|
*/
|
|
12
|
-
size?:
|
|
11
|
+
size?: ElementSize;
|
|
13
12
|
/** Element color */
|
|
14
|
-
style?:
|
|
13
|
+
style?: ElementColor;
|
|
15
14
|
/** Is element with rounded border */
|
|
16
15
|
rounded?: boolean;
|
|
17
16
|
/** Is element has light color */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tag/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tag/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAEjE,OAAO,cAAc,CAAC;AAEtB,0BAA0B;AAC1B,UAAU,QAAS,SAAQ,gBAAgB;IACvC,iBAAiB;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB;;;MAGE;IACF,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,0BAA0B;IAC1B,WAAW,CAAC,EAAE;QACV,iBAAiB;QACjB,KAAK,EAAE,MAAM,CAAC;QAEd,uBAAuB;QACvB,eAAe,EAAE,MAAM,CAAC;KAC3B,CAAC;CACL;AAED,sBAAsB;AACtB,QAAA,MAAM,GAAG,2FAMN,QAAQ,KAAG,WAmCb,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
package/components/tag/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
-
import {
|
|
3
|
+
import { ElementColor, ElementSize } from "..";
|
|
4
4
|
import "./style.scss";
|
|
5
5
|
/** Single tag item */
|
|
6
6
|
const Tag = ({ content, size, style, rounded, lightColor, customColor, onClick, className, title, }) => {
|
|
7
|
-
size ??=
|
|
8
|
-
style ??=
|
|
7
|
+
size ??= ElementSize.Normal;
|
|
8
|
+
style ??= ElementColor.Default;
|
|
9
9
|
if (!isNullOrUndefined(customColor)) {
|
|
10
|
-
style =
|
|
10
|
+
style = ElementColor.Default;
|
|
11
11
|
}
|
|
12
12
|
const elClassName = getClassName([
|
|
13
13
|
"bbr-tag",
|
|
14
14
|
"tag",
|
|
15
|
-
style ===
|
|
15
|
+
style === ElementColor.Default ? "" : `is-${style}`,
|
|
16
16
|
!isNullOrUndefined(customColor) ? "bbr-tag--custom" : "",
|
|
17
17
|
lightColor === true && isNullOrUndefined(customColor) ? "is-light" : "",
|
|
18
18
|
rounded === true ? "is-rounded" : "",
|
|
19
|
-
size ===
|
|
19
|
+
size === ElementSize.Normal || size === ElementSize.Small ? "" : `is-${size}`,
|
|
20
20
|
isNullOrUndefined(onClick) ? "" : "bbr-tag--clickable",
|
|
21
21
|
className,
|
|
22
22
|
]);
|
package/components/types.d.ts
CHANGED
|
@@ -10,10 +10,36 @@ export declare type BaseElementProps = {
|
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
14
|
-
export declare
|
|
13
|
+
/** Input component size variety */
|
|
14
|
+
export declare enum ElementSize {
|
|
15
|
+
/** Font size is 0.75rem */
|
|
16
|
+
Small = "small",
|
|
17
|
+
/** Font size is 1rem. Default */
|
|
18
|
+
Normal = "normal",
|
|
19
|
+
/** Font size is 1.25rem */
|
|
20
|
+
Medium = "medium",
|
|
21
|
+
/** Font size is 1.5rem */
|
|
22
|
+
Large = "large"
|
|
23
|
+
}
|
|
24
|
+
/** Input component border-color type */
|
|
25
|
+
export declare enum ElementColor {
|
|
26
|
+
/** color: transparent */
|
|
27
|
+
Default = "default",
|
|
28
|
+
/** color: seawave green */
|
|
29
|
+
Primary = "primary",
|
|
30
|
+
/** color: blue-violet */
|
|
31
|
+
Link = "link",
|
|
32
|
+
/** color: sky-blue */
|
|
33
|
+
Info = "info",
|
|
34
|
+
/** color: green */
|
|
35
|
+
Success = "success",
|
|
36
|
+
/** color: yellow */
|
|
37
|
+
Warning = "warning",
|
|
38
|
+
/** color: red */
|
|
39
|
+
Danger = "danger"
|
|
40
|
+
}
|
|
15
41
|
/** Allowed icon position */
|
|
16
|
-
export declare type IconPosition =
|
|
42
|
+
export declare type IconPosition = "left" | "right";
|
|
17
43
|
/** Icon for component */
|
|
18
44
|
export declare type ElementIcon = {
|
|
19
45
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oBAAY,gBAAgB,GAAG;IAC3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8BAA8B;IAC9B,IAAI,CAAC,EAAE;QACH,8CAA8C;QAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;CACL,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oBAAY,gBAAgB,GAAG;IAC3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8BAA8B;IAC9B,IAAI,CAAC,EAAE;QACH,8CAA8C;QAC9C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;CACL,CAAC;AAEF,mCAAmC;AACnC,oBAAY,WAAW;IACnB,2BAA2B;IAC3B,KAAK,UAAU;IAEf,iCAAiC;IACjC,MAAM,WAAW;IAEjB,2BAA2B;IAC3B,MAAM,WAAW;IAEjB,0BAA0B;IAC1B,KAAK,UAAU;CAClB;AAED,wCAAwC;AACxC,oBAAY,YAAY;IACpB,yBAAyB;IACzB,OAAO,YAAY;IAEnB,2BAA2B;IAC3B,OAAO,YAAY;IAEnB,yBAAyB;IACzB,IAAI,SAAS;IAEb,sBAAsB;IACtB,IAAI,SAAS;IAEb,mBAAmB;IACnB,OAAO,YAAY;IAEnB,oBAAoB;IACpB,OAAO,YAAY;IAEnB,iBAAiB;IACjB,MAAM,WAAW;CACpB;AAED,4BAA4B;AAC5B,oBAAY,YAAY,GAClB,MAAM,GACN,OAAO,CAAC;AAEd,0BAA0B;AAC1B,oBAAY,WAAW,GAAG;IACtB;;;;;MAKE;IACF,IAAI,EAAE,MAAM,CAAC;IAEb,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gBAAgB;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;MAGE;IACF,QAAQ,CAAC,EAAE,YAAY,CAAC;CAC3B,CAAC"}
|
package/components/types.js
CHANGED
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
/** Input component size variety */
|
|
2
|
+
export var ElementSize;
|
|
3
|
+
(function (ElementSize) {
|
|
4
|
+
/** Font size is 0.75rem */
|
|
5
|
+
ElementSize["Small"] = "small";
|
|
6
|
+
/** Font size is 1rem. Default */
|
|
7
|
+
ElementSize["Normal"] = "normal";
|
|
8
|
+
/** Font size is 1.25rem */
|
|
9
|
+
ElementSize["Medium"] = "medium";
|
|
10
|
+
/** Font size is 1.5rem */
|
|
11
|
+
ElementSize["Large"] = "large";
|
|
12
|
+
})(ElementSize || (ElementSize = {}));
|
|
13
|
+
/** Input component border-color type */
|
|
14
|
+
export var ElementColor;
|
|
15
|
+
(function (ElementColor) {
|
|
16
|
+
/** color: transparent */
|
|
17
|
+
ElementColor["Default"] = "default";
|
|
18
|
+
/** color: seawave green */
|
|
19
|
+
ElementColor["Primary"] = "primary";
|
|
20
|
+
/** color: blue-violet */
|
|
21
|
+
ElementColor["Link"] = "link";
|
|
22
|
+
/** color: sky-blue */
|
|
23
|
+
ElementColor["Info"] = "info";
|
|
24
|
+
/** color: green */
|
|
25
|
+
ElementColor["Success"] = "success";
|
|
26
|
+
/** color: yellow */
|
|
27
|
+
ElementColor["Warning"] = "warning";
|
|
28
|
+
/** color: red */
|
|
29
|
+
ElementColor["Danger"] = "danger";
|
|
30
|
+
})(ElementColor || (ElementColor = {}));
|
|
31
|
+
;
|
package/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./useComponentOutsideClick";
|
|
2
|
+
export * from "./usePagination";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/hooks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./useComponentOutsideClick";
|
|
2
|
+
export * from "./usePagination";
|
|
@@ -24,8 +24,8 @@ export const useComponentOutsideClick = (selector, clickHandleCondition, clickHa
|
|
|
24
24
|
}, [clickHandleCondition, selector, clickHandleChange, dependencies]);
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
if (isNullOrUndefined(clickListenCondition) || clickListenCondition === true) {
|
|
27
|
-
document.addEventListener(
|
|
28
|
-
return () => document.removeEventListener(
|
|
27
|
+
document.addEventListener("click", onDocumentClick);
|
|
28
|
+
return () => document.removeEventListener("click", onDocumentClick);
|
|
29
29
|
}
|
|
30
30
|
return () => { };
|
|
31
31
|
}, [clickListenCondition, onDocumentClick]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bodynarf/react.components",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Artem",
|
|
6
6
|
"email": "bodynar@gmail.com"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"typescript": "^4.7.3"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@bodynarf/utils": "^1.
|
|
33
|
+
"@bodynarf/utils": "^1.1.1",
|
|
34
34
|
"bulma": "^0.9.4",
|
|
35
35
|
"react": "^18.1.0",
|
|
36
36
|
"react-dom": "^18.1.0"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementColor, ValidationState } from "../components";
|
|
2
2
|
/**
|
|
3
3
|
* Get current validation state values
|
|
4
4
|
* @param style Component style color
|
|
5
5
|
* @param validationState Current form item validation state
|
|
6
6
|
* @returns [Is validation applicable; classname attribute value; validation messages]
|
|
7
7
|
*/
|
|
8
|
-
export declare const getValidationValues: (style?:
|
|
8
|
+
export declare const getValidationValues: (style?: ElementColor, validationState?: ValidationState) => [boolean, string, Array<string>];
|
|
9
9
|
/**
|
|
10
10
|
* Get classname attribute value based on current validation state and form item component style prop
|
|
11
11
|
* @param style Component style color
|
|
12
12
|
* @param validationState Current form item validation state
|
|
13
13
|
* @returns Classname attribute value
|
|
14
14
|
*/
|
|
15
|
-
export declare const getStyleClassName: (style?:
|
|
15
|
+
export declare const getStyleClassName: (style?: ElementColor, validationState?: ValidationState) => string;
|
|
16
16
|
//# sourceMappingURL=formValidation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formValidation.d.ts","sourceRoot":"","sources":["../../src/utils/formValidation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"formValidation.d.ts","sourceRoot":"","sources":["../../src/utils/formValidation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAoB,MAAM,eAAe,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,WAAY,YAAY,oBAAoB,eAAe,KAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC,CAO5H,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,WAAY,YAAY,oBAAoB,eAAe,KAAG,MAgB3F,CAAC"}
|
package/utils/formValidation.js
CHANGED
package/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./formValidation";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./formValidation";
|