@sima-land/ui-nucleons 45.0.0-alpha.71 → 45.0.0-alpha.72
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/field-block/field-block.d.ts +1 -1
- package/dist/field-block/field-block.js +2 -2
- package/dist/field-block/field-block.js.map +1 -1
- package/dist/field-block/types.d.ts +2 -0
- package/dist/textarea/textarea.d.ts +1 -1
- package/dist/textarea/textarea.js +5 -2
- package/dist/textarea/textarea.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,4 +12,4 @@ export declare const FIELD_BLOCK_DEFAULTS: {
|
|
|
12
12
|
* @param props Свойства.
|
|
13
13
|
* @return Элемент.
|
|
14
14
|
*/
|
|
15
|
-
export declare function FieldBlock({ size, main, mainProps, disabled, failed, focused, label, labelProps, labelAsPlaceholder, fixedHeight, caption, rootRef, rootProps, blockRef, blockProps, adornmentStart, adornmentEnd, 'data-testid': testId, }: FieldBlockProps): import("react").JSX.Element;
|
|
15
|
+
export declare function FieldBlock({ size, main, mainProps, mainColProps, disabled, failed, focused, label, labelProps, labelAsPlaceholder, fixedHeight, caption, rootRef, rootProps, blockRef, blockProps, adornmentStart, adornmentEnd, 'data-testid': testId, }: FieldBlockProps): import("react").JSX.Element;
|
|
@@ -54,10 +54,10 @@ exports.FIELD_BLOCK_DEFAULTS = {
|
|
|
54
54
|
* @param props Свойства.
|
|
55
55
|
* @return Элемент.
|
|
56
56
|
*/
|
|
57
|
-
function FieldBlock({ size = exports.FIELD_BLOCK_DEFAULTS.size, main, mainProps, disabled, failed, focused, label, labelProps, labelAsPlaceholder, fixedHeight = true, caption, rootRef, rootProps, blockRef, blockProps, adornmentStart, adornmentEnd, 'data-testid': testId = 'field-block', }) {
|
|
57
|
+
function FieldBlock({ size = exports.FIELD_BLOCK_DEFAULTS.size, main, mainProps, mainColProps, disabled, failed, focused, label, labelProps, labelAsPlaceholder, fixedHeight = true, caption, rootRef, rootProps, blockRef, blockProps, adornmentStart, adornmentEnd, 'data-testid': testId = 'field-block', }) {
|
|
58
58
|
const needLabel = Boolean(label) && (size === 'l' || labelAsPlaceholder);
|
|
59
59
|
const rootClassName = (0, classnames_1.default)(styles.root, styles[`size-${size}`], disabled && styles.disabled, focused && styles.focused, failed && styles.failed, needLabel && labelAsPlaceholder && styles['label-as-placeholder'], !needLabel && styles['no-label'], rootProps?.className);
|
|
60
60
|
const blockClassName = (0, classnames_1.default)(styles.block, fixedHeight && styles['fixed-height'], blockProps?.className);
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...rootProps, ref: rootRef, className: rootClassName, "data-testid": testId, children: [(0, jsx_runtime_1.jsxs)("div", { ...blockProps, ref: blockRef, className: blockClassName, "data-testid": 'field-block:block', children: [adornmentStart && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles.col, styles['adornment-col'], styles.start), "data-testid": 'field-block:adornment-start', children: adornmentStart })), (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles.col, styles['main-col']), children: [needLabel && ((0, jsx_runtime_1.jsx)("label", { ...labelProps, className: (0, classnames_1.default)(styles.label, labelProps?.className), "data-testid": 'field-block:label', children: label })), (0, jsx_runtime_1.jsx)("div", { ...mainProps, className: (0, classnames_1.default)(styles.main, mainProps?.className), "data-testid": 'field-block:main', children: main })] }), adornmentEnd && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles.col, styles['adornment-col'], styles.end), "data-testid": 'field-block:adornment-end', children: adornmentEnd }))] }), caption && ((0, jsx_runtime_1.jsx)("div", { className: styles.caption, "data-testid": 'field-block:caption', children: caption }))] }));
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...rootProps, ref: rootRef, className: rootClassName, "data-testid": testId, children: [(0, jsx_runtime_1.jsxs)("div", { ...blockProps, ref: blockRef, className: blockClassName, "data-testid": 'field-block:block', children: [adornmentStart && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles.col, styles['adornment-col'], styles.start), "data-testid": 'field-block:adornment-start', children: adornmentStart })), (0, jsx_runtime_1.jsxs)("div", { ...mainColProps, className: (0, classnames_1.default)(styles.col, styles['main-col'], mainColProps?.className), children: [needLabel && ((0, jsx_runtime_1.jsx)("label", { ...labelProps, className: (0, classnames_1.default)(styles.label, labelProps?.className), "data-testid": 'field-block:label', children: label })), (0, jsx_runtime_1.jsx)("div", { ...mainProps, className: (0, classnames_1.default)(styles.main, mainProps?.className), "data-testid": 'field-block:main', children: main })] }), adornmentEnd && ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles.col, styles['adornment-col'], styles.end), "data-testid": 'field-block:adornment-end', children: adornmentEnd }))] }), caption && ((0, jsx_runtime_1.jsx)("div", { className: styles.caption, "data-testid": 'field-block:caption', children: caption }))] }));
|
|
62
62
|
}
|
|
63
63
|
//# sourceMappingURL=field-block.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-block.js","sourceRoot":"","sources":["../../src/field-block/field-block.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,
|
|
1
|
+
{"version":3,"file":"field-block.js","sourceRoot":"","sources":["../../src/field-block/field-block.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,gCAmGC;;AArHD,4DAA4B;AAC5B,kEAAoD;AAEvC,QAAA,kBAAkB,GAAG;IAChC,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;CAC4C,CAAC;AAEvC,QAAA,oBAAoB,GAAG;IAClC,IAAI,EAAE,GAAG;CACD,CAAC;AAEX;;;;GAIG;AACH,SAAgB,UAAU,CAAC,EACzB,IAAI,GAAG,4BAAoB,CAAC,IAAI,EAChC,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,EACL,UAAU,EACV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S,CAAC,aAErE,SAAS,IAAI,CACZ,qCACM,UAAU,EACd,SAAS,EAAE,IAAA,oBAAE,EAAC,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,iBACtC,mBAAmB,YAE9B,KAAK,GACA,CACT,EAGD,mCACM,SAAS,EACb,SAAS,EAAE,IAAA,oBAAE,EAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,iBACpC,kBAAkB,YAE7B,IAAI,GACD,IACF,EAEL,YAAY,IAAI,CACf,gCACE,SAAS,EAAE,IAAA,oBAAE,EAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,iBAClD,2BAA2B,YAEtC,YAAY,GACT,CACP,IACG,EAEL,OAAO,IAAI,CACV,gCAAK,SAAS,EAAE,MAAM,CAAC,OAAO,iBAAc,qBAAqB,YAC9D,OAAO,GACJ,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -44,6 +44,8 @@ export interface FieldBlockProps extends WithTestId {
|
|
|
44
44
|
adornmentStart?: ReactNode;
|
|
45
45
|
/** Украшение после основного содержимого. */
|
|
46
46
|
adornmentEnd?: ReactNode;
|
|
47
|
+
/** Опции колонки с ярлыком и основным содержимым. */
|
|
48
|
+
mainColProps?: NoChildren<WithStyle<HTMLAttributes<HTMLDivElement>>>;
|
|
47
49
|
/** Основное содержимое. */
|
|
48
50
|
main?: ReactNode;
|
|
49
51
|
/** Опции основного содержимого. */
|
|
@@ -4,4 +4,4 @@ import type { TextareaProps } from './types';
|
|
|
4
4
|
* @param props Свойства.
|
|
5
5
|
* @return Элемент.
|
|
6
6
|
*/
|
|
7
|
-
export declare function Textarea({ textareaRef, baseInputProps, style, className, autoComplete, autoFocus, defaultValue, disabled, id, name, onBlur, onChange, onFocus, onInput, placeholder, readOnly, required, rows, value, label, failed, caption, blockProps, 'data-testid': testId, ...restProps }: TextareaProps): import("react").JSX.Element;
|
|
7
|
+
export declare function Textarea({ textareaRef, baseInputProps, style, className, autoComplete, autoFocus, defaultValue, disabled, id, name, onBlur, onChange, onFocus, onInput, placeholder, readOnly, required, rows, value, label, failed, caption, blockProps, mainProps, 'data-testid': testId, ...restProps }: TextareaProps): import("react").JSX.Element;
|
|
@@ -57,7 +57,7 @@ style, className,
|
|
|
57
57
|
// textarea element props (popular)
|
|
58
58
|
autoComplete, autoFocus, defaultValue, disabled, id, name, onBlur, onChange, onFocus, onInput, placeholder, readOnly, required, rows = 2, value,
|
|
59
59
|
// FieldBlock props
|
|
60
|
-
label, failed, caption, blockProps, 'data-testid': testId = 'textarea', ...restProps }) {
|
|
60
|
+
label, failed, caption, blockProps, mainProps, 'data-testid': testId = 'textarea', ...restProps }) {
|
|
61
61
|
const ref = (0, react_1.useRef)(null);
|
|
62
62
|
const [filled, updateFilled] = (0, utils_1.useFilledState)(ref, { value, defaultValue });
|
|
63
63
|
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
@@ -87,6 +87,9 @@ label, failed, caption, blockProps, 'data-testid': testId = 'textarea', ...restP
|
|
|
87
87
|
}, onChange: event => {
|
|
88
88
|
onChange?.(event);
|
|
89
89
|
updateFilled(event);
|
|
90
|
-
} }), mainProps: {
|
|
90
|
+
} }), mainProps: {
|
|
91
|
+
...mainProps,
|
|
92
|
+
className: (0, classnames_1.default)(styles.main, mainProps?.className),
|
|
93
|
+
} }));
|
|
91
94
|
}
|
|
92
95
|
//# sourceMappingURL=textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/textarea/textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/textarea/textarea.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,4BAmHC;;AA/HD,iCA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