infinity-forge 0.19.5 → 0.19.7
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.
|
@@ -33,13 +33,13 @@ function THeadItem(_a) {
|
|
|
33
33
|
var router = (0, router_1.useRouter)();
|
|
34
34
|
var asc = router.query.asc;
|
|
35
35
|
var actualColumn = router.query.orderColumn;
|
|
36
|
-
var ascIsActive = actualColumn === colunm.
|
|
36
|
+
var ascIsActive = actualColumn === colunm.id;
|
|
37
37
|
var rotateArrow = ascIsActive && asc === "true";
|
|
38
38
|
function handleOrd() {
|
|
39
39
|
if (disableOrdenationTable || !colunm.hasAsc) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
(0, ui_1.updateRoute)({ params: { orderColumn: colunm.id, asc: actualColumn !== colunm.
|
|
42
|
+
(0, ui_1.updateRoute)({ params: { orderColumn: colunm.id, asc: actualColumn !== colunm.id ? "true" : asc === "true" ? "false" : "true" }, router: router });
|
|
43
43
|
}
|
|
44
44
|
return ((0, jsx_runtime_1.jsx)(ui_1.Error, { name: 'thead-item', children: (0, jsx_runtime_1.jsx)("th", { style: { width: colunm.width + 'px' }, children: (0, jsx_runtime_1.jsxs)(S.THeadItem, { style: { width: colunm.width + 'px' }, onClick: handleOrd, children: [(0, jsx_runtime_1.jsx)("span", { className: 'font-12-bold uppercase', children: colunm.label }), !disableOrdenationTable && colunm.hasAsc && ((0, jsx_runtime_1.jsx)("div", { className: 'ord-actions', children: (0, jsx_runtime_1.jsx)("button", { type: 'button', children: (0, jsx_runtime_1.jsx)("svg", { style: { transform: rotateArrow ? "rotate(180deg)" : "rotate(0deg)" }, xmlns: 'http://www.w3.org/2000/svg', width: '11', height: '6', viewBox: '0 0 11 6', fill: 'none', children: (0, jsx_runtime_1.jsx)("path", { d: 'M5.75 5.5L0.75 0.5H10.75L5.75 5.5Z', fill: ascIsActive ? "#1ABB64" : '#828282' }) }) }) }))] }) }) }));
|
|
45
45
|
}
|
package/dist/system/presentation/hooks/ui/use-table/components/table/thead-item/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../src/system/presentation/hooks/ui/use-table/components/table/thead-item/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAuC;AAEvC,2BAAmD;AAGnD,0CAA6B;AAE7B,SAAgB,SAAS,CAAC,EAAmD;QAAjD,MAAM,YAAA,EAAE,sBAAsB,4BAAA;IAExD,IAAM,MAAM,GAAG,IAAA,kBAAS,GAAE,CAAC;IAE3B,IAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;IAC7B,IAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;IAE9C,IAAM,WAAW,GAAG,YAAY,KAAK,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../src/system/presentation/hooks/ui/use-table/components/table/thead-item/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAuC;AAEvC,2BAAmD;AAGnD,0CAA6B;AAE7B,SAAgB,SAAS,CAAC,EAAmD;QAAjD,MAAM,YAAA,EAAE,sBAAsB,4BAAA;IAExD,IAAM,MAAM,GAAG,IAAA,kBAAS,GAAE,CAAC;IAE3B,IAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;IAC7B,IAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;IAE9C,IAAM,WAAW,GAAG,YAAY,KAAK,MAAM,CAAC,EAAE,CAAA;IAC9C,IAAM,WAAW,GAAG,WAAW,IAAI,GAAG,KAAK,MAAM,CAAA;IAEjD,SAAS,SAAS;QAChB,IAAI,sBAAsB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7C,OAAM;QACR,CAAC;QAED,IAAA,gB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ean;
|
|
42
42
|
};
|
|
43
|
-
type
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
text?: string;
|
|
43
|
+
type TableActionCreate<T = any> = {
|
|
44
|
+
link?: {
|
|
45
|
+
href: string;
|
|
46
|
+
};
|
|
47
|
+
text?: string;
|
|
48
|
+
icon?: IconsNames;
|
|
49
|
+
} & DynamicFormHandlerProps<T>;
|
|
50
|
+
type TableActionEdit<T = any> = {
|
|
51
|
+
link?: {
|
|
52
|
+
href: (table: {
|
|
53
|
+
[key in keyof T]: string;
|
|
54
|
+
}) => string;
|
|
55
|
+
text: string;
|
|
58
56
|
icon?: IconsNames;
|
|
59
|
-
}
|
|
57
|
+
};
|
|
58
|
+
} & DynamicFormHandlerProps<T>;
|
|
59
|
+
type ActionsTable<T = any> = {
|
|
60
|
+
edit?: TableActionEdit<T>;
|
|
61
|
+
create?: TableActionCreate<T>;
|
|
60
62
|
delete?: (table: {
|
|
61
63
|
[key in keyof T]: T[key];
|
|
62
64
|
}) => void;
|
|
@@ -73,4 +75,4 @@ interface IUseTableProps<T = any, M = any> {
|
|
|
73
75
|
configs: IConfigurationsTable;
|
|
74
76
|
columnsConfiguration: ColumnsConfiguration<T>;
|
|
75
77
|
}
|
|
76
|
-
export type { Column, QueryTable, ActionsTable, IParamsTable, IUseTableProps, IConfigurationsTable, ColumnsConfiguration, };
|
|
78
|
+
export type { Column, QueryTable, ActionsTable, IParamsTable, IUseTableProps, TableActionEdit, TableActionCreate, IConfigurationsTable, ColumnsConfiguration, };
|