@tap-payments/auth-jsconnect 2.0.56 → 2.0.57
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/build/@types/app.d.ts +33 -0
- package/build/api/data.d.ts +1 -0
- package/build/api/data.js +9 -1
- package/build/api/entity.d.ts +7 -0
- package/build/api/entity.js +10 -1
- package/build/api/index.d.ts +4 -2
- package/build/components/SimpleList/SimpleList.d.ts +1 -1
- package/build/components/SimpleList/SimpleList.js +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/features/app/entity/entityStore.js +24 -12
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +19 -54
- package/build/features/entity/screens/EntityCapital/ActivityList.js +199 -97
- package/build/features/entity/screens/EntityCapital/validation.d.ts +165 -30
- package/build/features/entity/screens/EntityCapital/validation.js +5 -2
- package/build/features/shared/Search/Search.d.ts +2 -1
- package/build/features/shared/Search/Search.js +2 -2
- package/build/utils/array.d.ts +2 -1
- package/build/utils/array.js +72 -0
- package/package.json +1 -1
|
@@ -5,8 +5,11 @@ export var EntityCapitalValidationSchema = function () {
|
|
|
5
5
|
.array()
|
|
6
6
|
.min(1, 'activities_list_alert')
|
|
7
7
|
.of(yup.object().shape({
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
id: yup.string(),
|
|
9
|
+
name: yup.object().shape({
|
|
10
|
+
ar: yup.string(),
|
|
11
|
+
en: yup.string()
|
|
12
|
+
})
|
|
10
13
|
})),
|
|
11
14
|
capitalPaid: yup.string().required('capital_paid_required'),
|
|
12
15
|
capitalShareCount: yup.string().required('capital_share_count_required'),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface SearchProps {
|
|
3
3
|
showSearch?: boolean;
|
|
4
|
+
placeholder?: string;
|
|
4
5
|
onSearchValue?: (value: string) => void;
|
|
5
6
|
}
|
|
6
|
-
declare const Search: ({ onSearchValue }: SearchProps) => JSX.Element;
|
|
7
|
+
declare const Search: ({ onSearchValue, placeholder }: SearchProps) => JSX.Element;
|
|
7
8
|
export default Search;
|
|
@@ -3,11 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import Input from '../../shared/Input';
|
|
5
5
|
var Search = function (_a) {
|
|
6
|
-
var onSearchValue = _a.onSearchValue;
|
|
6
|
+
var onSearchValue = _a.onSearchValue, placeholder = _a.placeholder;
|
|
7
7
|
var t = useTranslation().t;
|
|
8
8
|
var handleOnChange = function (event) {
|
|
9
9
|
onSearchValue === null || onSearchValue === void 0 ? void 0 : onSearchValue(event.target.value);
|
|
10
10
|
};
|
|
11
|
-
return (_jsx(React.Fragment, { children: _jsx(Input, { placeholder: t('search_placeholder'), onChange: handleOnChange }) }));
|
|
11
|
+
return (_jsx(React.Fragment, { children: _jsx(Input, { placeholder: t(placeholder || 'search_placeholder'), onChange: handleOnChange }) }));
|
|
12
12
|
};
|
|
13
13
|
export default Search;
|
package/build/utils/array.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Activity, CountryCode, SaleChannel } from '../@types';
|
|
1
|
+
import { ActivitiesIsIc, Activity, CountryCode, SaleChannel } from '../@types';
|
|
2
2
|
export declare const isArray: (value: any) => value is any[];
|
|
3
3
|
export declare const joinArray: (items: Array<any>, joiner?: string) => string;
|
|
4
4
|
export declare const replaceStringArrayItems: (items: Array<string>, include: string, withThis: string) => string[];
|
|
@@ -65,3 +65,4 @@ export declare const sortActivitiesByName: (items: Array<Activity>, path: string
|
|
|
65
65
|
export declare const getFileDetailsFromDocument: (documents: Array<any>, purpose: string) => any;
|
|
66
66
|
export declare const getRecentDocumentBasedOnPurpose: (documents: Array<any>, purpose: string) => any;
|
|
67
67
|
export declare const findInArrayOrSubArray: (items: Array<any>, value: string | number) => null;
|
|
68
|
+
export declare const groupSectionWithSelectedActivitiesAtBeginning: (sections: Array<ActivitiesIsIc>, selectedActivities: Array<Activity>) => ActivitiesIsIc[];
|
package/build/utils/array.js
CHANGED
|
@@ -9,6 +9,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
12
21
|
import get from 'lodash-es/get';
|
|
13
22
|
export var isArray = function (value) { return Array.isArray(value); };
|
|
14
23
|
export var joinArray = function (items, joiner) {
|
|
@@ -179,3 +188,66 @@ export var findInArrayOrSubArray = function (items, value) {
|
|
|
179
188
|
});
|
|
180
189
|
return found;
|
|
181
190
|
};
|
|
191
|
+
export var groupSectionWithSelectedActivitiesAtBeginning = function (sections, selectedActivities) {
|
|
192
|
+
if ((selectedActivities === null || selectedActivities === void 0 ? void 0 : selectedActivities.length) === 0)
|
|
193
|
+
return sections || [];
|
|
194
|
+
if ((sections === null || sections === void 0 ? void 0 : sections.length) === 0)
|
|
195
|
+
return [];
|
|
196
|
+
var filteredSections = sections.filter(function (section) {
|
|
197
|
+
var _a;
|
|
198
|
+
return (selectedActivities.find(function (_a) {
|
|
199
|
+
var id = _a.id;
|
|
200
|
+
return id === section.id;
|
|
201
|
+
}) ||
|
|
202
|
+
((_a = section.divisions) === null || _a === void 0 ? void 0 : _a.some(function (division) {
|
|
203
|
+
var _a;
|
|
204
|
+
return (selectedActivities.find(function (_a) {
|
|
205
|
+
var id = _a.id;
|
|
206
|
+
return id === division.id;
|
|
207
|
+
}) ||
|
|
208
|
+
((_a = division === null || division === void 0 ? void 0 : division.activities) === null || _a === void 0 ? void 0 : _a.some(function (activity) {
|
|
209
|
+
return selectedActivities.find(function (_a) {
|
|
210
|
+
var id = _a.id;
|
|
211
|
+
return id === activity.id;
|
|
212
|
+
});
|
|
213
|
+
})));
|
|
214
|
+
})));
|
|
215
|
+
});
|
|
216
|
+
var mapSelectedDivisionBeginning = filteredSections.map(function (section) {
|
|
217
|
+
var _a, _b;
|
|
218
|
+
var selectedDivision = ((_a = section.divisions) === null || _a === void 0 ? void 0 : _a.filter(function (division) {
|
|
219
|
+
var _a;
|
|
220
|
+
return (selectedActivities.find(function (_a) {
|
|
221
|
+
var id = _a.id;
|
|
222
|
+
return id === division.id;
|
|
223
|
+
}) ||
|
|
224
|
+
((_a = division === null || division === void 0 ? void 0 : division.activities) === null || _a === void 0 ? void 0 : _a.some(function (activity) {
|
|
225
|
+
return selectedActivities.find(function (_a) {
|
|
226
|
+
var id = _a.id;
|
|
227
|
+
return id === activity.id;
|
|
228
|
+
});
|
|
229
|
+
})));
|
|
230
|
+
})) || [];
|
|
231
|
+
var remainingDivision = ((_b = section.divisions) === null || _b === void 0 ? void 0 : _b.filter(function (division) { return !selectedDivision.includes(division); })) || [];
|
|
232
|
+
var divisions = __spreadArray(__spreadArray([], selectedDivision, true), remainingDivision, true);
|
|
233
|
+
return __assign(__assign({}, section), { divisions: divisions });
|
|
234
|
+
});
|
|
235
|
+
var mapSelectedActivitiesBeginning = mapSelectedDivisionBeginning.map(function (section) {
|
|
236
|
+
var _a;
|
|
237
|
+
var divisions = (_a = section.divisions) === null || _a === void 0 ? void 0 : _a.map(function (division) {
|
|
238
|
+
var _a, _b;
|
|
239
|
+
var filterSelectedActivities = ((_a = division === null || division === void 0 ? void 0 : division.activities) === null || _a === void 0 ? void 0 : _a.filter(function (activity) {
|
|
240
|
+
return selectedActivities.find(function (_a) {
|
|
241
|
+
var id = _a.id;
|
|
242
|
+
return id === activity.id;
|
|
243
|
+
});
|
|
244
|
+
})) || [];
|
|
245
|
+
var remainingActivities = ((_b = division.activities) === null || _b === void 0 ? void 0 : _b.filter(function (activity) { return !filterSelectedActivities.includes(activity); })) || [];
|
|
246
|
+
var activities = __spreadArray(__spreadArray([], filterSelectedActivities, true), remainingActivities, true);
|
|
247
|
+
return __assign(__assign({}, division), { activities: activities });
|
|
248
|
+
});
|
|
249
|
+
return __assign(__assign({}, section), { divisions: divisions });
|
|
250
|
+
});
|
|
251
|
+
var remainingSections = sections.filter(function (section) { return !filteredSections.includes(section); });
|
|
252
|
+
return __spreadArray(__spreadArray([], mapSelectedActivitiesBeginning, true), remainingSections, true);
|
|
253
|
+
};
|