@cloud-ru/ds-field-decorator 1.0.3 → 1.0.4-preview-fd6730e3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/FieldDecorator/FieldDecorator.js +1 -2
- package/dist/cjs/components/Label/Label.js +1 -2
- package/dist/esm/components/FieldDecorator/FieldDecorator.js +1 -2
- package/dist/esm/components/Label/Label.js +1 -2
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/components/FieldDecorator/FieldDecorator.tsx +1 -2
- package/src/components/Label/Label.tsx +1 -3
|
@@ -12,8 +12,7 @@ const Hint_1 = require("../Hint");
|
|
|
12
12
|
const Label_1 = require("../Label");
|
|
13
13
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
14
14
|
function FieldDecorator({ className, innerRef, children, label, labelTooltip, caption, required, labelFor, hint, error, validationState: validationStateProp = constants_1.VALIDATION_STATE.Default, showHintIcon = true, length, size = constants_1.SIZE.M, disabled, readonly: readOnly, ...rest }) {
|
|
15
|
-
const
|
|
16
|
-
const showHeader = showLabelContent || caption;
|
|
15
|
+
const showHeader = label || caption;
|
|
17
16
|
const hintText = error || hint;
|
|
18
17
|
const isFieldActive = !disabled && !readOnly;
|
|
19
18
|
const showLength = isFieldActive && Boolean(length);
|
|
@@ -11,7 +11,6 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
11
11
|
const constants_1 = require("../../constants");
|
|
12
12
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
13
13
|
function Label({ className, innerRef, label, labelTooltip, caption, required, labelFor, disabled, size = constants_1.SIZE.M, ...rest }) {
|
|
14
|
-
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...(0, utils_1.extractSupportProps)(rest), ref: innerRef, className: (0, classnames_1.default)(styles_module_scss_1.default.labelWrapper, className), "data-size": size, "data-disabled": disabled || undefined, children: [showLabelContent && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.labelContent, children: [(0, jsx_runtime_1.jsx)("label", { className: styles_module_scss_1.default.label, htmlFor: labelFor, "data-test-id": constants_1.TEST_IDS.label, children: label }), required && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.required, "data-test-id": constants_1.TEST_IDS.required, children: "*" })), labelTooltip && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.labelTooltip, "data-test-id": constants_1.TEST_IDS.labelTooltip, children: (0, jsx_runtime_1.jsx)(tooltip_1.QuestionTooltip, { ...labelTooltip }) }))] })), caption && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.caption, "data-test-id": constants_1.TEST_IDS.caption, children: caption }))] }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...(0, utils_1.extractSupportProps)(rest), ref: innerRef, className: (0, classnames_1.default)(styles_module_scss_1.default.labelWrapper, className), "data-size": size, "data-disabled": disabled || undefined, children: [label && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.labelContent, children: [(0, jsx_runtime_1.jsx)("label", { className: styles_module_scss_1.default.label, htmlFor: labelFor, "data-test-id": constants_1.TEST_IDS.label, children: label }), required && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.required, "data-test-id": constants_1.TEST_IDS.required, children: "*" })), labelTooltip && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.labelTooltip, "data-test-id": constants_1.TEST_IDS.labelTooltip, children: (0, jsx_runtime_1.jsx)(tooltip_1.QuestionTooltip, { ...labelTooltip }) }))] })), caption && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.caption, "data-test-id": constants_1.TEST_IDS.caption, children: caption }))] }));
|
|
16
15
|
}
|
|
17
16
|
(0, utils_1.withInnerRefSupport)(Label);
|
|
@@ -6,8 +6,7 @@ import { Hint } from '../Hint/index.js';
|
|
|
6
6
|
import { Label } from '../Label/index.js';
|
|
7
7
|
import styles from './styles.module.css';
|
|
8
8
|
export function FieldDecorator({ className, innerRef, children, label, labelTooltip, caption, required, labelFor, hint, error, validationState: validationStateProp = VALIDATION_STATE.Default, showHintIcon = true, length, size = SIZE.M, disabled, readonly: readOnly, ...rest }) {
|
|
9
|
-
const
|
|
10
|
-
const showHeader = showLabelContent || caption;
|
|
9
|
+
const showHeader = label || caption;
|
|
11
10
|
const hintText = error || hint;
|
|
12
11
|
const isFieldActive = !disabled && !readOnly;
|
|
13
12
|
const showLength = isFieldActive && Boolean(length);
|
|
@@ -5,7 +5,6 @@ import cn from 'classnames';
|
|
|
5
5
|
import { SIZE, TEST_IDS } from '../../constants.js';
|
|
6
6
|
import styles from './styles.module.css';
|
|
7
7
|
export function Label({ className, innerRef, label, labelTooltip, caption, required, labelFor, disabled, size = SIZE.M, ...rest }) {
|
|
8
|
-
|
|
9
|
-
return (_jsxs("div", { ...extractSupportProps(rest), ref: innerRef, className: cn(styles.labelWrapper, className), "data-size": size, "data-disabled": disabled || undefined, children: [showLabelContent && (_jsxs("div", { className: styles.labelContent, children: [_jsx("label", { className: styles.label, htmlFor: labelFor, "data-test-id": TEST_IDS.label, children: label }), required && (_jsx("div", { className: styles.required, "data-test-id": TEST_IDS.required, children: "*" })), labelTooltip && (_jsx("div", { className: styles.labelTooltip, "data-test-id": TEST_IDS.labelTooltip, children: _jsx(QuestionTooltip, { ...labelTooltip }) }))] })), caption && (_jsx("div", { className: styles.caption, "data-test-id": TEST_IDS.caption, children: caption }))] }));
|
|
8
|
+
return (_jsxs("div", { ...extractSupportProps(rest), ref: innerRef, className: cn(styles.labelWrapper, className), "data-size": size, "data-disabled": disabled || undefined, children: [label && (_jsxs("div", { className: styles.labelContent, children: [_jsx("label", { className: styles.label, htmlFor: labelFor, "data-test-id": TEST_IDS.label, children: label }), required && (_jsx("div", { className: styles.required, "data-test-id": TEST_IDS.required, children: "*" })), labelTooltip && (_jsx("div", { className: styles.labelTooltip, "data-test-id": TEST_IDS.labelTooltip, children: _jsx(QuestionTooltip, { ...labelTooltip }) }))] })), caption && (_jsx("div", { className: styles.caption, "data-test-id": TEST_IDS.caption, children: caption }))] }));
|
|
10
9
|
}
|
|
11
10
|
withInnerRefSupport(Label);
|