@ostack.tech/ui-kform-scaffolder 0.16.1 → 0.16.3
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/ostack-ui-kform-scaffolder.js +161 -132
- package/dist/ostack-ui-kform-scaffolder.js.map +1 -1
- package/dist/webapp/assets/{index-D8y2qs8j.js → index-C9RGlUhq.js} +115 -194
- package/dist/webapp/index.html +1 -1
- package/package.json +1 -1
- package/types/SchematicKind.d.ts +1 -0
- package/types/index.d.ts +0 -1
- package/types/scaffolding/reactApp/ReactAppData.d.ts +1 -1
- package/types/scaffolding/scaffolders/scaffoldAppComponent.d.ts +1 -1
- package/types/scaffolding/scaffolders/scaffoldActions.d.ts +0 -3
|
@@ -174,94 +174,7 @@ suspend fun assert<%= formClass %>NotContainsWarning(
|
|
|
174
174
|
`),...this.declarations].filter(e=>e).join(`
|
|
175
175
|
|
|
176
176
|
`)+`
|
|
177
|
-
`}function Ja(e){let t=new Map;for(let n of e){let e=t.get(n.moduleName);e||t.set(n.moduleName,e={moduleName:n.moduleName}),n.isDefault?e.defaultImport=n.name:n.isNamespace?e.namespaceImport=n.name:n.isType?(e.typedImports??=new Set).add(n.name):n.name&&(e.namedImports??=new Set).add(n.name)}return Array.from(t.values())}function Ya(e){let t=[...new Set([...e.namedImports??[],...e.typedImports??[]])].sort((e,t)=>e.localeCompare(t)),n=t.every(t=>!e.namedImports?.has(t)),r=t.length>0?n?`type { ${t.join(`, `)} }`:`{ ${t.map(t=>e.namedImports?.has(t)?t:`type ${t}`).join(`, `)} }`:null,i=[e.defaultImport||null,e.namespaceImport?`* as ${e.namespaceImport}`:null,r].filter(e=>e).join(`, `),a=JSON.stringify(e.moduleName);return i?`import ${i} from ${a};`:`import ${a};`}var Xa=`en-US`,Za=JSON.parse(`["en-GB","en-US","fr-FR","pt-PT"]`);function Qa({defaultValue:e=Xa,disabled:t}){let[n,r]=Zr(`defaultLocale`,e);return(0,U.jsxs)(`div`,{className:`builder-config-field`,children:[(0,U.jsx)(`label`,{children:`Default locale`}),(0,U.jsx)(`select`,{value:n,onChange:e=>{r(e.target.value)},disabled:t,children:Za.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))})]})}var $a=`json`;function eo({defaultValue:e=$a,disabled:t}){let[n,r]=Zr(`useTableValuesSerializer`,!1),i=(0,C.useRef)(n),[a,o]=Zr(`serializationFormat`,e);return(0,U.jsxs)(`div`,{className:`builder-config-field`,children:[(0,U.jsx)(`label`,{children:`Serialization format`}),(0,U.jsxs)(`select`,{value:a,onChange:e=>{o(e.target.value),e.target.value===`xml`?(i.current=n,r(!0)):r(i.current)},disabled:t,children:[(0,U.jsx)(`option`,{value:`json`,children:`JSON`}),(0,U.jsx)(`option`,{value:`xml`,children:`XML`})]})]})}function to({disabled:e}){let[t]=Zr(`serializationFormat`,$a);return(0,U.jsx)($r,{disabled:e||t===`xml`})}var no=/([\p{Ll}\d])(\p{Lu})/gu,ro=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,io=/(\d)\p{Ll}|(\p{L})\d/u,ao=/[^\p{L}\d]+/giu,oo=`$1\0$2`,K=``;function q(e){let t=e.trim();t=t.replace(no,oo).replace(ro,oo),t=t.replace(ao,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function so(e){let t=q(e);for(let e=0;e<t.length;e++){let n=t[e],r=io.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function co(e,t){let[n,r,i]=bo(e,t);return n+r.map(go(t?.locale)).join(t?.delimiter??` `)+i}function lo(e,t){let[n,r,i]=bo(e,t),a=go(t?.locale),o=_o(t?.locale),s=t?.mergeAmbiguousCharacters?vo(a,o):yo(a,o);return n+r.map((e,t)=>t===0?a(e):s(e,t)).join(t?.delimiter??``)+i}function uo(e,t){let[n,r,i]=bo(e,t),a=go(t?.locale),o=_o(t?.locale),s=t?.mergeAmbiguousCharacters?vo(a,o):yo(a,o);return n+r.map(s).join(t?.delimiter??``)+i}function fo(e,t){let[n,r,i]=bo(e,t),a=go(t?.locale),o=_o(t?.locale);return n+r.map(vo(a,o)).join(t?.delimiter??` `)+i}function po(e,t){let[n,r,i]=bo(e,t);return n+r.map(_o(t?.locale)).join(t?.delimiter??`_`)+i}function mo(e,t){return co(e,{delimiter:`-`,...t})}function ho(e,t){let[n,r,i]=bo(e,t),a=go(t?.locale),o=vo(a,_o(t?.locale));return n+r.map((e,t)=>t===0?o(e):a(e)).join(t?.delimiter??` `)+i}function go(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function _o(e){return e===!1?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function vo(e,t){return n=>`${t(n[0])}${e(n.slice(1))}`}function yo(e,t){return(n,r)=>{let i=n[0];return(r>0&&i>=`0`&&i<=`9`?`_`+i:t(i))+e(n.slice(1))}}function bo(e,t={}){let n=t.split??(t.separateNumbers?so:q),r=t.prefixCharacters??K,i=t.suffixCharacters??K,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}var xo=`
|
|
178
|
-
import { decode<%= formClass %>FromString, <%= formClass %>FormMode } from "<%= kmpModuleName %>";
|
|
179
|
-
import { use<%= formClass %>Context } from "../<%= formClass %>Context.ts";
|
|
180
|
-
|
|
181
|
-
export function Load() {
|
|
182
|
-
const { externalContexts } = use<%= formClass %>Context();
|
|
183
|
-
|
|
184
|
-
return (
|
|
185
|
-
externalContexts.mode !== <%= formClass %>FormMode.READ && (
|
|
186
|
-
<LoadAction
|
|
187
|
-
decode={async (file) => decode<%= formClass %>FromString(await file.text())}
|
|
188
|
-
mimeTypes={["<%= serializationMimeType %>"]}
|
|
189
|
-
extensions={[".<%= serializationFormat %>"]}
|
|
190
|
-
/>
|
|
191
|
-
)
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
`,So=`import { SaveAction } from "@ostack.tech/ui-kform";
|
|
195
|
-
import { type <%= formClass %>, encode<%= formClass %>ToString, <%= formClass %>FormMode } from "<%= kmpModuleName %>";
|
|
196
|
-
import { use<%= formClass %>Context } from "../<%= formClass %>Context.ts";
|
|
197
|
-
|
|
198
|
-
export function Save() {
|
|
199
|
-
const { externalContexts } = use<%= formClass %>Context();
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<SaveAction
|
|
203
|
-
encode={(<%= formVar %>: <%= formClass %>) => encode<%= formClass %>ToString(<%= formVar %>, true)}
|
|
204
|
-
disableOverwrite={externalContexts.mode === <%= formClass %>FormMode.READ}
|
|
205
|
-
mimeTypes={["<%= serializationMimeType %>"]}
|
|
206
|
-
extensions={[".<%= serializationFormat %>"]}
|
|
207
|
-
/>
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
`,Co=`import { LocatedValidationWarning } from "@ostack.tech/kform";
|
|
211
|
-
import { SubmitAction } from "@ostack.tech/ui-kform";
|
|
212
|
-
import {
|
|
213
|
-
type <%= formClass %>,
|
|
214
|
-
<%= formClass %>FormMode,
|
|
215
|
-
<%= formClass %>SubmitSuccess,
|
|
216
|
-
<%= formClass %>SubmitValidationError,
|
|
217
|
-
<%= formClass %>SubmitError,
|
|
218
|
-
} from "<%= kmpModuleName %>";
|
|
219
|
-
import { use<%= formClass %>Context } from "../<%= formClass %>Context.ts";
|
|
220
|
-
import { submit } from "../api/submit.ts";
|
|
221
|
-
|
|
222
|
-
export function Submit() {
|
|
223
|
-
const { externalContexts } = use<%= formClass %>Context();
|
|
224
|
-
|
|
225
|
-
const handleSubmit = async (
|
|
226
|
-
<%= formVar %>: <%= formClass %>,
|
|
227
|
-
acceptedWarnings?: LocatedValidationWarning[],
|
|
228
|
-
) => {
|
|
229
|
-
const response = await submit(<%= formVar %>, acceptedWarnings);
|
|
230
|
-
if (response instanceof <%= formClass %>SubmitSuccess) {
|
|
231
|
-
return response.redirectTo;
|
|
232
|
-
} else if (response instanceof <%= formClass %>SubmitValidationError) {
|
|
233
|
-
return response.issues;
|
|
234
|
-
} else {
|
|
235
|
-
throw response as <%= formClass %>SubmitError;
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
const handleSuccessfulSubmit = (redirectTo: string) => {
|
|
240
|
-
window.location.href = redirectTo;
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
return (
|
|
244
|
-
externalContexts.mode !== <%= formClass %>FormMode.READ && (
|
|
245
|
-
<SubmitAction
|
|
246
|
-
onSubmit={handleSubmit}
|
|
247
|
-
onSuccessfulSubmit={handleSuccessfulSubmit}
|
|
248
|
-
<%_ if (useTableValuesSerializer) { -%>
|
|
249
|
-
convertExternalIssuesTableRowIndicesToIds
|
|
250
|
-
<%_ } -%>
|
|
251
|
-
/>
|
|
252
|
-
)
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
`,wo=`import { ValidateAction } from "@ostack.tech/ui-kform";
|
|
256
|
-
import { <%= formClass %>FormMode } from "<%= kmpModuleName %>";
|
|
257
|
-
import { use<%= formClass %>Context } from "../<%= formClass %>Context.ts";
|
|
258
|
-
|
|
259
|
-
export function Validate() {
|
|
260
|
-
const { externalContexts } = use<%= formClass %>Context();
|
|
261
|
-
|
|
262
|
-
return externalContexts.mode !== <%= formClass %>FormMode.READ && <ValidateAction />;
|
|
263
|
-
}
|
|
264
|
-
`;function To(e,t){let n={kmpModuleName:t.kmpModuleName??`${mo(e.name)}-shared`,serializationFormat:t.serializationFormat??`json`,serializationMimeType:`application/${t.serializationFormat}`,formVar:lo(e.name),formClass:e.name,useTableValuesSerializer:t.useTableValuesSerializer};Na(t,`actions/Load.tsx`,xo,n),Na(t,`actions/Save.tsx`,So,n),Na(t,`actions/Submit.tsx`,Co,n),Na(t,`actions/Validate.tsx`,wo,n)}var Eo=`const API_BASE_URL = new URL("<%= apiBasePath %>", window.location.origin);
|
|
177
|
+
`}function Ja(e){let t=new Map;for(let n of e){let e=t.get(n.moduleName);e||t.set(n.moduleName,e={moduleName:n.moduleName}),n.isDefault?e.defaultImport=n.name:n.isNamespace?e.namespaceImport=n.name:n.isType?(e.typedImports??=new Set).add(n.name):n.name&&(e.namedImports??=new Set).add(n.name)}return Array.from(t.values())}function Ya(e){let t=[...new Set([...e.namedImports??[],...e.typedImports??[]])].sort((e,t)=>e.localeCompare(t)),n=t.every(t=>!e.namedImports?.has(t)),r=t.length>0?n?`type { ${t.join(`, `)} }`:`{ ${t.map(t=>e.namedImports?.has(t)?t:`type ${t}`).join(`, `)} }`:null,i=[e.defaultImport||null,e.namespaceImport?`* as ${e.namespaceImport}`:null,r].filter(e=>e).join(`, `),a=JSON.stringify(e.moduleName);return i?`import ${i} from ${a};`:`import ${a};`}var Xa=`en-US`,Za=JSON.parse(`["en-GB","en-US","fr-FR","pt-PT"]`);function Qa({defaultValue:e=Xa,disabled:t}){let[n,r]=Zr(`defaultLocale`,e);return(0,U.jsxs)(`div`,{className:`builder-config-field`,children:[(0,U.jsx)(`label`,{children:`Default locale`}),(0,U.jsx)(`select`,{value:n,onChange:e=>{r(e.target.value)},disabled:t,children:Za.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))})]})}var $a=`json`;function eo({defaultValue:e=$a,disabled:t}){let[n,r]=Zr(`useTableValuesSerializer`,!1),i=(0,C.useRef)(n),[a,o]=Zr(`serializationFormat`,e);return(0,U.jsxs)(`div`,{className:`builder-config-field`,children:[(0,U.jsx)(`label`,{children:`Serialization format`}),(0,U.jsxs)(`select`,{value:a,onChange:e=>{o(e.target.value),e.target.value===`xml`?(i.current=n,r(!0)):r(i.current)},disabled:t,children:[(0,U.jsx)(`option`,{value:`json`,children:`JSON`}),(0,U.jsx)(`option`,{value:`xml`,children:`XML`})]})]})}function to({disabled:e}){let[t]=Zr(`serializationFormat`,$a);return(0,U.jsx)($r,{disabled:e||t===`xml`})}var no=/([\p{Ll}\d])(\p{Lu})/gu,ro=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,io=/(\d)\p{Ll}|(\p{L})\d/u,ao=/[^\p{L}\d]+/giu,oo=`$1\0$2`,K=``;function q(e){let t=e.trim();t=t.replace(no,oo).replace(ro,oo),t=t.replace(ao,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function so(e){let t=q(e);for(let e=0;e<t.length;e++){let n=t[e],r=io.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function co(e,t){let[n,r,i]=bo(e,t);return n+r.map(go(t?.locale)).join(t?.delimiter??` `)+i}function lo(e,t){let[n,r,i]=bo(e,t),a=go(t?.locale),o=_o(t?.locale),s=t?.mergeAmbiguousCharacters?vo(a,o):yo(a,o);return n+r.map((e,t)=>t===0?a(e):s(e,t)).join(t?.delimiter??``)+i}function uo(e,t){let[n,r,i]=bo(e,t),a=go(t?.locale),o=_o(t?.locale),s=t?.mergeAmbiguousCharacters?vo(a,o):yo(a,o);return n+r.map(s).join(t?.delimiter??``)+i}function fo(e,t){let[n,r,i]=bo(e,t),a=go(t?.locale),o=_o(t?.locale);return n+r.map(vo(a,o)).join(t?.delimiter??` `)+i}function po(e,t){let[n,r,i]=bo(e,t);return n+r.map(_o(t?.locale)).join(t?.delimiter??`_`)+i}function mo(e,t){return co(e,{delimiter:`-`,...t})}function ho(e,t){let[n,r,i]=bo(e,t),a=go(t?.locale),o=vo(a,_o(t?.locale));return n+r.map((e,t)=>t===0?o(e):a(e)).join(t?.delimiter??` `)+i}function go(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function _o(e){return e===!1?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function vo(e,t){return n=>`${t(n[0])}${e(n.slice(1))}`}function yo(e,t){return(n,r)=>{let i=n[0];return(r>0&&i>=`0`&&i<=`9`?`_`+i:t(i))+e(n.slice(1))}}function bo(e,t={}){let n=t.split??(t.separateNumbers?so:q),r=t.prefixCharacters??K,i=t.suffixCharacters??K,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}var xo=`const API_BASE_URL = new URL("<%= apiBasePath %>", window.location.origin);
|
|
265
178
|
|
|
266
179
|
/**
|
|
267
180
|
* Wrapper around \`fetch\` for accessing the API.
|
|
@@ -271,7 +184,7 @@ export function Validate() {
|
|
|
271
184
|
export function apiFetch(url: string | URL, init?: RequestInit) {
|
|
272
185
|
return fetch(new URL(url, API_BASE_URL), init);
|
|
273
186
|
}
|
|
274
|
-
`,
|
|
187
|
+
`,So=`import type { ErrorReport } from "@ostack.tech/ui";
|
|
275
188
|
import { apiFetch } from "./apiFetch.ts";
|
|
276
189
|
|
|
277
190
|
const REPORT_ERROR_API_ENDPOINT = "<%= reportErrorApiEndpoint %>";
|
|
@@ -283,7 +196,7 @@ export async function reportError(error: ErrorReport) {
|
|
|
283
196
|
body: JSON.stringify(error, null, import.meta.env.DEV ? 2 : 0),
|
|
284
197
|
});
|
|
285
198
|
}
|
|
286
|
-
`,
|
|
199
|
+
`,Co=`import { LocatedValidationWarning } from "@ostack.tech/kform";
|
|
287
200
|
import {
|
|
288
201
|
decode<%= formClass %>SubmitResponseFromString,
|
|
289
202
|
encode<%= formClass %>ToString,
|
|
@@ -310,15 +223,15 @@ export async function submit(
|
|
|
310
223
|
});
|
|
311
224
|
return decode<%= formClass %>SubmitResponseFromString(await response.text());
|
|
312
225
|
}
|
|
313
|
-
`;function
|
|
226
|
+
`;function wo(e,t){let n={kmpModuleName:t.kmpModuleName??`${mo(e.name)}-shared`,serializationFormat:t.serializationFormat??`json`,serializationMimeType:`application/${t.serializationFormat}`,formVar:lo(e.name),formClass:e.name,apiBasePath:t.apiBasePath??`/api/`,reportErrorApiEndpoint:t.reportErrorApiEndpoint??`report-error`,submitApiEndpoint:t.submitApiEndpoint??`submit`};Na(t,`api/apiFetch.ts`,xo,n),Na(t,`api/reportError.ts`,So,n),Na(t,`api/submit.ts`,Co,n)}var To=!0;function Eo(e,t){if(!Do(t))return;let n=W(t.currentDir,`${e.name}IssueMessages.tsx`),r=t.files.get(n);r||t.files.set(n,r=Ka()),Oo(e,{kmpModuleName:`${mo(t.rootSchematic.name)}-shared`,...t,currentFile:r})}function Do(e){return e.scaffoldIssueMessages??To}function Oo(e,t){t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`IssueMessagesByCode`,isType:!0}),t.currentFile.declarations.push(ea`
|
|
314
227
|
export const ${po(e.name)}_ISSUE_MESSAGES: Record<string, IssueMessagesByCode> = {};
|
|
315
|
-
`)}function
|
|
228
|
+
`)}function ko(e,t){let n=os(e,{kmpModuleName:`${mo(e.name)}-shared`,...t});for(let e of n)for(let t of e.formPages)Ao(t.schematic,t.data),t.data.currentPath!==`/`&&Eo(t.schematic,t.data)}function Ao(e,t){let n=W(t.currentDir,`${e.name}.tsx`),r=t.files.get(n);r||t.files.set(n,r=Ka()),jo(e,{kmpModuleName:`${mo(t.rootSchematic.name)}-shared`,...t,currentFile:r})}function jo(e,t){t.currentFile.imports.push({moduleName:`@ostack.tech/ui`,name:`Grid`}),t.currentFile.declarations.push(ea`
|
|
316
229
|
export function ${e.name}() {
|
|
317
230
|
return (
|
|
318
231
|
<Grid container>
|
|
319
232
|
${e.children.map(e=>ea`
|
|
320
233
|
<Grid xs={12}>
|
|
321
|
-
${
|
|
234
|
+
${Mo(e,{...t,currentPath:e.childName})}
|
|
322
235
|
</Grid>
|
|
323
236
|
`).join(`
|
|
324
237
|
|
|
@@ -326,12 +239,12 @@ export async function submit(
|
|
|
326
239
|
</Grid>
|
|
327
240
|
);
|
|
328
241
|
}
|
|
329
|
-
`)}function
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
</
|
|
334
|
-
`}var
|
|
242
|
+
`)}function Mo(e,t){let n=t.schematicKinds.get(e.kind);if(!n)throw Error(`Unknown schematic kind ${e.kind}`);let r,i;if(n.control){let e=n.control.lastIndexOf(`.`);r=n.control.slice(0,e),i=n.control.slice(e+1),t.currentFile.imports.push({moduleName:r,name:i})}let a=n.scaffoldControl?.(e,t);if(a||=`<${i} path="${t.currentPath}" />`,t.omitField)return a;if(n.scaffoldField)return n.scaffoldField?.(e,t);t.currentFile.imports.push({moduleName:`@ostack.tech/ui`,name:`Field`});let o;return n.omitFieldLabel||(t.currentFile.imports.push({moduleName:`@ostack.tech/ui`,name:`Label`}),o=`<Label>${ho(e.childName)}</Label>`),ea`
|
|
243
|
+
<Field>
|
|
244
|
+
${[o,a].filter(e=>e).join(`
|
|
245
|
+
`)}
|
|
246
|
+
</Field>
|
|
247
|
+
`}var No=`package <%= filePackage %>
|
|
335
248
|
|
|
336
249
|
import kotlin.js.JsExport
|
|
337
250
|
import kotlin.jvm.JvmOverloads
|
|
@@ -377,7 +290,7 @@ fun encode<%= formClass %>SubmitResponseToString(response: <%= formClass %>Submi
|
|
|
377
290
|
@JsExport
|
|
378
291
|
fun decode<%= formClass %>SubmitResponseFromString(json: String): <%= formClass %>SubmitResponse =
|
|
379
292
|
jsonConfig().decodeFromString(json)
|
|
380
|
-
`,
|
|
293
|
+
`,Po=`package <%= filePackage %>
|
|
381
294
|
|
|
382
295
|
import kotlin.js.JsExport
|
|
383
296
|
import kotlin.jvm.JvmOverloads
|
|
@@ -462,7 +375,7 @@ fun encode<%= formClass %>SubmitResponseToString(response: <%= formClass %>Submi
|
|
|
462
375
|
@JsExport
|
|
463
376
|
fun decode<%= formClass %>SubmitResponseFromString(xml: String): <%= formClass %>SubmitResponse =
|
|
464
377
|
xmlConfig().decodeFromString(xml)
|
|
465
|
-
`;function
|
|
378
|
+
`;function Fo(e,t){let n={filePackage:t.currentPackage,formVar:lo(e.name),formClass:e.name,formConstant:po(e.name),includeSerializationFormatVersion:t.includeSerializationFormatVersion??!0};Na(t,`${e.name}Serializer.kt`,t.serializationFormat===`xml`?Po:No,n)}function Io(e){return e==null?[]:Array.isArray(e)?e:[e]}var Lo={...oa},Ro={...sa,control:`@ostack.tech/ui-kform.NumericControl`},zo={...ca,control:`@ostack.tech/ui-kform.NumericControl`},Bo={...la,control:`@ostack.tech/ui-kform.CheckboxControl`,omitFieldLabel:!0,scaffoldControl:(e,t)=>t.omitField?`<CheckboxControl path="${t.currentPath}" />`:`<CheckboxControl path="${t.currentPath}">${ho(e.childName)}</CheckboxControl>`},Vo={...ua,control:`@ostack.tech/ui-kform.NumericControl`},Ho={...fa,defaultPackageSuffix:e=>`annexes.${e.toLowerCase()}`,kind:`Class (Annex)`},Uo={...fa,kind:`Class (FormPage)`,nullable:!1},Wo={...fa,nullable:!1,scaffoldModel:(e,t)=>{let n=fa.scaffoldModel(e,t);if(t.currentPath!==`/`)return n;let r=[],i=null;if(t.serializationFormat===`xml`){t.currentFile.imports.add(`nl.adaptivity.xmlutil.serialization.XmlSerialName`);let n=t.xmlNamespace??`http://${t.currentPackage.split(`.`).reverse().join(`.`)}/schema/${new Date().getFullYear()}`;r.push(`@XmlSerialName("${e.name}", "${n}")`)}if(t.includeSerializationFormatVersion??!0){t.currentFile.imports.add(`kotlinx.serialization.EncodeDefault`).add(`kotlinx.serialization.ExperimentalSerializationApi`);let n=[`@EncodeDefault`,`@OptIn(ExperimentalSerializationApi::class)`];t.serializationFormat===`xml`?(t.currentFile.imports.add(`nl.adaptivity.xmlutil.serialization.XmlElement`),n.push(`@XmlElement(false)`)):(t.currentFile.imports.add(`kotlinx.serialization.SerialName`),n.push(`@SerialName($$"$version")`)),i=si(n,`internal var version = ${po(e.name)}_SERIALIZATION_VERSION`)}return si(r,n)+(i?` ${ea`
|
|
466
379
|
{
|
|
467
380
|
${i}
|
|
468
381
|
}
|
|
@@ -476,7 +389,7 @@ fun decode<%= formClass %>SubmitResponseFromString(xml: String): <%= formClass %
|
|
|
476
389
|
<Grid container>
|
|
477
390
|
${e.children.map(e=>ea`
|
|
478
391
|
<Grid xs={12}>
|
|
479
|
-
${
|
|
392
|
+
${Mo(e,{...t,currentPath:W(t.currentPath,e.childName)})}
|
|
480
393
|
</Grid>
|
|
481
394
|
`).join(`
|
|
482
395
|
|
|
@@ -484,59 +397,43 @@ fun decode<%= formClass %>SubmitResponseFromString(xml: String): <%= formClass %
|
|
|
484
397
|
</Grid>
|
|
485
398
|
</FieldGroupBody>
|
|
486
399
|
</FieldGroup>
|
|
487
|
-
`)},
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
${e.children.map(t=>`{ value: ${e.name}.${t.childName}, text: ${JSON.stringify(ho(t.childName))} }`).join(`,
|
|
400
|
+
`)},Go={...pa,control:`@ostack.tech/ui-kform.NumericControl`},Ko={...ma,kind:`Enum`,internal:!0,nullable:!1},qo={...ma,kind:`Enum (Select)`,control:`@ostack.tech/ui-kform.SelectControl`,scaffoldControl:(e,t)=>(t.currentFile.imports.push({moduleName:t.kmpModuleName,name:e.name}),e.children.length>0&&t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`SelectControlItem`}),ea`
|
|
401
|
+
<SelectControl path="${t.currentPath}">
|
|
402
|
+
${e.children.map(t=>`<SelectControlItem value={${e.name}.${t.childName}}>${ho(t.childName)}</SelectControlItem>`).join(`
|
|
491
403
|
`)}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
<RadioGroupControl
|
|
497
|
-
options={[
|
|
498
|
-
${e.children.map(t=>`{ value: ${e.name}.${t.childName}, text: ${JSON.stringify(ho(t.childName))} }`).join(`,
|
|
404
|
+
</SelectControl>
|
|
405
|
+
`)},Jo={...ma,kind:`Enum (RadioGroup)`,control:`@ostack.tech/ui-kform.RadioGroupControl`,scaffoldControl:(e,t)=>(t.currentFile.imports.push({moduleName:t.kmpModuleName,name:e.name}),e.children.length>0&&t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`RadioGroupControlItem`}),ea`
|
|
406
|
+
<RadioGroupControl path="${t.currentPath}">
|
|
407
|
+
${e.children.map(t=>`<RadioGroupControlItem value={${e.name}.${t.childName}}>${ho(t.childName)}</RadioGroupControlItem>`).join(`
|
|
499
408
|
`)}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
<CheckboxGroupControl
|
|
505
|
-
options={[
|
|
506
|
-
${n.children.map(e=>`{ value: ${n.name}.${e.childName}, text: ${JSON.stringify(ho(e.childName))} }`).join(`,
|
|
409
|
+
</RadioGroupControl>
|
|
410
|
+
`)},Yo={...ha,nullable:!0,control:`@ostack.tech/ui-kform.FileControl`},Xo={...ga,control:`@ostack.tech/ui-kform.NumericControl`},Zo={...va,control:`@ostack.tech/ui-kform.NumericControl`},Qo={...ya,kind:`List<Enum> (CheckboxGroup)`,nullable:!1,initChildren:e=>[Lr({kind:`Enum`,name:uo(e),nullable:!1,children:[]})],builder:Ji,control:`@ostack.tech/ui-kform.CheckboxGroupControl`,scaffoldControl:(e,t)=>{let n=e.children[0];if(n.kind!==`Enum`)throw Error(`Invalid child kind.`);return t.currentFile.imports.push({moduleName:t.kmpModuleName,name:n.name}),n.children.length>0&&t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`CheckboxGroupControlItem`}),ea`
|
|
411
|
+
<CheckboxGroupControl path="${t.currentPath}">
|
|
412
|
+
${n.children.map(e=>`<CheckboxGroupControlItem value={${n.name}.${e.childName}}>${ho(e.childName)}</CheckboxGroupControlItem>`).join(`
|
|
507
413
|
`)}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
<SelectMultipleControl
|
|
513
|
-
options={[
|
|
514
|
-
${n.children.map(e=>`{ value: ${n.name}.${e.childName}, text: ${JSON.stringify(ho(e.childName))} }`).join(`,
|
|
414
|
+
</CheckboxGroupControl>
|
|
415
|
+
`}},$o={...ya,kind:`List<Enum> (SelectMultiple)`,nullable:!1,initChildren:e=>[Lr({kind:`Enum`,name:uo(e),nullable:!1,children:[]})],builder:Ji,control:`@ostack.tech/ui-kform.SelectMultipleControl`,scaffoldControl:(e,t)=>{let n=e.children[0];if(n.kind!==`Enum`)throw Error(`Invalid child kind.`);return t.currentFile.imports.push({moduleName:t.kmpModuleName,name:n.name}),n.children.length>0&&t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`SelectMultipleControlItem`}),ea`
|
|
416
|
+
<SelectMultipleControl path="${t.currentPath}">
|
|
417
|
+
${n.children.map(e=>`<SelectMultipleControlItem value={${n.name}.${e.childName}}>${ho(e.childName)}</SelectMultipleControlItem>`).join(`
|
|
515
418
|
`)}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
columns={[
|
|
522
|
-
tableControlIndexColumn(),
|
|
419
|
+
</SelectMultipleControl>
|
|
420
|
+
`}},es={...ba,nullable:!0,control:`@ostack.tech/ui-kform.DateControl`},ts={...Sa,control:`@ostack.tech/ui-kform.NumericControl`},ns={...Ca,control:`@ostack.tech/ui-kform.NumericControl`},rs={...wa,control:`@ostack.tech/ui-kform.TextControl`},is={...Ta,kind:`Table (Annexes)`,nullable:!1,builder:Ji,initChildren:e=>[Lr({kind:`Class (Annex)`,packageSuffix:`annexes.${e.toLowerCase()}`,name:uo(e),nullable:!1,children:[]})],propertyAnnotations:(e,t)=>{let n=Io(typeof Ta.propertyAnnotations==`function`?Ta.propertyAnnotations?.(e,t):Ta.propertyAnnotations);return t.serializationFormat===`xml`&&(t.currentFile.imports.add(`nl.adaptivity.xmlutil.serialization.XmlChildrenName`),n.push(`@XmlChildrenName("${lo(e.children[0].name)}")`)),n}},as=[Lo,Ro,zo,Bo,Vo,Wo,Ho,Uo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,{...Ta,nullable:!1,builder:Ji,initChildren:e=>[Lr({kind:`Class`,name:`${uo(e)}Row`,nullable:!1,children:[]})],propertyAnnotations:is.propertyAnnotations,control:`@ostack.tech/ui-kform.TableControl`,omitFieldLabel:!0,scaffoldControl:(e,t)=>{let n=e.children[0];if(n.kind!==`Class`)throw Error(`Table child schematic is not of Class kind.`);return t.currentFile.imports.push({moduleName:`@ostack.tech/ui`,name:`Label`},{moduleName:`@ostack.tech/ui-kform`,name:`TableControlColumns`},{moduleName:`@ostack.tech/ui-kform`,name:`TableControlIndexColumn`},{moduleName:`@ostack.tech/ui-kform`,name:`TableControlActionsColumn`},{moduleName:`@ostack.tech/ui-kform`,name:`TableControlAddRowTrigger`},{moduleName:`@ostack.tech/ui-kform`,name:`TableControlContent`}),n.children.length>0&&t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`TableControlColumn`}),ea`
|
|
421
|
+
<TableControl path="${t.currentPath}">
|
|
422
|
+
<TableControlColumns>
|
|
423
|
+
<TableControlIndexColumn />
|
|
523
424
|
${n.children.map(e=>ea`
|
|
524
|
-
{
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
)
|
|
529
|
-
}
|
|
530
|
-
`).join(`,
|
|
425
|
+
<TableControlColumn label=${JSON.stringify(ho(e.childName))}>
|
|
426
|
+
${Mo(e,{...t,omitField:!0,currentPath:e.childName})}
|
|
427
|
+
</TableControlColumn>
|
|
428
|
+
`).join(`
|
|
531
429
|
`)},
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
>
|
|
430
|
+
<TableControlActionsColumn />
|
|
431
|
+
</TableControlColumns>
|
|
535
432
|
<Label>${ho(e.childName)}</Label>
|
|
536
433
|
<TableControlAddRowTrigger />
|
|
537
434
|
<TableControlContent />
|
|
538
435
|
</TableControl>
|
|
539
|
-
`}}];function
|
|
436
|
+
`}}];function os(e,t){let n=[];if(e.children?.every(e=>e.kind===Ho.kind||e.kind===is.kind))for(let r of e.children)r.kind===Ho.kind?n.push(cs(r,{...t,currentPath:W(t.currentPath,r.childName),currentDir:W(t.currentDir,r.packageSuffix?.replaceAll(`.`,`/`))})):n.push(ss(r,{...t,currentPath:W(t.currentPath,r.childName)}));else if(e.children?.every(e=>e.kind===Uo.kind))n.push(cs(e,t));else if(e.children?.some(e=>e.kind===Ho.kind||e.kind===is.kind||e.kind===Uo.kind))throw Error(`Annexes/form pages cannot be mixed with other kinds of fields.`);else n.push(cs(e,t));return n}function ss(e,t){let n=e.children[0];return cs(n,{...t,currentPath:W(t.currentPath,`*`),currentDir:W(t.currentDir,n.packageSuffix?.replaceAll(`.`,`/`))})}function cs(e,t){if(e.children?.some(e=>e.kind===Ho.kind||e.kind===is.kind))throw Error(`Annexes must only appear at the top level of the schematic.`);let n;if(e.children?.every(e=>e.kind===Uo.kind))n=e.children?.map(e=>({schematic:e,data:{...t,currentPath:W(t.currentPath,lo(e.childName)),currentDir:W(t.currentDir,e.packageSuffix?.replaceAll(`.`,`/`))}}));else if(e.children?.some(e=>e.kind===Uo.kind))throw Error(`Form pages cannot be mixed with other kinds of fields.`);else n=[{schematic:e,data:t}];return{schematic:e,data:t,formPages:n}}function ls(e,t){let n=W(t.currentDir,`${e.name}App.tsx`),r=t.files.get(n);r||t.files.set(n,r=Ka()),us(e,{kmpModuleName:`${mo(e.name)}-shared`,...t,currentFile:r}),Eo(e,t)}function us(e,t){let n=(t.defaultLocale??`en-US`).replaceAll(`-`,``),r=t.activePathSearchParam??`page`;t.currentFile.imports.push({moduleName:`@ostack.tech/kform`,name:`ktMapToObject`},{moduleName:`@ostack.tech/ui`,name:`useSearchParam`},{moduleName:`@ostack.tech/ui-kform`,name:`FormApp`},{moduleName:`@ostack.tech/ui-kform`,name:n},{moduleName:`@ostack.tech/ui-kform`,name:`IssuesPanel`},{moduleName:`react`,name:`useMemo`},{moduleName:t.kmpModuleName,name:`${e.name}FormMode`},{moduleName:t.kmpModuleName,name:`${e.name}Schema`},{moduleName:`./api/reportError.ts`,name:`reportError`},{moduleName:`./${e.name}Context.ts`,name:`use${e.name}Context`});let i=``;Do(t)&&(t.currentFile.imports.push({moduleName:`./${e.name}IssueMessages.tsx`,name:`${po(e.name)}_ISSUE_MESSAGES`}),i=`\nissueMessages={${po(e.name)}_ISSUE_MESSAGES}`),t.currentFile.declarations.push(ea`
|
|
540
437
|
export function ${e.name}App() {
|
|
541
438
|
const { externalContexts } = use${e.name}Context();
|
|
542
439
|
const [activePath, setActivePath] = useSearchParam("${r}");
|
|
@@ -554,61 +451,85 @@ fun decode<%= formClass %>SubmitResponseFromString(xml: String): <%= formClass %
|
|
|
554
451
|
[externalContexts],
|
|
555
452
|
)}
|
|
556
453
|
readOnly={externalContexts.mode === ${e.name}FormMode.READ}
|
|
557
|
-
validationMode={
|
|
558
|
-
externalContexts.mode === ${e.name}FormMode.READ
|
|
559
|
-
? "manual"
|
|
560
|
-
: "auto"
|
|
561
|
-
}
|
|
562
454
|
formTitle="${fo(e.name)}"
|
|
563
455
|
activePath={activePath}
|
|
564
456
|
onActivePathChange={setActivePath}${i}
|
|
565
457
|
defaultLocale={${n}}
|
|
566
458
|
reportError={reportError}
|
|
459
|
+
debug={import.meta.env.DEV}
|
|
567
460
|
>
|
|
568
|
-
${
|
|
461
|
+
${ds(e,t)}
|
|
569
462
|
|
|
570
463
|
<IssuesPanel />
|
|
571
464
|
</FormApp>
|
|
572
465
|
);
|
|
573
466
|
}
|
|
574
|
-
`)}function
|
|
575
|
-
${n(t)}
|
|
467
|
+
`)}function ds(e,t,n=fs){let r=os(e,t);return r.length===1&&r[0].data.currentPath===`/`?ea`
|
|
468
|
+
${n(e,t)}
|
|
576
469
|
|
|
577
|
-
${
|
|
470
|
+
${hs(t,r[0])}
|
|
578
471
|
`:(t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`Annexes`},{moduleName:`@ostack.tech/ui-kform`,name:`AnnexesManager`}),ea`
|
|
579
472
|
<Annexes>
|
|
580
|
-
${n(t,`<AnnexesManager />`)}
|
|
473
|
+
${n(e,t,`<AnnexesManager />`)}
|
|
581
474
|
|
|
582
|
-
${r.map(e=>
|
|
475
|
+
${r.map(e=>ms(t,e)).join(`
|
|
583
476
|
|
|
584
477
|
`)}
|
|
585
478
|
</Annexes>
|
|
586
|
-
`)}function
|
|
587
|
-
<TopBar>${
|
|
479
|
+
`)}function fs(e,t,n){return t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`TopBar`},{moduleName:`@ostack.tech/ui-kform`,name:`TopBarActions`}),ea`
|
|
480
|
+
<TopBar>${n?`\n ${n}\n`:``}
|
|
588
481
|
<TopBarActions>
|
|
589
|
-
|
|
590
|
-
<Save />
|
|
591
|
-
<Validate />
|
|
592
|
-
<Submit />
|
|
482
|
+
${ps(e,t)}
|
|
593
483
|
</TopBarActions>
|
|
594
|
-
</TopBar
|
|
595
|
-
`}function
|
|
484
|
+
</TopBar>;
|
|
485
|
+
`}function ps(e,t){let n=e.name,r=lo(n),i=t.serializationFormat??`json`,a=`application/${t.serializationFormat}`;return t.currentFile.imports.push({moduleName:`@ostack.tech/kform`,name:`LocatedValidationWarning`},{moduleName:`@ostack.tech/ui-kform`,name:`LoadAction`},{moduleName:`@ostack.tech/ui-kform`,name:`SaveAction`},{moduleName:`@ostack.tech/ui-kform`,name:`ValidateAction`},{moduleName:`@ostack.tech/ui-kform`,name:`SubmitAction`},{moduleName:t.kmpModuleName,name:n,isType:!0},{moduleName:t.kmpModuleName,name:`decode${n}FromString`},{moduleName:t.kmpModuleName,name:`encode${n}ToString`},{moduleName:t.kmpModuleName,name:`${n}SubmitSuccess`},{moduleName:t.kmpModuleName,name:`${n}SubmitValidationError`},{moduleName:t.kmpModuleName,name:`${n}SubmitError`},{moduleName:`./api/submit.ts`,name:`submit`}),ea`
|
|
486
|
+
<LoadAction
|
|
487
|
+
decode={async (file) => decode${n}FromString(await file.text())}
|
|
488
|
+
mimeTypes={["${a}"]}
|
|
489
|
+
extensions={[".${i}"]}
|
|
490
|
+
/>
|
|
491
|
+
<SaveAction
|
|
492
|
+
encode={(${r}: ${n}) => encode${n}ToString(${r}, true)}
|
|
493
|
+
mimeTypes={["${a}"]}
|
|
494
|
+
extensions={[".${i}"]}
|
|
495
|
+
/>
|
|
496
|
+
<ValidateAction />
|
|
497
|
+
<SubmitAction
|
|
498
|
+
onSubmit={async (
|
|
499
|
+
${r}: ${n},
|
|
500
|
+
acceptedWarnings?: LocatedValidationWarning[],
|
|
501
|
+
) => {
|
|
502
|
+
const response = await submit(${r}, acceptedWarnings);
|
|
503
|
+
if (response instanceof ${n}SubmitSuccess) {
|
|
504
|
+
return response.redirectTo;
|
|
505
|
+
} else if (response instanceof ${n}SubmitValidationError) {
|
|
506
|
+
return response.issues;
|
|
507
|
+
} else {
|
|
508
|
+
throw response as ${n}SubmitError;
|
|
509
|
+
}
|
|
510
|
+
}}
|
|
511
|
+
onSuccessfulSubmit={(redirectTo: string) => {
|
|
512
|
+
window.location.href = redirectTo;
|
|
513
|
+
}}${t.useTableValuesSerializer?`
|
|
514
|
+
convertExternalIssuesTableRowIndicesToIds`:``}
|
|
515
|
+
/>
|
|
516
|
+
`}function ms(e,t){return e.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`Annex`}),ea`
|
|
596
517
|
<Annex path="${t.data.currentPath}" title="${ho(t.schematic.name)}"${t.formPages.length===1&&t.schematic===t.formPages[0].schematic?` documentTitle={null}`:``}>
|
|
597
|
-
${
|
|
518
|
+
${hs(e,t)}
|
|
598
519
|
</Annex>
|
|
599
|
-
`}function
|
|
520
|
+
`}function hs(e,t){e.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`FormPages`});let n=``;return t.formPages.length>1&&(e.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`FormPagesNavigation`}),n=`
|
|
600
521
|
<FormPagesNavigation />
|
|
601
522
|
`),ea`
|
|
602
523
|
<FormPages>${n}
|
|
603
|
-
${t.formPages.map(n=>
|
|
524
|
+
${t.formPages.map(n=>gs(e,t,n)).join(`
|
|
604
525
|
|
|
605
526
|
`)}
|
|
606
527
|
</FormPages>
|
|
607
|
-
`}function
|
|
528
|
+
`}function gs(e,t,n){e.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`FormPage`},{moduleName:`./${W(n.data.currentDir.slice(e.currentDir.length+ +!e.currentDir.endsWith(`/`)),n.schematic.name)}.tsx`,name:n.schematic.name});let r=``;Do(e)&&n.data.currentPath!==`/`&&(e.currentFile.imports.push({moduleName:`./${W(n.data.currentDir.slice(e.currentDir.length+ +!e.currentDir.endsWith(`/`)),n.schematic.name)}IssueMessages.tsx`,name:`${po(n.schematic.name)}_ISSUE_MESSAGES`}),r=` issueMessages={${po(n.schematic.name)}_ISSUE_MESSAGES}`);let i=t.schematic===n.schematic?``:` path="${n.data.currentPath.slice(t.data.currentPath.length+ +!t.data.currentPath.endsWith(`/`))}"`,a=n.data.currentPath===`/`?` documentTitle={null}`:``;return ea`
|
|
608
529
|
<FormPage${i} title="${ho(n.schematic.name)}" code="${n.schematic.name?.[0].toUpperCase()}"${a}${r}>
|
|
609
530
|
<${n.schematic.name} />
|
|
610
531
|
</FormPage>
|
|
611
|
-
`}var
|
|
532
|
+
`}var _s=`import { createContext, useContext } from "react";
|
|
612
533
|
import { <%= formClass %>ExternalContexts } from "<%= kmpModuleName %>";
|
|
613
534
|
|
|
614
535
|
export interface <%= formClass %>ContextValue {
|
|
@@ -620,7 +541,7 @@ export const <%= formClass %>Context = createContext<<%= formClass %>ContextValu
|
|
|
620
541
|
export function use<%= formClass %>Context(): <%= formClass %>ContextValue {
|
|
621
542
|
return useContext(<%= formClass %>Context);
|
|
622
543
|
}
|
|
623
|
-
`;function
|
|
544
|
+
`;function vs(e,t){let n={kmpModuleName:t.kmpModuleName??`${mo(e.name)}-shared`,formClass:e.name};Na(t,`${e.name}Context.ts`,_s,n)}var ys=`package <%= filePackage %>
|
|
624
545
|
|
|
625
546
|
import kotlin.js.JsExport
|
|
626
547
|
import kotlin.jvm.JvmOverloads
|
|
@@ -645,15 +566,15 @@ data class <%= formClass %>ExternalContexts @JvmOverloads constructor(
|
|
|
645
566
|
) {
|
|
646
567
|
fun toMap(): Map<String, Any?> = mapOf("mode" to mode, "initialValue" to initialValue)
|
|
647
568
|
}
|
|
648
|
-
`;function
|
|
569
|
+
`;function bs(e,t){let n={filePackage:t.currentPackage,formClass:e.name};Na(t,`${e.name}ExternalContexts.kt`,ys,n)}var xs=`allprojects {
|
|
649
570
|
repositories { mavenCentral() }
|
|
650
571
|
}
|
|
651
|
-
`,
|
|
572
|
+
`,Ss=`group=<%= gradlePropertiesGroup %>
|
|
652
573
|
version=0.0.1
|
|
653
574
|
|
|
654
575
|
org.gradle.caching=true
|
|
655
576
|
org.gradle.configuration-cache=true
|
|
656
|
-
`,
|
|
577
|
+
`,Cs=`[versions]
|
|
657
578
|
# Plugins
|
|
658
579
|
kotlin = "2.4.0"
|
|
659
580
|
nodeGradle = "7.1.0"
|
|
@@ -704,7 +625,7 @@ xmlutil-serialization = { module = "io.github.pdvrieze.xmlutil:serialization", v
|
|
|
704
625
|
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
|
705
626
|
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
|
706
627
|
nodeGradle = { id = "com.github.node-gradle.node", version.ref = "nodeGradle" }
|
|
707
|
-
`,
|
|
628
|
+
`,ws=`import com.github.gradle.node.npm.task.NpmTask
|
|
708
629
|
|
|
709
630
|
plugins {
|
|
710
631
|
alias(libs.plugins.nodeGradle)
|
|
@@ -787,14 +708,14 @@ val npmRunLint by tasks.registering(NpmTask::class) {
|
|
|
787
708
|
tasks.assemble {
|
|
788
709
|
dependsOn(npmRunBuild)
|
|
789
710
|
}
|
|
790
|
-
`,
|
|
711
|
+
`,Ts=`plugins {
|
|
791
712
|
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
|
792
713
|
}
|
|
793
714
|
|
|
794
715
|
rootProject.name = "<%= formId %>"
|
|
795
716
|
|
|
796
717
|
include("shared", "react-app")
|
|
797
|
-
`,
|
|
718
|
+
`,Es=`import com.github.gradle.node.npm.task.NpmTask
|
|
798
719
|
|
|
799
720
|
plugins {
|
|
800
721
|
alias(libs.plugins.kotlin.multiplatform)
|
|
@@ -871,7 +792,7 @@ val packJsPackage by tasks.registering(NpmTask::class) {
|
|
|
871
792
|
inputs.dir(libraryDir)
|
|
872
793
|
outputs.file("build/<%= formId %>-shared-$version.tgz")
|
|
873
794
|
}
|
|
874
|
-
`,
|
|
795
|
+
`,Ds=`package <%= filePackage %>
|
|
875
796
|
|
|
876
797
|
// See: https://github.com/Kotlin/kotlinx-datetime?tab=readme-ov-file#note-about-time-zones-in-js
|
|
877
798
|
@JsModule("@js-joda/timezone")
|
|
@@ -880,7 +801,7 @@ external object JsJodaTimeZoneModule
|
|
|
880
801
|
|
|
881
802
|
@JsExport
|
|
882
803
|
val jsJodaTz = JsJodaTimeZoneModule
|
|
883
|
-
`;function
|
|
804
|
+
`;function Os(e,t){let n={gradlePropertiesGroup:t.gradlePropertiesGroup??t.currentPackage,filePackage:t.currentPackage,formId:mo(e.name),formTitle:fo(e.name),kFormVersion:`1.0.0-rc.1`,serializationFormat:t.serializationFormat??`json`,includeKotlinxDatetime:t.includeKotlinxDatetime??ks(e,t),includeKtMath:t.includeKtMath??As(e),jvmToolchainVersion:t.jvmToolchainVersion??`21`,nodejsVersion:t.nodejsVersion??`24.16.0`};Na(t,`gradle.properties`,Ss,n),Na(t,`settings.gradle.kts`,Ts,n),Na(t,`gradle/libs.versions.toml`,Cs,n),Ga(t,`build.gradle.kts`,xs),Na(t,`shared/build.gradle.kts`,Es,n),n.includeKotlinxDatetime&&Na(t,`shared/src/jsMain/kotlin/JsJodaTimeZone.kt`,Ds,n),Na(t,`react-app/build.gradle.kts`,ws,n)}function ks(e,t){return t.schematicKinds.get(e.kind)?.package===`kotlinx.datetime`||e.children?.some(e=>ks(e,t))===!0}function As(e){return[`BigInteger`,`BigDecimal`].includes(e.kind)||e.children?.some(e=>As(e))===!0}var js=`/assets/gradle-wrapper-BvbY_R1M.jar`,Ms=`distributionBase=GRADLE_USER_HOME
|
|
884
805
|
distributionPath=wrapper/dists
|
|
885
806
|
distributionUrl=https\\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
|
886
807
|
networkTimeout=10000
|
|
@@ -889,7 +810,7 @@ retryBackOffMs=500
|
|
|
889
810
|
validateDistributionUrl=true
|
|
890
811
|
zipStoreBase=GRADLE_USER_HOME
|
|
891
812
|
zipStorePath=wrapper/dists
|
|
892
|
-
`,
|
|
813
|
+
`,Ns=`@rem\r
|
|
893
814
|
@rem Copyright 2015 the original author or authors.\r
|
|
894
815
|
@rem\r
|
|
895
816
|
@rem Licensed under the Apache License, Version 2.0 (the "License");\r
|
|
@@ -971,7 +892,7 @@ endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.grad
|
|
|
971
892
|
:exitWithErrorLevel\r
|
|
972
893
|
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts\r
|
|
973
894
|
"%COMSPEC%" /c exit %ERRORLEVEL%\r
|
|
974
|
-
`,
|
|
895
|
+
`,Ps=`#!/bin/sh
|
|
975
896
|
|
|
976
897
|
#
|
|
977
898
|
# Copyright © 2015 the original authors.
|
|
@@ -1219,7 +1140,7 @@ eval "set -- $(
|
|
|
1219
1140
|
)" '"$@"'
|
|
1220
1141
|
|
|
1221
1142
|
exec "$JAVACMD" "$@"
|
|
1222
|
-
`;function
|
|
1143
|
+
`;function Fs(e,t){Ga(t,`gradlew`,Ps,{executable:!0}),Ga(t,`gradlew.bat`,Ns),Ga(t,`gradle/wrapper/gradle-wrapper.jar`,fetch(js).then(e=>e.arrayBuffer())),Ga(t,`gradle/wrapper/gradle-wrapper.properties`,Ms)}function Is(e,t){let n=W(t.currentDir,`main.tsx`),r=t.files.get(n);r||t.files.set(n,r=Ka()),Ls(e,{kmpModuleName:`${mo(e.name)}-shared`,...t,currentFile:r})}function Ls(e,t){t.currentFile.imports.push({moduleName:`./index.scss`},{moduleName:`react`,name:`StrictMode`},{moduleName:`react-dom/client`,name:`createRoot`},{moduleName:t.kmpModuleName,name:`decode${e.name}ExternalContextsFromString`},{moduleName:`./${e.name}Context.ts`,name:`${e.name}Context`},{moduleName:`./${e.name}App.tsx`,name:`${e.name}App`}),t.currentFile.declarations.push(ea`
|
|
1223
1144
|
export function renderRoot(encodedExternalContexts: string) {
|
|
1224
1145
|
createRoot(document.getElementById("${mo(e.name)}-app-root")!).render(
|
|
1225
1146
|
<StrictMode>
|
|
@@ -1235,7 +1156,7 @@ exec "$JAVACMD" "$@"
|
|
|
1235
1156
|
</StrictMode>,
|
|
1236
1157
|
);
|
|
1237
1158
|
}
|
|
1238
|
-
`)}var
|
|
1159
|
+
`)}var Rs=`# http://editorconfig.org
|
|
1239
1160
|
root = true
|
|
1240
1161
|
|
|
1241
1162
|
[*]
|
|
@@ -1253,9 +1174,9 @@ end_of_line = crlf
|
|
|
1253
1174
|
[{*.kt,*.kts,*.md}]
|
|
1254
1175
|
indent_size = 4
|
|
1255
1176
|
max_line_length = 100
|
|
1256
|
-
`,
|
|
1177
|
+
`,zs=`* text=auto eol=lf
|
|
1257
1178
|
*.bat text eol=crlf
|
|
1258
|
-
`,
|
|
1179
|
+
`,Bs=`# Gradle
|
|
1259
1180
|
.gradle/
|
|
1260
1181
|
build/
|
|
1261
1182
|
!**/src/**/build/
|
|
@@ -1292,7 +1213,7 @@ out/
|
|
|
1292
1213
|
# Misc
|
|
1293
1214
|
.DS_Store
|
|
1294
1215
|
*.pem
|
|
1295
|
-
`;function
|
|
1216
|
+
`;function Vs(e,t){Ga(t,`.gitignore`,Bs),Ga(t,`.gitattributes`,zs),Ga(t,`.editorconfig`,Rs)}var Hs=`package <%= filePackage %>
|
|
1296
1217
|
|
|
1297
1218
|
import kotlin.js.JsExport
|
|
1298
1219
|
import kotlin.jvm.JvmOverloads
|
|
@@ -1320,9 +1241,9 @@ class <%= formClass %>SubmitError @JvmOverloads constructor(override val message
|
|
|
1320
1241
|
@SerialName("validationError")
|
|
1321
1242
|
class <%= formClass %>SubmitValidationError(val issues: List<LocatedValidationIssue>) :
|
|
1322
1243
|
<%= formClass %>SubmitResponse
|
|
1323
|
-
`;function
|
|
1244
|
+
`;function Us(e,t){let n={filePackage:t.currentPackage,formClass:e.name};Na(t,`${e.name}Responses.kt`,Hs,n)}var Ws=`@use "@ostack.tech/ui/scss" as o-ui;
|
|
1324
1245
|
@use "@ostack.tech/ui-kform/scss" as o-ui-kform;
|
|
1325
|
-
`;function
|
|
1246
|
+
`;function Gs(e,t){Ga(t,`index.scss`,Ws)}var Ks=`import js from "@eslint/js";
|
|
1326
1247
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
1327
1248
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
1328
1249
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
@@ -1344,7 +1265,7 @@ export default defineConfig([
|
|
|
1344
1265
|
},
|
|
1345
1266
|
},
|
|
1346
1267
|
]);
|
|
1347
|
-
`,
|
|
1268
|
+
`,qs=`<!doctype html>
|
|
1348
1269
|
<html lang="en">
|
|
1349
1270
|
<head>
|
|
1350
1271
|
<meta charset="UTF-8" />
|
|
@@ -1366,7 +1287,7 @@ export default defineConfig([
|
|
|
1366
1287
|
<\/script>
|
|
1367
1288
|
</body>
|
|
1368
1289
|
</html>
|
|
1369
|
-
`,
|
|
1290
|
+
`,Js=`{
|
|
1370
1291
|
"name": "<%= formId %>-react-app",
|
|
1371
1292
|
"private": true,
|
|
1372
1293
|
"version": "0.0.0",
|
|
@@ -1406,7 +1327,7 @@ export default defineConfig([
|
|
|
1406
1327
|
"vite": "<%= dependencyVersions.vite %>"
|
|
1407
1328
|
}
|
|
1408
1329
|
}
|
|
1409
|
-
|
|
1330
|
+
`,Ys=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>`,Xs=`{
|
|
1410
1331
|
"compilerOptions": {
|
|
1411
1332
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
1412
1333
|
"target": "es2023",
|
|
@@ -1432,14 +1353,14 @@ export default defineConfig([
|
|
|
1432
1353
|
},
|
|
1433
1354
|
"include": ["src"]
|
|
1434
1355
|
}
|
|
1435
|
-
`,
|
|
1356
|
+
`,Zs=`{
|
|
1436
1357
|
"files": [],
|
|
1437
1358
|
"references": [
|
|
1438
1359
|
{ "path": "./tsconfig.app.json" },
|
|
1439
1360
|
{ "path": "./tsconfig.node.json" }
|
|
1440
1361
|
]
|
|
1441
1362
|
}
|
|
1442
|
-
`,
|
|
1363
|
+
`,Qs=`{
|
|
1443
1364
|
"compilerOptions": {
|
|
1444
1365
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
1445
1366
|
"target": "es2023",
|
|
@@ -1462,7 +1383,7 @@ export default defineConfig([
|
|
|
1462
1383
|
},
|
|
1463
1384
|
"include": ["vite.config.ts"]
|
|
1464
1385
|
}
|
|
1465
|
-
|
|
1386
|
+
`,$s=`import { resolve } from "node:path";
|
|
1466
1387
|
|
|
1467
1388
|
import react from "@vitejs/plugin-react";
|
|
1468
1389
|
import { defineConfig } from "vite";
|
|
@@ -1504,4 +1425,4 @@ export default defineConfig({
|
|
|
1504
1425
|
proxy: { "<%= apiBasePath %>": "<%= viteConfigProxyTarget %>" },
|
|
1505
1426
|
},
|
|
1506
1427
|
});
|
|
1507
|
-
`;function
|
|
1428
|
+
`;function ec(e,t){let n={formId:mo(e.name),formClass:e.name,formTitle:fo(e.name),ostackUiVersion:`0.16.3`,kFormVersion:`1.0.0-rc.1`,dependencyVersions:JSON.parse(`{"@eslint/js":"^10.0.1","@fortawesome/fontawesome-svg-core":"^7.3.1","@fortawesome/free-brands-svg-icons":"^7.3.1","@fortawesome/free-regular-svg-icons":"^7.3.1","@fortawesome/free-solid-svg-icons":"^7.3.1","@ostack.tech/kform":"~1.0.0-rc.1","@ostack.tech/kform-react":"~1.0.0-rc.1","@ostack.tech/kform-scaffolder":"~1.0.0-rc.1","@storybook/addon-a11y":"^10.5.7","@storybook/addon-docs":"^10.5.7","@storybook/addon-links":"^10.5.7","@storybook/react-vite":"^10.5.7","@types/node":"^24.13.3","@types/react":"^19.2.18","@types/react-dom":"^19.2.4","@vitejs/plugin-react":"^6.0.5","change-case":"^5.4.4","cpy-cli":"^7.0.0","date-fns":"^4.4.0","eslint":"^10.8.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.6","eslint-plugin-react-hooks":"^7.1.1","eslint-plugin-react-refresh":"^0.5.4","eslint-plugin-simple-import-sort":"^14.0.0","eslint-plugin-storybook":"^10.5.7","globals":"^17.10.0","happy-dom":"^20.11.2","lint-staged":"^17.2.0","prettier":"^3.9.6","prettier-plugin-jsdoc":"^1.8.1","react":"^19.2.8","react-dom":"^19.2.8","refractor":"^5.0.0","rimraf":"^6.1.3","sass-embedded":"^1.100.0","simple-git-hooks":"^2.13.1","storybook":"^10.5.7","terser":"^5.50.0","tslib":"^2.8.1","typescript":"~6.0.3","typescript-eslint":"^8.67.0","vite":"^8.2.1","vitest":"^4.1.10","write-excel-file":"^4.1.1","zod":"^4.4.3","zustand":"^5.0.14"}`),encodedExternalContexts:JSON.stringify(t.serializationFormat===`json`?`{}`:`<${e.name}ExternalContexts />`),apiBasePath:t.apiBasePath??`/api/`,viteConfigOutDir:t.viteConfigOutDir??`build/dist/`,viteConfigProxyTarget:t.viteConfigProxyTarget??`http://127.0.0.1:8080/`};Na(t,`react-app/package.json`,Js,n),Na(t,`react-app/vite.config.ts`,$s,n),Ga(t,`react-app/tsconfig.json`,Zs),Ga(t,`react-app/tsconfig.app.json`,Xs),Ga(t,`react-app/tsconfig.node.json`,Qs),Ga(t,`react-app/eslint.config.js`,Ks),Na(t,`react-app/index.html`,qs,n),Ga(t,`react-app/public/favicon.svg`,Ys)}var tc={currentDir:`shared/src/commonMain/kotlin`},nc={currentDir:`shared/src/commonTest/kotlin`},rc={currentDir:`react-app/src`};function ic({name:e=`ostack-ui-kform`,schematicKinds:t=as,scaffolders:n=[Vs,Fs,Os,ec,Gr(Da,tc),Gr(ui,tc),Gr(Us,tc),Gr(bs,tc),Gr(Fo,tc),Gr(Ia,nc),Gr(Is,rc),Gr(Gs,rc),Gr(ls,rc),Gr(vs,rc),Gr(wo,rc),Gr(ko,rc)],scaffoldingData:r=e=>({useFileBase64Serializer:!0,...e.config}),configs:i=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Qa,{}),(0,U.jsx)(eo,{}),(0,U.jsx)(to,{})]}),version:a=`0.16.3`,...o}){return(0,U.jsx)(Ha,{name:e,schematicKinds:t,scaffolders:n,scaffoldingData:r,configs:i,version:a,...o})}(0,S.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(C.StrictMode,{children:(0,U.jsx)(ic,{})}));
|