@steroidsjs/core 3.0.9 → 3.0.10

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.
@@ -15192,6 +15192,15 @@
15192
15192
  "type": "React.ReactNode | {}",
15193
15193
  "example": "MyCustomView",
15194
15194
  "defaultValue": null
15195
+ },
15196
+ {
15197
+ "name": "viewProps",
15198
+ "decorators": [],
15199
+ "description": "Свойства для компонента отображения",
15200
+ "required": false,
15201
+ "type": "{}",
15202
+ "example": "{\n customHandler: () => {...}\n}",
15203
+ "defaultValue": null
15195
15204
  }
15196
15205
  ],
15197
15206
  "methods": [
@@ -15223,9 +15232,18 @@
15223
15232
  "tags": {},
15224
15233
  "defaultProps": null,
15225
15234
  "extends": [
15226
- "IFieldWrapperOutputProps"
15235
+ "IFieldWrapperOutputProps",
15236
+ "IUiComponent"
15227
15237
  ],
15228
15238
  "properties": [
15239
+ {
15240
+ "name": "className",
15241
+ "decorators": [],
15242
+ "description": "Дополнительный CSS-класс для элемента отображения",
15243
+ "required": false,
15244
+ "type": "string",
15245
+ "example": null
15246
+ },
15229
15247
  {
15230
15248
  "name": "componentId",
15231
15249
  "decorators": [],
@@ -15279,7 +15297,7 @@
15279
15297
  "decorators": [],
15280
15298
  "description": "",
15281
15299
  "required": true,
15282
- "type": "{color: string, id: string | number | boolean, isHovered: boolean, isSelected: boolean, label: string, required: boolean, size: string}[]",
15300
+ "type": "{color: string, disabled: boolean, id: string | number | boolean, isHovered: boolean, isSelected: boolean, label: string, required: boolean, size: string}[]",
15283
15301
  "example": null
15284
15302
  },
15285
15303
  {
@@ -15305,6 +15323,22 @@
15305
15323
  "required": false,
15306
15324
  "type": "string",
15307
15325
  "example": null
15326
+ },
15327
+ {
15328
+ "name": "style",
15329
+ "decorators": [],
15330
+ "description": "Объект CSS стилей",
15331
+ "required": false,
15332
+ "type": "CSSProperties",
15333
+ "example": "{width: '45%'}"
15334
+ },
15335
+ {
15336
+ "name": "view",
15337
+ "decorators": [],
15338
+ "description": "Переопределение view React компонента для кастомизации отображения",
15339
+ "required": false,
15340
+ "type": "React.ReactNode | {}",
15341
+ "example": "MyCustomView"
15308
15342
  }
15309
15343
  ],
15310
15344
  "methods": [
@@ -37386,6 +37420,15 @@
37386
37420
  "type": "React.ReactNode | {}",
37387
37421
  "example": "MyCustomView",
37388
37422
  "defaultValue": null
37423
+ },
37424
+ {
37425
+ "name": "viewProps",
37426
+ "decorators": [],
37427
+ "description": "Свойства для компонента отображения",
37428
+ "required": false,
37429
+ "type": "{}",
37430
+ "example": "{\n customHandler: () => {...}\n}",
37431
+ "defaultValue": null
37389
37432
  }
37390
37433
  ],
37391
37434
  "methods": []
@@ -37473,6 +37516,14 @@
37473
37516
  "required": false,
37474
37517
  "type": "React.ReactNode | {}",
37475
37518
  "example": "MyCustomView"
37519
+ },
37520
+ {
37521
+ "name": "viewProps",
37522
+ "decorators": [],
37523
+ "description": "Свойства для компонента отображения",
37524
+ "required": false,
37525
+ "type": "{}",
37526
+ "example": "{\n customHandler: () => {...}\n}"
37476
37527
  }
37477
37528
  ],
37478
37529
  "methods": []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -48,9 +48,19 @@ export interface ICheckboxListFieldProps extends IFieldWrapperInputProps, Omit<I
48
48
  * Кастомная вьюшка для элемента
49
49
  */
50
50
  itemView?: CustomView;
51
+ /**
52
+ * Свойства для компонента отображения
53
+ * @example
54
+ * {
55
+ * customHandler: () => {...}
56
+ * }
57
+ */
58
+ viewProps?: {
59
+ [key: string]: any;
60
+ };
51
61
  [key: string]: any;
52
62
  }
53
- export interface ICheckboxListFieldViewProps extends IFieldWrapperOutputProps {
63
+ export interface ICheckboxListFieldViewProps extends IFieldWrapperOutputProps, IUiComponent {
54
64
  inputProps: {
55
65
  name: string;
56
66
  type: string;
@@ -65,6 +75,7 @@ export interface ICheckboxListFieldViewProps extends IFieldWrapperOutputProps {
65
75
  color?: string;
66
76
  required?: boolean;
67
77
  size?: Size;
78
+ disabled?: boolean;
68
79
  }[];
69
80
  selectedIds: (PrimaryKey | any)[];
70
81
  onItemSelect: (id: PrimaryKey | any) => void;
@@ -79,7 +79,7 @@ function CheckboxListField(props) {
79
79
  }
80
80
  }, [onReset, prevInputValue, props.input.value, selectedIds.length]);
81
81
  var CheckboxFieldView = props.itemView || components.ui.getView('form.CheckboxFieldView');
82
- var renderCheckbox = function (checkboxProps) { return (react_1["default"].createElement(CheckboxFieldView, __assign({}, checkboxProps))); };
82
+ var renderCheckbox = (0, react_1.useCallback)(function (checkboxProps) { return (react_1["default"].createElement(CheckboxFieldView, __assign({}, checkboxProps))); }, [CheckboxFieldView]);
83
83
  var viewProps = (0, react_1.useMemo)(function () { return ({
84
84
  items: items,
85
85
  inputProps: inputProps,
@@ -88,8 +88,23 @@ function CheckboxListField(props) {
88
88
  renderCheckbox: renderCheckbox,
89
89
  orientation: props.orientation,
90
90
  size: props.size,
91
- disabled: props.disabled
92
- }); }, [inputProps, items, onItemSelect, props.disabled, props.orientation, props.size, renderCheckbox, selectedIds]);
91
+ disabled: props.disabled,
92
+ className: props.className,
93
+ style: props.style,
94
+ viewProps: props.viewProps
95
+ }); }, [
96
+ inputProps,
97
+ items,
98
+ onItemSelect,
99
+ props.className,
100
+ props.disabled,
101
+ props.orientation,
102
+ props.size,
103
+ props.style,
104
+ props.viewProps,
105
+ renderCheckbox,
106
+ selectedIds,
107
+ ]);
93
108
  return components.ui.renderView(props.view || 'form.CheckboxListFieldView', viewProps);
94
109
  }
95
110
  CheckboxListField.defaultProps = {
@@ -74,7 +74,7 @@ function RadioListField(props) {
74
74
  // eslint-disable-next-line react-hooks/exhaustive-deps
75
75
  }, [props.input.onChange, selectedIds]);
76
76
  var RadioFieldView = components.ui.getView('form.RadioFieldView');
77
- var renderRadio = function (radioProps) { return react_1["default"].createElement(RadioFieldView, __assign({}, radioProps)); };
77
+ var renderRadio = (0, react_1.useCallback)(function (radioProps) { return react_1["default"].createElement(RadioFieldView, __assign({}, radioProps)); }, [RadioFieldView]);
78
78
  var viewProps = (0, react_1.useMemo)(function () { return ({
79
79
  items: items,
80
80
  inputProps: inputProps,
@@ -40,6 +40,16 @@ export interface IButtonGroupProps extends IUiComponent {
40
40
  * }
41
41
  */
42
42
  buttonProps?: IButtonProps;
43
+ /**
44
+ * Свойства для компонента отображения
45
+ * @example
46
+ * {
47
+ * customHandler: () => {...}
48
+ * }
49
+ */
50
+ viewProps?: {
51
+ [key: string]: any;
52
+ };
43
53
  }
44
54
  export interface IButtonGroupViewProps extends Omit<IButtonGroupProps, 'items'> {
45
55
  items: {
@@ -32,9 +32,10 @@ function ButtonGroup(props) {
32
32
  size: ((_a = props.buttonProps) === null || _a === void 0 ? void 0 : _a.size) || DEFAULT_BUTTON_GROUP_SIZE,
33
33
  activeButton: activeButton,
34
34
  items: items,
35
- onClick: onClick
35
+ onClick: onClick,
36
+ viewProps: props.viewProps
36
37
  });
37
- }, [activeButton, items, onClick, props.buttonProps, props.className, props.style]);
38
+ }, [activeButton, items, onClick, props.buttonProps, props.className, props.style, props.viewProps]);
38
39
  return components.ui.renderView(props.view || 'nav.ButtonGroupView', viewProps);
39
40
  }
40
41
  exports["default"] = ButtonGroup;