infinity-forge 0.21.4 → 0.21.6
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/dist/system/presentation/hooks/ui/use-table/component.js +2 -2
- package/dist/system/presentation/hooks/ui/use-table/component.js.map +1 -1
- package/dist/system/presentation/hooks/ui/use-table/index.d.ts +1 -0
- package/dist/system/presentation/hooks/ui/use-table/index.js +1 -0
- package/dist/system/presentation/hooks/ui/use-table/index.js.map +1 -1
- package/dist/system/presentation/hooks/ui/use-table/query/get-key-query-table.d.ts +4 -0
- package/dist/system/presentation/hooks/ui/use-table/query/get-key-query-table.js +22 -0
- package/dist/system/presentation/hooks/ui/use-table/query/get-key-query-table.js.map +1 -0
- package/dist/system/presentation/hooks/ui/use-table/query/hook.d.ts +5 -0
- package/dist/system/presentation/hooks/ui/use-table/query/hook.js +53 -0
- package/dist/system/presentation/hooks/ui/use-table/query/hook.js.map +1 -0
- package/dist/system/presentation/hooks/ui/use-table/query/index.d.ts +1 -0
- package/dist/system/presentation/hooks/ui/use-table/query/index.js +18 -0
- package/dist/system/presentation/hooks/ui/use-table/query/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -14,9 +14,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.useTable = void 0;
|
|
15
15
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
var components_1 = require("./components/index.js");
|
|
17
|
-
var
|
|
17
|
+
var hook_1 = require("./query/hook.js");
|
|
18
18
|
function useTable(props) {
|
|
19
|
-
var queryTable = props.query && (0,
|
|
19
|
+
var queryTable = props.query && (0, hook_1.useQueryTable)(props.query);
|
|
20
20
|
return {
|
|
21
21
|
query: queryTable,
|
|
22
22
|
Table: (0, jsx_runtime_1.jsx)(components_1.Table, __assign({}, props, { isFetching: queryTable === null || queryTable === void 0 ? void 0 : queryTable.isLoading, tableInformations: queryTable === null || queryTable === void 0 ? void 0 : queryTable.data })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../src/system/presentation/hooks/ui/use-table/component.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../src/system/presentation/hooks/ui/use-table/component.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoC;AACpC,qCAA4C;AAI5C,SAAgB,QAAQ,CAAmB,KAA2B;IAEpE,IAAM,UAAU,GAAG,KAAK,CAAC,KAAK,IAAI,IAAA,oBAAa,EAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAE5D,OAAO;QACL,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,uBAAC,kBAAK,eAAK,KAAK,IAAE,UAAU,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,IAAK;KACrG,CAAA;AACH,CAAC;AARD,4BAQC"}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./query.js"), exports);
|
|
17
18
|
__exportStar(require("./component.js"), exports);
|
|
18
19
|
__exportStar(require("./components/index.js"), exports);
|
|
19
20
|
__exportStar(require("./interfaces.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/system/presentation/hooks/ui/use-table/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,+CAA6B;AAC7B,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/system/presentation/hooks/ui/use-table/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,8CAA4B;AAC5B,+CAA6B;AAC7B,+CAA6B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGetKeyQueryTable = void 0;
|
|
4
|
+
var router_1 = require("next/router");
|
|
5
|
+
function useGetKeyQueryTable() {
|
|
6
|
+
var _a = (0, router_1.useRouter)(), query = _a.query, isReady = _a.isReady;
|
|
7
|
+
function getKeyQueryTable(_a) {
|
|
8
|
+
var dynamicFiltersFromApi = _a.dynamicFiltersFromApi, requireUser = _a.requireUser, user = _a.user, queryKey = _a.queryKey;
|
|
9
|
+
var enabled = requireUser ? user : true;
|
|
10
|
+
var KEY_TABLE = enabled
|
|
11
|
+
? dynamicFiltersFromApi
|
|
12
|
+
? isReady
|
|
13
|
+
? queryKey + JSON.stringify(query)
|
|
14
|
+
: null
|
|
15
|
+
: queryKey
|
|
16
|
+
: null;
|
|
17
|
+
return KEY_TABLE;
|
|
18
|
+
}
|
|
19
|
+
return { getKeyQueryTable: getKeyQueryTable };
|
|
20
|
+
}
|
|
21
|
+
exports.useGetKeyQueryTable = useGetKeyQueryTable;
|
|
22
|
+
//# sourceMappingURL=get-key-query-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-key-query-table.js","sourceRoot":"","sources":["../../../../../../../src/system/presentation/hooks/ui/use-table/query/get-key-query-table.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AAGvC,SAAgB,mBAAmB;IAC3B,IAAA,KAAqB,IAAA,kBAAS,GAAE,EAA9B,KAAK,WAAA,EAAE,OAAO,aAAgB,CAAA;IAEtC,SAAS,gBAAgB,CAAC,EAAkE;YAAhE,qBAAqB,2BAAA,EAAE,WAAW,iBAAA,EAAE,IAAI,UAAA,EAAE,QAAQ,cAAA;QAC5E,IAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;QAEzC,IAAM,SAAS,GAAG,OAAO;YACvB,CAAC,CAAC,qBAAqB;gBACrB,CAAC,CAAC,OAAO;oBACP,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;oBAClC,CAAC,CAAC,IAAI;gBACR,CAAC,CAAC,QAAQ;YACZ,CAAC,CAAC,IAAI,CAAA;QAEN,OAAO,SAAS,CAAA;IACpB,CAAC;IAED,OAAO,EAAE,gBAAgB,kBAAA,EAAE,CAAA;AAC7B,CAAC;AAlBD,kDAkBC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.useQueryTable = void 0;
|
|
18
|
+
var swr_1 = __importDefault(require("swr"));
|
|
19
|
+
var router_1 = require("next/router");
|
|
20
|
+
var ui_1 = require("../../../../../../ui/index.js");
|
|
21
|
+
var get_key_query_table_1 = require("./get-key-query-table.js");
|
|
22
|
+
function useQueryTable(props) {
|
|
23
|
+
var _a;
|
|
24
|
+
var query = (0, router_1.useRouter)().query;
|
|
25
|
+
var getKeyQueryTable = (0, get_key_query_table_1.useGetKeyQueryTable)().getKeyQueryTable;
|
|
26
|
+
var KEY_TABLE = getKeyQueryTable(props);
|
|
27
|
+
var enabled = props.requireUser ? props.user : true;
|
|
28
|
+
var REMOTE = props.container && ((_a = props.container) === null || _a === void 0 ? void 0 : _a.get(props.Types[props.queryKey]));
|
|
29
|
+
var queryFiltersBase64 = (0, ui_1.fromBase64ToString)(query.filters);
|
|
30
|
+
var params = __assign(__assign({}, query), { orderColumn: undefined, asc: undefined, order: query.orderColumn && { column: query.orderColumn, asc: !!(query.asc === 'true') }, filters: queryFiltersBase64.filters });
|
|
31
|
+
var tableResponse = (0, swr_1.default)(REMOTE && KEY_TABLE, function () { return REMOTE.loadAll(params); });
|
|
32
|
+
var configurations = (0, swr_1.default)(REMOTE && props.dynamicFiltersFromApi && "".concat(props.queryKey, "/Table"), function () { return REMOTE.loadTable(); });
|
|
33
|
+
if (props.debugMode) {
|
|
34
|
+
console.log({
|
|
35
|
+
enabled: enabled,
|
|
36
|
+
REMOTE: REMOTE,
|
|
37
|
+
KEY_TABLE: KEY_TABLE,
|
|
38
|
+
queryFiltersBase64: queryFiltersBase64,
|
|
39
|
+
params: params,
|
|
40
|
+
data: tableResponse.data,
|
|
41
|
+
isLoading: tableResponse.isLoading,
|
|
42
|
+
error: tableResponse.error,
|
|
43
|
+
loadAll: REMOTE.loadAll,
|
|
44
|
+
configurations: configurations,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
data: __assign(__assign({}, tableResponse.data), configurations === null || configurations === void 0 ? void 0 : configurations.data),
|
|
49
|
+
isLoading: (configurations === null || configurations === void 0 ? void 0 : configurations.isLoading) || tableResponse.isLoading || tableResponse.isValidating,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.useQueryTable = useQueryTable;
|
|
53
|
+
//# sourceMappingURL=hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../../../../../src/system/presentation/hooks/ui/use-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C,SAAS,EAAE,EAAlB,CAAkB,CAAC,CAAA;IAE3H,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC;YACV,OAAO,SAAA;YACP,MAAM,QAAA;YACN,SAAS,WAAA;YACT,kBAAkB,oBAAA;YAClB,MAAM,QAAA;YACN,IAAI,EAAE,aAAa,CAAC,IAAI;YACxB,SAAS,EAAE,aAAa,CAAC,SAAS;YAClC,KAAK,EAAE,aAAa,CAAC,KAAK;YAC1B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,cAAc,gBAAA;SACf,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,IAAI,wBAAO,aAAa,CAAC,IAAI,GAAK,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI,CAAE;QACxD,SAAS,EAAE,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,SAAS,KAAI,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,YAAY;KAC9F,CAAA;AACH,CAAC;AA1CD,sCA0CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./hook.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hook.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/system/presentation/hooks/ui/use-table/query/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB"}
|