@tap-payments/os-micro-frontend-shared 0.1.442-test.2 → 0.1.442-test.4-test.5
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/components/TableHeader/TableView/hooks/useCustomTableViews.js +1 -1
- package/build/components/TableHeader/TableView/types.d.ts +1 -1
- package/build/components/TableHeader/TableView/utils/layoutTransform.js +1 -3
- package/build/utils/columns.d.ts +2 -2
- package/build/utils/columns.js +10 -11
- package/package.json +2 -2
|
@@ -88,7 +88,7 @@ export function useCustomTableViews({ templates, setTemplates, createTemplate, u
|
|
|
88
88
|
for (const mod of columnModifiers) {
|
|
89
89
|
result = updateColumnSelection({
|
|
90
90
|
columnsViewData: result,
|
|
91
|
-
|
|
91
|
+
columnsId: mod.columnsId,
|
|
92
92
|
selected: mod.selected,
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -2,9 +2,7 @@ export const isDateColumn = (name) => name.toLowerCase() === 'date';
|
|
|
2
2
|
export const transformLayoutToColumns = (layout, lang = 'en') => {
|
|
3
3
|
const columns = [];
|
|
4
4
|
layout.forEach((section) => {
|
|
5
|
-
|
|
6
|
-
.sort((a, b) => { var _a, _b; return ((_a = a.order) !== null && _a !== void 0 ? _a : 999999) - ((_b = b.order) !== null && _b !== void 0 ? _b : 999999); })
|
|
7
|
-
.forEach((col) => {
|
|
5
|
+
section.columns.forEach((col) => {
|
|
8
6
|
var _a, _b, _c, _d;
|
|
9
7
|
const label = ((_a = col.name.find((n) => n.lang === lang)) === null || _a === void 0 ? void 0 : _a.text) || ((_b = col.name[0]) === null || _b === void 0 ? void 0 : _b.text) || col.code;
|
|
10
8
|
const menuItems = ((_c = col.fields) === null || _c === void 0 ? void 0 : _c.length)
|
package/build/utils/columns.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export declare function filterShownColumns(columns: IColumnProps[], tableViews:
|
|
|
3
3
|
export declare function isParameterSelected(columns: ColumnViewProps[], columnId: string, parameter: string): boolean;
|
|
4
4
|
export declare function mapDataToViews(columnData?: ColumnsView[], language?: string): ColumnViewProps[];
|
|
5
5
|
export declare function mapViewsToData(columns: ColumnViewProps[]): ColumnsView[];
|
|
6
|
-
export declare const updateColumnSelection: ({ columnsViewData,
|
|
6
|
+
export declare const updateColumnSelection: ({ columnsViewData, columnsId, selected, }: {
|
|
7
7
|
columnsViewData: ColumnsView[];
|
|
8
|
-
|
|
8
|
+
columnsId: string[];
|
|
9
9
|
selected: boolean;
|
|
10
10
|
}) => ColumnsView[];
|
package/build/utils/columns.js
CHANGED
|
@@ -70,15 +70,14 @@ export function mapViewsToData(columns) {
|
|
|
70
70
|
})) || [] });
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
export const updateColumnSelection = ({ columnsViewData,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
});
|
|
73
|
+
export const updateColumnSelection = ({ columnsViewData, columnsId, selected, }) => {
|
|
74
|
+
const ids = new Set(columnsId.map((id) => id === null || id === void 0 ? void 0 : id.toLowerCase()));
|
|
75
|
+
const withSelected = (col) => {
|
|
76
|
+
var _a;
|
|
77
|
+
return (Object.assign(Object.assign({}, col), { selected, fields: (_a = col.fields) === null || _a === void 0 ? void 0 : _a.map((field) => {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
return (Object.assign(Object.assign({}, field), { parameters: (_b = (_a = field.parameters) === null || _a === void 0 ? void 0 : _a.map((p) => (Object.assign(Object.assign({}, p), { selected })))) !== null && _b !== void 0 ? _b : [] }));
|
|
80
|
+
}) }));
|
|
81
|
+
};
|
|
82
|
+
return columnsViewData.map((column) => { var _a, _b; return ids.has((_b = (_a = column.code) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '') ? withSelected(column) : column; });
|
|
84
83
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.442-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.442-test.4-test.5",
|
|
5
|
+
"testVersion": 5,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|