@steroidsjs/core 3.0.0-beta.1 → 3.0.0-beta.4
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/components/ClientStorageComponent.js +1 -0
- package/components/HtmlComponent.js +3 -1
- package/components/HttpComponent.d.ts +1 -0
- package/components/HttpComponent.js +3 -0
- package/components/LocaleComponent.js +6 -5
- package/components/ResourceComponent.js +2 -0
- package/components/StoreComponent.js +2 -0
- package/components/social/FacebookProvider.js +2 -0
- package/hooks/useAbsolutePositioning.js +7 -4
- package/hooks/useAddressBar.js +2 -0
- package/hooks/useDispatch.d.ts +1 -1
- package/hooks/useLayout.js +6 -0
- package/hooks/useList.js +6 -0
- package/hooks/useUniqueId.d.ts +1 -1
- package/hooks/useUniqueId.js +1 -1
- package/index.d.ts +1 -1
- package/package.json +12 -14
- package/reducers/fields.d.ts +9 -7
- package/reducers/fields.js +3 -2
- package/reducers/index.d.ts +1 -2
- package/reducers/index.js +2 -5
- package/ui/content/Calendar/Calendar.d.ts +1 -1
- package/ui/content/Card/demo/basic.js +1 -0
- package/ui/content/Card/demo/border color.js +2 -1
- package/ui/content/Card/demo/color.js +2 -1
- package/ui/content/Card/demo/header.d.ts +0 -5
- package/ui/content/Card/demo/header.js +4 -3
- package/ui/content/Card/demo/hover.d.ts +0 -5
- package/ui/content/Card/demo/hover.js +3 -2
- package/ui/content/Card/demo/link.d.ts +0 -5
- package/ui/content/Card/demo/link.js +2 -1
- package/ui/content/Card/demo/orientation.js +2 -1
- package/ui/content/Collapse/demo/icon.js +1 -0
- package/ui/content/CopyToClipboard/CopyToClipboard.js +2 -0
- package/ui/content/Detail/demo/colors.js +2 -1
- package/ui/crud/Crud/Crud.js +4 -0
- package/ui/crud/Crud/CrudContent.js +2 -0
- package/ui/form/Button/Button.js +2 -0
- package/ui/form/DateField/useDateInputState.js +4 -1
- package/ui/form/DateField/useDateRange.js +1 -0
- package/ui/form/DateField/useDateTime.js +2 -0
- package/ui/form/Form/Form.js +5 -1
- package/ui/form/RadioListField/RadioListField.js +3 -2
- package/ui/form/SliderField/SliderField.d.ts +3 -3
- package/ui/form/validate.d.ts +1 -4
- package/ui/form/validate.js +10 -8
- package/ui/layout/Notifications/Notifications.js +2 -0
- package/ui/layout/Notifications/demo/basic.js +2 -0
- package/ui/layout/Notifications/demo/position.js +2 -0
- package/ui/layout/Notifications/demo/timeOut.js +4 -1
- package/ui/layout/Portal.d.ts +6 -1
- package/ui/layout/Portal.js +1 -1
- package/ui/layout/ProgressBar/index.d.ts +1 -1
- package/ui/layout/Skeleton/index.d.ts +1 -1
- package/ui/layout/Tooltip/Tooltip.d.ts +1 -1
- package/ui/layout/Tooltip/TooltipPortalInner.d.ts +4 -4
- package/ui/layout/Tooltip/TooltipPortalInner.js +8 -38
- package/ui/list/CheckboxColumn/demo/basic.js +1 -1
- package/ui/list/Grid/demo/empty.js +1 -1
- package/ui/list/Grid/demo/search-form.js +1 -1
- package/ui/list/List/demo/condition.js +1 -1
- package/ui/list/List/demo/sort.js +1 -1
- package/ui/list/Pagination/Pagination.js +2 -2
- package/ui/list/Steps/Steps.d.ts +1 -1
- package/ui/list/Steps/Steps.js +14 -5
- package/ui/list/Steps/index.d.ts +1 -1
- package/ui/modal/Modal/Modal.js +1 -0
- package/ui/nav/Router/ConnectedRouter.d.ts +1 -1
- package/ui/nav/Router/Router.js +2 -0
- package/utils/data.d.ts +1 -0
- package/utils/data.js +4 -3
- package/utils/form.d.ts +7 -2
- package/utils/text.d.ts +1 -1
- package/utils/text.js +1 -0
- package/actions/screen.d.ts +0 -7
- package/actions/screen.js +0 -33
- package/reducers/screen.d.ts +0 -26
- package/reducers/screen.js +0 -54
package/ui/form/Button/Button.js
CHANGED
|
@@ -23,7 +23,9 @@ function useDateInputState(props) {
|
|
|
23
23
|
var propsDisplayValue = react_1.useMemo(function () { return calendar_1.convertDate(props.input.value, [
|
|
24
24
|
props.valueFormat,
|
|
25
25
|
props.displayFormat,
|
|
26
|
-
], props.displayFormat, props.useUTC, props.dateInUTC) || ''; },
|
|
26
|
+
], props.displayFormat, props.useUTC, props.dateInUTC) || ''; },
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
[props.displayFormat, props.input.value, props.valueFormat]);
|
|
27
29
|
// Display value state
|
|
28
30
|
var _a = react_1.useState(propsDisplayValue), displayValue = _a[0], setDisplayValue = _a[1];
|
|
29
31
|
// Update display value on update props input value
|
|
@@ -52,6 +54,7 @@ function useDateInputState(props) {
|
|
|
52
54
|
props.onChange.call(null, value);
|
|
53
55
|
}
|
|
54
56
|
}
|
|
57
|
+
// eslint-disable-next-line max-len
|
|
55
58
|
}, [props.displayFormat, props.input.onChange, props.input.value, props.onChange, props.valueFormat, props.useUTC, props.dateInUTC]);
|
|
56
59
|
// Dropdown opened state
|
|
57
60
|
var _b = react_1.useState(false), isOpened = _b[0], setIsOpened = _b[1];
|
|
@@ -62,6 +62,7 @@ function useDateRange(props) {
|
|
|
62
62
|
inputFromRef.current.focus();
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
// eslint-disable-next-line max-len
|
|
65
66
|
}, [focus, onClose, prevValueFrom, prevValueTo, props, props.inputFrom.onChange, props.inputFrom.value, props.inputTo.onChange, props.inputTo.value]);
|
|
66
67
|
return {
|
|
67
68
|
focus: focus,
|
|
@@ -23,6 +23,7 @@ function useDateTime(props) {
|
|
|
23
23
|
props.dateInUTC,
|
|
24
24
|
// whether the date provided from onSelect is in UTC or not depends on this flag
|
|
25
25
|
props.useUTC));
|
|
26
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
27
|
}, [props.dateTimeSeparator, props.input.onChange, props.valueFormat, timeValue]);
|
|
27
28
|
var onTimeSelect = react_1.useCallback(function (time) {
|
|
28
29
|
var result = (dateValue || moment_1["default"]().format(dateValueFormat)) + props.dateTimeSeparator + time;
|
|
@@ -31,6 +32,7 @@ function useDateTime(props) {
|
|
|
31
32
|
props.dateInUTC,
|
|
32
33
|
// whether the date provided from onSelect is in UTC or not depends on this flag
|
|
33
34
|
props.useUTC));
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
36
|
}, [dateValue, dateValueFormat, props.dateTimeSeparator, props.input.onChange, props.valueFormat]);
|
|
35
37
|
return {
|
|
36
38
|
dateValue: dateValue,
|
package/ui/form/Form/Form.js
CHANGED
|
@@ -272,7 +272,11 @@ function Form(props) {
|
|
|
272
272
|
console.error(requestError_1); // eslint-disable-line no-console
|
|
273
273
|
dispatch(form_2.formSetSubmitting(props.formId, false));
|
|
274
274
|
props.onError(requestError_1);
|
|
275
|
-
|
|
275
|
+
//TODO Remove @ts-ignore
|
|
276
|
+
//@ts-ignore
|
|
277
|
+
reduxDispatch(
|
|
278
|
+
//@ts-ignore
|
|
279
|
+
notifications_1.showNotification(props.submitErrorMessage || __('Ошибка сервера'), 'danger'));
|
|
276
280
|
return [2 /*return*/, null];
|
|
277
281
|
case 12:
|
|
278
282
|
// Skip on 2fa
|
|
@@ -15,10 +15,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
exports.__esModule = true;
|
|
17
17
|
var react_1 = require("react");
|
|
18
|
-
var hooks_1 = require("../../../hooks");
|
|
19
|
-
var fieldWrapper_1 = __importDefault(require("../../form/Field/fieldWrapper"));
|
|
20
18
|
var react_use_1 = require("react-use");
|
|
21
19
|
var isEqual_1 = __importDefault(require("lodash-es/isEqual"));
|
|
20
|
+
var hooks_1 = require("../../../hooks");
|
|
21
|
+
var fieldWrapper_1 = __importDefault(require("../../form/Field/fieldWrapper"));
|
|
22
22
|
function RadioListField(props) {
|
|
23
23
|
var components = hooks_1.useComponents();
|
|
24
24
|
var inputSelectedIds = react_1.useMemo(function () { return props.selectedIds || [].concat(props.input.value || []); }, [props.input.value, props.selectedIds]);
|
|
@@ -47,6 +47,7 @@ function RadioListField(props) {
|
|
|
47
47
|
props.onChange.call(null, selectedIds[0]);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
51
|
}, [props.input.onChange, selectedIds]);
|
|
51
52
|
return components.ui.renderView(props.view || 'form.RadioListFieldView', __assign(__assign({}, props), { items: items,
|
|
52
53
|
inputProps: inputProps,
|
|
@@ -55,10 +55,10 @@ export interface ISliderFieldProps extends IFieldWrapperInputProps {
|
|
|
55
55
|
* @example { min: 20, 40: 40, max: 100 }
|
|
56
56
|
*/
|
|
57
57
|
marks?: Record<string, {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
label: any;
|
|
58
|
+
style: {
|
|
59
|
+
color: any;
|
|
61
60
|
};
|
|
61
|
+
label: any;
|
|
62
62
|
} | React.ReactNode | string>;
|
|
63
63
|
/**
|
|
64
64
|
* Функция, вызываемая после отпускания tip'а у слайдера (при событии onmouseup)
|
package/ui/form/validate.d.ts
CHANGED
package/ui/form/validate.js
CHANGED
|
@@ -65,14 +65,16 @@ var validate = function (data, rules) {
|
|
|
65
65
|
max: params.max
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
else if ((params.min || params.min === 0)
|
|
69
|
-
size_1["default"](value) < params.min) {
|
|
68
|
+
else if ((params.min || params.min === 0)
|
|
69
|
+
&& size_1["default"](value) < params.min) {
|
|
70
70
|
errors[attribute] = __('String is too short, min: {min}', {
|
|
71
71
|
min: params.min
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
break;
|
|
76
|
+
default:
|
|
77
|
+
break;
|
|
76
78
|
}
|
|
77
79
|
if (isFunction_1["default"](rule)) {
|
|
78
80
|
var error = rule(data, attribute);
|
|
@@ -88,10 +90,10 @@ var validate = function (data, rules) {
|
|
|
88
90
|
// throw new SubmissionError(errors);
|
|
89
91
|
}
|
|
90
92
|
};
|
|
91
|
-
validate.error =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
};
|
|
93
|
+
// validate.error = (attribute, message) => {
|
|
94
|
+
// // TODO
|
|
95
|
+
// // throw new SubmissionError({
|
|
96
|
+
// // [attribute]: message
|
|
97
|
+
// // });
|
|
98
|
+
// };
|
|
97
99
|
exports["default"] = validate;
|
|
@@ -52,6 +52,8 @@ function Notifications(props) {
|
|
|
52
52
|
var dispatch = useDispatch_1["default"]();
|
|
53
53
|
react_use_1.useMount(function () {
|
|
54
54
|
if (props.initialFlashes) {
|
|
55
|
+
//TODO remove @ts-ignore
|
|
56
|
+
//@ts-ignore
|
|
55
57
|
dispatch(notifications_1.setFlashes(props.initialFlashes));
|
|
56
58
|
// Disable scroll or scroll to top on show notifications
|
|
57
59
|
if (!process.env.IS_SSR) {
|
|
@@ -48,6 +48,8 @@ exports["default"] = (function () {
|
|
|
48
48
|
flexFlow: 'column'
|
|
49
49
|
} }, Object.keys(notifications).map(function (level) { return ([].concat(notifications[level] || [])
|
|
50
50
|
.map(function (message) { return (React.createElement(Button_1["default"], { key: level, color: level, label: __("\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0435 \u0442\u0438\u043F\u0430 \"" + level + "\""), onClick: function () {
|
|
51
|
+
//TODO remove @ts-ignore
|
|
52
|
+
//@ts-ignore
|
|
51
53
|
dispatch(notifications_1.showNotification(message, level));
|
|
52
54
|
}, style: { margin: '10px 0' } })); })); })));
|
|
53
55
|
});
|
|
@@ -40,6 +40,8 @@ var positions = {
|
|
|
40
40
|
exports["default"] = (function () {
|
|
41
41
|
var dispatch = useDispatch_1["default"]();
|
|
42
42
|
return (React.createElement("div", { style: { display: 'grid', gridAutoFlow: 'column', gridGap: '10px', justifyContent: 'center' } }, Object.values(positions).map(function (position) { return (React.createElement(form_1.Button, { key: position, color: 'dark', label: "\u041F\u043E\u0437\u0438\u0446\u0438\u044F " + position, onClick: function () {
|
|
43
|
+
//TODO remove @ts-ignore
|
|
44
|
+
//@ts-ignore
|
|
43
45
|
dispatch(notifications_1.showNotification(position, 'success', { position: position, timeOut: 1000 }));
|
|
44
46
|
} })); })));
|
|
45
47
|
});
|
|
@@ -40,6 +40,9 @@ var times = {
|
|
|
40
40
|
exports["default"] = (function () {
|
|
41
41
|
var dispatch = useDispatch_1["default"]();
|
|
42
42
|
return (React.createElement("div", { style: { display: 'flex', flexFlow: 'column' } }, Object.values(times).map(function (time) { return (React.createElement(form_1.Button, { key: time, color: 'primary', label: "\u0427\u0435\u0440\u0435\u0437 " + time / 1000 + " \u0441\u0435\u043A\u0443\u043D\u0434 \u043F\u0440\u043E\u043F\u0430\u0434\u0435\u0442 \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0435", onClick: function () {
|
|
43
|
-
dispatch(
|
|
43
|
+
dispatch(
|
|
44
|
+
//TODO remove @ts-ignore
|
|
45
|
+
//@ts-ignore
|
|
46
|
+
notifications_1.showNotification(time / 1000 + " \u0441\u0435\u043A\u0443\u043D\u0434", 'info', { position: 'bottom-right', timeOut: time }));
|
|
44
47
|
}, style: { margin: '10px 0' } })); })));
|
|
45
48
|
});
|
package/ui/layout/Portal.d.ts
CHANGED
package/ui/layout/Portal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
var react_dom_1 = require("react-dom");
|
|
4
3
|
var react_1 = require("react");
|
|
4
|
+
var react_dom_1 = require("react-dom");
|
|
5
5
|
var react_use_1 = require("react-use");
|
|
6
6
|
var hooks_1 = require("../../hooks");
|
|
7
7
|
function Portal(props) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ProgressBar from
|
|
1
|
+
import ProgressBar from './ProgressBar';
|
|
2
2
|
export default ProgressBar;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Skeleton from
|
|
1
|
+
import Skeleton from './Skeleton';
|
|
2
2
|
export default Skeleton;
|
|
@@ -42,7 +42,7 @@ export interface ITooltipProps {
|
|
|
42
42
|
/**
|
|
43
43
|
* Рассчет позиции подсказки
|
|
44
44
|
*/
|
|
45
|
-
calculatePosition?: (tooltipDimensions:
|
|
45
|
+
calculatePosition?: (tooltipDimensions: Record<string, any>, arrowDimensions: Record<string, any>) => void;
|
|
46
46
|
[key: string]: any;
|
|
47
47
|
}
|
|
48
48
|
export interface ITooltipViewProps extends ITooltipProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
componentDidMount(): void;
|
|
5
|
-
render(): any;
|
|
2
|
+
interface ITooltipPortalProps {
|
|
3
|
+
children: React.ReactNode;
|
|
6
4
|
}
|
|
5
|
+
export default function TooltipPortal(props: ITooltipPortalProps): React.ReactPortal;
|
|
6
|
+
export {};
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
3
|
if (k2 === undefined) k2 = k;
|
|
19
4
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -26,12 +11,6 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
26
11
|
}) : function(o, v) {
|
|
27
12
|
o["default"] = v;
|
|
28
13
|
});
|
|
29
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
30
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
31
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
32
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
33
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
34
|
-
};
|
|
35
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
36
15
|
if (mod && mod.__esModule) return mod;
|
|
37
16
|
var result = {};
|
|
@@ -42,23 +21,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
42
21
|
exports.__esModule = true;
|
|
43
22
|
var React = __importStar(require("react"));
|
|
44
23
|
var react_dom_1 = require("react-dom");
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
TooltipPortal.prototype.componentDidMount = function () {
|
|
52
|
-
if (!this.props.ui.getPortalElement()) {
|
|
24
|
+
var hooks_1 = require("../../../hooks");
|
|
25
|
+
function TooltipPortal(props) {
|
|
26
|
+
var components = hooks_1.useComponents();
|
|
27
|
+
React.useEffect(function () {
|
|
28
|
+
if (!components.ui.getPortalElement()) {
|
|
53
29
|
throw new Error('Not found UI Portal container. Please set <Portal/> in layout.');
|
|
54
30
|
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
TooltipPortal = __decorate([
|
|
60
|
-
hoc_1.components('ui')
|
|
61
|
-
], TooltipPortal);
|
|
62
|
-
return TooltipPortal;
|
|
63
|
-
}(React.PureComponent));
|
|
31
|
+
}, [components]);
|
|
32
|
+
return react_dom_1.createPortal(props.children, components.ui.getPortalElement());
|
|
33
|
+
}
|
|
64
34
|
exports["default"] = TooltipPortal;
|
|
@@ -27,8 +27,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
exports.__esModule = true;
|
|
30
|
-
var Grid_1 = __importDefault(require("../../Grid"));
|
|
31
30
|
var React = __importStar(require("react"));
|
|
31
|
+
var Grid_1 = __importDefault(require("../../Grid"));
|
|
32
32
|
var CheckboxColumn_1 = __importDefault(require("../CheckboxColumn"));
|
|
33
33
|
var basic_1 = require("../../Grid/demo/basic");
|
|
34
34
|
/**
|
|
@@ -22,8 +22,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
exports.__esModule = true;
|
|
25
|
-
var Grid_1 = __importDefault(require("../Grid"));
|
|
26
25
|
var React = __importStar(require("react"));
|
|
26
|
+
var Grid_1 = __importDefault(require("../Grid"));
|
|
27
27
|
var basic_1 = require("./basic");
|
|
28
28
|
/**
|
|
29
29
|
* Grid with empty data
|
|
@@ -33,9 +33,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
34
|
};
|
|
35
35
|
exports.__esModule = true;
|
|
36
|
+
var React = __importStar(require("react"));
|
|
36
37
|
var Grid_1 = __importDefault(require("../Grid"));
|
|
37
38
|
var basic_1 = require("./basic");
|
|
38
|
-
var React = __importStar(require("react"));
|
|
39
39
|
var inner_search_form_1 = require("./inner-search-form");
|
|
40
40
|
/**
|
|
41
41
|
* Grid with search form
|
|
@@ -22,8 +22,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
exports.__esModule = true;
|
|
25
|
-
var List_1 = __importDefault(require("../List"));
|
|
26
25
|
var React = __importStar(require("react"));
|
|
26
|
+
var List_1 = __importDefault(require("../List"));
|
|
27
27
|
/**
|
|
28
28
|
* List with filtration by custom condition
|
|
29
29
|
* @order 7
|
|
@@ -23,8 +23,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
};
|
|
24
24
|
exports.__esModule = true;
|
|
25
25
|
exports.items = void 0;
|
|
26
|
-
var List_1 = __importDefault(require("../List"));
|
|
27
26
|
var React = __importStar(require("react"));
|
|
27
|
+
var List_1 = __importDefault(require("../List"));
|
|
28
28
|
exports.items = [
|
|
29
29
|
{
|
|
30
30
|
id: 1,
|
|
@@ -75,9 +75,9 @@ function Pagination(props) {
|
|
|
75
75
|
}) || initialValues, page = _e.page, pageSize = _e.pageSize;
|
|
76
76
|
var totalPages = Math.ceil((((_c = props.list) === null || _c === void 0 ? void 0 : _c.total) || 0) / (pageSize || 1));
|
|
77
77
|
var pages = react_1.useMemo(function () { return exports.generatePages(page, totalPages, props.aroundCount)
|
|
78
|
-
.map(function (pageItem, index,
|
|
78
|
+
.map(function (pageItem, index, pagesArray) {
|
|
79
79
|
// Номер страницы для '...' кнопки (выбирает страницу между двумя соседними пронумерованными)
|
|
80
|
-
var pageNumberForButtonWithDots = Math.floor(((
|
|
80
|
+
var pageNumberForButtonWithDots = Math.floor(((pagesArray[index + 1] + pagesArray[index - 1]) / 2));
|
|
81
81
|
return {
|
|
82
82
|
page: pageItem !== '...' ? pageItem : pageNumberForButtonWithDots,
|
|
83
83
|
label: pageItem,
|
package/ui/list/Steps/Steps.d.ts
CHANGED
package/ui/list/Steps/Steps.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
var hooks_1 = require("../../../hooks");
|
|
4
3
|
var react_1 = require("react");
|
|
4
|
+
var hooks_1 = require("../../../hooks");
|
|
5
5
|
function Steps(props) {
|
|
6
6
|
var _a = react_1.useState(false), isChangeable = _a[0], setIsChangeable = _a[1];
|
|
7
7
|
react_1.useEffect(function () { return setIsChangeable(props.isChangeable); }, [props.isChangeable]);
|
|
@@ -14,10 +14,19 @@ function Steps(props) {
|
|
|
14
14
|
return 'active';
|
|
15
15
|
return 'finish';
|
|
16
16
|
}
|
|
17
|
-
return hooks_1.useComponents().ui.renderView(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
return hooks_1.useComponents().ui.renderView('list.StepsView', {
|
|
18
|
+
className: props.className,
|
|
19
|
+
children: props.stepItems.map(
|
|
20
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
21
|
+
function (stepItem, index) { return hooks_1.useComponents().ui.renderView('list.StepItemView', {
|
|
22
|
+
stepItem: stepItem,
|
|
23
|
+
index: index + 1,
|
|
24
|
+
status: getStepStatus(index, stepItem),
|
|
25
|
+
disabled: !isChangeable,
|
|
26
|
+
onChange: function () { if (isChangeable)
|
|
27
|
+
props.onChange(index); }
|
|
28
|
+
}); })
|
|
29
|
+
});
|
|
21
30
|
}
|
|
22
31
|
Steps.defaultProps = {};
|
|
23
32
|
exports["default"] = Steps;
|
package/ui/list/Steps/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Steps from
|
|
1
|
+
import Steps from './Steps';
|
|
2
2
|
export default Steps;
|
package/ui/modal/Modal/Modal.js
CHANGED
|
@@ -40,6 +40,7 @@ function Modal(props) {
|
|
|
40
40
|
if (props.closeAfterMs) {
|
|
41
41
|
setTimeout(function () { return props.onClose(); }, props.closeAfterMs);
|
|
42
42
|
}
|
|
43
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
44
|
}, []);
|
|
44
45
|
return (React.createElement(ModalView, __assign({}, props), (ContentComponent && (React.createElement(ContentComponent, __assign({}, props, props.componentProps)))) || (props.children)));
|
|
45
46
|
}
|
|
@@ -3,7 +3,7 @@ interface IConnectedRouterProps {
|
|
|
3
3
|
store?: any;
|
|
4
4
|
history?: any;
|
|
5
5
|
}
|
|
6
|
-
export default class ConnectedRouter extends React.PureComponent<IConnectedRouterProps
|
|
6
|
+
export default class ConnectedRouter extends React.PureComponent<React.PropsWithChildren<IConnectedRouterProps>> {
|
|
7
7
|
inTimeTravelling?: any;
|
|
8
8
|
unsubscribe?: any;
|
|
9
9
|
unlisten?: any;
|
package/ui/nav/Router/Router.js
CHANGED
package/utils/data.d.ts
CHANGED
|
@@ -6,4 +6,5 @@
|
|
|
6
6
|
export declare const normalizeItems: (items: any) => any;
|
|
7
7
|
export declare const checkCondition: (item: any, condition: any) => any;
|
|
8
8
|
export declare const filterItems: (items: Array<any>, condition: any) => any[];
|
|
9
|
+
export declare const shouldUpdateSingle: (a: any, b: any) => boolean;
|
|
9
10
|
export declare const shouldUpdate: (objA: any, objB: any, deepPaths?: any) => boolean;
|
package/utils/data.js
CHANGED
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
exports.__esModule = true;
|
|
17
|
-
exports.shouldUpdate = exports.filterItems = exports.checkCondition = exports.normalizeItems = void 0;
|
|
17
|
+
exports.shouldUpdate = exports.shouldUpdateSingle = exports.filterItems = exports.checkCondition = exports.normalizeItems = void 0;
|
|
18
18
|
var uniqBy_1 = __importDefault(require("lodash-es/uniqBy"));
|
|
19
19
|
var isString_1 = __importDefault(require("lodash-es/isString"));
|
|
20
20
|
var isArray_1 = __importDefault(require("lodash-es/isArray"));
|
|
@@ -121,6 +121,7 @@ var shouldUpdateSingle = function (a, b) {
|
|
|
121
121
|
}
|
|
122
122
|
return a !== b;
|
|
123
123
|
};
|
|
124
|
+
exports.shouldUpdateSingle = shouldUpdateSingle;
|
|
124
125
|
var shouldUpdate = function (objA, objB, deepPaths) {
|
|
125
126
|
if (deepPaths === void 0) { deepPaths = null; }
|
|
126
127
|
if (isObject_1["default"](objA) && isObject_1["default"](objB)) {
|
|
@@ -141,7 +142,7 @@ var shouldUpdate = function (objA, objB, deepPaths) {
|
|
|
141
142
|
}
|
|
142
143
|
var hasChanges = deepPath
|
|
143
144
|
? exports.shouldUpdate(objA[key], objB[key], deepPath)
|
|
144
|
-
: shouldUpdateSingle(objA[key], objB[key]);
|
|
145
|
+
: exports.shouldUpdateSingle(objA[key], objB[key]);
|
|
145
146
|
if (hasChanges) {
|
|
146
147
|
console.log(0, 'shouldUpdate changed key:', key, objA[key], objB[key]);
|
|
147
148
|
return { value: true };
|
|
@@ -154,6 +155,6 @@ var shouldUpdate = function (objA, objB, deepPaths) {
|
|
|
154
155
|
}
|
|
155
156
|
return false;
|
|
156
157
|
}
|
|
157
|
-
return shouldUpdateSingle(objA, objB);
|
|
158
|
+
return exports.shouldUpdateSingle(objA, objB);
|
|
158
159
|
};
|
|
159
160
|
exports.shouldUpdate = shouldUpdate;
|
package/utils/form.d.ts
CHANGED
|
@@ -7,11 +7,16 @@ export declare const providers: {
|
|
|
7
7
|
redux: {
|
|
8
8
|
useForm: (formId: any, initialValues: any) => any;
|
|
9
9
|
useField: (formId: any, name: any, isList: any) => {
|
|
10
|
-
setValue: (value: any) =>
|
|
10
|
+
setValue: (value: any) => {
|
|
11
|
+
type: string;
|
|
12
|
+
formId: any;
|
|
13
|
+
nameOrObject: any;
|
|
14
|
+
value: any;
|
|
15
|
+
};
|
|
11
16
|
errors: any;
|
|
12
17
|
value: any;
|
|
13
18
|
};
|
|
14
|
-
useDispatch: () =>
|
|
19
|
+
useDispatch: () => import("redux").Dispatch<import("redux").AnyAction>;
|
|
15
20
|
select: (formId: any, selector: any) => any;
|
|
16
21
|
};
|
|
17
22
|
reducer: {
|
package/utils/text.d.ts
CHANGED
|
@@ -12,5 +12,5 @@ export declare type TSmartSearchOutput = ISmartSearchOutputItem[];
|
|
|
12
12
|
* @param query
|
|
13
13
|
* @param sourceItems
|
|
14
14
|
*/
|
|
15
|
-
export declare const smartSearch: (query: string, sourceItems: ISmartSearchSourceItem[]) => TSmartSearchOutput;
|
|
15
|
+
export declare const smartSearch: (query: string | null, sourceItems: ISmartSearchSourceItem[] | null) => TSmartSearchOutput;
|
|
16
16
|
export {};
|
package/utils/text.js
CHANGED
|
@@ -78,6 +78,7 @@ var smartSearch = function (query, sourceItems) {
|
|
|
78
78
|
}
|
|
79
79
|
highlighted = highlighted.filter(function (highlightedItem) { return !!highlightedItem[0]; });
|
|
80
80
|
if (highlighted.findIndex(function (highlightedItem) { return highlightedItem[1]; }) !== -1) {
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
81
82
|
// @ts-ignore
|
|
82
83
|
item.labelHighlighted = highlighted;
|
|
83
84
|
return true;
|
package/actions/screen.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const SCREEN_SET_WIDTH = "SCREEN_SET_WIDTH";
|
|
2
|
-
export declare const SCREEN_SET_MEDIA = "SCREEN_SET_MEDIA";
|
|
3
|
-
export declare const setMedia: (media: any) => {
|
|
4
|
-
type: string;
|
|
5
|
-
media: any;
|
|
6
|
-
};
|
|
7
|
-
export declare const setWidth: (width: any, skipTimeout?: boolean) => (dispatch: any) => any;
|
package/actions/screen.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.setWidth = exports.setMedia = exports.SCREEN_SET_MEDIA = exports.SCREEN_SET_WIDTH = void 0;
|
|
4
|
-
exports.SCREEN_SET_WIDTH = 'SCREEN_SET_WIDTH';
|
|
5
|
-
exports.SCREEN_SET_MEDIA = 'SCREEN_SET_MEDIA';
|
|
6
|
-
var setMedia = function (media) { return ({
|
|
7
|
-
type: exports.SCREEN_SET_MEDIA,
|
|
8
|
-
media: media
|
|
9
|
-
}); };
|
|
10
|
-
exports.setMedia = setMedia;
|
|
11
|
-
var timer = null;
|
|
12
|
-
var setWidth = function (width, skipTimeout) {
|
|
13
|
-
if (skipTimeout === void 0) { skipTimeout = false; }
|
|
14
|
-
return function (dispatch) {
|
|
15
|
-
if (timer) {
|
|
16
|
-
clearTimeout(timer);
|
|
17
|
-
}
|
|
18
|
-
if (skipTimeout) {
|
|
19
|
-
return dispatch({
|
|
20
|
-
type: exports.SCREEN_SET_WIDTH,
|
|
21
|
-
width: width
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
timer = setTimeout(function () {
|
|
25
|
-
dispatch({
|
|
26
|
-
type: exports.SCREEN_SET_WIDTH,
|
|
27
|
-
width: width
|
|
28
|
-
});
|
|
29
|
-
}, 100);
|
|
30
|
-
return null;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
exports.setWidth = setWidth;
|
package/reducers/screen.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare const SCREEN_PHONE = "phone";
|
|
2
|
-
export declare const SCREEN_TABLET = "tablet";
|
|
3
|
-
export declare const SCREEN_DESKTOP = "desktop";
|
|
4
|
-
export declare type TMediaDevice = typeof SCREEN_PHONE | typeof SCREEN_TABLET | typeof SCREEN_DESKTOP;
|
|
5
|
-
export interface IScreenInitialState {
|
|
6
|
-
width: number;
|
|
7
|
-
media: {
|
|
8
|
-
[key in TMediaDevice]: number;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
declare const _default: (state: IScreenInitialState, action: any) => {
|
|
12
|
-
width: any;
|
|
13
|
-
media: {
|
|
14
|
-
phone: number;
|
|
15
|
-
tablet: number;
|
|
16
|
-
desktop: number;
|
|
17
|
-
};
|
|
18
|
-
} | {
|
|
19
|
-
media: any;
|
|
20
|
-
width: number;
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
|
23
|
-
export declare const getDeviceType: (state: any) => "phone" | "tablet" | "desktop";
|
|
24
|
-
export declare const isPhone: (state: any) => boolean;
|
|
25
|
-
export declare const isTablet: (state: any) => boolean;
|
|
26
|
-
export declare const isDesktop: (state: any) => boolean;
|