@steroidsjs/core 3.0.9 → 3.0.11
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/docs-autogen-result.json +61 -10
- package/hooks/useDataProvider.d.ts +1 -1
- package/package.json +1 -1
- package/ui/form/CheckboxListField/CheckboxListField.d.ts +12 -1
- package/ui/form/CheckboxListField/CheckboxListField.js +18 -3
- package/ui/form/RadioListField/RadioListField.js +1 -1
- package/ui/nav/ButtonGroup/ButtonGroup.d.ts +10 -0
- package/ui/nav/ButtonGroup/ButtonGroup.js +3 -2
package/docs-autogen-result.json
CHANGED
|
@@ -3163,7 +3163,7 @@
|
|
|
3163
3163
|
"decorators": [],
|
|
3164
3164
|
"description": "Коллекция элементов",
|
|
3165
3165
|
"required": false,
|
|
3166
|
-
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record}[]",
|
|
3166
|
+
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
3167
3167
|
"example": "[\n {\n id: 1,\n label: 'Krasnoyarsk'\n },\n {\n id: 2,\n label: 'Moscow'\n }\n]"
|
|
3168
3168
|
},
|
|
3169
3169
|
{
|
|
@@ -13258,7 +13258,7 @@
|
|
|
13258
13258
|
"decorators": [],
|
|
13259
13259
|
"description": "Коллекция элементов",
|
|
13260
13260
|
"required": false,
|
|
13261
|
-
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record}[]",
|
|
13261
|
+
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
13262
13262
|
"example": "[\n {\n id: 1,\n label: 'Krasnoyarsk'\n },\n {\n id: 2,\n label: 'Moscow'\n }\n]",
|
|
13263
13263
|
"defaultValue": null
|
|
13264
13264
|
},
|
|
@@ -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": [
|
|
@@ -24708,7 +24742,7 @@
|
|
|
24708
24742
|
"decorators": [],
|
|
24709
24743
|
"description": "Коллекция элементов",
|
|
24710
24744
|
"required": false,
|
|
24711
|
-
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record}[]",
|
|
24745
|
+
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
24712
24746
|
"example": "[\n {\n id: 1,\n label: 'Krasnoyarsk'\n },\n {\n id: 2,\n label: 'Moscow'\n }\n]",
|
|
24713
24747
|
"defaultValue": null
|
|
24714
24748
|
},
|
|
@@ -26485,7 +26519,7 @@
|
|
|
26485
26519
|
"decorators": [],
|
|
26486
26520
|
"description": "Коллекция элементов",
|
|
26487
26521
|
"required": false,
|
|
26488
|
-
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record}[]",
|
|
26522
|
+
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
26489
26523
|
"example": "[\n {\n id: 1,\n label: 'Krasnoyarsk'\n },\n {\n id: 2,\n label: 'Moscow'\n }\n]",
|
|
26490
26524
|
"defaultValue": null
|
|
26491
26525
|
},
|
|
@@ -28682,7 +28716,7 @@
|
|
|
28682
28716
|
"decorators": [],
|
|
28683
28717
|
"description": "Коллекция элементов",
|
|
28684
28718
|
"required": false,
|
|
28685
|
-
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record}[]",
|
|
28719
|
+
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
28686
28720
|
"example": "[\n {\n id: 1,\n label: 'Krasnoyarsk'\n },\n {\n id: 2,\n label: 'Moscow'\n }\n]",
|
|
28687
28721
|
"defaultValue": null
|
|
28688
28722
|
},
|
|
@@ -31029,7 +31063,7 @@
|
|
|
31029
31063
|
"decorators": [],
|
|
31030
31064
|
"description": "Перечисление элементов.\n1) Может быть строкой вида: `app.geo.enums.Cities`\n2) Массивом: ['{'id: 1, label: \"London\"'}']",
|
|
31031
31065
|
"required": false,
|
|
31032
|
-
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record}[]",
|
|
31066
|
+
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
31033
31067
|
"example": null,
|
|
31034
31068
|
"defaultValue": null
|
|
31035
31069
|
},
|
|
@@ -37356,7 +37390,7 @@
|
|
|
37356
37390
|
"decorators": [],
|
|
37357
37391
|
"description": "Элементы для группы кнопок",
|
|
37358
37392
|
"required": true,
|
|
37359
|
-
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record}[]",
|
|
37393
|
+
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
37360
37394
|
"example": "[\n 'button1',\n 'button2',\n 'button3'\n]",
|
|
37361
37395
|
"defaultValue": null
|
|
37362
37396
|
},
|
|
@@ -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": []
|
|
@@ -39785,7 +39836,7 @@
|
|
|
39785
39836
|
"decorators": [],
|
|
39786
39837
|
"description": "",
|
|
39787
39838
|
"required": true,
|
|
39788
|
-
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record}[]",
|
|
39839
|
+
"type": "string | {} | string | number | {id: string | number | boolean, label: string | Record | number}[]",
|
|
39789
39840
|
"example": null
|
|
39790
39841
|
},
|
|
39791
39842
|
"ColorName": {
|
|
@@ -20,7 +20,7 @@ export type DataProviderItems = string | ({
|
|
|
20
20
|
new (): Enum;
|
|
21
21
|
}) | (string | number | {
|
|
22
22
|
id: string | number | boolean;
|
|
23
|
-
label: string | Record<string, any
|
|
23
|
+
label: string | Record<string, any> | number;
|
|
24
24
|
[key: string]: any;
|
|
25
25
|
})[];
|
|
26
26
|
export interface IDataProvider {
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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;
|