@jskit-ai/crud-ui-generator 0.1.32 → 0.1.34
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/package.descriptor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default Object.freeze({
|
|
2
2
|
packageVersion: 1,
|
|
3
3
|
packageId: "@jskit-ai/crud-ui-generator",
|
|
4
|
-
version: "0.1.
|
|
4
|
+
version: "0.1.34",
|
|
5
5
|
kind: "generator",
|
|
6
6
|
description: "Generate CRUD route trees from resource validators at an explicit route root relative to src/pages/.",
|
|
7
7
|
options: {
|
|
@@ -168,7 +168,7 @@ export default Object.freeze({
|
|
|
168
168
|
mutations: {
|
|
169
169
|
dependencies: {
|
|
170
170
|
runtime: {
|
|
171
|
-
"@jskit-ai/users-web": "0.1.
|
|
171
|
+
"@jskit-ai/users-web": "0.1.66"
|
|
172
172
|
},
|
|
173
173
|
dev: {}
|
|
174
174
|
},
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/crud-ui-generator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@jskit-ai/crud-core": "0.1.
|
|
10
|
-
"@jskit-ai/kernel": "0.1.
|
|
9
|
+
"@jskit-ai/crud-core": "0.1.59",
|
|
10
|
+
"@jskit-ai/kernel": "0.1.51"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
"./server/buildTemplateContext": "./src/server/buildTemplateContext.js"
|
|
@@ -329,6 +329,30 @@ function buildLookupFormProps(fields = []) {
|
|
|
329
329
|
:set-lookup-search="setLookupSearch"`;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
+
function buildLookupFormPropDefinitions({ createFields = [], editFields = [] } = {}) {
|
|
333
|
+
if (!hasLookupFormFields(createFields) && !hasLookupFormFields(editFields)) {
|
|
334
|
+
return "";
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
return `,
|
|
338
|
+
resolveLookupItems: {
|
|
339
|
+
type: Function,
|
|
340
|
+
required: true
|
|
341
|
+
},
|
|
342
|
+
resolveLookupLoading: {
|
|
343
|
+
type: Function,
|
|
344
|
+
required: true
|
|
345
|
+
},
|
|
346
|
+
resolveLookupSearch: {
|
|
347
|
+
type: Function,
|
|
348
|
+
required: true
|
|
349
|
+
},
|
|
350
|
+
setLookupSearch: {
|
|
351
|
+
type: Function,
|
|
352
|
+
required: true
|
|
353
|
+
}`;
|
|
354
|
+
}
|
|
355
|
+
|
|
332
356
|
function filterDefaultHiddenListFields(selectedFieldKeys, fields, { recordIdFieldKey = "" } = {}) {
|
|
333
357
|
const selectedFields = Array.isArray(selectedFieldKeys) ? selectedFieldKeys : [];
|
|
334
358
|
const availableFields = Array.isArray(fields) ? fields : [];
|
|
@@ -612,6 +636,10 @@ async function buildUiTemplateContext({ appRoot, options } = {}) {
|
|
|
612
636
|
}),
|
|
613
637
|
__JSKIT_UI_CREATE_LOOKUP_FORM_PROPS__: buildLookupFormProps(createFields),
|
|
614
638
|
__JSKIT_UI_EDIT_LOOKUP_FORM_PROPS__: buildLookupFormProps(editFields),
|
|
639
|
+
__JSKIT_UI_FORM_LOOKUP_PROP_DEFS__: buildLookupFormPropDefinitions({
|
|
640
|
+
createFields,
|
|
641
|
+
editFields
|
|
642
|
+
}),
|
|
615
643
|
__JSKIT_UI_MENU_MARKER__: menuMarker,
|
|
616
644
|
__JSKIT_UI_MENU_PLACEMENT_ID__: String(pageLinkTarget?.pageTarget?.placementId || ""),
|
|
617
645
|
__JSKIT_UI_MENU_PLACEMENT_TARGET__: String(pageLinkTarget?.placementTarget?.id || ""),
|
|
@@ -72,23 +72,8 @@ const props = defineProps({
|
|
|
72
72
|
cancelTo: {
|
|
73
73
|
type: [String, Object],
|
|
74
74
|
default: ""
|
|
75
|
-
},
|
|
76
|
-
resolveLookupItems: {
|
|
77
|
-
type: Function,
|
|
78
|
-
required: true
|
|
79
|
-
},
|
|
80
|
-
resolveLookupLoading: {
|
|
81
|
-
type: Function,
|
|
82
|
-
required: true
|
|
83
|
-
},
|
|
84
|
-
resolveLookupSearch: {
|
|
85
|
-
type: Function,
|
|
86
|
-
required: true
|
|
87
|
-
},
|
|
88
|
-
setLookupSearch: {
|
|
89
|
-
type: Function,
|
|
90
|
-
required: true
|
|
91
75
|
}
|
|
76
|
+
__JSKIT_UI_FORM_LOOKUP_PROP_DEFS__
|
|
92
77
|
});
|
|
93
78
|
|
|
94
79
|
const formRuntime = props.formRuntime;
|
|
@@ -465,6 +465,7 @@ test("buildUiTemplateContext omits lookup runtime placeholders when form fields
|
|
|
465
465
|
assert.equal(context.__JSKIT_UI_EDIT_LOOKUP_RUNTIME_SETUP__, "");
|
|
466
466
|
assert.equal(context.__JSKIT_UI_CREATE_LOOKUP_FORM_PROPS__, "");
|
|
467
467
|
assert.equal(context.__JSKIT_UI_EDIT_LOOKUP_FORM_PROPS__, "");
|
|
468
|
+
assert.equal(context.__JSKIT_UI_FORM_LOOKUP_PROP_DEFS__, "");
|
|
468
469
|
});
|
|
469
470
|
});
|
|
470
471
|
|
|
@@ -501,6 +502,7 @@ test("buildUiTemplateContext includes lookup runtime placeholders when form fiel
|
|
|
501
502
|
assert.match(context.__JSKIT_UI_EDIT_LOOKUP_RUNTIME_SETUP__, /resolveLookupItems/);
|
|
502
503
|
assert.match(context.__JSKIT_UI_CREATE_LOOKUP_FORM_PROPS__, /resolve-lookup-items/);
|
|
503
504
|
assert.match(context.__JSKIT_UI_EDIT_LOOKUP_FORM_PROPS__, /resolve-lookup-items/);
|
|
505
|
+
assert.match(context.__JSKIT_UI_FORM_LOOKUP_PROP_DEFS__, /resolveLookupItems/);
|
|
504
506
|
});
|
|
505
507
|
});
|
|
506
508
|
|