@steroidsjs/core 3.0.8 → 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.
- package/docs-autogen-result.json +127 -2
- package/en.json +1 -0
- package/package.json +1 -1
- package/ui/form/Button/Button.d.ts +4 -0
- package/ui/form/Button/Button.js +3 -2
- 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
|
@@ -4526,6 +4526,14 @@
|
|
|
4526
4526
|
"type": "React.ReactNode | {}",
|
|
4527
4527
|
"example": "MyCustomView"
|
|
4528
4528
|
},
|
|
4529
|
+
{
|
|
4530
|
+
"name": "viewProps",
|
|
4531
|
+
"decorators": [],
|
|
4532
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
4533
|
+
"required": false,
|
|
4534
|
+
"type": "Record",
|
|
4535
|
+
"example": null
|
|
4536
|
+
},
|
|
4529
4537
|
{
|
|
4530
4538
|
"name": "visible",
|
|
4531
4539
|
"decorators": [],
|
|
@@ -4926,6 +4934,14 @@
|
|
|
4926
4934
|
"type": "React.ReactNode | {}",
|
|
4927
4935
|
"example": "MyCustomView"
|
|
4928
4936
|
},
|
|
4937
|
+
{
|
|
4938
|
+
"name": "viewProps",
|
|
4939
|
+
"decorators": [],
|
|
4940
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
4941
|
+
"required": false,
|
|
4942
|
+
"type": "Record",
|
|
4943
|
+
"example": null
|
|
4944
|
+
},
|
|
4929
4945
|
{
|
|
4930
4946
|
"name": "visible",
|
|
4931
4947
|
"decorators": [],
|
|
@@ -14120,6 +14136,15 @@
|
|
|
14120
14136
|
"type": "React.ReactNode | {}",
|
|
14121
14137
|
"example": "MyCustomView",
|
|
14122
14138
|
"defaultValue": null
|
|
14139
|
+
},
|
|
14140
|
+
{
|
|
14141
|
+
"name": "viewProps",
|
|
14142
|
+
"decorators": [],
|
|
14143
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
14144
|
+
"required": false,
|
|
14145
|
+
"type": "Record",
|
|
14146
|
+
"example": null,
|
|
14147
|
+
"defaultValue": null
|
|
14123
14148
|
}
|
|
14124
14149
|
],
|
|
14125
14150
|
"methods": [
|
|
@@ -14385,6 +14410,14 @@
|
|
|
14385
14410
|
"required": false,
|
|
14386
14411
|
"type": "React.ReactNode | {}",
|
|
14387
14412
|
"example": "MyCustomView"
|
|
14413
|
+
},
|
|
14414
|
+
{
|
|
14415
|
+
"name": "viewProps",
|
|
14416
|
+
"decorators": [],
|
|
14417
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
14418
|
+
"required": false,
|
|
14419
|
+
"type": "Record",
|
|
14420
|
+
"example": null
|
|
14388
14421
|
}
|
|
14389
14422
|
],
|
|
14390
14423
|
"methods": []
|
|
@@ -15159,6 +15192,15 @@
|
|
|
15159
15192
|
"type": "React.ReactNode | {}",
|
|
15160
15193
|
"example": "MyCustomView",
|
|
15161
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
|
|
15162
15204
|
}
|
|
15163
15205
|
],
|
|
15164
15206
|
"methods": [
|
|
@@ -15190,9 +15232,18 @@
|
|
|
15190
15232
|
"tags": {},
|
|
15191
15233
|
"defaultProps": null,
|
|
15192
15234
|
"extends": [
|
|
15193
|
-
"IFieldWrapperOutputProps"
|
|
15235
|
+
"IFieldWrapperOutputProps",
|
|
15236
|
+
"IUiComponent"
|
|
15194
15237
|
],
|
|
15195
15238
|
"properties": [
|
|
15239
|
+
{
|
|
15240
|
+
"name": "className",
|
|
15241
|
+
"decorators": [],
|
|
15242
|
+
"description": "Дополнительный CSS-класс для элемента отображения",
|
|
15243
|
+
"required": false,
|
|
15244
|
+
"type": "string",
|
|
15245
|
+
"example": null
|
|
15246
|
+
},
|
|
15196
15247
|
{
|
|
15197
15248
|
"name": "componentId",
|
|
15198
15249
|
"decorators": [],
|
|
@@ -15246,7 +15297,7 @@
|
|
|
15246
15297
|
"decorators": [],
|
|
15247
15298
|
"description": "",
|
|
15248
15299
|
"required": true,
|
|
15249
|
-
"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}[]",
|
|
15250
15301
|
"example": null
|
|
15251
15302
|
},
|
|
15252
15303
|
{
|
|
@@ -15272,6 +15323,22 @@
|
|
|
15272
15323
|
"required": false,
|
|
15273
15324
|
"type": "string",
|
|
15274
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"
|
|
15275
15342
|
}
|
|
15276
15343
|
],
|
|
15277
15344
|
"methods": [
|
|
@@ -32086,6 +32153,14 @@
|
|
|
32086
32153
|
"type": "React.ReactNode | {}",
|
|
32087
32154
|
"example": "MyCustomView"
|
|
32088
32155
|
},
|
|
32156
|
+
{
|
|
32157
|
+
"name": "viewProps",
|
|
32158
|
+
"decorators": [],
|
|
32159
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
32160
|
+
"required": false,
|
|
32161
|
+
"type": "Record",
|
|
32162
|
+
"example": null
|
|
32163
|
+
},
|
|
32089
32164
|
{
|
|
32090
32165
|
"name": "visible",
|
|
32091
32166
|
"decorators": [],
|
|
@@ -33336,6 +33411,14 @@
|
|
|
33336
33411
|
"type": "React.ReactNode | {}",
|
|
33337
33412
|
"example": "MyCustomView"
|
|
33338
33413
|
},
|
|
33414
|
+
{
|
|
33415
|
+
"name": "viewProps",
|
|
33416
|
+
"decorators": [],
|
|
33417
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
33418
|
+
"required": false,
|
|
33419
|
+
"type": "Record",
|
|
33420
|
+
"example": null
|
|
33421
|
+
},
|
|
33339
33422
|
{
|
|
33340
33423
|
"name": "visible",
|
|
33341
33424
|
"decorators": [],
|
|
@@ -37337,6 +37420,15 @@
|
|
|
37337
37420
|
"type": "React.ReactNode | {}",
|
|
37338
37421
|
"example": "MyCustomView",
|
|
37339
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
|
|
37340
37432
|
}
|
|
37341
37433
|
],
|
|
37342
37434
|
"methods": []
|
|
@@ -37424,6 +37516,14 @@
|
|
|
37424
37516
|
"required": false,
|
|
37425
37517
|
"type": "React.ReactNode | {}",
|
|
37426
37518
|
"example": "MyCustomView"
|
|
37519
|
+
},
|
|
37520
|
+
{
|
|
37521
|
+
"name": "viewProps",
|
|
37522
|
+
"decorators": [],
|
|
37523
|
+
"description": "Свойства для компонента отображения",
|
|
37524
|
+
"required": false,
|
|
37525
|
+
"type": "{}",
|
|
37526
|
+
"example": "{\n customHandler: () => {...}\n}"
|
|
37427
37527
|
}
|
|
37428
37528
|
],
|
|
37429
37529
|
"methods": []
|
|
@@ -37671,6 +37771,14 @@
|
|
|
37671
37771
|
"type": "React.ReactNode | {}",
|
|
37672
37772
|
"example": "MyCustomView"
|
|
37673
37773
|
},
|
|
37774
|
+
{
|
|
37775
|
+
"name": "viewProps",
|
|
37776
|
+
"decorators": [],
|
|
37777
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
37778
|
+
"required": false,
|
|
37779
|
+
"type": "Record",
|
|
37780
|
+
"example": null
|
|
37781
|
+
},
|
|
37674
37782
|
{
|
|
37675
37783
|
"name": "visible",
|
|
37676
37784
|
"decorators": [],
|
|
@@ -38048,6 +38156,15 @@
|
|
|
38048
38156
|
"type": "React.ReactNode | {}",
|
|
38049
38157
|
"example": "MyCustomView",
|
|
38050
38158
|
"defaultValue": null
|
|
38159
|
+
},
|
|
38160
|
+
{
|
|
38161
|
+
"name": "viewProps",
|
|
38162
|
+
"decorators": [],
|
|
38163
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
38164
|
+
"required": false,
|
|
38165
|
+
"type": "Record",
|
|
38166
|
+
"example": null,
|
|
38167
|
+
"defaultValue": null
|
|
38051
38168
|
}
|
|
38052
38169
|
],
|
|
38053
38170
|
"methods": [
|
|
@@ -38338,6 +38455,14 @@
|
|
|
38338
38455
|
"type": "React.ReactNode | {}",
|
|
38339
38456
|
"example": "MyCustomView"
|
|
38340
38457
|
},
|
|
38458
|
+
{
|
|
38459
|
+
"name": "viewProps",
|
|
38460
|
+
"decorators": [],
|
|
38461
|
+
"description": "Дополнительный свойства для view части компонента",
|
|
38462
|
+
"required": false,
|
|
38463
|
+
"type": "Record",
|
|
38464
|
+
"example": null
|
|
38465
|
+
},
|
|
38341
38466
|
{
|
|
38342
38467
|
"name": "visible",
|
|
38343
38468
|
"decorators": [],
|
package/en.json
CHANGED
|
@@ -979,6 +979,7 @@
|
|
|
979
979
|
"Скрыть иконку c лева от элемента": "",
|
|
980
980
|
"\nКомпонент `Kanban` позволяет создать доску для управления задачами.\nКоличество столбцов задается с помощью пропа `columns`.\nЗадачи на доске можно создавать, редактировать и перемещать с визуальным отображением.\n\nДля работы этого компонента необходимо установить в проекте зависимости `react-beautiful-dnd`\nи передать в пропсы `droppableComponent`, `draggableComponent` и `dndContext`\nкомпоненты `Droppable`, `Draggable` и `DragDropContext` соответственно.\n\nДля корректной работы функционала создания задач,\nнеобходимо установить в проекте зависимости `@ckeditor/ckeditor5-react` и `@steroidsjs/ckeditor5`,\nзатем импортировать `CKEditor` из `@ckeditor/ckeditor5-react` и `ClassicEditor` из `@steroidsjs/ckeditor5/packages/ckeditor5-build-classic`.\nИмпортированные компоненты нужно передать в проп `createTaskEditorConfig`,\nв поле `htmlComponent` передать `CKEditor`, а в `editorConstructor` передать `ClassicEditor`.\n": "",
|
|
981
981
|
"Компонент для создания HTML-разметки, использующий WYSIWYG редактор.\n\nДля использования WYSIWYG редактора, необходимо установить в проекте зависимости `@ckeditor/ckeditor5-react` и `@steroidsjs/ckeditor5`,\nзатем импортировать `CKEditor` из `@ckeditor/ckeditor5-react` и `ClassicEditor` из `@steroidsjs/ckeditor5/packages/ckeditor5-build-classic`.\nКомпонент `CKEditor` нужно передать в проп `htmlComponent`, а конструктор `ClassicEditor` в проп `editorConstructor`.\n\nПри передаче `HtmlField` с бэкенда, необходимо переопределить `view` компонента, указав локальный.\nВ локальном компоненте добавить вместо пропсов `htmlComponent` и `editorConstructor` импорты `CKEditor` и `ClassicEditor` соотвественно.\n": "",
|
|
982
|
+
"Дополнительный свойства для view части компонента": "",
|
|
982
983
|
"Идентификатор (ключ) для сохранения в LocalStorage коллекции.": "",
|
|
983
984
|
"Сохранение в localStorage уровней вложенности.": "",
|
|
984
985
|
"Компоненты для подключения wysiwyg редактора": "",
|
package/package.json
CHANGED
|
@@ -149,6 +149,10 @@ export interface IButtonProps extends IUiComponent {
|
|
|
149
149
|
* Цвет текста кнопки или ссылки
|
|
150
150
|
*/
|
|
151
151
|
textColor?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Дополнительный свойства для view части компонента
|
|
154
|
+
*/
|
|
155
|
+
viewProps?: Record<string, any>;
|
|
152
156
|
[key: string]: any;
|
|
153
157
|
}
|
|
154
158
|
export interface IButtonViewProps extends IButtonProps {
|
package/ui/form/Button/Button.js
CHANGED
|
@@ -147,10 +147,11 @@ function Button(props) {
|
|
|
147
147
|
onClick: !disabled ? onClick : undefined,
|
|
148
148
|
children: props.label || props.children,
|
|
149
149
|
className: props.className,
|
|
150
|
-
style: props.style
|
|
150
|
+
style: props.style,
|
|
151
|
+
viewProps: props.viewProps
|
|
151
152
|
}); }, [badge, context === null || context === void 0 ? void 0 : context.formId, disabled, isFailed, isLoading, onClick, props.block,
|
|
152
153
|
props.children, props.className, props.color, props.hint, props.icon, props.label,
|
|
153
|
-
props.link, props.outline, props.size, props.style, props.target, props.type, submitting, tag, url]);
|
|
154
|
+
props.link, props.outline, props.size, props.style, props.target, props.type, submitting, tag, url, props.viewProps]);
|
|
154
155
|
return components.ui.renderView(props.view || 'form.ButtonView', viewProps);
|
|
155
156
|
}
|
|
156
157
|
Button.defaultProps = {
|
|
@@ -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;
|