@simitgroup/simpleapp-generator 2.0.3-h-alpha → 2.0.3-j-alpha

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.
Files changed (21) hide show
  1. package/ReleaseNote.md +9 -0
  2. package/dist/buildinschemas/customfield.d.ts.map +1 -1
  3. package/dist/buildinschemas/customfield.js +4 -0
  4. package/dist/buildinschemas/customfield.js.map +1 -1
  5. package/package.json +1 -1
  6. package/src/buildinschemas/customfield.ts +4 -0
  7. package/templates/nuxt/components/simpleApp/SimpleAppCalendarInput.vue.eta +4 -7
  8. package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +17 -16
  9. package/templates/nuxt/components/simpleApp/SimpleAppJsonSchemaForm.vue.eta +138 -136
  10. package/templates/nuxt/components/simpleApp/SimpleAppRemoteSelect.vue.eta +7 -10
  11. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +19 -25
  12. package/templates/nuxt/simpleapp/generate/features/customField/services/CustomFieldService.ts.eta +68 -69
  13. package/templates/nuxt/simpleapp/generate/features/miniApp/app/components/MiniAppSettingPage.vue.eta +51 -51
  14. package/templates/nuxt/lang/cn.ts._eta +0 -15
  15. package/templates/nuxt/lang/en.ts.eta +0 -19
  16. package/templates/nuxt/simpleapp/generate/features/customField/components/CustomFieldFormField.vue.eta +0 -100
  17. package/templates/nuxt/simpleapp/generate/features/customField/components/CustomFieldFormFieldInput.vue.eta +0 -125
  18. package/templates/nuxt/simpleapp/generate/features/customField/components/CustomFieldFormSection.vue.eta +0 -40
  19. package/templates/nuxt/simpleapp/generate/features/customField/components/CustomFieldViewFormField.vue.eta +0 -96
  20. package/templates/nuxt/simpleapp/generate/features/customField/components/CustomFieldViewFormFieldInput.vue.eta +0 -150
  21. package/templates/nuxt/simpleapp/generate/features/customField/components/CustomFieldViewFormSection.vue.eta +0 -38
@@ -1,96 +0,0 @@
1
- <template>
2
- <template v-if="validJsonSchema">
3
- <template v-if="_.isArray(validJsonSchema)"> </template>
4
- <template v-else>
5
- <template v-if="validJsonSchema.type === 'object'">
6
- <template v-if="validJsonSchema['x-foreignkey']">
7
- <CustomFieldViewFormFieldInput
8
- :jsonSchema="validJsonSchema"
9
- :hierarchy="hierarchy"
10
- :schemaSource="schemaSource"
11
- v-model="data[schemaName]"
12
- />
13
- </template>
14
- <template v-else>
15
- <Fieldset class="col-span-2 rounded-xl">
16
- <template #legend>
17
- <span
18
- :class="{
19
- 'mx-2': legendTitle && legendTitle !== '',
20
- }"
21
- >
22
- {{ legendTitle }}
23
- </span>
24
- </template>
25
-
26
- <div
27
- class="grid grid-cols-2 gap-4 p-2"
28
- :class="{
29
- 'pt-4': legendTitle === undefined || legendTitle === '',
30
- }"
31
- >
32
- <template
33
- v-if="validJsonSchema.properties"
34
- v-for="(subSchema, subSchemaName) in validJsonSchema.properties"
35
- :key="subSchemaName"
36
- >
37
- <CustomFieldViewFormField
38
- :jsonSchema="subSchema"
39
- :data="data[schemaName]"
40
- :schemaSource="schemaSource"
41
- :schemaName="subSchemaName as string"
42
- :hierarchy="
43
- hierarchy === '' || hierarchy === undefined
44
- ? (subSchemaName as string)
45
- : `${hierarchy}.${subSchemaName}`
46
- "
47
- />
48
- </template>
49
- </div>
50
- </Fieldset>
51
- </template>
52
- </template>
53
- <template v-else>
54
- <CustomFieldViewFormFieldInput
55
- :jsonSchema="validJsonSchema"
56
- :hierarchy="hierarchy"
57
- :schemaSource="schemaSource"
58
- v-model="data[schemaName]"
59
- />
60
- </template>
61
- </template>
62
- </template>
63
- </template>
64
-
65
- <script setup lang="ts">
66
- import _ from "lodash";
67
- import { SimpleAppJSONSchema7Definition } from "~/types";
68
- import { SchemaSource } from "~/types/customField.type";
69
- import CustomFieldViewFormFieldInput from "./CustomFieldViewFormFieldInput.vue";
70
-
71
- const props = defineProps<{
72
- jsonSchema?: SimpleAppJSONSchema7Definition | undefined;
73
- data: any;
74
- hierarchy: string;
75
- schemaName: string;
76
- schemaSource: SchemaSource;
77
- isHideFieldsetLegend?: boolean;
78
- }>();
79
-
80
- const legendTitle = computed(() => {
81
- if (props.isHideFieldsetLegend) return "";
82
-
83
- return (
84
- (props.jsonSchema &&
85
- typeof props.jsonSchema !== "boolean" &&
86
- props.jsonSchema?.title) ??
87
- props.schemaName
88
- );
89
- });
90
- const validJsonSchema = computed(() => {
91
- if (props.jsonSchema !== undefined && typeof props.jsonSchema === "object") {
92
- return props.jsonSchema;
93
- }
94
- return false;
95
- });
96
- </script>
@@ -1,150 +0,0 @@
1
- <template>
2
- <template v-if="jsonSchema.type !== 'array'">
3
- <div>
4
- <label v-if="!isParentIsArray" class="text-gray-400 text-sm truncate">
5
- {{ label }}
6
- </label>
7
- <div>
8
- <PageDocListColumnItem
9
- :col="columnName"
10
- :data="{
11
- [columnName]: model,
12
- }"
13
- :schemacols="schemaCols"
14
- :uniqueKey="''"
15
- :documentTitle="''"
16
- :resourcename="''"
17
- />
18
- </div>
19
- </div>
20
- </template>
21
- <template
22
- v-else-if="
23
- jsonSchema.type === 'array' &&
24
- jsonSchema.items &&
25
- _.isObject(jsonSchema.items) &&
26
- !Array.isArray(jsonSchema.items)
27
- "
28
- >
29
- <template v-if="jsonSchema.items.type === 'object'">
30
- <div class="col-span-2">
31
- <SimpleAppInputTable
32
- :getField="() => {}"
33
- class="col-span-4"
34
- :setting="{
35
- readonly: true,
36
- }"
37
- v-model="model"
38
- >
39
- <Column
40
- v-if="
41
- jsonSchema.items &&
42
- typeof jsonSchema.items === 'object' &&
43
- 'properties' in jsonSchema.items
44
- "
45
- v-for="(subSchema, subSchemaName) in jsonSchema.items.properties"
46
- :key="subSchemaName"
47
- :field="subSchemaName.toString()"
48
- #body="{ index }"
49
- :header="camelCaseToWords(subSchemaName.toString())"
50
- >
51
- <CustomFieldViewFormFieldInput
52
- v-if="typeof subSchema === 'object' && subSchema !== null"
53
- :jsonSchema="subSchema"
54
- :hierarchy="
55
- hierarchy === '' || hierarchy === undefined
56
- ? (subSchemaName as string)
57
- : `${hierarchy}.*.${subSchemaName}`
58
- "
59
- :schemaSource="schemaSource"
60
- v-model="model[index][subSchemaName]"
61
- />
62
- </Column>
63
- </SimpleAppInputTable>
64
- </div>
65
- </template>
66
- <template v-else-if="jsonSchema.items.type === 'string'">
67
- <div>
68
- <label v-if="!isParentIsArray" class="text-gray-400 text-sm truncate">
69
- {{ label }}
70
- </label>
71
- <div>
72
- <PageDocListColumnItem
73
- :col="columnName"
74
- :data="{
75
- [columnName]: model,
76
- }"
77
- :schemacols="schemaCols"
78
- :uniqueKey="''"
79
- :documentTitle="''"
80
- :resourcename="''"
81
- />
82
- </div>
83
- </div>
84
- </template>
85
- </template>
86
- </template>
87
-
88
- <script setup lang="ts">
89
- import _ from "lodash";
90
- import PageDocListColumnItem from "~/components/page/PageDocListColumnItem.vue";
91
- import {
92
- SchemaFields,
93
- SimpleAppInputType,
94
- SimpleAppJSONSchema7,
95
- } from "~/types";
96
- import { SchemaSource } from "~/types/customField.type";
97
-
98
- const props = defineProps<{
99
- jsonSchema: SimpleAppJSONSchema7;
100
- hierarchy: string;
101
- schemaSource: SchemaSource;
102
- }>();
103
-
104
- const model = defineModel<any>();
105
-
106
- const columnName = computed(() => {
107
- return props.hierarchy.split(".").pop() ?? "";
108
- });
109
-
110
- const schemaCols = computed(() => {
111
- return {
112
- [columnName.value]: props.jsonSchema,
113
- } as SchemaFields;
114
- });
115
-
116
- const label = computed(() => {
117
- return props.jsonSchema.title ?? props.hierarchy.split(".").pop();
118
- });
119
-
120
- const fieldPath = computed(() => {
121
- const hierarchies = props.hierarchy.split(".");
122
-
123
- const path = (getFieldPathPrefix() + hierarchies.join("/properties/"))
124
- .replace("properties/*", "items")
125
- .replace("*", "items");
126
-
127
- // if (props.schemaSource === "miniAppSetting") {
128
- // return path.replace("/properties/setting", "");
129
- // }
130
-
131
- return path;
132
- });
133
-
134
- const inputType = computed(() => {
135
- return getInputType(props.jsonSchema);
136
- });
137
-
138
- const isParentIsArray = computed(() => {
139
- const hierarchies = props.hierarchy.split(".");
140
- return hierarchies[hierarchies.length - 2] == "*";
141
- });
142
-
143
- function getFieldPathPrefix() {
144
- if (props.schemaSource === "customField") {
145
- return "#/properties/more/properties/";
146
- }
147
-
148
- return "#/properties/";
149
- }
150
- </script>
@@ -1,38 +0,0 @@
1
- <template>
2
- <section v-if="validProperties" class="space-y-4">
3
- <template
4
- v-for="(groupJsonSchema, groupName) in validProperties"
5
- :key="groupName"
6
- >
7
- <CustomFieldViewFormField
8
- v-if="isValidSchema(groupJsonSchema)"
9
- :jsonSchema="groupJsonSchema"
10
- :data="data"
11
- :schemaName="groupName.toString()"
12
- :hierarchy="groupName.toString()"
13
- schemaSource="customField"
14
- />
15
- </template>
16
- </section>
17
- </template>
18
-
19
- <script setup lang="ts">
20
- import _ from 'lodash';
21
- import { CustomFieldMoreSchema } from '~/simpleapp/generate/features/customField/types/common';
22
- import CustomFieldViewFormField from './CustomFieldViewFormField.vue';
23
-
24
- const props = defineProps<{
25
- customFieldJsonSchema: CustomFieldMoreSchema;
26
- data: any;
27
- }>();
28
-
29
- const validProperties = computed(() => {
30
- if (
31
- props.customFieldJsonSchema.properties !== undefined &&
32
- typeof props.customFieldJsonSchema.properties === 'object'
33
- ) {
34
- return props.customFieldJsonSchema.properties;
35
- }
36
- return false;
37
- });
38
- </script>