fastapi-rtk 0.2.15 → 0.2.17
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/.external/cjs/{mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.2_yup@1.6.1 → mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.2_yup@1.7.0}/mantine-form-yup-resolver/dist/esm/index.cjs +1 -1
- package/dist/.external/cjs/{yup@1.6.1 → yup@1.7.0}/yup/index.esm.cjs +140 -11
- package/dist/.external/esm/{mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.2_yup@1.6.1 → mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.2_yup@1.7.0}/mantine-form-yup-resolver/dist/esm/index.mjs +1 -1
- package/dist/.external/esm/{yup@1.6.1 → yup@1.7.0}/yup/index.esm.mjs +140 -11
- package/dist/core/cjs/ActionIcons/View/ViewDialog.cjs +2 -3
- package/dist/core/cjs/Tables/DataGrid/FormField/Inputs/FormRelatedListSelect.cjs +2 -3
- package/dist/core/cjs/Tables/DataGrid/FormField/Inputs/FormRelatedSelect.cjs +3 -4
- package/dist/core/cjs/Tables/DataGrid/Main/Body/Body.cjs +2 -3
- package/dist/core/cjs/Tables/DataGrid/Toolbar/Filter/FilterMenu.cjs +2 -2
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderMultiSelectInput.cjs +1 -2
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/utils.cjs +2 -3
- package/dist/core/cjs/Wrappers/ApiProvider/ApiProvider.cjs +18 -28
- package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideApi.cjs +31 -20
- package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideBulk.cjs +5 -3
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/createItem.cjs +2 -7
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/deleteItem.cjs +1 -2
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/downloadItems.cjs +1 -2
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/formCreateItem.cjs +4 -13
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/formUpdateItem.cjs +4 -13
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getInfo.cjs +2 -6
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getItem.cjs +1 -2
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getItems.cjs +1 -2
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/updateItem.cjs +1 -2
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/uploadItems.cjs +1 -2
- package/dist/core/cjs/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.cjs +1 -14
- package/dist/core/cjs/Wrappers/ApiProvider/utils/getValidationSchema.cjs +1 -1
- package/dist/core/cjs/Wrappers/Provider/Provider.cjs +8 -15
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideAuth.cjs +55 -24
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideInfo.cjs +4 -3
- package/dist/core/cjs/Wrappers/Provider/utils/authFetch.cjs +1 -1
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideApi.cjs +25 -299
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideBulk.cjs +3 -25
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getItems.cjs +1 -2
- package/dist/core/cjs/fab-react-toolkit-patch/auth/hooks/useProvideAuth.cjs +9 -56
- package/dist/core/cjs/fab-react-toolkit-patch/auth/hooks/useProvideInfo.cjs +2 -16
- package/dist/core/cjs/fab-react-toolkit-patch/auth/utils/authFetch.cjs +1 -1
- package/dist/core/esm/ActionIcons/View/ViewDialog.mjs +1 -2
- package/dist/core/esm/Tables/DataGrid/FormField/Inputs/FormRelatedListSelect.mjs +1 -2
- package/dist/core/esm/Tables/DataGrid/FormField/Inputs/FormRelatedSelect.mjs +1 -2
- package/dist/core/esm/Tables/DataGrid/Main/Body/Body.mjs +1 -2
- package/dist/core/esm/Tables/DataGrid/Toolbar/Filter/FilterMenu.mjs +2 -2
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderMultiSelectInput.mjs +1 -2
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/utils.mjs +1 -2
- package/dist/core/esm/Wrappers/ApiProvider/ApiProvider.mjs +21 -31
- package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideApi.mjs +30 -19
- package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideBulk.mjs +5 -3
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/createItem.mjs +2 -7
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/deleteItem.mjs +1 -2
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/downloadItems.mjs +1 -2
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/formCreateItem.mjs +3 -12
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/formUpdateItem.mjs +3 -12
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getInfo.mjs +2 -6
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getItem.mjs +1 -2
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getItems.mjs +1 -2
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/updateItem.mjs +1 -2
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/uploadItems.mjs +1 -2
- package/dist/core/esm/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.mjs +2 -15
- package/dist/core/esm/Wrappers/ApiProvider/utils/getValidationSchema.mjs +2 -2
- package/dist/core/esm/Wrappers/Provider/Provider.mjs +11 -18
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideAuth.mjs +58 -27
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideInfo.mjs +4 -3
- package/dist/core/esm/Wrappers/Provider/utils/authFetch.mjs +2 -2
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideApi.mjs +25 -299
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideBulk.mjs +3 -25
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getItems.mjs +1 -2
- package/dist/core/esm/fab-react-toolkit-patch/auth/hooks/useProvideAuth.mjs +11 -58
- package/dist/core/esm/fab-react-toolkit-patch/auth/hooks/useProvideInfo.mjs +2 -16
- package/dist/core/esm/fab-react-toolkit-patch/auth/utils/authFetch.mjs +1 -1
- package/dist/core/lib/Wrappers/ApiProvider/ApiProvider.d.ts +15 -0
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideApi.d.ts +11 -0
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideBulk.d.ts +7 -1
- package/dist/core/lib/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.d.ts +1 -1
- package/dist/core/lib/Wrappers/Provider/hooks/useProvideAuth.d.ts +16 -6
- package/dist/core/lib/Wrappers/Provider/hooks/useProvideInfo.d.ts +4 -1
- package/dist/core/lib/Wrappers/Provider/utils/authFetch.d.ts +2 -3
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideApi.d.ts +20 -41
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideBulk.d.ts +4 -11
- package/dist/core/lib/fab-react-toolkit-patch/auth/hooks/useProvideAuth.d.ts +10 -15
- package/dist/core/lib/fab-react-toolkit-patch/auth/hooks/useProvideInfo.d.ts +4 -7
- package/dist/core/lib/fab-react-toolkit-patch/auth/utils/authFetch.d.ts +2 -2
- package/dist/core/lib/hooks/auth/useAuth.d.ts +1 -1
- package/dist/utils/cjs/index.cjs +6 -0
- package/dist/{core/cjs/fab-react-toolkit-patch/api/utils/api/utils → utils/cjs/parseResponse}/parseResponse.cjs +3 -1
- package/dist/utils/esm/index.mjs +6 -0
- package/dist/{core/esm/fab-react-toolkit-patch/api/utils/api/utils → utils/esm/parseResponse}/parseResponse.mjs +3 -1
- package/dist/utils/lib/convertId/index.d.ts +1 -0
- package/dist/utils/lib/convertToFormData/index.d.ts +1 -0
- package/dist/utils/lib/index.d.ts +3 -0
- package/dist/utils/lib/parseResponse/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/utils/parseResponse.cjs +0 -19
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/createItem.cjs +0 -14
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/deleteItem.cjs +0 -10
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getInfo.cjs +0 -13
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getItem.cjs +0 -10
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/updateItem.cjs +0 -10
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/uploadItems.cjs +0 -27
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/bulkActions/postBulkAction.cjs +0 -26
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/convertId.cjs +0 -12
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/convertInfo.cjs +0 -20
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/createQueryParams.cjs +0 -18
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/getDefaultValues.cjs +0 -28
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/getValidationSchema.cjs +0 -38
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/utils/parseResponse.mjs +0 -19
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/createItem.mjs +0 -14
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/deleteItem.mjs +0 -10
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getInfo.mjs +0 -13
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getItem.mjs +0 -10
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/updateItem.mjs +0 -10
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/uploadItems.mjs +0 -27
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/bulkActions/postBulkAction.mjs +0 -26
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/convertId.mjs +0 -12
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/convertInfo.mjs +0 -20
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/createQueryParams.mjs +0 -18
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/getDefaultValues.mjs +0 -28
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/getValidationSchema.mjs +0 -39
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/createItem.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/deleteItem.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/getInfo.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/getItem.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/updateItem.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/uploadItems.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/utils/parseResponse.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/bulkActions/postBulkAction.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/convertId.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/convertInfo.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/createQueryParams.d.ts +0 -10
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/getDefaultValues.d.ts +0 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/getValidationSchema.d.ts +0 -6
- /package/dist/.external/cjs/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/suspense.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.cjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/suspense.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_react-query@5.83.1_react@18.3.1 → @tanstack_react-query@5.84.1_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.mjs +0 -0
- /package/dist/{core/cjs/Wrappers/ApiProvider/utils → utils/cjs/convertId}/convertId.cjs +0 -0
- /package/dist/{core/cjs/Wrappers/ApiProvider/utils/api/utils → utils/cjs/convertToFormData}/convertToFormData.cjs +0 -0
- /package/dist/{core/esm/Wrappers/ApiProvider/utils → utils/esm/convertId}/convertId.mjs +0 -0
- /package/dist/{core/esm/Wrappers/ApiProvider/utils/api/utils → utils/esm/convertToFormData}/convertToFormData.mjs +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils → utils/lib/convertId}/convertId.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/utils → utils/lib/convertToFormData}/convertToFormData.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/utils → utils/lib/parseResponse}/parseResponse.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index_esm = require("../../../../yup@1.
|
|
3
|
+
const index_esm = require("../../../../yup@1.7.0/yup/index.esm.cjs");
|
|
4
4
|
function yupResolver(schema) {
|
|
5
5
|
return (values) => {
|
|
6
6
|
try {
|
|
@@ -314,19 +314,20 @@ function createValidation(config) {
|
|
|
314
314
|
abortEarly = schema.spec.abortEarly,
|
|
315
315
|
disableStackTrace = schema.spec.disableStackTrace
|
|
316
316
|
} = options;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
317
|
+
const resolveOptions = {
|
|
318
|
+
value,
|
|
319
|
+
parent,
|
|
320
|
+
context
|
|
321
|
+
};
|
|
320
322
|
function createError(overrides = {}) {
|
|
321
|
-
const nextParams = Object.assign({
|
|
323
|
+
const nextParams = resolveParams(Object.assign({
|
|
322
324
|
value,
|
|
323
325
|
originalValue,
|
|
324
326
|
label: schema.spec.label,
|
|
325
327
|
path: overrides.path || path,
|
|
326
328
|
spec: schema.spec,
|
|
327
329
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
328
|
-
}, params, overrides.params);
|
|
329
|
-
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
330
|
+
}, params, overrides.params), resolveOptions);
|
|
330
331
|
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
|
|
331
332
|
error.params = nextParams;
|
|
332
333
|
return error;
|
|
@@ -338,7 +339,9 @@ function createValidation(config) {
|
|
|
338
339
|
type: name,
|
|
339
340
|
from: options.from,
|
|
340
341
|
createError,
|
|
341
|
-
resolve
|
|
342
|
+
resolve(item) {
|
|
343
|
+
return resolveMaybeRef(item, resolveOptions);
|
|
344
|
+
},
|
|
342
345
|
options,
|
|
343
346
|
originalValue,
|
|
344
347
|
schema
|
|
@@ -375,6 +378,16 @@ function createValidation(config) {
|
|
|
375
378
|
validate.OPTIONS = config;
|
|
376
379
|
return validate;
|
|
377
380
|
}
|
|
381
|
+
function resolveParams(params, options) {
|
|
382
|
+
if (!params) return params;
|
|
383
|
+
for (const key of Object.keys(params)) {
|
|
384
|
+
params[key] = resolveMaybeRef(params[key], options);
|
|
385
|
+
}
|
|
386
|
+
return params;
|
|
387
|
+
}
|
|
388
|
+
function resolveMaybeRef(item, options) {
|
|
389
|
+
return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
|
|
390
|
+
}
|
|
378
391
|
function getIn(schema, path, value, context = value) {
|
|
379
392
|
let parent, lastPart, lastPartDebug;
|
|
380
393
|
if (!path) return {
|
|
@@ -474,6 +487,69 @@ function clone(src, seen = /* @__PURE__ */ new Map()) {
|
|
|
474
487
|
}
|
|
475
488
|
return copy;
|
|
476
489
|
}
|
|
490
|
+
function createStandardPath(path) {
|
|
491
|
+
if (!(path != null && path.length)) {
|
|
492
|
+
return void 0;
|
|
493
|
+
}
|
|
494
|
+
const segments = [];
|
|
495
|
+
let currentSegment = "";
|
|
496
|
+
let inBrackets = false;
|
|
497
|
+
let inQuotes = false;
|
|
498
|
+
for (let i = 0; i < path.length; i++) {
|
|
499
|
+
const char = path[i];
|
|
500
|
+
if (char === "[" && !inQuotes) {
|
|
501
|
+
if (currentSegment) {
|
|
502
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
503
|
+
currentSegment = "";
|
|
504
|
+
}
|
|
505
|
+
inBrackets = true;
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
if (char === "]" && !inQuotes) {
|
|
509
|
+
if (currentSegment) {
|
|
510
|
+
if (/^\d+$/.test(currentSegment)) {
|
|
511
|
+
segments.push(currentSegment);
|
|
512
|
+
} else {
|
|
513
|
+
segments.push(currentSegment.replace(/^"|"$/g, ""));
|
|
514
|
+
}
|
|
515
|
+
currentSegment = "";
|
|
516
|
+
}
|
|
517
|
+
inBrackets = false;
|
|
518
|
+
continue;
|
|
519
|
+
}
|
|
520
|
+
if (char === '"') {
|
|
521
|
+
inQuotes = !inQuotes;
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
if (char === "." && !inBrackets && !inQuotes) {
|
|
525
|
+
if (currentSegment) {
|
|
526
|
+
segments.push(currentSegment);
|
|
527
|
+
currentSegment = "";
|
|
528
|
+
}
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
currentSegment += char;
|
|
532
|
+
}
|
|
533
|
+
if (currentSegment) {
|
|
534
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
535
|
+
}
|
|
536
|
+
return segments;
|
|
537
|
+
}
|
|
538
|
+
function createStandardIssues(error, parentPath) {
|
|
539
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
540
|
+
return error.errors.map((err) => ({
|
|
541
|
+
message: err,
|
|
542
|
+
path: createStandardPath(path)
|
|
543
|
+
}));
|
|
544
|
+
}
|
|
545
|
+
function issuesFromValidationError(error, parentPath) {
|
|
546
|
+
var _error$inner;
|
|
547
|
+
if (!((_error$inner = error.inner) != null && _error$inner.length) && error.errors.length) {
|
|
548
|
+
return createStandardIssues(error, parentPath);
|
|
549
|
+
}
|
|
550
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
551
|
+
return error.inner.flatMap((err) => issuesFromValidationError(err, path));
|
|
552
|
+
}
|
|
477
553
|
class Schema {
|
|
478
554
|
constructor(options) {
|
|
479
555
|
this.type = void 0;
|
|
@@ -1017,13 +1093,41 @@ attempted value: ${formattedValue}
|
|
|
1017
1093
|
type: next.type,
|
|
1018
1094
|
oneOf: next._whitelist.describe(),
|
|
1019
1095
|
notOneOf: next._blacklist.describe(),
|
|
1020
|
-
tests: next.tests.map((fn) =>
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1096
|
+
tests: next.tests.filter((n, idx, list) => list.findIndex((c) => c.OPTIONS.name === n.OPTIONS.name) === idx).map((fn) => {
|
|
1097
|
+
const params = fn.OPTIONS.params && options ? resolveParams(Object.assign({}, fn.OPTIONS.params), options) : fn.OPTIONS.params;
|
|
1098
|
+
return {
|
|
1099
|
+
name: fn.OPTIONS.name,
|
|
1100
|
+
params
|
|
1101
|
+
};
|
|
1102
|
+
})
|
|
1024
1103
|
};
|
|
1025
1104
|
return description;
|
|
1026
1105
|
}
|
|
1106
|
+
get ["~standard"]() {
|
|
1107
|
+
const schema = this;
|
|
1108
|
+
const standard = {
|
|
1109
|
+
version: 1,
|
|
1110
|
+
vendor: "yup",
|
|
1111
|
+
async validate(value) {
|
|
1112
|
+
try {
|
|
1113
|
+
const result = await schema.validate(value, {
|
|
1114
|
+
abortEarly: false
|
|
1115
|
+
});
|
|
1116
|
+
return {
|
|
1117
|
+
value: result
|
|
1118
|
+
};
|
|
1119
|
+
} catch (err) {
|
|
1120
|
+
if (err instanceof ValidationError) {
|
|
1121
|
+
return {
|
|
1122
|
+
issues: issuesFromValidationError(err)
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
throw err;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1129
|
+
return standard;
|
|
1130
|
+
}
|
|
1027
1131
|
}
|
|
1028
1132
|
Schema.prototype.__isYupSchema__ = true;
|
|
1029
1133
|
for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At`] = function(path, value, options = {}) {
|
|
@@ -2286,6 +2390,31 @@ class Lazy {
|
|
|
2286
2390
|
next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);
|
|
2287
2391
|
return next;
|
|
2288
2392
|
}
|
|
2393
|
+
get ["~standard"]() {
|
|
2394
|
+
const schema = this;
|
|
2395
|
+
const standard = {
|
|
2396
|
+
version: 1,
|
|
2397
|
+
vendor: "yup",
|
|
2398
|
+
async validate(value) {
|
|
2399
|
+
try {
|
|
2400
|
+
const result = await schema.validate(value, {
|
|
2401
|
+
abortEarly: false
|
|
2402
|
+
});
|
|
2403
|
+
return {
|
|
2404
|
+
value: result
|
|
2405
|
+
};
|
|
2406
|
+
} catch (err) {
|
|
2407
|
+
if (ValidationError.isError(err)) {
|
|
2408
|
+
return {
|
|
2409
|
+
issues: issuesFromValidationError(err)
|
|
2410
|
+
};
|
|
2411
|
+
}
|
|
2412
|
+
throw err;
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
};
|
|
2416
|
+
return standard;
|
|
2417
|
+
}
|
|
2289
2418
|
}
|
|
2290
2419
|
function setLocale(custom) {
|
|
2291
2420
|
Object.keys(custom).forEach((type) => {
|
|
@@ -312,19 +312,20 @@ function createValidation(config) {
|
|
|
312
312
|
abortEarly = schema.spec.abortEarly,
|
|
313
313
|
disableStackTrace = schema.spec.disableStackTrace
|
|
314
314
|
} = options;
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
const resolveOptions = {
|
|
316
|
+
value,
|
|
317
|
+
parent,
|
|
318
|
+
context
|
|
319
|
+
};
|
|
318
320
|
function createError(overrides = {}) {
|
|
319
|
-
const nextParams = Object.assign({
|
|
321
|
+
const nextParams = resolveParams(Object.assign({
|
|
320
322
|
value,
|
|
321
323
|
originalValue,
|
|
322
324
|
label: schema.spec.label,
|
|
323
325
|
path: overrides.path || path,
|
|
324
326
|
spec: schema.spec,
|
|
325
327
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
326
|
-
}, params, overrides.params);
|
|
327
|
-
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
328
|
+
}, params, overrides.params), resolveOptions);
|
|
328
329
|
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
|
|
329
330
|
error.params = nextParams;
|
|
330
331
|
return error;
|
|
@@ -336,7 +337,9 @@ function createValidation(config) {
|
|
|
336
337
|
type: name,
|
|
337
338
|
from: options.from,
|
|
338
339
|
createError,
|
|
339
|
-
resolve
|
|
340
|
+
resolve(item) {
|
|
341
|
+
return resolveMaybeRef(item, resolveOptions);
|
|
342
|
+
},
|
|
340
343
|
options,
|
|
341
344
|
originalValue,
|
|
342
345
|
schema
|
|
@@ -373,6 +376,16 @@ function createValidation(config) {
|
|
|
373
376
|
validate.OPTIONS = config;
|
|
374
377
|
return validate;
|
|
375
378
|
}
|
|
379
|
+
function resolveParams(params, options) {
|
|
380
|
+
if (!params) return params;
|
|
381
|
+
for (const key of Object.keys(params)) {
|
|
382
|
+
params[key] = resolveMaybeRef(params[key], options);
|
|
383
|
+
}
|
|
384
|
+
return params;
|
|
385
|
+
}
|
|
386
|
+
function resolveMaybeRef(item, options) {
|
|
387
|
+
return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
|
|
388
|
+
}
|
|
376
389
|
function getIn(schema, path, value, context = value) {
|
|
377
390
|
let parent, lastPart, lastPartDebug;
|
|
378
391
|
if (!path) return {
|
|
@@ -472,6 +485,69 @@ function clone(src, seen = /* @__PURE__ */ new Map()) {
|
|
|
472
485
|
}
|
|
473
486
|
return copy;
|
|
474
487
|
}
|
|
488
|
+
function createStandardPath(path) {
|
|
489
|
+
if (!(path != null && path.length)) {
|
|
490
|
+
return void 0;
|
|
491
|
+
}
|
|
492
|
+
const segments = [];
|
|
493
|
+
let currentSegment = "";
|
|
494
|
+
let inBrackets = false;
|
|
495
|
+
let inQuotes = false;
|
|
496
|
+
for (let i = 0; i < path.length; i++) {
|
|
497
|
+
const char = path[i];
|
|
498
|
+
if (char === "[" && !inQuotes) {
|
|
499
|
+
if (currentSegment) {
|
|
500
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
501
|
+
currentSegment = "";
|
|
502
|
+
}
|
|
503
|
+
inBrackets = true;
|
|
504
|
+
continue;
|
|
505
|
+
}
|
|
506
|
+
if (char === "]" && !inQuotes) {
|
|
507
|
+
if (currentSegment) {
|
|
508
|
+
if (/^\d+$/.test(currentSegment)) {
|
|
509
|
+
segments.push(currentSegment);
|
|
510
|
+
} else {
|
|
511
|
+
segments.push(currentSegment.replace(/^"|"$/g, ""));
|
|
512
|
+
}
|
|
513
|
+
currentSegment = "";
|
|
514
|
+
}
|
|
515
|
+
inBrackets = false;
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
if (char === '"') {
|
|
519
|
+
inQuotes = !inQuotes;
|
|
520
|
+
continue;
|
|
521
|
+
}
|
|
522
|
+
if (char === "." && !inBrackets && !inQuotes) {
|
|
523
|
+
if (currentSegment) {
|
|
524
|
+
segments.push(currentSegment);
|
|
525
|
+
currentSegment = "";
|
|
526
|
+
}
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
currentSegment += char;
|
|
530
|
+
}
|
|
531
|
+
if (currentSegment) {
|
|
532
|
+
segments.push(...currentSegment.split(".").filter(Boolean));
|
|
533
|
+
}
|
|
534
|
+
return segments;
|
|
535
|
+
}
|
|
536
|
+
function createStandardIssues(error, parentPath) {
|
|
537
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
538
|
+
return error.errors.map((err) => ({
|
|
539
|
+
message: err,
|
|
540
|
+
path: createStandardPath(path)
|
|
541
|
+
}));
|
|
542
|
+
}
|
|
543
|
+
function issuesFromValidationError(error, parentPath) {
|
|
544
|
+
var _error$inner;
|
|
545
|
+
if (!((_error$inner = error.inner) != null && _error$inner.length) && error.errors.length) {
|
|
546
|
+
return createStandardIssues(error, parentPath);
|
|
547
|
+
}
|
|
548
|
+
const path = parentPath ? `${parentPath}.${error.path}` : error.path;
|
|
549
|
+
return error.inner.flatMap((err) => issuesFromValidationError(err, path));
|
|
550
|
+
}
|
|
475
551
|
class Schema {
|
|
476
552
|
constructor(options) {
|
|
477
553
|
this.type = void 0;
|
|
@@ -1015,13 +1091,41 @@ attempted value: ${formattedValue}
|
|
|
1015
1091
|
type: next.type,
|
|
1016
1092
|
oneOf: next._whitelist.describe(),
|
|
1017
1093
|
notOneOf: next._blacklist.describe(),
|
|
1018
|
-
tests: next.tests.map((fn) =>
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1094
|
+
tests: next.tests.filter((n, idx, list) => list.findIndex((c) => c.OPTIONS.name === n.OPTIONS.name) === idx).map((fn) => {
|
|
1095
|
+
const params = fn.OPTIONS.params && options ? resolveParams(Object.assign({}, fn.OPTIONS.params), options) : fn.OPTIONS.params;
|
|
1096
|
+
return {
|
|
1097
|
+
name: fn.OPTIONS.name,
|
|
1098
|
+
params
|
|
1099
|
+
};
|
|
1100
|
+
})
|
|
1022
1101
|
};
|
|
1023
1102
|
return description;
|
|
1024
1103
|
}
|
|
1104
|
+
get ["~standard"]() {
|
|
1105
|
+
const schema = this;
|
|
1106
|
+
const standard = {
|
|
1107
|
+
version: 1,
|
|
1108
|
+
vendor: "yup",
|
|
1109
|
+
async validate(value) {
|
|
1110
|
+
try {
|
|
1111
|
+
const result = await schema.validate(value, {
|
|
1112
|
+
abortEarly: false
|
|
1113
|
+
});
|
|
1114
|
+
return {
|
|
1115
|
+
value: result
|
|
1116
|
+
};
|
|
1117
|
+
} catch (err) {
|
|
1118
|
+
if (err instanceof ValidationError) {
|
|
1119
|
+
return {
|
|
1120
|
+
issues: issuesFromValidationError(err)
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
throw err;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
return standard;
|
|
1128
|
+
}
|
|
1025
1129
|
}
|
|
1026
1130
|
Schema.prototype.__isYupSchema__ = true;
|
|
1027
1131
|
for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At`] = function(path, value, options = {}) {
|
|
@@ -2284,6 +2388,31 @@ class Lazy {
|
|
|
2284
2388
|
next.spec.meta = Object.assign(next.spec.meta || {}, args[0]);
|
|
2285
2389
|
return next;
|
|
2286
2390
|
}
|
|
2391
|
+
get ["~standard"]() {
|
|
2392
|
+
const schema = this;
|
|
2393
|
+
const standard = {
|
|
2394
|
+
version: 1,
|
|
2395
|
+
vendor: "yup",
|
|
2396
|
+
async validate(value) {
|
|
2397
|
+
try {
|
|
2398
|
+
const result = await schema.validate(value, {
|
|
2399
|
+
abortEarly: false
|
|
2400
|
+
});
|
|
2401
|
+
return {
|
|
2402
|
+
value: result
|
|
2403
|
+
};
|
|
2404
|
+
} catch (err) {
|
|
2405
|
+
if (ValidationError.isError(err)) {
|
|
2406
|
+
return {
|
|
2407
|
+
issues: issuesFromValidationError(err)
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
throw err;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
};
|
|
2414
|
+
return standard;
|
|
2415
|
+
}
|
|
2287
2416
|
}
|
|
2288
2417
|
function setLocale(custom) {
|
|
2289
2418
|
Object.keys(custom).forEach((type) => {
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const utils = require("fastapi-rtk/utils");
|
|
5
5
|
const core = require("@mantine/core");
|
|
6
|
-
const convertId = require("../../Wrappers/ApiProvider/utils/convertId.cjs");
|
|
7
6
|
const RelationPanel = require("./RelationPanel.cjs");
|
|
8
7
|
function ViewDialog({ item, info, opened, onClose, ...props }) {
|
|
9
8
|
const defaultProps = {
|
|
@@ -18,7 +17,7 @@ function ViewDialog({ item, info, opened, onClose, ...props }) {
|
|
|
18
17
|
{
|
|
19
18
|
opened,
|
|
20
19
|
onClose,
|
|
21
|
-
title: `${item == null ? void 0 : item.show_title} (#${
|
|
20
|
+
title: `${item == null ? void 0 : item.show_title} (#${utils.convertId(utils.getItemId(item))})`,
|
|
22
21
|
size: "lg",
|
|
23
22
|
centered: true,
|
|
24
23
|
zIndex: 1e3,
|
|
@@ -42,7 +41,7 @@ function ViewDialog({ item, info, opened, onClose, ...props }) {
|
|
|
42
41
|
RelationPanel,
|
|
43
42
|
{
|
|
44
43
|
relatedPath: relation.path,
|
|
45
|
-
id:
|
|
44
|
+
id: utils.convertId(utils.getItemId(item)),
|
|
46
45
|
foreign_key: relation.foreign_key,
|
|
47
46
|
type: relation.type
|
|
48
47
|
}
|
|
@@ -3,10 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const utils = require("fastapi-rtk/utils");
|
|
5
5
|
const core = require("@mantine/core");
|
|
6
|
-
const convertId = require("../../../../Wrappers/ApiProvider/utils/convertId.cjs");
|
|
7
6
|
function FormRelatedListSelect({ form, name, items, ...props }) {
|
|
8
|
-
const data = items.map((item) => ({ value: String(
|
|
9
|
-
const currentItems = Array.isArray(form.getInputProps(name).value) ? form.getInputProps(name).value.map((value) => typeof value === "object" ? String(
|
|
7
|
+
const data = items.map((item) => ({ value: String(utils.convertId(utils.getItemId(item))), label: item.value }));
|
|
8
|
+
const currentItems = Array.isArray(form.getInputProps(name).value) ? form.getInputProps(name).value.map((value) => typeof value === "object" ? String(utils.convertId(utils.getItemId(value))) : String(value)) : [];
|
|
10
9
|
return /* @__PURE__ */ jsxRuntime.jsx(core.MultiSelect, { data, searchable: true, ...form.getInputProps(name), value: currentItems || [], ...props });
|
|
11
10
|
}
|
|
12
11
|
exports.FormRelatedListSelect = FormRelatedListSelect;
|
|
@@ -3,10 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const utils = require("fastapi-rtk/utils");
|
|
5
5
|
const core = require("@mantine/core");
|
|
6
|
-
const convertId = require("../../../../Wrappers/ApiProvider/utils/convertId.cjs");
|
|
7
6
|
function FormRelatedSelect({ form, name, items, filter, ...props }) {
|
|
8
7
|
const data = items.map((item) => ({
|
|
9
|
-
value: String(
|
|
8
|
+
value: String(utils.convertId(utils.getItemId(item))),
|
|
10
9
|
label: item.value
|
|
11
10
|
}));
|
|
12
11
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20,10 +19,10 @@ function FormRelatedSelect({ form, name, items, filter, ...props }) {
|
|
|
20
19
|
form.setFieldValue(name, value);
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
const newItem = items.find((item) => String(
|
|
22
|
+
const newItem = items.find((item) => String(utils.convertId(utils.getItemId(item))) === value) || null;
|
|
24
23
|
form.setFieldValue(name, newItem);
|
|
25
24
|
},
|
|
26
|
-
value: filter ? form.getInputProps(name).value : String(
|
|
25
|
+
value: filter ? form.getInputProps(name).value : String(utils.convertId(utils.getItemId(form.getInputProps(name).value))) || "",
|
|
27
26
|
...props
|
|
28
27
|
}
|
|
29
28
|
);
|
|
@@ -5,7 +5,6 @@ const utils = require("fastapi-rtk/utils");
|
|
|
5
5
|
const core = require("@mantine/core");
|
|
6
6
|
const React = require("react");
|
|
7
7
|
const Actions = require("../../../../ActionIcons/Actions.cjs");
|
|
8
|
-
const convertId = require("../../../../Wrappers/ApiProvider/utils/convertId.cjs");
|
|
9
8
|
const Field = require("./Field/Field.cjs");
|
|
10
9
|
const Row = require("./Row/Row.cjs");
|
|
11
10
|
function ActionCustomElement({ bodyCustomizer, actionColumn, id, entry }) {
|
|
@@ -49,7 +48,7 @@ function Body({
|
|
|
49
48
|
{
|
|
50
49
|
bodyCustomizer,
|
|
51
50
|
actionColumn,
|
|
52
|
-
id:
|
|
51
|
+
id: utils.convertId(id),
|
|
53
52
|
entry
|
|
54
53
|
}
|
|
55
54
|
) }) : null,
|
|
@@ -82,7 +81,7 @@ function Body({
|
|
|
82
81
|
columnIndex
|
|
83
82
|
);
|
|
84
83
|
})
|
|
85
|
-
] },
|
|
84
|
+
] }, utils.convertId(id));
|
|
86
85
|
}) : /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
86
|
"td",
|
|
88
87
|
{
|
|
@@ -4,9 +4,9 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const core = require("@mantine/core");
|
|
5
5
|
const form = require("@mantine/form");
|
|
6
6
|
const hooks = require("@mantine/hooks");
|
|
7
|
-
const index = require("../../../../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.2_yup@1.
|
|
7
|
+
const index = require("../../../../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.2_yup@1.7.0/mantine-form-yup-resolver/dist/esm/index.cjs");
|
|
8
8
|
const React = require("react");
|
|
9
|
-
const index_esm = require("../../../../../../.external/cjs/yup@1.
|
|
9
|
+
const index_esm = require("../../../../../../.external/cjs/yup@1.7.0/yup/index.esm.cjs");
|
|
10
10
|
const useApi = require("../../../../hooks/api/useApi.cjs");
|
|
11
11
|
const FormField = require("../../FormField/FormField.cjs");
|
|
12
12
|
const FormFilterField = require("./FormFilterField.cjs");
|
|
@@ -4,11 +4,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const utils = require("fastapi-rtk/utils");
|
|
5
5
|
const core = require("@mantine/core");
|
|
6
6
|
const React = require("react");
|
|
7
|
-
const convertId = require("../../../../../../Wrappers/ApiProvider/utils/convertId.cjs");
|
|
8
7
|
const HeaderMultiSelectInput = React.forwardRef(
|
|
9
8
|
// eslint-disable-next-line no-unused-vars
|
|
10
9
|
({ data, clearIcon, mrtprops: { multiselectprops }, placeholder, ...props }, ref) => {
|
|
11
|
-
const value = Array.isArray(props.value) ? props.value.map((value2) => typeof value2 === "object" ? String(
|
|
10
|
+
const value = Array.isArray(props.value) ? props.value.map((value2) => typeof value2 === "object" ? String(utils.convertId(utils.getItemId(value2))) : String(value2)) : [];
|
|
12
11
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Box, { ...props, children: [
|
|
13
12
|
!value.length && /* @__PURE__ */ jsxRuntime.jsx(core.TextInput, { pos: "absolute", placeholder, ...props, value: void 0, onChange: void 0 }),
|
|
14
13
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const utils = require("fastapi-rtk/utils");
|
|
5
|
-
const convertId = require("../../../../Wrappers/ApiProvider/utils/convertId.cjs");
|
|
6
5
|
const HeaderBetweenInput = require("./ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.cjs");
|
|
7
6
|
const HeaderBooleanInput = require("./ColumnHeaderFilterInput/HeaderInputs/HeaderBooleanInput.cjs");
|
|
8
7
|
const HeaderDateInput = require("./ColumnHeaderFilterInput/HeaderInputs/HeaderDateInput.cjs");
|
|
@@ -47,7 +46,7 @@ const getBasicInput = (opr, schema) => {
|
|
|
47
46
|
return ({ componentProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
47
|
HeaderSelectInput.HeaderSelectInput,
|
|
49
48
|
{
|
|
50
|
-
data: schema.values.map((item) => ({ value: String(
|
|
49
|
+
data: schema.values.map((item) => ({ value: String(utils.convertId(utils.getItemId(item))), label: item.value })),
|
|
51
50
|
...componentProps
|
|
52
51
|
}
|
|
53
52
|
);
|
|
@@ -56,7 +55,7 @@ const getBasicInput = (opr, schema) => {
|
|
|
56
55
|
return ({ componentProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
56
|
HeaderMultiSelectInput.HeaderMultiSelectInput,
|
|
58
57
|
{
|
|
59
|
-
data: schema.values.map((item) => ({ value: String(
|
|
58
|
+
data: schema.values.map((item) => ({ value: String(utils.convertId(utils.getItemId(item))), label: item.value })),
|
|
60
59
|
...componentProps
|
|
61
60
|
}
|
|
62
61
|
);
|
|
@@ -13,18 +13,6 @@ const FormContext = require("./Contexts/FormContext.cjs");
|
|
|
13
13
|
const useProvideApi$1 = require("./hooks/useProvideApi.cjs");
|
|
14
14
|
const useProvideBulk$1 = require("./hooks/useProvideBulk.cjs");
|
|
15
15
|
const useProvideForm = require("./hooks/useProvideForm.cjs");
|
|
16
|
-
function useApi({ fab, ...props }) {
|
|
17
|
-
if (fab) {
|
|
18
|
-
return useProvideApi.useFabProvideApi(props);
|
|
19
|
-
}
|
|
20
|
-
return useProvideApi$1.useProvideApi(props);
|
|
21
|
-
}
|
|
22
|
-
function useBulkActions({ fab, ...props }) {
|
|
23
|
-
if (fab) {
|
|
24
|
-
return useProvideBulk.useFabProvideBulk(props);
|
|
25
|
-
}
|
|
26
|
-
return useProvideBulk$1.useProvideBulk(props);
|
|
27
|
-
}
|
|
28
16
|
function ApiProvider({
|
|
29
17
|
resource_name = "",
|
|
30
18
|
initialQueryParams,
|
|
@@ -40,23 +28,25 @@ function ApiProvider({
|
|
|
40
28
|
children
|
|
41
29
|
}) {
|
|
42
30
|
const { baseUrl, fab } = useInfo.useInfo();
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
31
|
+
const { apiParams, bulkParams } = React.useMemo(() => fab ? { apiParams: useProvideApi.defaultApi, bulkParams: useProvideBulk.defaultBulk } : {}, [fab]);
|
|
32
|
+
const api = useProvideApi$1.useProvideApi(
|
|
33
|
+
{
|
|
34
|
+
path: utils.urlJoin(baseUrl, resource_name),
|
|
35
|
+
initialQueryParams,
|
|
36
|
+
relation,
|
|
37
|
+
fetchInfo,
|
|
38
|
+
clearInfoOnRefetch,
|
|
39
|
+
clearDataOnRefetch,
|
|
40
|
+
resetQueryParamsOnPathChange,
|
|
41
|
+
infoQueryProps,
|
|
42
|
+
dataQueryProps,
|
|
43
|
+
throwOnError,
|
|
44
|
+
streaming
|
|
45
|
+
},
|
|
46
|
+
apiParams
|
|
47
|
+
);
|
|
58
48
|
const apiProxy = zustand.useProxy(api);
|
|
59
|
-
const bulkActions =
|
|
49
|
+
const bulkActions = useProvideBulk$1.useProvideBulk(apiProxy, bulkParams);
|
|
60
50
|
const bulkActionsProxy = zustand.useProxy(bulkActions);
|
|
61
51
|
const formAdd = useProvideForm.useProvideForm();
|
|
62
52
|
const [formAddProxy] = React.useState(() => zustand.createProxy(formAdd));
|