@steroidsjs/core 3.0.46 → 3.0.48

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.
@@ -7850,7 +7850,7 @@
7850
7850
  "decorators": [],
7851
7851
  "description": "",
7852
7852
  "required": true,
7853
- "type": "default",
7853
+ "type": "string",
7854
7854
  "example": null
7855
7855
  },
7856
7856
  {
@@ -7972,7 +7972,7 @@
7972
7972
  "decorators": [],
7973
7973
  "description": "",
7974
7974
  "required": true,
7975
- "type": "default",
7975
+ "type": "string",
7976
7976
  "example": null
7977
7977
  }
7978
7978
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "3.0.46",
3
+ "version": "3.0.48",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { ICheckboxListFieldProps } from '../../../ui/form/CheckboxListField/CheckboxListField';
3
3
  import { ICalendarProps } from '../../../ui/content/Calendar/Calendar';
4
4
  import { IModalProps } from '../../../ui/modal/Modal/Modal';
5
- import CalendarEnum from './enums/CalendarType';
6
5
  import { ICustomViews } from './hooks/useCustomViews';
7
6
  export type CalendarSystemModalFields = 'title' | 'eventGroupId' | 'description' | 'startDate' | 'endDate' | 'id' | 'usersIds';
8
7
  export type CalendarSystemEventGroupModalFields = 'label' | 'color';
@@ -178,9 +177,9 @@ export interface ICalendarSystemViewProps extends Pick<ICalendarSystemProps, 'cl
178
177
  dateToDisplay: string;
179
178
  handleCalendarTypeChange: (newType: string) => void;
180
179
  onClickControl: (event: React.MouseEvent<HTMLElement>) => void;
181
- calendarType: CalendarEnum;
180
+ calendarType: string;
182
181
  children: React.ReactNode;
183
- getEventsFromDate: (dateFromDay: Date, currentCalendarType: CalendarEnum) => IEvent[];
182
+ getEventsFromDate: (dateFromDay: Date, currentCalendarType: string) => IEvent[];
184
183
  openEditModal: (event: IEvent) => void;
185
184
  openCreateModal: (eventInitialDay?: IDay) => void;
186
185
  monthGridProps: {
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import CalendarEnum from '../enums/CalendarType';
3
2
  import { IDay } from '../CalendarSystem';
4
- declare const useCalendarControls: (calendarType: CalendarEnum, generalCurrentDay: IDay, setGeneralCurrentDay: React.Dispatch<React.SetStateAction<IDay>>, isGeneralCurrentDayNeedsUpdate: React.MutableRefObject<boolean>) => {
3
+ declare const useCalendarControls: (calendarType: string, generalCurrentDay: IDay, setGeneralCurrentDay: React.Dispatch<React.SetStateAction<IDay>>, isGeneralCurrentDayNeedsUpdate: React.MutableRefObject<boolean>) => {
5
4
  onClickControl: (event: React.MouseEvent<HTMLElement>) => void;
6
5
  };
7
6
  export default useCalendarControls;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ICalendarSystemProps, ICalendarUser, IEventGroup } from '../CalendarSystem';
3
- import CalendarType from '../enums/CalendarType';
4
3
  export declare const useCalendarSystem: (props: ICalendarSystemProps) => {
5
4
  monthGridWeekDays: any;
6
5
  monthGridCalendarDays: import("../CalendarSystem").IDay[];
@@ -16,11 +15,11 @@ export declare const useCalendarSystem: (props: ICalendarSystemProps) => {
16
15
  dayGridCurrentDay: import("../CalendarSystem").IDay;
17
16
  dateToDisplay: any;
18
17
  innerEventGroups: IEventGroup[];
19
- calendarType: CalendarType;
18
+ calendarType: string;
20
19
  users: ICalendarUser[];
21
20
  setSelectedEventGroupsIds: React.Dispatch<React.SetStateAction<number[]>>;
22
21
  handleCalendarTypeChange: (newType: string) => void;
23
- getEventsFromDate: (dateFromDay: Date, currentCalendarType: CalendarType) => import("../CalendarSystem").IEvent[];
22
+ getEventsFromDate: (dateFromDay: Date, currentCalendarType: string) => import("../CalendarSystem").IEvent[];
24
23
  onCalendarChangedMonth: (newDate: Date) => void;
25
24
  openCreateEventGroupModal: () => void;
26
25
  openEditModal: (event: import("../CalendarSystem").IEvent) => void;
@@ -1,5 +1,4 @@
1
- import CalendarEnum from '../enums/CalendarType';
2
1
  export declare const useCalendarType: (onChangeCalendarType?: (newType: string) => void) => {
3
2
  handleCalendarTypeChange: (newType: string) => void;
4
- calendarType: CalendarEnum;
3
+ calendarType: string;
5
4
  };
@@ -1,5 +1,4 @@
1
1
  import { IEvent, IEventGroup } from '../CalendarSystem';
2
- import CalendarEnum from '../enums/CalendarType';
3
2
  export declare const useEventsFromDate: (innerEventGroups: IEventGroup[], selectedEventGroupsIds: number[]) => {
4
- getEventsFromDate: (dateFromDay: Date, currentCalendarType: CalendarEnum) => IEvent[];
3
+ getEventsFromDate: (dateFromDay: Date, currentCalendarType: string) => IEvent[];
5
4
  };
@@ -33,15 +33,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
33
33
  __setModuleDefault(result, mod);
34
34
  return result;
35
35
  };
36
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
37
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
38
- if (ar || !(i in from)) {
39
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
40
- ar[i] = from[i];
41
- }
42
- }
43
- return to.concat(ar || Array.prototype.slice.call(from));
44
- };
45
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
46
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
47
38
  };
@@ -49,8 +40,6 @@ exports.__esModule = true;
49
40
  var react_1 = __importStar(require("react"));
50
41
  var isBoolean_1 = __importDefault(require("lodash-es/isBoolean"));
51
42
  var range_1 = __importDefault(require("lodash-es/range"));
52
- var concat_1 = __importDefault(require("lodash-es/concat"));
53
- var last_1 = __importDefault(require("lodash-es/last"));
54
43
  var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
55
44
  var get_1 = __importDefault(require("lodash-es/get"));
56
45
  var react_use_1 = require("react-use");
@@ -68,26 +57,15 @@ function FieldList(props) {
68
57
  var isWithReduxForm = (0, hooks_1.useSelector)(function (state) { return (0, get_1["default"])(state, ['form', context.formId]) || null; });
69
58
  var dispatch = context.provider.useDispatch();
70
59
  // Mapper for preserving the correct sequence of rows on the UI
71
- var _b = (0, react_1.useState)((0, range_1["default"])(props.input.value) || []), storeToRowIndexMap = _b[0], setStoreToRowIndexMap = _b[1];
72
- var addRowIndexes = (0, react_1.useCallback)(function (rowsCount) {
73
- setStoreToRowIndexMap(function (prevMap) {
74
- var lastIndex = !(0, isEmpty_1["default"])(prevMap) ? (0, last_1["default"])(prevMap) + 1 : 0;
75
- return (0, concat_1["default"])(prevMap, (0, range_1["default"])(lastIndex, lastIndex + rowsCount));
76
- });
77
- }, []);
78
- var removeRowIndex = (0, react_1.useCallback)(function (rowIndex) {
79
- setStoreToRowIndexMap(function (prevMap) { return __spreadArray(__spreadArray([], prevMap.slice(0, rowIndex), true), prevMap.slice(rowIndex + 1), true); });
80
- }, []);
60
+ var storeToRowIndexMap = (0, react_1.useMemo)(function () { return (0, range_1["default"])(props.input.value || 0); }, [props.input.value]);
81
61
  // Add and Remove handlers
82
62
  var onAdd = (0, react_1.useCallback)(function (rowsCount) {
83
63
  if (rowsCount === void 0) { rowsCount = 1; }
84
- addRowIndexes(rowsCount);
85
64
  dispatch((0, form_1.formArrayAdd)(context.formId, props.input.name, rowsCount, props.initialValues));
86
- }, [context.formId, dispatch, props.initialValues, props.input.name, addRowIndexes]);
65
+ }, [context.formId, dispatch, props.initialValues, props.input.name]);
87
66
  var onRemove = (0, react_1.useCallback)(function (rowIndex) {
88
- removeRowIndex(rowIndex);
89
67
  dispatch((0, form_1.formArrayRemove)(context.formId, props.input.name, rowIndex));
90
- }, [context.formId, dispatch, props.input.name, removeRowIndex]);
68
+ }, [context.formId, dispatch, props.input.name]);
91
69
  (0, react_use_1.useMount)(function () {
92
70
  // Add initial rows
93
71
  if (!props.input.value) {