@steroidsjs/core 3.0.0-beta.99 → 3.0.1
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/actions/notifications.js +7 -1
- package/actions/router.js +16 -2
- package/components/HttpComponent.d.ts +7 -7
- package/components/JwtHttpComponent.d.ts +2 -2
- package/components/LocaleComponent.d.ts +6 -6
- package/components/MetaComponent.d.ts +90 -1
- package/components/MetricsComponent.js +2 -1
- package/components/ResourceComponent.d.ts +4 -4
- package/components/UiComponent.d.ts +7 -7
- package/components/WebSocketComponent.d.ts +11 -11
- package/docs-autogen-result.json +15160 -6374
- package/en.json +151 -92
- package/hooks/index.d.ts +4 -3
- package/hooks/index.js +7 -5
- package/hooks/useAbsolutePositioning.js +0 -1
- package/hooks/useAddressBar.js +0 -1
- package/hooks/useApplication.js +8 -1
- package/hooks/useDataProvider.d.ts +17 -2
- package/hooks/useDataSelect.js +21 -4
- package/hooks/useFetch.js +6 -1
- package/hooks/useFile.d.ts +1 -0
- package/hooks/useFile.js +2 -0
- package/hooks/useList.d.ts +53 -14
- package/hooks/useList.js +31 -70
- package/hooks/useTree.d.ts +104 -0
- package/hooks/useTree.js +169 -0
- package/index.d.ts +3 -3
- package/package.json +94 -93
- package/reducers/router.d.ts +2 -1
- package/ui/content/Accordion/Accordion.d.ts +8 -5
- package/ui/content/Accordion/Accordion.js +6 -1
- package/ui/content/Accordion/AccordionItem.d.ts +2 -2
- package/ui/content/Accordion/AccordionItem.js +1 -12
- package/ui/content/Alert/Alert.d.ts +5 -2
- package/ui/content/Alert/Alert.js +13 -12
- package/ui/content/Avatar/Avatar.js +18 -12
- package/ui/content/Badge/Badge.d.ts +5 -1
- package/ui/content/Badge/Badge.js +14 -12
- package/ui/content/Calendar/Calendar.d.ts +6 -1
- package/ui/content/Calendar/Calendar.js +19 -12
- package/ui/content/CalendarSystem/CalendarSystem.d.ts +40 -18
- package/ui/content/CalendarSystem/CalendarSystem.js +65 -76
- package/ui/content/CalendarSystem/hooks/useCalendarControls.d.ts +1 -2
- package/ui/content/CalendarSystem/hooks/useCalendarControls.js +14 -17
- package/ui/content/CalendarSystem/hooks/useCalendarSystemEventGroupModals.js +11 -3
- package/ui/content/CalendarSystem/hooks/useCalendarSystemModals.js +2 -2
- package/ui/content/CalendarSystem/hooks/useCalendarType.d.ts +5 -0
- package/ui/content/CalendarSystem/hooks/useCalendarType.js +22 -0
- package/ui/content/CalendarSystem/hooks/useEventsFromDate.d.ts +5 -0
- package/ui/content/CalendarSystem/hooks/useEventsFromDate.js +49 -0
- package/ui/content/CalendarSystem/hooks/{useMonthCalendar.d.ts → useMonthGrid.d.ts} +4 -5
- package/ui/content/CalendarSystem/hooks/{useMonthCalendar.js → useMonthGrid.js} +24 -15
- package/ui/content/CalendarSystem/hooks/{useWeekCalendar.d.ts → useWeekGrid.d.ts} +6 -5
- package/ui/content/CalendarSystem/hooks/useWeekGrid.js +72 -0
- package/ui/content/CalendarSystem/utils/utils.d.ts +8 -0
- package/ui/content/CalendarSystem/utils/utils.js +27 -1
- package/ui/content/Card/Card.d.ts +33 -27
- package/ui/content/Card/Card.js +1 -12
- package/ui/content/Chart/Chart.d.ts +38 -8
- package/ui/content/Chart/Chart.js +16 -12
- package/ui/content/Chat/Chat.d.ts +90 -5
- package/ui/content/Chat/Chat.js +40 -14
- package/ui/content/Chat/constants/timeTemplatesAndUnits.d.ts +1 -0
- package/ui/content/Chat/constants/timeTemplatesAndUnits.js +2 -1
- package/ui/content/Chat/hooks/useChat.d.ts +5 -6
- package/ui/content/Chat/hooks/useChat.js +49 -3
- package/ui/content/Chat/utils/addNewMessageIntoGroupedMessages.d.ts +5 -0
- package/ui/content/Chat/utils/addNewMessageIntoGroupedMessages.js +61 -0
- package/ui/content/Chat/utils/getMessagesGroupedByDate.d.ts +1 -0
- package/ui/content/Chat/utils/getMessagesGroupedByDate.js +3 -2
- package/ui/content/Chat/utils/index.d.ts +4 -2
- package/ui/content/Chat/utils/index.js +6 -1
- package/ui/content/Chat/utils/isTodayMessage.d.ts +1 -0
- package/ui/content/Chat/utils/isTodayMessage.js +13 -0
- package/ui/content/CopyToClipboard/CopyToClipboard.d.ts +3 -3
- package/ui/content/CopyToClipboard/CopyToClipboard.js +10 -12
- package/ui/content/Dashboard/Dashboard.d.ts +5 -2
- package/ui/content/Dashboard/Dashboard.js +27 -3
- package/ui/content/Detail/Detail.d.ts +15 -2
- package/ui/content/Detail/Detail.js +12 -1
- package/ui/content/DropDown/DropDown.d.ts +1 -1
- package/ui/content/DropDown/DropDown.js +16 -4
- package/ui/content/Icon/Icon.js +13 -15
- package/ui/content/Kanban/Kanban.d.ts +15 -4
- package/ui/content/Kanban/Kanban.js +8 -12
- package/ui/content/Kanban/hooks/useKanban.d.ts +33 -26
- package/ui/content/Menu/Menu.js +10 -12
- package/ui/content/Slider/Slider.js +1 -12
- package/ui/crud/index.d.ts +3 -0
- package/ui/form/AutoCompleteField/AutoCompleteField.js +1 -1
- package/ui/form/Button/Button.js +8 -2
- package/ui/form/CheckboxField/CheckboxField.d.ts +1 -0
- package/ui/form/CheckboxField/CheckboxField.js +2 -2
- package/ui/form/CheckboxListField/CheckboxListField.d.ts +18 -2
- package/ui/form/CheckboxListField/CheckboxListField.js +1 -1
- package/ui/form/CheckboxTreeField/CheckboxTreeField.d.ts +67 -0
- package/ui/form/CheckboxTreeField/CheckboxTreeField.js +126 -0
- package/ui/form/CheckboxTreeField/index.d.ts +2 -0
- package/ui/form/CheckboxTreeField/index.js +7 -0
- package/ui/form/DateField/DateField.d.ts +4 -3
- package/ui/form/DateField/DateField.js +6 -2
- package/ui/form/DateField/useDateRange.d.ts +1 -0
- package/ui/form/DateField/useDateRange.js +13 -2
- package/ui/form/DateRangeField/DateRangeField.d.ts +34 -1
- package/ui/form/DateRangeField/DateRangeField.js +59 -8
- package/ui/form/DateTimeField/DateTimeField.d.ts +10 -0
- package/ui/form/DateTimeField/DateTimeField.js +11 -3
- package/ui/form/DateTimeRangeField/DateTimeRangeField.d.ts +25 -1
- package/ui/form/DateTimeRangeField/DateTimeRangeField.js +66 -13
- package/ui/form/DropDownField/DropDownField.d.ts +23 -3
- package/ui/form/DropDownField/DropDownField.js +1 -1
- package/ui/form/EmailField/EmailField.d.ts +6 -0
- package/ui/form/EmailField/EmailField.js +0 -4
- package/ui/form/Field/Field.d.ts +9 -1
- package/ui/form/Field/Field.js +1 -1
- package/ui/form/Field/fieldWrapper.d.ts +9 -1
- package/ui/form/FieldList/FieldList.d.ts +13 -7
- package/ui/form/FieldList/FieldList.js +30 -4
- package/ui/form/FileField/FileField.js +5 -0
- package/ui/form/Form/Form.d.ts +26 -3
- package/ui/form/Form/Form.js +5 -3
- package/ui/form/ImageField/ImageField.d.ts +9 -1
- package/ui/form/InputField/InputField.d.ts +5 -2
- package/ui/form/InputField/hooks/useInputFieldWarningByType.js +1 -0
- package/ui/form/NumberField/NumberField.js +34 -7
- package/ui/form/SliderField/SliderField.d.ts +10 -2
- package/ui/form/TimeRangeField/TimeRangeField.d.ts +10 -1
- package/ui/form/TimeRangeField/TimeRangeField.js +3 -1
- package/ui/form/WizardForm/WizardForm.d.ts +119 -0
- package/ui/form/WizardForm/WizardForm.js +167 -0
- package/ui/form/WizardForm/index.d.ts +2 -0
- package/ui/form/WizardForm/index.js +7 -0
- package/ui/form/WizardForm/utils.d.ts +12 -0
- package/ui/form/WizardForm/utils.js +111 -0
- package/ui/form/index.d.ts +3 -1
- package/ui/form/index.js +4 -1
- package/ui/layout/ProgressBar/ProgressBar.js +12 -2
- package/ui/layout/Skeleton/Skeleton.d.ts +3 -1
- package/ui/layout/Tooltip/Tooltip.d.ts +4 -1
- package/ui/list/ControlsColumn/ControlsColumn.d.ts +17 -3
- package/ui/list/FlexGrid/FlexGrid.d.ts +11 -1
- package/ui/list/Grid/Grid.d.ts +42 -6
- package/ui/list/Grid/Grid.js +1 -2
- package/ui/list/LayoutNames/LayoutNames.d.ts +11 -1
- package/ui/list/Steps/Steps.d.ts +19 -7
- package/ui/list/Steps/Steps.js +46 -26
- package/ui/list/TreeTable/TreeTable.d.ts +34 -33
- package/ui/list/TreeTable/TreeTable.js +19 -8
- package/ui/modal/Modal/Modal.d.ts +7 -1
- package/ui/nav/Breadcrumbs/Breadcrumbs.d.ts +11 -1
- package/ui/nav/ButtonGroup/ButtonGroup.d.ts +13 -4
- package/ui/nav/Controls/Controls.d.ts +7 -1
- package/ui/nav/Link/Link.d.ts +1 -1
- package/ui/nav/Nav/Nav.d.ts +19 -4
- package/ui/nav/Router/Router.d.ts +19 -3
- package/ui/nav/Router/Router.js +11 -6
- package/ui/nav/Router/helpers.d.ts +2 -2
- package/ui/nav/Router/helpers.js +39 -7
- package/ui/nav/Tree/Tree.d.ts +32 -62
- package/ui/nav/Tree/Tree.js +18 -165
- package/utils/calculateComponentAbsolutePosition.js +74 -24
- package/utils/calendar.d.ts +8 -0
- package/utils/calendar.js +76 -1
- package/utils/data.js +1 -0
- package/utils/form.d.ts +1 -0
- package/utils/form.js +16 -1
- package/ui/content/CalendarSystem/hooks/useWeekCalendar.js +0 -86
- package/utils/list.d.ts +0 -1
- package/utils/list.js +0 -5
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { getMessagesGroupedByDate } from './getMessagesGroupedByDate';
|
|
1
|
+
import { getMessagesGroupedByDate, isWithinTimeThreshold } from './getMessagesGroupedByDate';
|
|
2
|
+
import { addNewMessageIntoGroupedMessages } from './addNewMessageIntoGroupedMessages';
|
|
2
3
|
import { calculateMessageTimeAgo } from './calculateMessageTimeAgo';
|
|
3
|
-
|
|
4
|
+
import { isTodayMessage } from './isTodayMessage';
|
|
5
|
+
export { getMessagesGroupedByDate, isWithinTimeThreshold, addNewMessageIntoGroupedMessages, calculateMessageTimeAgo, isTodayMessage, };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.calculateMessageTimeAgo = exports.getMessagesGroupedByDate = void 0;
|
|
3
|
+
exports.isTodayMessage = exports.calculateMessageTimeAgo = exports.addNewMessageIntoGroupedMessages = exports.isWithinTimeThreshold = exports.getMessagesGroupedByDate = void 0;
|
|
4
4
|
var getMessagesGroupedByDate_1 = require("./getMessagesGroupedByDate");
|
|
5
5
|
exports.getMessagesGroupedByDate = getMessagesGroupedByDate_1.getMessagesGroupedByDate;
|
|
6
|
+
exports.isWithinTimeThreshold = getMessagesGroupedByDate_1.isWithinTimeThreshold;
|
|
7
|
+
var addNewMessageIntoGroupedMessages_1 = require("./addNewMessageIntoGroupedMessages");
|
|
8
|
+
exports.addNewMessageIntoGroupedMessages = addNewMessageIntoGroupedMessages_1.addNewMessageIntoGroupedMessages;
|
|
6
9
|
var calculateMessageTimeAgo_1 = require("./calculateMessageTimeAgo");
|
|
7
10
|
exports.calculateMessageTimeAgo = calculateMessageTimeAgo_1.calculateMessageTimeAgo;
|
|
11
|
+
var isTodayMessage_1 = require("./isTodayMessage");
|
|
12
|
+
exports.isTodayMessage = isTodayMessage_1.isTodayMessage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isTodayMessage: (timestamp: string | Date) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.isTodayMessage = void 0;
|
|
7
|
+
var dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
+
var isTodayMessage = function (timestamp) {
|
|
9
|
+
var messageDate = (0, dayjs_1["default"])(timestamp);
|
|
10
|
+
var currentDate = (0, dayjs_1["default"])();
|
|
11
|
+
return currentDate.isSame(messageDate, 'day') || currentDate.isAfter(messageDate);
|
|
12
|
+
};
|
|
13
|
+
exports.isTodayMessage = isTodayMessage;
|
|
@@ -33,9 +33,9 @@ export interface ICopyToClipboardProps extends IUiComponent {
|
|
|
33
33
|
* message: 'Some value has been copied to buffer',
|
|
34
34
|
* level: 'info',
|
|
35
35
|
* params: {
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* position: 'top-left',
|
|
37
|
+
* timeOut: 100,
|
|
38
|
+
* }
|
|
39
39
|
* }
|
|
40
40
|
*/
|
|
41
41
|
notification?: string | {
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -87,7 +76,16 @@ function CopyToClipboard(props) {
|
|
|
87
76
|
}
|
|
88
77
|
});
|
|
89
78
|
}); }, [dispatch, isCopied, notification, props]);
|
|
90
|
-
|
|
79
|
+
var viewProps = (0, react_1.useMemo)(function () { return ({
|
|
80
|
+
disabled: props.disabled,
|
|
81
|
+
showCopyIcon: props.showCopyIcon,
|
|
82
|
+
icon: props.icon,
|
|
83
|
+
children: props.children,
|
|
84
|
+
className: props.className,
|
|
85
|
+
style: props.style,
|
|
86
|
+
onClick: onClick
|
|
87
|
+
}); }, [onClick, props.children, props.className, props.disabled, props.icon, props.showCopyIcon, props.style]);
|
|
88
|
+
return components.ui.renderView(props.view || 'content.CopyToClipboardView', viewProps);
|
|
91
89
|
}
|
|
92
90
|
CopyToClipboard.defaultProps = {
|
|
93
91
|
showCopyIcon: true
|
|
@@ -5,6 +5,10 @@ export interface IDashboardItem extends IFlexGridItem {
|
|
|
5
5
|
* Заголовок для элемента
|
|
6
6
|
*/
|
|
7
7
|
title?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Иконка, которая отобразится слева от заголовка
|
|
10
|
+
*/
|
|
11
|
+
iconName?: string;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* Dashboard
|
|
@@ -21,9 +25,8 @@ export interface IDashboardProps extends IUiComponent, IFlexGridProps {
|
|
|
21
25
|
*/
|
|
22
26
|
itemView?: CustomView;
|
|
23
27
|
}
|
|
24
|
-
export interface IDashboardItemViewProps {
|
|
28
|
+
export interface IDashboardItemViewProps extends Pick<IDashboardItem, 'title' | 'iconName'> {
|
|
25
29
|
children: React.ReactNode;
|
|
26
|
-
title?: string;
|
|
27
30
|
}
|
|
28
31
|
declare function Dashboard(props: IDashboardProps): JSX.Element;
|
|
29
32
|
export default Dashboard;
|
|
@@ -10,17 +10,41 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
38
|
};
|
|
16
39
|
exports.__esModule = true;
|
|
17
|
-
var react_1 =
|
|
40
|
+
var react_1 = __importStar(require("react"));
|
|
18
41
|
var FlexGrid_1 = __importDefault(require("../../../ui/list/FlexGrid/FlexGrid"));
|
|
19
42
|
var hooks_1 = require("../../../hooks");
|
|
20
43
|
function Dashboard(props) {
|
|
21
44
|
var components = (0, hooks_1.useComponents)();
|
|
22
45
|
var DashboardItemView = props.itemView || components.ui.getView('content.DashboardItemView');
|
|
23
|
-
var flexGridItems = react_1["default"].useMemo(function () { return props.items.map(function (item) { return (__assign(__assign({}, item), { content: (react_1["default"].createElement(DashboardItemView, { title: item.title }, item.content)) })); }); }, [DashboardItemView, props.items]);
|
|
24
|
-
|
|
46
|
+
var flexGridItems = react_1["default"].useMemo(function () { return props.items.map(function (item) { return (__assign(__assign({}, item), { content: (react_1["default"].createElement(DashboardItemView, { title: item.title, iconName: item.iconName }, item.content)) })); }); }, [DashboardItemView, props.items]);
|
|
47
|
+
var viewProps = (0, react_1.useMemo)(function () { return (__assign(__assign({}, props), { items: flexGridItems })); }, [flexGridItems, props]);
|
|
48
|
+
return (react_1["default"].createElement(FlexGrid_1["default"], __assign({}, viewProps)));
|
|
25
49
|
}
|
|
26
50
|
exports["default"] = Dashboard;
|
|
@@ -58,7 +58,16 @@ export interface IDetailProps extends IUiComponent {
|
|
|
58
58
|
layout?: DetailLayoutEnum;
|
|
59
59
|
/**
|
|
60
60
|
* Перестраивать таблицу при ресайзе
|
|
61
|
-
* @example
|
|
61
|
+
* @example
|
|
62
|
+
* {
|
|
63
|
+
* enable: true,
|
|
64
|
+
* media: [
|
|
65
|
+
* {
|
|
66
|
+
* breakpoint: 600,
|
|
67
|
+
* column: 2
|
|
68
|
+
* }
|
|
69
|
+
* ]
|
|
70
|
+
* }
|
|
62
71
|
*/
|
|
63
72
|
responsive?: boolean | IDetailResponsive;
|
|
64
73
|
/**
|
|
@@ -73,7 +82,11 @@ export interface IDetailProps extends IUiComponent {
|
|
|
73
82
|
title?: string | React.ReactNode;
|
|
74
83
|
/**
|
|
75
84
|
* Контролы, которые нужно расположить рядом с таблицей
|
|
76
|
-
* @example
|
|
85
|
+
* @example
|
|
86
|
+
* [{
|
|
87
|
+
* label: __(('Edit')),
|
|
88
|
+
* onClick: () => props.onClick()
|
|
89
|
+
* }]
|
|
77
90
|
*/
|
|
78
91
|
controls?: IControlItem[];
|
|
79
92
|
/**
|
|
@@ -148,7 +148,18 @@ function Detail(props) {
|
|
|
148
148
|
(0, react_1.useEffect)(function () {
|
|
149
149
|
setRows(createRows(detailItems, column, props.layout));
|
|
150
150
|
}, [column, detailItems, props.layout]);
|
|
151
|
-
|
|
151
|
+
var viewProps = (0, react_1.useMemo)(function () { return ({
|
|
152
|
+
title: props.title,
|
|
153
|
+
controls: props.controls,
|
|
154
|
+
layout: props.layout,
|
|
155
|
+
rows: rows,
|
|
156
|
+
resizedNodeRef: responsiveProps.enable ? { resizedNodeRef: resizedNodeRef } : {},
|
|
157
|
+
size: props.size,
|
|
158
|
+
className: props.className,
|
|
159
|
+
style: props.style
|
|
160
|
+
}); }, [props.title, props.controls, props.layout, props.size, props.className,
|
|
161
|
+
props.style, rows, responsiveProps.enable, resizedNodeRef]);
|
|
162
|
+
return components.ui.renderView(props.view || 'content.DetailView', viewProps);
|
|
152
163
|
}
|
|
153
164
|
exports["default"] = Detail;
|
|
154
165
|
Detail.defaultProps = {
|
|
@@ -36,7 +36,7 @@ export interface IDropDownViewProps extends IDropDownProps, IAbsolutePositioning
|
|
|
36
36
|
/**
|
|
37
37
|
* Рассчет абсолютной позиции
|
|
38
38
|
*/
|
|
39
|
-
calculatePosition
|
|
39
|
+
calculatePosition?: (dropDownDimensions: Record<string, any>, arrowDimensions: Record<string, any>) => void;
|
|
40
40
|
/**
|
|
41
41
|
* Ссылка на view
|
|
42
42
|
*/
|
|
@@ -45,7 +45,7 @@ var TooltipPortalInner_1 = __importDefault(require("../../layout/Tooltip/Tooltip
|
|
|
45
45
|
var useAbsolutePositioning_1 = __importDefault(require("../../../hooks/useAbsolutePositioning"));
|
|
46
46
|
function DropDown(props) {
|
|
47
47
|
var components = (0, hooks_1.useComponents)();
|
|
48
|
-
var _a = (0, useAbsolutePositioning_1["default"])(props), isComponentExist = _a.isComponentExist, isComponentVisible = _a.isComponentVisible, calculateAbsolutePosition = _a.calculateAbsolutePosition, onShow = _a.onShow, onHide = _a.onHide, position = _a.position, style = _a.style;
|
|
48
|
+
var _a = (0, useAbsolutePositioning_1["default"])(props), isComponentExist = _a.isComponentExist, isComponentVisible = _a.isComponentVisible, calculateAbsolutePosition = _a.calculateAbsolutePosition, onShow = _a.onShow, onHide = _a.onHide, position = _a.position, arrowPosition = _a.arrowPosition, style = _a.style;
|
|
49
49
|
var childRef = (0, react_1.useRef)(null);
|
|
50
50
|
var isManualControl = props.visible !== undefined;
|
|
51
51
|
// Outside click -> close
|
|
@@ -70,8 +70,8 @@ function DropDown(props) {
|
|
|
70
70
|
}, [isComponentExist, isComponentVisible, onHide, props.closeMode]);
|
|
71
71
|
(0, react_use_1.useEvent)('mousedown', onAnyClick);
|
|
72
72
|
(0, react_use_1.useEvent)('touchstart', onAnyClick);
|
|
73
|
-
var calculatePosition = (0, react_1.useCallback)(function (componentSize) {
|
|
74
|
-
calculateAbsolutePosition(position, childRef.current, componentSize);
|
|
73
|
+
var calculatePosition = (0, react_1.useCallback)(function (componentSize, arrowSize) {
|
|
74
|
+
calculateAbsolutePosition(position, childRef.current, componentSize, arrowSize);
|
|
75
75
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
76
|
}, []);
|
|
77
77
|
var DropDownView = components.ui.getView(props.view || 'content.DropDownView');
|
|
@@ -86,6 +86,18 @@ function DropDown(props) {
|
|
|
86
86
|
onShow();
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
+
var viewProps = (0, react_1.useMemo)(function () { return ({
|
|
90
|
+
className: props.className,
|
|
91
|
+
forwardedRef: forwardedRef,
|
|
92
|
+
content: props.content,
|
|
93
|
+
position: position,
|
|
94
|
+
style: style,
|
|
95
|
+
arrowPosition: arrowPosition,
|
|
96
|
+
calculatePosition: calculatePosition,
|
|
97
|
+
isComponentVisible: isComponentVisible,
|
|
98
|
+
onClose: onHide,
|
|
99
|
+
hasArrow: props.hasArrow
|
|
100
|
+
}); }, [arrowPosition, calculatePosition, isComponentVisible, onHide, props.className, props.content, props.hasArrow, position, style]);
|
|
89
101
|
return (React.createElement(React.Fragment, null,
|
|
90
102
|
childrenElement
|
|
91
103
|
? React.cloneElement(childrenElement, resultProps)
|
|
@@ -93,7 +105,7 @@ function DropDown(props) {
|
|
|
93
105
|
isComponentExist && (
|
|
94
106
|
// TODO Change Portal to global
|
|
95
107
|
React.createElement(TooltipPortalInner_1["default"], null,
|
|
96
|
-
React.createElement(DropDownView, __assign({},
|
|
108
|
+
React.createElement(DropDownView, __assign({}, viewProps))))));
|
|
97
109
|
}
|
|
98
110
|
DropDown.defaultProps = {
|
|
99
111
|
autoPositioning: true,
|
package/ui/content/Icon/Icon.js
CHANGED
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
exports.__esModule = true;
|
|
17
6
|
var isObject_1 = __importDefault(require("lodash-es/isObject"));
|
|
18
7
|
var isString_1 = __importDefault(require("lodash-es/isString"));
|
|
8
|
+
var react_1 = require("react");
|
|
19
9
|
var hooks_1 = require("../../../hooks");
|
|
20
10
|
var DEFAULT_ICON_NAME = 'default_24x24';
|
|
21
11
|
function Icon(props) {
|
|
22
12
|
var components = (0, hooks_1.useComponents)();
|
|
23
13
|
var name = props.name;
|
|
24
|
-
if (!(0, isString_1["default"])(name)) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
14
|
var icon;
|
|
28
15
|
if (process.env.PLATFORM === 'mobile') {
|
|
29
16
|
icon = components.ui.getIcon(name) || name;
|
|
@@ -48,6 +35,17 @@ function Icon(props) {
|
|
|
48
35
|
icon = components.ui.getIcon(DEFAULT_ICON_NAME);
|
|
49
36
|
}
|
|
50
37
|
}
|
|
51
|
-
|
|
38
|
+
var viewProps = (0, react_1.useMemo)(function () { return ({
|
|
39
|
+
onClick: props.onClick,
|
|
40
|
+
tabIndex: props.tabIndex,
|
|
41
|
+
title: props.title,
|
|
42
|
+
className: props.className,
|
|
43
|
+
style: props.style,
|
|
44
|
+
icon: icon
|
|
45
|
+
}); }, [props.onClick, props.tabIndex, props.title, props.className, props.style, icon]);
|
|
46
|
+
if (!(0, isString_1["default"])(name)) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return components.ui.renderView(props.view || 'content.IconView', viewProps);
|
|
52
50
|
}
|
|
53
51
|
exports["default"] = Icon;
|
|
@@ -22,7 +22,7 @@ export interface ITaskPriority {
|
|
|
22
22
|
type: string;
|
|
23
23
|
}
|
|
24
24
|
export interface IKanbanTask {
|
|
25
|
-
id:
|
|
25
|
+
id: number;
|
|
26
26
|
title: string;
|
|
27
27
|
description?: string;
|
|
28
28
|
fullDescription?: string;
|
|
@@ -46,7 +46,7 @@ export interface IDragEndResult {
|
|
|
46
46
|
combine: null;
|
|
47
47
|
}
|
|
48
48
|
export interface IKanbanColumn {
|
|
49
|
-
id:
|
|
49
|
+
id: number;
|
|
50
50
|
title: string;
|
|
51
51
|
tasks: IKanbanTask[];
|
|
52
52
|
}
|
|
@@ -69,6 +69,17 @@ export interface IKanbanTaskDetailsModalViewProps extends IModalProps {
|
|
|
69
69
|
bem: IBem;
|
|
70
70
|
task: IKanbanTask;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Kanban
|
|
74
|
+
*
|
|
75
|
+
* Компонент `Kanban` позволяет создать доску для управления задачами.
|
|
76
|
+
* Количество столбцов задается с помощью пропа `columns`.
|
|
77
|
+
* Задачи на доске можно создавать, редактировать и перемещать с визуальным отображением.
|
|
78
|
+
*
|
|
79
|
+
* Для работы этого компонента необходимо установить в проекте зависимости `react-beautiful-dnd`
|
|
80
|
+
* и передать в пропсы `droppableComponent`, `draggableComponent` и `dndContext`
|
|
81
|
+
* компоненты `Droppable`, `Draggable` и `DragDropContext` соответственно.
|
|
82
|
+
*/
|
|
72
83
|
export interface IKanbanProps extends IKanbanConfig, IUiComponent {
|
|
73
84
|
/**
|
|
74
85
|
* Компонент обертка для инициализации области куда можно переместить элемент из библиотеки react-beautiful-dnd
|
|
@@ -100,8 +111,8 @@ export interface IKanbanColumnViewProps {
|
|
|
100
111
|
droppableComponent: any;
|
|
101
112
|
draggableComponent: any;
|
|
102
113
|
task?: IKanbanTask;
|
|
103
|
-
renderTask: (task: IKanbanTask, columnId:
|
|
104
|
-
onOpenCreateTaskModal: (columnId:
|
|
114
|
+
renderTask: (task: IKanbanTask, columnId: number, index: number) => JSX.Element;
|
|
115
|
+
onOpenCreateTaskModal: (columnId: number) => void;
|
|
105
116
|
}
|
|
106
117
|
export type IKanbanViewProps = IKanbanProps;
|
|
107
118
|
export default function Kanban(props: IKanbanProps): JSX.Element;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -54,6 +43,13 @@ function Kanban(props) {
|
|
|
54
43
|
// Column
|
|
55
44
|
var Column = components.ui.getView('content.KanbanColumnView');
|
|
56
45
|
var renderColumn = (0, react_1.useCallback)(function (column, index) { return (react_1["default"].createElement(Column, { key: column.id, column: column, columnIndex: index, draggableComponent: props.draggableComponent, droppableComponent: props.droppableComponent, renderTask: renderTask, onOpenCreateTaskModal: onOpenCreateTaskModal })); }, [Column, onOpenCreateTaskModal, props.draggableComponent, props.droppableComponent, renderTask]);
|
|
57
|
-
|
|
46
|
+
var viewProps = (0, react_1.useMemo)(function () { return ({
|
|
47
|
+
columns: columns,
|
|
48
|
+
renderColumn: renderColumn,
|
|
49
|
+
droppableComponent: props.droppableComponent,
|
|
50
|
+
className: props.className,
|
|
51
|
+
style: props.style
|
|
52
|
+
}); }, [columns, renderColumn, props.droppableComponent, props.className, props.style]);
|
|
53
|
+
return (react_1["default"].createElement(DragDropContext, { onDragEnd: onDragEnd }, components.ui.renderView(props.view || 'content.KanbanView', viewProps)));
|
|
58
54
|
}
|
|
59
55
|
exports["default"] = Kanban;
|
|
@@ -7,18 +7,24 @@ export interface IKanbanConfig {
|
|
|
7
7
|
kanbanId?: string;
|
|
8
8
|
/**
|
|
9
9
|
* Коллекция с наименованиями и свойствами колонок в таблице
|
|
10
|
-
* @example
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
10
|
+
* @example
|
|
11
|
+
* [
|
|
12
|
+
* {
|
|
13
|
+
* id: 1,
|
|
14
|
+
* title: 'column 1',
|
|
15
|
+
* tasks: [
|
|
16
|
+
* {
|
|
17
|
+
* content: 'item 1',
|
|
18
|
+
* id: 1
|
|
19
|
+
* }
|
|
20
|
+
* ],
|
|
21
|
+
* },
|
|
22
|
+
* {
|
|
23
|
+
* id: 2,
|
|
24
|
+
* title: 'column 2',
|
|
25
|
+
* tasks: [],
|
|
26
|
+
* }
|
|
27
|
+
* ]
|
|
22
28
|
*/
|
|
23
29
|
columns: IKanbanColumn[];
|
|
24
30
|
/**
|
|
@@ -32,20 +38,21 @@ export interface IKanbanConfig {
|
|
|
32
38
|
/**
|
|
33
39
|
* Обработчик события окончания перетаскивания карточки или колонки
|
|
34
40
|
* В result передается объект с информацией о событии
|
|
35
|
-
* @example
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
41
|
+
* @example
|
|
42
|
+
* {
|
|
43
|
+
* draggableId: 1,
|
|
44
|
+
* type: 'task',
|
|
45
|
+
* source: {
|
|
46
|
+
* index: 0,
|
|
47
|
+
* droppableId: 2
|
|
48
|
+
* },
|
|
49
|
+
* reason: 'DROP',
|
|
50
|
+
* mode: 'FLUID',
|
|
51
|
+
* destination: {
|
|
52
|
+
* droppableId: 2,
|
|
53
|
+
* index: 1
|
|
54
|
+
* },
|
|
55
|
+
* combine: null
|
|
49
56
|
* }
|
|
50
57
|
*/
|
|
51
58
|
onDragEnd?: (result: IDragEndResult) => void;
|
package/ui/content/Menu/Menu.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
exports.__esModule = true;
|
|
6
|
+
var react_1 = require("react");
|
|
17
7
|
var useComponents_1 = __importDefault(require("../../../hooks/useComponents"));
|
|
18
8
|
function Menu(props) {
|
|
19
9
|
var components = (0, useComponents_1["default"])();
|
|
20
10
|
var MenuItemView = components.ui.getView(props.itemView || 'content.MenuItemView');
|
|
21
|
-
|
|
11
|
+
var viewProps = (0, react_1.useMemo)(function () { return ({
|
|
12
|
+
items: props.items,
|
|
13
|
+
dropDownProps: props.dropDownProps,
|
|
14
|
+
icon: props.icon,
|
|
15
|
+
className: props.className,
|
|
16
|
+
style: props.style,
|
|
17
|
+
itemView: MenuItemView
|
|
18
|
+
}); }, [MenuItemView, props.className, props.dropDownProps, props.icon, props.items, props.style]);
|
|
19
|
+
return components.ui.renderView(props.view || 'content.MenuView', viewProps);
|
|
22
20
|
}
|
|
23
21
|
exports["default"] = Menu;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
exports.__esModule = true;
|
|
14
3
|
var hooks_1 = require("../../../hooks");
|
|
15
4
|
function Slider(props) {
|
|
16
5
|
var components = (0, hooks_1.useComponents)();
|
|
17
|
-
return components.ui.renderView(props.view || 'content.SliderView',
|
|
6
|
+
return components.ui.renderView(props.view || 'content.SliderView', props);
|
|
18
7
|
}
|
|
19
8
|
exports["default"] = Slider;
|
package/ui/crud/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import Crud from './Crud';
|
|
2
3
|
import { IRouteItem } from '../nav/Router/Router';
|
|
3
4
|
import { ICrudProps } from './Crud/Crud';
|
|
@@ -19,6 +20,7 @@ export declare const generateCrud: (routeId: string, props: ICrudGeneratorProps)
|
|
|
19
20
|
title?: string;
|
|
20
21
|
path: string;
|
|
21
22
|
exact?: boolean;
|
|
23
|
+
strict?: boolean;
|
|
22
24
|
redirectTo?: string | boolean;
|
|
23
25
|
component: any;
|
|
24
26
|
layout?: string;
|
|
@@ -32,4 +34,5 @@ export declare const generateCrud: (routeId: string, props: ICrudGeneratorProps)
|
|
|
32
34
|
[key: string]: IRouteItem;
|
|
33
35
|
};
|
|
34
36
|
preloadData?: (match: Record<string, any>) => (import("../../hooks/useFetch").IFetchConfig | import("../list/List/List").IListProps)[];
|
|
37
|
+
icon?: string | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
35
38
|
};
|
|
@@ -94,7 +94,7 @@ function AutoCompleteField(props) {
|
|
|
94
94
|
}, [onClose, props.inputProps, props.isOpened]);
|
|
95
95
|
var inputProps = (0, react_1.useMemo)(function () {
|
|
96
96
|
var _a;
|
|
97
|
-
return (__assign(__assign({}, props.inputProps), { type: 'text', name: props.input.name,
|
|
97
|
+
return (__assign(__assign({}, props.inputProps), { type: 'text', name: props.input.name, value: (_a = props.input.value) !== null && _a !== void 0 ? _a : '', placeholder: props.placeholder, disabled: props.disabled, onChange: onChange, onBlur: onBlur }));
|
|
98
98
|
}, [onBlur, onChange, props.disabled, props.input.name, props.input.value, props.inputProps, props.placeholder]);
|
|
99
99
|
//Sync with form
|
|
100
100
|
(0, react_1.useEffect)(function () {
|
package/ui/form/Button/Button.js
CHANGED
|
@@ -52,9 +52,15 @@ function Button(props) {
|
|
|
52
52
|
? props.url
|
|
53
53
|
: (routePath ? (0, router_2.buildUrl)(routePath, props.toRouteParams) : null);
|
|
54
54
|
// Flags: isLoading, isFailed
|
|
55
|
-
var _a = (0, react_1.useState)({
|
|
55
|
+
var _a = (0, react_1.useState)({
|
|
56
|
+
isLoading: false,
|
|
57
|
+
isFailed: false
|
|
58
|
+
}), _b = _a[0], isLoading = _b.isLoading, isFailed = _b.isFailed, setStateFlags = _a[1];
|
|
56
59
|
React.useEffect(function () {
|
|
57
|
-
setStateFlags({
|
|
60
|
+
setStateFlags({
|
|
61
|
+
isLoading: props.isLoading,
|
|
62
|
+
isFailed: props.isFailed
|
|
63
|
+
});
|
|
58
64
|
}, [props.isLoading, props.isFailed]);
|
|
59
65
|
// Form submitting
|
|
60
66
|
var context = (0, react_1.useContext)(Form_1.FormContext);
|
|
@@ -29,6 +29,7 @@ export interface ICheckboxFieldViewProps extends ICheckboxFieldProps, IFieldWrap
|
|
|
29
29
|
checked: boolean;
|
|
30
30
|
onChange: (value: string | React.ChangeEvent) => void;
|
|
31
31
|
disabled: boolean;
|
|
32
|
+
required?: boolean;
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
declare const _default: import("../Field/fieldWrapper").FieldWrapperComponent<ICheckboxFieldProps>;
|
|
@@ -53,8 +53,8 @@ function CheckboxField(props) {
|
|
|
53
53
|
}, [props]);
|
|
54
54
|
var inputProps = (0, react_1.useMemo)(function () {
|
|
55
55
|
var _a, _b;
|
|
56
|
-
return (__assign({ name: (_a = props.input) === null || _a === void 0 ? void 0 : _a.name, type: 'checkbox', checked: !!((_b = props.input) === null || _b === void 0 ? void 0 : _b.value), onChange: onChangeHandler, disabled: props.disabled }, props.inputProps));
|
|
57
|
-
}, [onChangeHandler, props.disabled, (_a = props.input) === null || _a === void 0 ? void 0 : _a.name, (_b = props.input) === null || _b === void 0 ? void 0 : _b.value, props.inputProps]);
|
|
56
|
+
return (__assign({ name: (_a = props.input) === null || _a === void 0 ? void 0 : _a.name, type: 'checkbox', checked: !!((_b = props.input) === null || _b === void 0 ? void 0 : _b.value), onChange: onChangeHandler, disabled: props.disabled, required: props.required }, props.inputProps));
|
|
57
|
+
}, [onChangeHandler, props.disabled, (_a = props.input) === null || _a === void 0 ? void 0 : _a.name, (_b = props.input) === null || _b === void 0 ? void 0 : _b.value, props.inputProps, props.required]);
|
|
58
58
|
return components.ui.renderView(props.view || 'form.CheckboxFieldView', __assign(__assign({}, props), { inputProps: inputProps }));
|
|
59
59
|
}
|
|
60
60
|
CheckboxField.defaultProps = {
|
|
@@ -20,7 +20,7 @@ type CheckboxFieldListItems = string | ({
|
|
|
20
20
|
export interface ICheckboxListFieldProps extends IFieldWrapperInputProps, Omit<IDataProviderConfig, 'items'>, Omit<IDataSelectConfig, 'items'>, IUiComponent {
|
|
21
21
|
/**
|
|
22
22
|
* Свойства для элемента input
|
|
23
|
-
* @example {onKeyDown: ...}
|
|
23
|
+
* @example { onKeyDown: ... }
|
|
24
24
|
*/
|
|
25
25
|
inputProps?: any;
|
|
26
26
|
/**
|
|
@@ -29,9 +29,25 @@ export interface ICheckboxListFieldProps extends IFieldWrapperInputProps, Omit<I
|
|
|
29
29
|
orientation?: Orientation;
|
|
30
30
|
/**
|
|
31
31
|
* Коллекция элементов
|
|
32
|
-
* @example
|
|
32
|
+
* @example
|
|
33
|
+
* [
|
|
34
|
+
* {
|
|
35
|
+
* id: 1,
|
|
36
|
+
* label: 'Krasnoyarsk',
|
|
37
|
+
* color: 'red'
|
|
38
|
+
* },
|
|
39
|
+
* {
|
|
40
|
+
* id: 2,
|
|
41
|
+
* label: 'Moscow',
|
|
42
|
+
* color: 'purple'
|
|
43
|
+
* }
|
|
44
|
+
* ]
|
|
33
45
|
*/
|
|
34
46
|
items: CheckboxFieldListItems;
|
|
47
|
+
/**
|
|
48
|
+
* Кастомная вьюшка для элемента
|
|
49
|
+
*/
|
|
50
|
+
itemView?: CustomView;
|
|
35
51
|
[key: string]: any;
|
|
36
52
|
}
|
|
37
53
|
export interface ICheckboxListFieldViewProps extends IFieldWrapperOutputProps {
|
|
@@ -79,7 +79,7 @@ function CheckboxListField(props) {
|
|
|
79
79
|
onReset();
|
|
80
80
|
}
|
|
81
81
|
}, [onReset, prevInputValue, props.input.value, selectedIds.length]);
|
|
82
|
-
var CheckboxFieldView = components.ui.getView('form.CheckboxFieldView');
|
|
82
|
+
var CheckboxFieldView = props.itemView || components.ui.getView('form.CheckboxFieldView');
|
|
83
83
|
var renderCheckbox = function (checkboxProps) { return (React.createElement(CheckboxFieldView, __assign({}, checkboxProps))); };
|
|
84
84
|
return components.ui.renderView(props.view || 'form.CheckboxListFieldView', __assign(__assign({}, props), { items: items, inputProps: inputProps, onItemSelect: onItemSelect, selectedIds: selectedIds, renderCheckbox: renderCheckbox }));
|
|
85
85
|
}
|