@steroidsjs/core 3.0.0-beta.13 → 3.0.0-beta.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "3.0.0-beta.13",
3
+ "version": "3.0.0-beta.14",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -46,6 +46,10 @@ export interface IFieldWrapperInputProps {
46
46
  * @example 'horizontal'
47
47
  */
48
48
  layout?: FormLayout;
49
+ /**
50
+ * Input ID для связи поля с label
51
+ */
52
+ id?: string;
49
53
  value?: any;
50
54
  onChange?: (...args: any[]) => any;
51
55
  /**
@@ -131,8 +131,10 @@ function fieldWrapper(componentId, Component, optionsConfig) {
131
131
  }
132
132
  // Resolve layout
133
133
  var layout = (0, react_1.useMemo)(function () { return (0, form_1.mergeLayoutProp)(context.layout, props.layout); }, [context.layout, props.layout]);
134
+ var uniqueId = (0, hooks_1.useUniqueId)('input');
135
+ var inputId = props.id || uniqueId;
134
136
  if (layout !== null) {
135
- return components.ui.renderView(FieldLayout_1["default"], __assign(__assign({}, attributesProps), { layout: layout, size: props.size || context.size || null, required: (0, has_1["default"])(props, 'required') ? props.required : metaProps.required, label: options.label === false ? null : ((0, has_1["default"])(props, 'label') ? props.label : metaProps.label), hint: (0, has_1["default"])(props, 'hint') ? props.hint : metaProps.hint, errors: props.errors, children: (React.createElement(Component.DynamicField, __assign({}, props))) }));
137
+ return components.ui.renderView(FieldLayout_1["default"], __assign(__assign({}, attributesProps), { layout: layout, size: props.size || context.size || null, required: (0, has_1["default"])(props, 'required') ? props.required : metaProps.required, label: options.label === false ? null : ((0, has_1["default"])(props, 'label') ? props.label : metaProps.label), hint: (0, has_1["default"])(props, 'hint') ? props.hint : metaProps.hint, errors: props.errors, id: inputId, children: (React.createElement(Component.DynamicField, __assign({}, props, { id: inputId }))) }));
136
138
  }
137
139
  return components.ui.renderView(Component.DynamicField, props);
138
140
  };
@@ -48,6 +48,7 @@ export interface IFieldLayoutViewProps {
48
48
  hint: string | boolean;
49
49
  errors: string[];
50
50
  successful: boolean;
51
+ id: string;
51
52
  size: Size;
52
53
  layout?: {
53
54
  layout: FormLayoutName | boolean;