@sealcode/sealgen 0.19.6 → 0.19.8
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/lib/forms/fields/field.js +1 -1
- package/lib/forms/fields/phone-number-with-country-code.js +2 -2
- package/lib/templates/shared/collection-create-form.js +1 -1
- package/lib/templates/shared/collection-edit-form.js +1 -1
- package/package.json +1 -1
- package/src/forms/fields/field.ts +1 -1
- package/src/forms/fields/phone-number-with-country-code.ts +2 -2
- package/src/templates/shared/collection-create-form.ts +1 -1
- package/src/templates/shared/collection-edit-form.ts +1 -1
|
@@ -109,7 +109,7 @@ class FormField {
|
|
|
109
109
|
return `${wrapKeyName(field_info.name)}: await ${vars.form_fields}${wrapAttribute(field_info.name)}.getSealiousCreateValue(fctx)`;
|
|
110
110
|
}
|
|
111
111
|
generateInitialValue(field_info, vars) {
|
|
112
|
-
return `${wrapKeyName(field_info.name)}: await ${vars.form_fields}${wrapAttribute(field_info.name)}.sealiousValueToForm(ctx, item.get("${field_info.name}")
|
|
112
|
+
return `${wrapKeyName(field_info.name)}: await ${vars.form_fields}${wrapAttribute(field_info.name)}.sealiousValueToForm(ctx, item.get("${field_info.name}"))`;
|
|
113
113
|
}
|
|
114
114
|
generateImportsForFieldList(field_info) {
|
|
115
115
|
return [];
|
|
@@ -30,7 +30,7 @@ class PhoneNumberWithCountryCode extends FormField {
|
|
|
30
30
|
getControl() {
|
|
31
31
|
return new Hybrid(this, {
|
|
32
32
|
country_code: new PickFromListField(
|
|
33
|
-
|
|
33
|
+
this.required,
|
|
34
34
|
async () => countryCodes.all().sort(
|
|
35
35
|
(a, b) => a.countryCallingCode < b.countryCallingCode ? -1 : 1
|
|
36
36
|
).map((code) => ({
|
|
@@ -38,7 +38,7 @@ class PhoneNumberWithCountryCode extends FormField {
|
|
|
38
38
|
label: "+" + code.countryCallingCode + " " + code.flag
|
|
39
39
|
}))
|
|
40
40
|
).setLabel("Country code"),
|
|
41
|
-
number: new PhoneNumberWithoutCountryCode(
|
|
41
|
+
number: new PhoneNumberWithoutCountryCode(this.required).setLabel(
|
|
42
42
|
"Phone number"
|
|
43
43
|
)
|
|
44
44
|
});
|
|
@@ -23,7 +23,7 @@ async function createItemFormTemplate(create_action_name, newfilefullpath, colle
|
|
|
23
23
|
new Controls.FormHeader("Create ${toPascalCase(
|
|
24
24
|
collection_name
|
|
25
25
|
)}"),
|
|
26
|
-
...get${toPascalCase(collection_name)}FormControls(
|
|
26
|
+
...get${toPascalCase(collection_name)}FormControls(fields)]`,
|
|
27
27
|
can_access: `canAccess = async (ctx: Context) => {
|
|
28
28
|
const policy = ${toPascalCase(collection_name)}.getPolicy("create");
|
|
29
29
|
const response = await policy.check(ctx.$context);
|
|
@@ -22,7 +22,7 @@ async function editItemFormTemplate(edit_action_name, newfilefullpath, collectio
|
|
|
22
22
|
new Controls.FormHeader("Edit ${toPascalCase(
|
|
23
23
|
collection_name
|
|
24
24
|
)}"),
|
|
25
|
-
...get${toPascalCase(collection_name)}FormControls(
|
|
25
|
+
...get${toPascalCase(collection_name)}FormControls(fields)]`,
|
|
26
26
|
can_access: `canAccess = async (ctx: Context) => {
|
|
27
27
|
const policy = ${toPascalCase(collection_name)}.getPolicy("edit");
|
|
28
28
|
const response = await policy.check(ctx.$context);
|
package/package.json
CHANGED
|
@@ -260,7 +260,7 @@ export abstract class FormField<
|
|
|
260
260
|
vars.form_fields
|
|
261
261
|
}${wrapAttribute(field_info.name)}.sealiousValueToForm(ctx, item.get("${
|
|
262
262
|
field_info.name
|
|
263
|
-
}")
|
|
263
|
+
}"))`;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
generateImportsForFieldList(field_info: ExtractedFieldInfo): {
|
|
@@ -40,7 +40,7 @@ export class PhoneNumberWithCountryCode<
|
|
|
40
40
|
|
|
41
41
|
getControl(): FormControl {
|
|
42
42
|
return new Hybrid(this, {
|
|
43
|
-
country_code: new PickFromListField(
|
|
43
|
+
country_code: new PickFromListField(this.required, async () =>
|
|
44
44
|
countryCodes
|
|
45
45
|
.all()
|
|
46
46
|
.sort((a, b) =>
|
|
@@ -51,7 +51,7 @@ export class PhoneNumberWithCountryCode<
|
|
|
51
51
|
label: "+" + code.countryCallingCode + " " + code.flag,
|
|
52
52
|
}))
|
|
53
53
|
).setLabel("Country code"),
|
|
54
|
-
number: new PhoneNumberWithoutCountryCode(
|
|
54
|
+
number: new PhoneNumberWithoutCountryCode(this.required).setLabel(
|
|
55
55
|
"Phone number"
|
|
56
56
|
),
|
|
57
57
|
});
|
|
@@ -33,7 +33,7 @@ export async function createItemFormTemplate(
|
|
|
33
33
|
new Controls.FormHeader("Create ${toPascalCase(
|
|
34
34
|
collection_name
|
|
35
35
|
)}"),
|
|
36
|
-
...get${toPascalCase(collection_name)}FormControls(
|
|
36
|
+
...get${toPascalCase(collection_name)}FormControls(fields)]`,
|
|
37
37
|
|
|
38
38
|
can_access: `canAccess = async (ctx: Context) => {
|
|
39
39
|
const policy = ${toPascalCase(collection_name)}.getPolicy("create");
|
|
@@ -32,7 +32,7 @@ export async function editItemFormTemplate(
|
|
|
32
32
|
new Controls.FormHeader("Edit ${toPascalCase(
|
|
33
33
|
collection_name
|
|
34
34
|
)}"),
|
|
35
|
-
...get${toPascalCase(collection_name)}FormControls(
|
|
35
|
+
...get${toPascalCase(collection_name)}FormControls(fields)]`,
|
|
36
36
|
|
|
37
37
|
can_access: `canAccess = async (ctx: Context) => {
|
|
38
38
|
const policy = ${toPascalCase(collection_name)}.getPolicy("edit");
|