@ostack.tech/ui-kform-scaffolder 1.2.0-beta.1 → 1.2.0
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 +75 -27
- package/dist/ostack-ui-kform-scaffolder.js.map +1 -1
- package/dist/webapp/assets/{index-BvtvukH_.js → index-B5F6GfVR.js} +95 -82
- package/dist/webapp/index.html +1 -1
- package/package.json +2 -2
- package/types/configs/UseReactCompilerConfig.d.ts +5 -0
- package/types/configs/UseTableValuesSerializerConfig.d.ts +5 -3
- package/types/index.d.ts +1 -0
- package/types/scaffolding/ScaffoldingData.d.ts +2 -0
|
@@ -170,11 +170,11 @@ suspend fun assert<%= formClass %>NotContainsWarning(
|
|
|
170
170
|
LocatedValidationWarning(path, code),
|
|
171
171
|
validate<%= formClass %>(<%= formVar %>, path, externalContexts),
|
|
172
172
|
)
|
|
173
|
-
`;function fo(e,t){co(t,`${e.name}Validator.kt`,uo,{filePackage:t.currentPackage,formVar:Si(e.name),formClass:e.name})}var po=typeof document<`u`?E.useLayoutEffect:E.useEffect;function mo(e,t){let n=(0,T.c)(4),r,i;n[0]!==e||n[1]!==t?(r=()=>{if(!e){t(void 0);return}let n=()=>t(e.getBoundingClientRect());n();let r=new ResizeObserver(e=>{let[t]=e;return t&&n()});return r.observe(e),window.addEventListener(`resize`,n),()=>{r.disconnect(),window.removeEventListener(`resize`,n),t(void 0)}},i=[e,t],n[0]=e,n[1]=t,n[2]=r,n[3]=i):(r=n[2],i=n[3]),po(r,i)}function ho(e){let t=(0,T.c)(7),{children:n}=e,[r,i]=(0,E.useState)(null),[a,o]=(0,E.useState)(null),s;t[0]===a?s=t[1]:(s=e=>{a&&e&&(a.style.setProperty(`--anchor-top`,`${e.top}px`),a.style.setProperty(`--anchor-left`,`${e.left}px`),a.style.setProperty(`--anchor-bottom`,`${e.bottom}px`),a.style.setProperty(`--anchor-right`,`${e.right}px`),a.style.setProperty(`--anchor-width`,`${e.width}px`),a.style.setProperty(`--anchor-height`,`${e.height}px`))},t[0]=a,t[1]=s),mo(r,s);let c;t[2]===a?c=t[3]:(c=e=>{a&&e&&(a.style.setProperty(`--width`,`${e.width}px`),a.style.setProperty(`--height`,`${e.height}px`))},t[2]=a,t[3]=c),mo(a,c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,q.jsx)(`button`,{type:`button`,className:`builder-icon-button builder-action builder-config-schematic`,popoverTarget:`builder-config-popover`,title:`Config`,"aria-label":`Config`,ref:i,children:`⚙️`}),t[4]=l):l=t[4];let u;return t[5]===n?u=t[6]:(u=(0,q.jsxs)(q.Fragment,{children:[l,(0,q.jsx)(`div`,{popover:``,id:`builder-config-popover`,ref:o,children:n})]}),t[5]=n,t[6]=u),u}var go={currentDir:`shared/src/commonMain/kotlin`},_o={currentDir:`shared/src/commonTest/kotlin`},vo=`1.2.0
|
|
173
|
+
`;function fo(e,t){co(t,`${e.name}Validator.kt`,uo,{filePackage:t.currentPackage,formVar:Si(e.name),formClass:e.name})}var po=typeof document<`u`?E.useLayoutEffect:E.useEffect;function mo(e,t){let n=(0,T.c)(4),r,i;n[0]!==e||n[1]!==t?(r=()=>{if(!e){t(void 0);return}let n=()=>t(e.getBoundingClientRect());n();let r=new ResizeObserver(e=>{let[t]=e;return t&&n()});return r.observe(e),window.addEventListener(`resize`,n),()=>{r.disconnect(),window.removeEventListener(`resize`,n),t(void 0)}},i=[e,t],n[0]=e,n[1]=t,n[2]=r,n[3]=i):(r=n[2],i=n[3]),po(r,i)}function ho(e){let t=(0,T.c)(7),{children:n}=e,[r,i]=(0,E.useState)(null),[a,o]=(0,E.useState)(null),s;t[0]===a?s=t[1]:(s=e=>{a&&e&&(a.style.setProperty(`--anchor-top`,`${e.top}px`),a.style.setProperty(`--anchor-left`,`${e.left}px`),a.style.setProperty(`--anchor-bottom`,`${e.bottom}px`),a.style.setProperty(`--anchor-right`,`${e.right}px`),a.style.setProperty(`--anchor-width`,`${e.width}px`),a.style.setProperty(`--anchor-height`,`${e.height}px`))},t[0]=a,t[1]=s),mo(r,s);let c;t[2]===a?c=t[3]:(c=e=>{a&&e&&(a.style.setProperty(`--width`,`${e.width}px`),a.style.setProperty(`--height`,`${e.height}px`))},t[2]=a,t[3]=c),mo(a,c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,q.jsx)(`button`,{type:`button`,className:`builder-icon-button builder-action builder-config-schematic`,popoverTarget:`builder-config-popover`,title:`Config`,"aria-label":`Config`,ref:i,children:`⚙️`}),t[4]=l):l=t[4];let u;return t[5]===n?u=t[6]:(u=(0,q.jsxs)(q.Fragment,{children:[l,(0,q.jsx)(`div`,{popover:``,id:`builder-config-popover`,ref:o,children:n})]}),t[5]=n,t[6]=u),u}var go={currentDir:`shared/src/commonMain/kotlin`},_o={currentDir:`shared/src/commonTest/kotlin`},vo=`1.2.0`,yo=[Ur(no,go),Ur(li,go),Ur(lo,go),Ur(fo,_o)],bo=e=>e.config,xo=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Vr,{}),(0,q.jsx)(Hr,{}),(0,q.jsx)(Yr,{})]}),So=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zr,{}),(0,q.jsx)(Qr,{})]});function Co(e){let t=(0,T.c)(53),{name:n,title:r,basePath:i,basePackage:a,baseDir:o,defaultRootClassPackage:s,defaultRootClassName:c,schematicKinds:l,scaffolders:u,scaffoldingData:d,actions:f,configs:p,version:m}=e,h=n===void 0?`kform`:n,g=r===void 0?document.title:r,_=s===void 0?`org.example`:s,v=c===void 0?`MyForm`:c,y=l===void 0?to:l,b=u===void 0?yo:u,x=d===void 0?bo:d,S=f===void 0?xo:f,C=p===void 0?So:p,w=m===void 0?vo:m,D;t[0]!==v||t[1]!==_||t[2]!==h?(D=()=>Vn(Kn(()=>Pr({kind:Va.kind,packageSuffix:_,name:v,children:[]}),{name:h})),t[0]=v,t[1]=_,t[2]=h,t[3]=D):D=t[3];let[O]=(0,E.useState)(D),k;t[4]===y?k=t[5]:(k=new Map(y.sort(Eo).map(To)),t[4]=y,t[5]=k);let A=k,j=(0,E.useRef)(null),[M,N]=(0,E.useState)(null),P;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(P={activationConstraint:{distance:10,delay:400,tolerance:20}},t[6]=P):P=t[6];let F=Se(xe(St,P),xe(_t)),I,L;t[7]===O?(I=t[8],L=t[9]):(I=()=>O.getState(),L=e=>O.setState(e),t[7]=O,t[8]=I,t[9]=L);let R;t[10]!==o||t[11]!==a||t[12]!==i||t[13]!==M||t[14]!==h||t[15]!==b||t[16]!==x||t[17]!==A||t[18]!==O||t[19]!==I||t[20]!==L?(R={name:h,basePath:i,basePackage:a,baseDir:o,schematicKinds:A,scaffolders:b,scaffoldingData:x,store:O,getSchematic:I,setSchematic:L,removeSchematic:wo,parentPackage:a,draggedSchematic:M,latestSchematicFileHandleRef:j},t[10]=o,t[11]=a,t[12]=i,t[13]=M,t[14]=h,t[15]=b,t[16]=x,t[17]=A,t[18]=O,t[19]=I,t[20]=L,t[21]=R):R=t[21];let z;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>N({id:e.active.id,...e.active.data.current}),t[22]=z):z=t[22];let B;t[23]===O?B=t[24]:(B=e=>{let{parentId:t,sortBefore:n,ignored:r}=e.over?.data.current??{};r||O.setState(r=>Fr(r,e.active.id,t,n)),N(null)},t[23]=O,t[24]=B);let V;t[25]===g?V=t[26]:(V=(0,q.jsx)(`h1`,{className:`builder-title`,children:g}),t[25]=g,t[26]=V);let ee;t[27]===w?ee=t[28]:(ee=w&&(0,q.jsx)(`div`,{className:`builder-version`,children:w}),t[27]=w,t[28]=ee);let te;t[29]===C?te=t[30]:(te=C&&(0,q.jsx)(ho,{children:C}),t[29]=C,t[30]=te);let ne;t[31]!==S||t[32]!==te?(ne=(0,q.jsxs)(`div`,{className:`builder-actions`,children:[te,S]}),t[31]=S,t[32]=te,t[33]=ne):ne=t[33];let re;t[34]!==V||t[35]!==ee||t[36]!==ne?(re=(0,q.jsxs)(`header`,{className:`builder-header`,children:[V,ee,ne]}),t[34]=V,t[35]=ee,t[36]=ne,t[37]=re):re=t[37];let ie;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,q.jsx)(Xi,{}),t[38]=ie):ie=t[38];let H;t[39]===re?H=t[40]:(H=(0,q.jsxs)(`form`,{className:`builder-root`,children:[re,ie]}),t[39]=re,t[40]=H);let ae;t[41]===M?ae=t[42]:(ae=M&&(0,q.jsx)(`div`,{className:`builder-dragged`,children:M.node}),t[41]=M,t[42]=ae);let oe;t[43]===ae?oe=t[44]:(oe=(0,q.jsx)(zn,{children:ae}),t[43]=ae,t[44]=oe);let se;t[45]!==F||t[46]!==B||t[47]!==H||t[48]!==oe?(se=(0,q.jsxs)(yn,{sensors:F,collisionDetection:Ae,onDragStart:z,onDragEnd:B,children:[H,oe]}),t[45]=F,t[46]=B,t[47]=H,t[48]=oe,t[49]=se):se=t[49];let U;return t[50]!==R||t[51]!==se?(U=(0,q.jsx)(Rr,{value:R,children:se}),t[50]=R,t[51]=se,t[52]=U):U=t[52],U}function wo(){}function To(e){return[e.kind,e]}function Eo(e,t){return e.kind.localeCompare(t.kind)}function Do(e,t){return{...t,content:e,getContent:Oo}}function Oo(){return this.content}function ko(e,t,n,r){e.files.set(Gr(e.currentDir,t),Do(n,r))}function Ao(){return{imports:[],declarations:[],getContent:jo}}function jo(){return[Mo(this.imports).sort((e,t)=>e.moduleName.localeCompare(t.moduleName)).map(e=>No(e)).join(`
|
|
174
174
|
`),...this.declarations].filter(e=>e).join(`
|
|
175
175
|
|
|
176
176
|
`)+`
|
|
177
|
-
`}function Mo(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 No(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 Po=`en-US`,Y=JSON.parse(`["en-GB","en-US","fr-FR","pt-PT"]`);function Fo(e){let t=(0,T.c)(8),{defaultValue:n,disabled:r}=e,[i,a]=Xr(`defaultLocale`,n===void 0?Po:n),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(`label`,{children:`Default locale`}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>{a(e.target.value)},t[1]=a,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=Y.map(Io),t[3]=c):c=t[3];let l;return t[4]!==i||t[5]!==r||t[6]!==s?(l=(0,q.jsxs)(`div`,{className:`builder-config-field`,children:[o,(0,q.jsx)(`select`,{value:i,onChange:s,disabled:r,children:c})]}),t[4]=i,t[5]=r,t[6]=s,t[7]=l):l=t[7],l}function Io(e){return(0,q.jsx)(`option`,{value:e,children:e},e)}var Lo=`json`;function Ro(e){let t=(0,T.c)(11),{defaultValue:n,disabled:r}=e,i=n===void 0?Lo:n,[a,o]=Xr(`useTableValuesSerializer`,!1),s=(0,E.useRef)(a),[c,l]=Xr(`serializationFormat`,i),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(`label`,{children:`Serialization format`}),t[0]=u):u=t[0];let d;t[1]!==l||t[2]!==o||t[3]!==a?(d=e=>{l(e.target.value),e.target.value===`xml`?(s.current=a,o(!0)):o(s.current)},t[1]=l,t[2]=o,t[3]=a,t[4]=d):d=t[4];let f,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,q.jsx)(`option`,{value:`json`,children:`JSON`}),p=(0,q.jsx)(`option`,{value:`xml`,children:`XML`}),t[5]=f,t[6]=p):(f=t[5],p=t[6]);let m;return t[7]!==c||t[8]!==r||t[9]!==d?(m=(0,q.jsxs)(`div`,{className:`builder-config-field`,children:[u,(0,q.jsxs)(`select`,{value:c,onChange:d,disabled:r,children:[f,p]})]}),t[7]=c,t[8]=r,t[9]=d,t[10]=m):m=t[10],m}function zo(e){let t=(0,T.c)(2),{disabled:n}=e,[r]=Xr(`serializationFormat`,Lo),
|
|
177
|
+
`}function Mo(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 No(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 Po=`en-US`,Y=JSON.parse(`["en-GB","en-US","fr-FR","pt-PT"]`);function Fo(e){let t=(0,T.c)(8),{defaultValue:n,disabled:r}=e,[i,a]=Xr(`defaultLocale`,n===void 0?Po:n),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(`label`,{children:`Default locale`}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>{a(e.target.value)},t[1]=a,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=Y.map(Io),t[3]=c):c=t[3];let l;return t[4]!==i||t[5]!==r||t[6]!==s?(l=(0,q.jsxs)(`div`,{className:`builder-config-field`,children:[o,(0,q.jsx)(`select`,{value:i,onChange:s,disabled:r,children:c})]}),t[4]=i,t[5]=r,t[6]=s,t[7]=l):l=t[7],l}function Io(e){return(0,q.jsx)(`option`,{value:e,children:e},e)}var Lo=`json`;function Ro(e){let t=(0,T.c)(11),{defaultValue:n,disabled:r}=e,i=n===void 0?Lo:n,[a,o]=Xr(`useTableValuesSerializer`,!1),s=(0,E.useRef)(a),[c,l]=Xr(`serializationFormat`,i),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(`label`,{children:`Serialization format`}),t[0]=u):u=t[0];let d;t[1]!==l||t[2]!==o||t[3]!==a?(d=e=>{l(e.target.value),e.target.value===`xml`?(s.current=a,o(!0)):o(s.current)},t[1]=l,t[2]=o,t[3]=a,t[4]=d):d=t[4];let f,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,q.jsx)(`option`,{value:`json`,children:`JSON`}),p=(0,q.jsx)(`option`,{value:`xml`,children:`XML`}),t[5]=f,t[6]=p):(f=t[5],p=t[6]);let m;return t[7]!==c||t[8]!==r||t[9]!==d?(m=(0,q.jsxs)(`div`,{className:`builder-config-field`,children:[u,(0,q.jsxs)(`select`,{value:c,onChange:d,disabled:r,children:[f,p]})]}),t[7]=c,t[8]=r,t[9]=d,t[10]=m):m=t[10],m}function zo(e){let t=(0,T.c)(6),{defaultValue:n,disabled:r}=e,[i,a]=Xr(`useReactCompiler`,n!==void 0&&n),o;t[0]===a?o=t[1]:(o=e=>a(e.target.checked),t[0]=a,t[1]=o);let s;return t[2]!==i||t[3]!==r||t[4]!==o?(s=(0,q.jsx)(`div`,{className:`builder-config-field`,children:(0,q.jsxs)(`label`,{children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:i,onChange:o,disabled:r}),`Use React Compiler`]})}),t[2]=i,t[3]=r,t[4]=o,t[5]=s):s=t[5],s}function Bo(e){let t=(0,T.c)(7),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({defaultSerializationFormatValue:i,disabled:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let[a]=Xr(`serializationFormat`,i===void 0?Lo:i),o=n||a===`xml`,s;return t[4]!==r||t[5]!==o?(s=(0,q.jsx)(Qr,{disabled:o,...r}),t[4]=r,t[5]=o,t[6]=s):s=t[6],s}var Vo=/([\p{Ll}\d])(\p{Lu})/gu,Ho=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,Uo=/(\d)\p{Ll}|(\p{L})\d/u,Wo=/[^\p{L}\d]+/giu,Go=`$1\0$2`,Ko=``;function qo(e){let t=e.trim();t=t.replace(Vo,Go).replace(Ho,Go),t=t.replace(Wo,`\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 Jo(e){let t=qo(e);for(let e=0;e<t.length;e++){let n=t[e],r=Uo.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 Yo(e,t){let[n,r,i]=as(e,t);return n+r.map(ts(t?.locale)).join(t?.delimiter??` `)+i}function Xo(e,t){let[n,r,i]=as(e,t),a=ts(t?.locale),o=ns(t?.locale),s=t?.mergeAmbiguousCharacters?rs(a,o):is(a,o);return n+r.map((e,t)=>t===0?a(e):s(e,t)).join(t?.delimiter??``)+i}function Zo(e,t){let[n,r,i]=as(e,t),a=ts(t?.locale),o=ns(t?.locale),s=t?.mergeAmbiguousCharacters?rs(a,o):is(a,o);return n+r.map(s).join(t?.delimiter??``)+i}function Qo(e,t){let[n,r,i]=as(e,t),a=ts(t?.locale),o=ns(t?.locale);return n+r.map(rs(a,o)).join(t?.delimiter??` `)+i}function $o(e,t){let[n,r,i]=as(e,t);return n+r.map(ns(t?.locale)).join(t?.delimiter??`_`)+i}function X(e,t){return Yo(e,{delimiter:`-`,...t})}function es(e,t){let[n,r,i]=as(e,t),a=ts(t?.locale),o=rs(a,ns(t?.locale));return n+r.map((e,t)=>t===0?o(e):a(e)).join(t?.delimiter??` `)+i}function ts(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function ns(e){return e===!1?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function rs(e,t){return n=>`${t(n[0])}${e(n.slice(1))}`}function is(e,t){return(n,r)=>{let i=n[0];return(r>0&&i>=`0`&&i<=`9`?`_`+i:t(i))+e(n.slice(1))}}function as(e,t={}){let n=t.split??(t.separateNumbers?Jo:qo),r=t.prefixCharacters??Ko,i=t.suffixCharacters??Ko,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 os=`const API_BASE_URL = new URL("<%= apiBasePath %>", window.location.origin);
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
180
|
* Wrapper around \`fetch\` for accessing the API.
|
|
@@ -184,7 +184,7 @@ suspend fun assert<%= formClass %>NotContainsWarning(
|
|
|
184
184
|
export function apiFetch(url: string | URL, init?: RequestInit) {
|
|
185
185
|
return fetch(new URL(url, API_BASE_URL), init);
|
|
186
186
|
}
|
|
187
|
-
`,
|
|
187
|
+
`,ss=`import type { ErrorReport } from "@ostack.tech/ui";
|
|
188
188
|
import { apiFetch } from "./apiFetch.ts";
|
|
189
189
|
|
|
190
190
|
const REPORT_ERROR_API_ENDPOINT = "<%= reportErrorApiEndpoint %>";
|
|
@@ -196,7 +196,7 @@ export async function reportError(error: ErrorReport) {
|
|
|
196
196
|
body: JSON.stringify(error, null, import.meta.env.DEV ? 2 : 0),
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
|
-
`,
|
|
199
|
+
`,cs=`import { LocatedValidationWarning } from "@ostack.tech/kform";
|
|
200
200
|
import {
|
|
201
201
|
decode<%= formClass %>SubmitResponseFromString,
|
|
202
202
|
encode<%= formClass %>ToString,
|
|
@@ -223,15 +223,15 @@ export async function submit(
|
|
|
223
223
|
});
|
|
224
224
|
return decode<%= formClass %>SubmitResponseFromString(await response.text());
|
|
225
225
|
}
|
|
226
|
-
`;function
|
|
227
|
-
export const ${
|
|
228
|
-
`)}function
|
|
226
|
+
`;function ls(e,t){let n={kmpModuleName:t.kmpModuleName??`${X(e.name)}-shared`,serializationFormat:t.serializationFormat??`json`,serializationMimeType:`application/${t.serializationFormat}`,formVar:Xo(e.name),formClass:e.name,apiBasePath:t.apiBasePath??`/api/`,reportErrorApiEndpoint:t.reportErrorApiEndpoint??`report-error`,submitApiEndpoint:t.submitApiEndpoint??`submit`};co(t,`api/apiFetch.ts`,os,n),co(t,`api/reportError.ts`,ss,n),co(t,`api/submit.ts`,cs,n)}var us=!0;function ds(e,t){if(!fs(t))return;let n=Gr(t.currentDir,`${e.name}IssueMessages.tsx`),r=t.files.get(n);r||t.files.set(n,r=Ao()),ps(e,{kmpModuleName:`${X(t.rootSchematic.name)}-shared`,...t,currentFile:r})}function fs(e){return e.scaffoldIssueMessages??us}function ps(e,t){t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`IssueMessagesByCode`,isType:!0}),t.currentFile.declarations.push(ka`
|
|
227
|
+
export const ${$o(e.name)}_ISSUE_MESSAGES: Record<string, IssueMessagesByCode> = {};
|
|
228
|
+
`)}function ms(e,t){let n=Gs(e,{kmpModuleName:`${X(e.name)}-shared`,...t});for(let e of n)for(let t of e.formPages)hs(t.schematic,t.data),t.data.currentPath!==`/`&&ds(t.schematic,t.data)}function hs(e,t){let n=Gr(t.currentDir,`${e.name}.tsx`),r=t.files.get(n);r||t.files.set(n,r=Ao()),gs(e,{kmpModuleName:`${X(t.rootSchematic.name)}-shared`,...t,currentFile:r})}function gs(e,t){t.currentFile.imports.push({moduleName:`@ostack.tech/ui`,name:`Grid`}),t.currentFile.declarations.push(ka`
|
|
229
229
|
export function ${e.name}() {
|
|
230
230
|
return (
|
|
231
231
|
<Grid container>
|
|
232
232
|
${e.children.map(e=>ka`
|
|
233
233
|
<Grid xs={12}>
|
|
234
|
-
${
|
|
234
|
+
${_s(e,{...t,currentPath:e.childName})}
|
|
235
235
|
</Grid>
|
|
236
236
|
`).join(`
|
|
237
237
|
|
|
@@ -239,12 +239,12 @@ export async function submit(
|
|
|
239
239
|
</Grid>
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
|
-
`)}function
|
|
242
|
+
`)}function _s(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>${es(e.childName)}</Label>`),ka`
|
|
243
243
|
<Field>
|
|
244
244
|
${[o,a].filter(e=>e).join(`
|
|
245
245
|
`)}
|
|
246
246
|
</Field>
|
|
247
|
-
`}var
|
|
247
|
+
`}var vs=`package <%= filePackage %>
|
|
248
248
|
|
|
249
249
|
import kotlin.js.JsExport
|
|
250
250
|
import kotlin.jvm.JvmOverloads
|
|
@@ -290,7 +290,7 @@ fun encode<%= formClass %>SubmitResponseToString(response: <%= formClass %>Submi
|
|
|
290
290
|
@JsExport
|
|
291
291
|
fun decode<%= formClass %>SubmitResponseFromString(json: String): <%= formClass %>SubmitResponse =
|
|
292
292
|
jsonConfig().decodeFromString(json)
|
|
293
|
-
`,
|
|
293
|
+
`,ys=`package <%= filePackage %>
|
|
294
294
|
|
|
295
295
|
import kotlin.js.JsExport
|
|
296
296
|
import kotlin.jvm.JvmOverloads
|
|
@@ -375,21 +375,21 @@ fun encode<%= formClass %>SubmitResponseToString(response: <%= formClass %>Submi
|
|
|
375
375
|
@JsExport
|
|
376
376
|
fun decode<%= formClass %>SubmitResponseFromString(xml: String): <%= formClass %>SubmitResponse =
|
|
377
377
|
xmlConfig().decodeFromString(xml)
|
|
378
|
-
`;function
|
|
378
|
+
`;function bs(e,t){let n={filePackage:t.currentPackage,formVar:Xo(e.name),formClass:e.name,formConstant:$o(e.name),includeSerializationFormatVersion:t.includeSerializationFormatVersion??!0};co(t,`${e.name}Serializer.kt`,t.serializationFormat===`xml`?ys:vs,n)}function xs(e){return e==null?[]:Array.isArray(e)?e:[e]}var Ss={...Fa},Cs={...Ia,control:`@ostack.tech/ui-kform.NumericControl`},ws={...La,control:`@ostack.tech/ui-kform.NumericControl`},Ts={...Ra,control:`@ostack.tech/ui-kform.CheckboxControl`,omitFieldLabel:!0,scaffoldControl:(e,t)=>t.omitField?`<CheckboxControl path="${t.currentPath}" />`:`<CheckboxControl path="${t.currentPath}">${es(e.childName)}</CheckboxControl>`},Es={...za,control:`@ostack.tech/ui-kform.NumericControl`},Ds={...Va,defaultPackageSuffix:e=>`annexes.${e.toLowerCase()}`,kind:`Class (Annex)`},Os={...Va,kind:`Class (FormPage)`,nullable:!1},ks={...Va,nullable:!1,scaffoldModel:(e,t)=>{let n=Va.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=oi(n,`internal var version = ${$o(e.name)}_SERIALIZATION_VERSION`)}return oi(r,n)+(i?` ${ka`
|
|
379
379
|
{
|
|
380
380
|
${i}
|
|
381
381
|
}
|
|
382
382
|
`}`:``)},scaffoldField:(e,t)=>(t.currentFile.imports.push({moduleName:`@ostack.tech/ui`,name:`FieldGroup`},{moduleName:`@ostack.tech/ui`,name:`FieldGroupHeader`},{moduleName:`@ostack.tech/ui`,name:`FieldGroupTitle`},{moduleName:`@ostack.tech/ui`,name:`FieldGroupBody`},{moduleName:`@ostack.tech/ui`,name:`Grid`}),ka`
|
|
383
383
|
<FieldGroup>
|
|
384
384
|
<FieldGroupHeader>
|
|
385
|
-
<FieldGroupTitle>${
|
|
385
|
+
<FieldGroupTitle>${Qo(e.name)}</FieldGroupTitle>
|
|
386
386
|
</FieldGroupHeader>
|
|
387
387
|
|
|
388
388
|
<FieldGroupBody>
|
|
389
389
|
<Grid container>
|
|
390
390
|
${e.children.map(e=>ka`
|
|
391
391
|
<Grid xs={12}>
|
|
392
|
-
${
|
|
392
|
+
${_s(e,{...t,currentPath:Gr(t.currentPath,e.childName)})}
|
|
393
393
|
</Grid>
|
|
394
394
|
`).join(`
|
|
395
395
|
|
|
@@ -397,43 +397,43 @@ fun decode<%= formClass %>SubmitResponseFromString(xml: String): <%= formClass %
|
|
|
397
397
|
</Grid>
|
|
398
398
|
</FieldGroupBody>
|
|
399
399
|
</FieldGroup>
|
|
400
|
-
`)},
|
|
400
|
+
`)},As={...Ha,control:`@ostack.tech/ui-kform.NumericControl`},js={...Ua,kind:`Enum`,internal:!0,nullable:!1},Ms={...Ua,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`}),ka`
|
|
401
401
|
<SelectControl path="${t.currentPath}">
|
|
402
|
-
${e.children.map(t=>`<SelectControlItem value={${e.name}.${t.childName}}>${
|
|
402
|
+
${e.children.map(t=>`<SelectControlItem value={${e.name}.${t.childName}}>${es(t.childName)}</SelectControlItem>`).join(`
|
|
403
403
|
`)}
|
|
404
404
|
</SelectControl>
|
|
405
|
-
`)},
|
|
405
|
+
`)},Ns={...Ua,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`}),ka`
|
|
406
406
|
<RadioGroupControl path="${t.currentPath}">
|
|
407
|
-
${e.children.map(t=>`<RadioGroupControlItem value={${e.name}.${t.childName}}>${
|
|
407
|
+
${e.children.map(t=>`<RadioGroupControlItem value={${e.name}.${t.childName}}>${es(t.childName)}</RadioGroupControlItem>`).join(`
|
|
408
408
|
`)}
|
|
409
409
|
</RadioGroupControl>
|
|
410
|
-
`)},
|
|
410
|
+
`)},Ps={...Wa,nullable:!0,control:`@ostack.tech/ui-kform.FileControl`},Fs={...Ga,control:`@ostack.tech/ui-kform.NumericControl`},Is={...qa,control:`@ostack.tech/ui-kform.NumericControl`},Ls={...Ja,kind:`List<Enum> (CheckboxGroup)`,nullable:!1,initChildren:e=>[Pr({kind:`Enum`,name:Zo(e),nullable:!1,children:[]})],builder:Sa,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`}),ka`
|
|
411
411
|
<CheckboxGroupControl path="${t.currentPath}">
|
|
412
|
-
${n.children.map(e=>`<CheckboxGroupControlItem value={${n.name}.${e.childName}}>${
|
|
412
|
+
${n.children.map(e=>`<CheckboxGroupControlItem value={${n.name}.${e.childName}}>${es(e.childName)}</CheckboxGroupControlItem>`).join(`
|
|
413
413
|
`)}
|
|
414
414
|
</CheckboxGroupControl>
|
|
415
|
-
`}},
|
|
415
|
+
`}},Rs={...Ja,kind:`List<Enum> (SelectMultiple)`,nullable:!1,initChildren:e=>[Pr({kind:`Enum`,name:Zo(e),nullable:!1,children:[]})],builder:Sa,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`}),ka`
|
|
416
416
|
<SelectMultipleControl path="${t.currentPath}">
|
|
417
|
-
${n.children.map(e=>`<SelectMultipleControlItem value={${n.name}.${e.childName}}>${
|
|
417
|
+
${n.children.map(e=>`<SelectMultipleControlItem value={${n.name}.${e.childName}}>${es(e.childName)}</SelectMultipleControlItem>`).join(`
|
|
418
418
|
`)}
|
|
419
419
|
</SelectMultipleControl>
|
|
420
|
-
`}},
|
|
420
|
+
`}},zs={...Ya,nullable:!0,control:`@ostack.tech/ui-kform.DateControl`},Bs={...Za,control:`@ostack.tech/ui-kform.NumericControl`},Vs={...Qa,control:`@ostack.tech/ui-kform.NumericControl`},Hs={...$a,control:`@ostack.tech/ui-kform.TextControl`},Us={...eo,kind:`Table (Annexes)`,nullable:!1,builder:Sa,initChildren:e=>[Pr({kind:`Class (Annex)`,packageSuffix:`annexes.${e.toLowerCase()}`,name:Zo(e),nullable:!1,children:[]})],propertyAnnotations:(e,t)=>{let n=xs(typeof eo.propertyAnnotations==`function`?eo.propertyAnnotations?.(e,t):eo.propertyAnnotations);return t.serializationFormat===`xml`&&(t.currentFile.imports.add(`nl.adaptivity.xmlutil.serialization.XmlChildrenName`),n.push(`@XmlChildrenName("${Xo(e.children[0].name)}")`)),n}},Ws=[Ss,Cs,ws,Ts,Es,ks,Ds,Os,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,{...eo,nullable:!1,builder:Sa,initChildren:e=>[Pr({kind:`Class`,name:`${Zo(e)}Row`,nullable:!1,children:[]})],propertyAnnotations:Us.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`}),ka`
|
|
421
421
|
<TableControl path="${t.currentPath}">
|
|
422
422
|
<TableControlColumns>
|
|
423
423
|
<TableControlIndexColumn />
|
|
424
424
|
${n.children.map(e=>ka`
|
|
425
|
-
<TableControlColumn label=${JSON.stringify(
|
|
426
|
-
${
|
|
425
|
+
<TableControlColumn label=${JSON.stringify(es(e.childName))}>
|
|
426
|
+
${_s(e,{...t,omitField:!0,currentPath:e.childName})}
|
|
427
427
|
</TableControlColumn>
|
|
428
428
|
`).join(`
|
|
429
429
|
`)},
|
|
430
430
|
<TableControlActionsColumn />
|
|
431
431
|
</TableControlColumns>
|
|
432
|
-
<Label>${
|
|
432
|
+
<Label>${es(e.childName)}</Label>
|
|
433
433
|
<TableControlAddRowTrigger />
|
|
434
434
|
<TableControlContent />
|
|
435
435
|
</TableControl>
|
|
436
|
-
`}}];function
|
|
436
|
+
`}}];function Gs(e,t){let n=[];if(e.children?.every(e=>e.kind===Ds.kind||e.kind===Us.kind))for(let r of e.children)r.kind===Ds.kind?n.push(qs(r,{...t,currentPath:Gr(t.currentPath,r.childName),currentDir:Gr(t.currentDir,r.packageSuffix?.replaceAll(`.`,`/`))})):n.push(Ks(r,{...t,currentPath:Gr(t.currentPath,r.childName)}));else if(e.children?.every(e=>e.kind===Os.kind))n.push(qs(e,t));else if(e.children?.some(e=>e.kind===Ds.kind||e.kind===Us.kind||e.kind===Os.kind))throw Error(`Annexes/form pages cannot be mixed with other kinds of fields.`);else n.push(qs(e,t));return n}function Ks(e,t){let n=e.children[0];return qs(n,{...t,currentPath:Gr(t.currentPath,`*`),currentDir:Gr(t.currentDir,n.packageSuffix?.replaceAll(`.`,`/`))})}function qs(e,t){if(e.children?.some(e=>e.kind===Ds.kind||e.kind===Us.kind))throw Error(`Annexes must only appear at the top level of the schematic.`);let n;if(e.children?.every(e=>e.kind===Os.kind))n=e.children?.map(e=>({schematic:e,data:{...t,currentPath:Gr(t.currentPath,Xo(e.childName)),currentDir:Gr(t.currentDir,e.packageSuffix?.replaceAll(`.`,`/`))}}));else if(e.children?.some(e=>e.kind===Os.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 Js(e,t){let n=Gr(t.currentDir,`${e.name}App.tsx`),r=t.files.get(n);r||t.files.set(n,r=Ao()),Ys(e,{kmpModuleName:`${X(e.name)}-shared`,...t,currentFile:r}),ds(e,t)}function Ys(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/locales`,name:n},{moduleName:`@ostack.tech/ui-kform`,name:`IssuesPanel`},{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`}),t.useReactCompiler||t.currentFile.imports.push({moduleName:`react`,name:`useMemo`});let i=``;fs(t)&&(t.currentFile.imports.push({moduleName:`./${e.name}IssueMessages.tsx`,name:`${$o(e.name)}_ISSUE_MESSAGES`}),i=`\nissueMessages={${$o(e.name)}_ISSUE_MESSAGES}`),t.currentFile.declarations.push(ka`
|
|
437
437
|
export function ${e.name}App() {
|
|
438
438
|
const { externalContexts } = use${e.name}Context();
|
|
439
439
|
const [activePath, setActivePath] = useSearchParam("${r}");
|
|
@@ -446,37 +446,34 @@ fun decode<%= formClass %>SubmitResponseFromString(xml: String): <%= formClass %
|
|
|
446
446
|
? externalContexts.initialValue
|
|
447
447
|
: undefined
|
|
448
448
|
}
|
|
449
|
-
externalContexts={useMemo(
|
|
450
|
-
() => ktMapToObject(externalContexts.toMap()),
|
|
451
|
-
[externalContexts],
|
|
452
|
-
)}
|
|
449
|
+
externalContexts={${t.useReactCompiler?`ktMapToObject(externalContexts.toMap())`:`useMemo(() => ktMapToObject(externalContexts.toMap()), [externalContexts])`}}
|
|
453
450
|
readOnly={externalContexts.mode === ${e.name}FormMode.READ}
|
|
454
|
-
formTitle="${
|
|
451
|
+
formTitle="${Qo(e.name)}"
|
|
455
452
|
activePath={activePath}
|
|
456
453
|
onActivePathChange={setActivePath}${i}
|
|
457
454
|
defaultLocale={${n}}
|
|
458
455
|
reportError={reportError}
|
|
459
456
|
debug={import.meta.env.DEV}
|
|
460
457
|
>
|
|
461
|
-
${
|
|
458
|
+
${Xs(e,t)}
|
|
462
459
|
|
|
463
460
|
<IssuesPanel />
|
|
464
461
|
</FormApp>
|
|
465
462
|
);
|
|
466
463
|
}
|
|
467
|
-
`)}function
|
|
464
|
+
`)}function Xs(e,t,n=Zs){let r=Gs(e,t);return r.length===1&&r[0].data.currentPath===`/`?ka`
|
|
468
465
|
${n(e,t)}
|
|
469
466
|
|
|
470
|
-
${
|
|
467
|
+
${$s(t,r[0])}
|
|
471
468
|
`:(t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`Annexes`},{moduleName:`@ostack.tech/ui-kform`,name:`AnnexesManager`}),ka`
|
|
472
469
|
<Annexes>
|
|
473
470
|
${n(e,t,`<AnnexesManager />`)}
|
|
474
471
|
|
|
475
|
-
${r.map(e=>
|
|
472
|
+
${r.map(e=>Qs(t,e)).join(`
|
|
476
473
|
|
|
477
474
|
`)}
|
|
478
475
|
</Annexes>
|
|
479
|
-
`)}function
|
|
476
|
+
`)}function Zs(e,t,n){let r=e.name,i=Xo(r),a=t.serializationFormat??`json`,o=`application/${t.serializationFormat}`;return t.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`TopBar`},{moduleName:`@ostack.tech/ui-kform`,name:`TopBarActions`},{moduleName:`@ostack.tech/ui-kform`,name:`TopBarActionsSecondary`},{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:`@ostack.tech/kform`,name:`LocatedValidationWarning`},{moduleName:t.kmpModuleName,name:r,isType:!0},{moduleName:t.kmpModuleName,name:`decode${r}FromString`},{moduleName:t.kmpModuleName,name:`encode${r}ToString`},{moduleName:t.kmpModuleName,name:`${r}SubmitSuccess`},{moduleName:t.kmpModuleName,name:`${r}SubmitValidationError`},{moduleName:t.kmpModuleName,name:`${r}SubmitError`},{moduleName:`./api/submit.ts`,name:`submit`}),ka`
|
|
480
477
|
<TopBar>${n?`\n ${n}\n`:``}
|
|
481
478
|
<TopBarActions>
|
|
482
479
|
<TopBarActionsSecondary>
|
|
@@ -513,23 +510,23 @@ convertExternalIssuesTableRowIndicesToIds`:``}
|
|
|
513
510
|
/>
|
|
514
511
|
</TopBarActions>
|
|
515
512
|
</TopBar>
|
|
516
|
-
`}function
|
|
517
|
-
<Annex path="${t.data.currentPath}" title="${
|
|
518
|
-
${
|
|
513
|
+
`}function Qs(e,t){return e.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`Annex`}),ka`
|
|
514
|
+
<Annex path="${t.data.currentPath}" title="${es(t.schematic.name)}"${t.formPages.length===1&&t.schematic===t.formPages[0].schematic?` documentTitle={null}`:``}>
|
|
515
|
+
${$s(e,t)}
|
|
519
516
|
</Annex>
|
|
520
|
-
`}function
|
|
517
|
+
`}function $s(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=`
|
|
521
518
|
<FormPagesNavigation />
|
|
522
519
|
`),ka`
|
|
523
520
|
<FormPages>${n}
|
|
524
|
-
${t.formPages.map(n
|
|
521
|
+
${t.formPages.map(n=>ec(e,t,n)).join(`
|
|
525
522
|
|
|
526
523
|
`)}
|
|
527
524
|
</FormPages>
|
|
528
|
-
`}function
|
|
529
|
-
<FormPage${i} title="${
|
|
525
|
+
`}function ec(e,t,n){e.currentFile.imports.push({moduleName:`@ostack.tech/ui-kform`,name:`FormPage`},{moduleName:`./${Gr(n.data.currentDir.slice(e.currentDir.length+ +!e.currentDir.endsWith(`/`)),n.schematic.name)}.tsx`,name:n.schematic.name});let r=``;fs(e)&&n.data.currentPath!==`/`&&(e.currentFile.imports.push({moduleName:`./${Gr(n.data.currentDir.slice(e.currentDir.length+ +!e.currentDir.endsWith(`/`)),n.schematic.name)}IssueMessages.tsx`,name:`${$o(n.schematic.name)}_ISSUE_MESSAGES`}),r=` issueMessages={${$o(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 ka`
|
|
526
|
+
<FormPage${i} title="${es(n.schematic.name)}" code="${n.schematic.name?.[0].toUpperCase()}"${a}${r}>
|
|
530
527
|
<${n.schematic.name} />
|
|
531
528
|
</FormPage>
|
|
532
|
-
`}var
|
|
529
|
+
`}var tc=`import { createContext, useContext } from "react";
|
|
533
530
|
import { <%= formClass %>ExternalContexts } from "<%= kmpModuleName %>";
|
|
534
531
|
|
|
535
532
|
export interface <%= formClass %>ContextValue {
|
|
@@ -541,7 +538,7 @@ export const <%= formClass %>Context = createContext<<%= formClass %>ContextValu
|
|
|
541
538
|
export function use<%= formClass %>Context(): <%= formClass %>ContextValue {
|
|
542
539
|
return useContext(<%= formClass %>Context);
|
|
543
540
|
}
|
|
544
|
-
`;function
|
|
541
|
+
`;function nc(e,t){let n={kmpModuleName:t.kmpModuleName??`${X(e.name)}-shared`,formClass:e.name};co(t,`${e.name}Context.ts`,tc,n)}var rc=`package <%= filePackage %>
|
|
545
542
|
|
|
546
543
|
import kotlin.js.JsExport
|
|
547
544
|
import kotlin.jvm.JvmOverloads
|
|
@@ -566,12 +563,12 @@ data class <%= formClass %>ExternalContexts @JvmOverloads constructor(
|
|
|
566
563
|
) {
|
|
567
564
|
fun toMap(): Map<String, Any?> = mapOf("mode" to mode, "initialValue" to initialValue)
|
|
568
565
|
}
|
|
569
|
-
`;function
|
|
566
|
+
`;function ic(e,t){let n={filePackage:t.currentPackage,formClass:e.name};co(t,`${e.name}ExternalContexts.kt`,rc,n)}var ac=`plugins { \`kotlin-dsl\` }
|
|
570
567
|
|
|
571
568
|
dependencies {
|
|
572
569
|
implementation(libs.nodeGradle.plugin)
|
|
573
570
|
}
|
|
574
|
-
`,
|
|
571
|
+
`,oc=`@Suppress("UnstableApiUsage")
|
|
575
572
|
dependencyResolutionManagement {
|
|
576
573
|
versionCatalogs {
|
|
577
574
|
create("libs") {
|
|
@@ -582,7 +579,7 @@ dependencyResolutionManagement {
|
|
|
582
579
|
}
|
|
583
580
|
|
|
584
581
|
rootProject.name = "build-logic"
|
|
585
|
-
`,
|
|
582
|
+
`,sc=`plugins { id("com.github.node-gradle.node") }
|
|
586
583
|
|
|
587
584
|
val libs = versionCatalogs.named("libs")
|
|
588
585
|
val isCI = System.getenv("CI") !in arrayOf(null, "0", "false")
|
|
@@ -593,7 +590,7 @@ node {
|
|
|
593
590
|
npmInstallCommand = if (isCI) "ci" else "install"
|
|
594
591
|
distBaseUrl = null // Prevent repository declaration
|
|
595
592
|
}
|
|
596
|
-
`,
|
|
593
|
+
`,cc=`import org.gradle.kotlin.dsl.configure
|
|
597
594
|
import org.gradle.kotlin.dsl.withType
|
|
598
595
|
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsEnvSpec
|
|
599
596
|
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
|
|
@@ -614,7 +611,7 @@ plugins.withType<NodeJsRootPlugin> {
|
|
|
614
611
|
downloadBaseUrl = null // Prevent repository declaration
|
|
615
612
|
}
|
|
616
613
|
}
|
|
617
|
-
`,
|
|
614
|
+
`,lc=`group=<%= gradlePropertiesGroup %>
|
|
618
615
|
version=0.0.1
|
|
619
616
|
|
|
620
617
|
kotlin.code.style=official
|
|
@@ -623,7 +620,7 @@ kotlin.js.yarn=false
|
|
|
623
620
|
|
|
624
621
|
org.gradle.caching=true
|
|
625
622
|
org.gradle.configuration-cache=true
|
|
626
|
-
`,
|
|
623
|
+
`,uc=`#This file is generated by updateDaemonJvm
|
|
627
624
|
toolchainUrl.FREE_BSD.AARCH64=https\\://api.foojay.io/disco/v3.0/ids/cb205e54cea236622eee3d62deb2c768/redirect
|
|
628
625
|
toolchainUrl.FREE_BSD.X86_64=https\\://api.foojay.io/disco/v3.0/ids/452acd2202c1005abda962c6dae7fc5f/redirect
|
|
629
626
|
toolchainUrl.LINUX.AARCH64=https\\://api.foojay.io/disco/v3.0/ids/cb205e54cea236622eee3d62deb2c768/redirect
|
|
@@ -635,7 +632,7 @@ toolchainUrl.UNIX.X86_64=https\\://api.foojay.io/disco/v3.0/ids/452acd2202c1005a
|
|
|
635
632
|
toolchainUrl.WINDOWS.AARCH64=https\\://api.foojay.io/disco/v3.0/ids/e0e37f85a97c5f2df685b37b14a25072/redirect
|
|
636
633
|
toolchainUrl.WINDOWS.X86_64=https\\://api.foojay.io/disco/v3.0/ids/ccc3884e65cd85bb71a09d2223c77229/redirect
|
|
637
634
|
toolchainVersion=<%= jvmToolchainVersion %>
|
|
638
|
-
`,
|
|
635
|
+
`,dc=`[versions]
|
|
639
636
|
# Plugins
|
|
640
637
|
kotlin = "2.4.10"
|
|
641
638
|
nodeGradle = "7.1.0"
|
|
@@ -651,7 +648,7 @@ kotlinxSerialization = "1.11.0"
|
|
|
651
648
|
<%_ if (includeKtMath) { -%>
|
|
652
649
|
ktMath = "0.10.2"
|
|
653
650
|
<%_ } -%>
|
|
654
|
-
slf4j = "2.0.
|
|
651
|
+
slf4j = "2.0.19"
|
|
655
652
|
<%_ if (serializationFormat === "xml") { -%>
|
|
656
653
|
xmlutil = "0.91.1"
|
|
657
654
|
<%_ } -%>
|
|
@@ -687,7 +684,7 @@ nodeGradle-plugin = { module = "com.github.node-gradle:gradle-node-plugin", vers
|
|
|
687
684
|
[plugins]
|
|
688
685
|
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
|
689
686
|
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
|
690
|
-
`,
|
|
687
|
+
`,fc=`import com.github.gradle.node.npm.task.NpmTask
|
|
691
688
|
|
|
692
689
|
plugins {
|
|
693
690
|
id("node-gradle-conventions")
|
|
@@ -767,7 +764,7 @@ tasks.assemble {
|
|
|
767
764
|
tasks.check {
|
|
768
765
|
dependsOn(npmRunLint)
|
|
769
766
|
}
|
|
770
|
-
`,
|
|
767
|
+
`,pc=`plugins {
|
|
771
768
|
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
|
|
772
769
|
}
|
|
773
770
|
|
|
@@ -792,7 +789,7 @@ includeBuild("build-logic")
|
|
|
792
789
|
include("shared", "react-app")
|
|
793
790
|
|
|
794
791
|
rootProject.name = "<%= formId %>"
|
|
795
|
-
`,
|
|
792
|
+
`,mc=`import com.github.gradle.node.npm.task.NpmTask
|
|
796
793
|
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsEnvSpec
|
|
797
794
|
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsPlugin
|
|
798
795
|
|
|
@@ -873,7 +870,7 @@ tasks.register<NpmTask>("packJsPackage") {
|
|
|
873
870
|
inputs.dir(libraryDir)
|
|
874
871
|
outputs.file("build/<%= formId %>-shared-$version.tgz")
|
|
875
872
|
}
|
|
876
|
-
`,
|
|
873
|
+
`,hc=`package <%= filePackage %>
|
|
877
874
|
|
|
878
875
|
// See: https://github.com/Kotlin/kotlinx-datetime?tab=readme-ov-file#note-about-time-zones-in-js
|
|
879
876
|
@JsModule("@js-joda/timezone")
|
|
@@ -882,7 +879,7 @@ external object JsJodaTimeZoneModule
|
|
|
882
879
|
|
|
883
880
|
@JsExport
|
|
884
881
|
val jsJodaTz = JsJodaTimeZoneModule
|
|
885
|
-
`;function
|
|
882
|
+
`;function gc(e,t){let n={gradlePropertiesGroup:t.gradlePropertiesGroup??t.currentPackage,filePackage:t.currentPackage,formId:X(e.name),formTitle:Qo(e.name),kFormVersion:`1.2.0`,serializationFormat:t.serializationFormat??`json`,includeKotlinxDatetime:t.includeKotlinxDatetime??_c(e,t),includeKtMath:t.includeKtMath??vc(e),jvmToolchainVersion:t.jvmToolchainVersion??`21`,nodejsVersion:t.nodejsVersion??`24.16.0`};co(t,`gradle.properties`,lc,n),co(t,`settings.gradle.kts`,pc,n),co(t,`gradle/libs.versions.toml`,dc,n),co(t,`gradle/gradle-daemon-jvm.properties`,uc,n),ko(t,`build.gradle.kts`,cc),ko(t,`build-logic/settings.gradle.kts`,oc),ko(t,`build-logic/build.gradle.kts`,ac),ko(t,`build-logic/src/main/kotlin/node-gradle-conventions.gradle.kts`,sc),co(t,`shared/build.gradle.kts`,mc,n),n.includeKotlinxDatetime&&co(t,`shared/src/jsMain/kotlin/JsJodaTimeZone.kt`,hc,n),co(t,`react-app/build.gradle.kts`,fc,n)}function _c(e,t){return t.schematicKinds.get(e.kind)?.package===`kotlinx.datetime`||e.children?.some(e=>_c(e,t))===!0}function vc(e){return[`BigInteger`,`BigDecimal`].includes(e.kind)||e.children?.some(e=>vc(e))===!0}var yc=`/assets/gradle-wrapper-BvbY_R1M.jar`,bc=`distributionBase=GRADLE_USER_HOME
|
|
886
883
|
distributionPath=wrapper/dists
|
|
887
884
|
distributionUrl=https\\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
|
888
885
|
networkTimeout=10000
|
|
@@ -891,7 +888,7 @@ retryBackOffMs=500
|
|
|
891
888
|
validateDistributionUrl=true
|
|
892
889
|
zipStoreBase=GRADLE_USER_HOME
|
|
893
890
|
zipStorePath=wrapper/dists
|
|
894
|
-
`,
|
|
891
|
+
`,xc=`#!/bin/sh
|
|
895
892
|
|
|
896
893
|
#
|
|
897
894
|
# Copyright © 2015 the original authors.
|
|
@@ -1139,7 +1136,7 @@ eval "set -- $(
|
|
|
1139
1136
|
)" '"$@"'
|
|
1140
1137
|
|
|
1141
1138
|
exec "$JAVACMD" "$@"
|
|
1142
|
-
`,
|
|
1139
|
+
`,Sc=`@rem\r
|
|
1143
1140
|
@rem Copyright 2015 the original author or authors.\r
|
|
1144
1141
|
@rem\r
|
|
1145
1142
|
@rem Licensed under the Apache License, Version 2.0 (the "License");\r
|
|
@@ -1221,9 +1218,9 @@ endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.grad
|
|
|
1221
1218
|
:exitWithErrorLevel\r
|
|
1222
1219
|
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts\r
|
|
1223
1220
|
"%COMSPEC%" /c exit %ERRORLEVEL%\r
|
|
1224
|
-
`;function
|
|
1221
|
+
`;function Cc(e,t){ko(t,`gradlew`,xc,{executable:!0}),ko(t,`gradlew.bat`,Sc),ko(t,`gradle/wrapper/gradle-wrapper.jar`,fetch(yc).then(e=>e.arrayBuffer())),ko(t,`gradle/wrapper/gradle-wrapper.properties`,bc)}function wc(e,t){let n=Gr(t.currentDir,`main.tsx`),r=t.files.get(n);r||t.files.set(n,r=Ao()),Tc(e,{kmpModuleName:`${X(e.name)}-shared`,...t,currentFile:r})}function Tc(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(ka`
|
|
1225
1222
|
export function renderRoot(encodedExternalContexts: string) {
|
|
1226
|
-
createRoot(document.getElementById("${
|
|
1223
|
+
createRoot(document.getElementById("${X(e.name)}-app-root")!).render(
|
|
1227
1224
|
<StrictMode>
|
|
1228
1225
|
<${e.name}Context
|
|
1229
1226
|
value={{
|
|
@@ -1237,7 +1234,7 @@ endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.grad
|
|
|
1237
1234
|
</StrictMode>,
|
|
1238
1235
|
);
|
|
1239
1236
|
}
|
|
1240
|
-
`)}var
|
|
1237
|
+
`)}var Ec=`# http://editorconfig.org
|
|
1241
1238
|
root = true
|
|
1242
1239
|
|
|
1243
1240
|
[*]
|
|
@@ -1254,9 +1251,9 @@ end_of_line = crlf
|
|
|
1254
1251
|
|
|
1255
1252
|
[{*.kt,*.kts,*.md}]
|
|
1256
1253
|
indent_size = 4
|
|
1257
|
-
`,
|
|
1254
|
+
`,Dc=`* text=auto eol=lf
|
|
1258
1255
|
*.bat text eol=crlf
|
|
1259
|
-
`,
|
|
1256
|
+
`,Oc=`# Gradle
|
|
1260
1257
|
.gradle/
|
|
1261
1258
|
build/
|
|
1262
1259
|
!**/src/**/build/
|
|
@@ -1293,7 +1290,7 @@ out/
|
|
|
1293
1290
|
# Misc
|
|
1294
1291
|
.DS_Store
|
|
1295
1292
|
*.pem
|
|
1296
|
-
`;function
|
|
1293
|
+
`;function kc(e,t){ko(t,`.gitignore`,Oc),ko(t,`.gitattributes`,Dc),ko(t,`.editorconfig`,Ec)}var Ac=`package <%= filePackage %>
|
|
1297
1294
|
|
|
1298
1295
|
import kotlin.js.JsExport
|
|
1299
1296
|
import kotlin.jvm.JvmOverloads
|
|
@@ -1321,9 +1318,9 @@ class <%= formClass %>SubmitError @JvmOverloads constructor(override val message
|
|
|
1321
1318
|
@SerialName("validationError")
|
|
1322
1319
|
class <%= formClass %>SubmitValidationError(val issues: List<LocatedValidationIssue>) :
|
|
1323
1320
|
<%= formClass %>SubmitResponse
|
|
1324
|
-
`;function
|
|
1321
|
+
`;function jc(e,t){let n={filePackage:t.currentPackage,formClass:e.name};co(t,`${e.name}Responses.kt`,Ac,n)}var Mc=`@use "@ostack.tech/ui/scss" as o-ui;
|
|
1325
1322
|
@use "@ostack.tech/ui-kform/scss" as o-ui-kform;
|
|
1326
|
-
`;function
|
|
1323
|
+
`;function Nc(e,t){ko(t,`index.scss`,Mc)}var Pc=`{
|
|
1327
1324
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
1328
1325
|
"plugins": ["react", "typescript", "oxc"],
|
|
1329
1326
|
"options": { "typeAware": true },
|
|
@@ -1332,7 +1329,7 @@ class <%= formClass %>SubmitValidationError(val issues: List<LocatedValidationIs
|
|
|
1332
1329
|
"react/only-export-components": ["warn", { "allowConstantExport": true }]
|
|
1333
1330
|
}
|
|
1334
1331
|
}
|
|
1335
|
-
`,
|
|
1332
|
+
`,Fc=`<!doctype html>
|
|
1336
1333
|
<html lang="en">
|
|
1337
1334
|
<head>
|
|
1338
1335
|
<meta charset="UTF-8" />
|
|
@@ -1354,7 +1351,7 @@ class <%= formClass %>SubmitValidationError(val issues: List<LocatedValidationIs
|
|
|
1354
1351
|
<\/script>
|
|
1355
1352
|
</body>
|
|
1356
1353
|
</html>
|
|
1357
|
-
`,
|
|
1354
|
+
`,Ic=`{
|
|
1358
1355
|
"name": "<%= formId %>-react-app",
|
|
1359
1356
|
"private": true,
|
|
1360
1357
|
"version": "0.0.0",
|
|
@@ -1378,11 +1375,18 @@ class <%= formClass %>SubmitValidationError(val issues: List<LocatedValidationIs
|
|
|
1378
1375
|
"react-dom": "<%= dependencyVersions["react-dom"] %>"
|
|
1379
1376
|
},
|
|
1380
1377
|
"devDependencies": {
|
|
1378
|
+
<%_ if (useReactCompiler) { -%>
|
|
1379
|
+
"@babel/core": "^8.0.5",
|
|
1380
|
+
"@rolldown/plugin-babel": "^0.2.4",
|
|
1381
|
+
<%_ } -%>
|
|
1381
1382
|
"@types/node": "<%= dependencyVersions["@types/node"] %>",
|
|
1382
1383
|
"@types/ostack.tech__kform": "npm:@ostack.tech/kform@^<%= kFormVersion %>",
|
|
1383
1384
|
"@types/react": "<%= dependencyVersions["@types/react"] %>",
|
|
1384
1385
|
"@types/react-dom": "<%= dependencyVersions["@types/react-dom"] %>",
|
|
1385
1386
|
"@vitejs/plugin-react": "<%= dependencyVersions["@vitejs/plugin-react"] %>",
|
|
1387
|
+
<%_ if (useReactCompiler) { -%>
|
|
1388
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
1389
|
+
<%_ } -%>
|
|
1386
1390
|
"oxlint": "<%= dependencyVersions.oxlint %>",
|
|
1387
1391
|
"oxlint-tsgolint": "<%= dependencyVersions["oxlint-tsgolint"] %>",
|
|
1388
1392
|
"sass-embedded": "<%= dependencyVersions["sass-embedded"] %>",
|
|
@@ -1390,7 +1394,7 @@ class <%= formClass %>SubmitValidationError(val issues: List<LocatedValidationIs
|
|
|
1390
1394
|
"vite": "<%= dependencyVersions.vite %>"
|
|
1391
1395
|
}
|
|
1392
1396
|
}
|
|
1393
|
-
`,
|
|
1397
|
+
`,Lc=`<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>`,Rc=`{
|
|
1394
1398
|
"compilerOptions": {
|
|
1395
1399
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
1396
1400
|
"target": "es2023",
|
|
@@ -1416,11 +1420,11 @@ class <%= formClass %>SubmitValidationError(val issues: List<LocatedValidationIs
|
|
|
1416
1420
|
},
|
|
1417
1421
|
"include": ["src"]
|
|
1418
1422
|
}
|
|
1419
|
-
`,
|
|
1423
|
+
`,zc=`{
|
|
1420
1424
|
"files": [],
|
|
1421
1425
|
"references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
|
|
1422
1426
|
}
|
|
1423
|
-
`,
|
|
1427
|
+
`,Bc=`{
|
|
1424
1428
|
"compilerOptions": {
|
|
1425
1429
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
1426
1430
|
"target": "es2023",
|
|
@@ -1443,14 +1447,24 @@ class <%= formClass %>SubmitValidationError(val issues: List<LocatedValidationIs
|
|
|
1443
1447
|
},
|
|
1444
1448
|
"include": ["vite.config.ts"]
|
|
1445
1449
|
}
|
|
1446
|
-
`,
|
|
1450
|
+
`,Vc=`import { resolve } from "node:path";
|
|
1447
1451
|
|
|
1452
|
+
<%_ if (useReactCompiler) { -%>
|
|
1453
|
+
import babel from "@rolldown/plugin-babel";
|
|
1454
|
+
import react, { reactCompilerPreset } from "@vitejs/plugin-react";
|
|
1455
|
+
<%_ } else { -%>
|
|
1448
1456
|
import react from "@vitejs/plugin-react";
|
|
1457
|
+
<%_ } -%>
|
|
1449
1458
|
import { defineConfig } from "vite";
|
|
1450
1459
|
|
|
1451
1460
|
// https://vite.dev/config/
|
|
1452
1461
|
export default defineConfig({
|
|
1453
|
-
plugins: [
|
|
1462
|
+
plugins: [
|
|
1463
|
+
react(),
|
|
1464
|
+
<%_ if (useReactCompiler) { -%>
|
|
1465
|
+
babel({ presets: [reactCompilerPreset()] }),
|
|
1466
|
+
<%_ } -%>
|
|
1467
|
+
],
|
|
1454
1468
|
build: {
|
|
1455
1469
|
outDir: "<%= viteConfigOutDir %>",
|
|
1456
1470
|
rolldownOptions: {
|
|
@@ -1460,9 +1474,8 @@ export default defineConfig({
|
|
|
1460
1474
|
process.env.VITE_BUILD_REASON === "preview" ? "index.html" : "src/main.tsx",
|
|
1461
1475
|
},
|
|
1462
1476
|
output: {
|
|
1463
|
-
// Output files without hashes, making it easier to serve them in the
|
|
1464
|
-
// server
|
|
1465
|
-
// cache busting purposes.
|
|
1477
|
+
// Output files without hashes, making it easier to serve them in the server. However, the
|
|
1478
|
+
// server is expected to somehow "version" them for cache busting purposes.
|
|
1466
1479
|
entryFileNames: "assets/[name].js",
|
|
1467
1480
|
chunkFileNames: "assets/[name].js",
|
|
1468
1481
|
assetFileNames: "assets/[name].[ext]",
|
|
@@ -1471,8 +1484,8 @@ export default defineConfig({
|
|
|
1471
1484
|
},
|
|
1472
1485
|
resolve: {
|
|
1473
1486
|
alias: {
|
|
1474
|
-
// Due to how Kotlin "bundles" dependencies, we need to use the
|
|
1475
|
-
//
|
|
1487
|
+
// Due to how Kotlin "bundles" dependencies, we need to use the \`@ostack.tech/kform\` produced
|
|
1488
|
+
// by the shared module.
|
|
1476
1489
|
"@ostack.tech/kform": resolve(
|
|
1477
1490
|
import.meta.dirname,
|
|
1478
1491
|
"node_modules/<%= formId %>-shared/ostack-kform.mjs",
|
|
@@ -1483,4 +1496,4 @@ export default defineConfig({
|
|
|
1483
1496
|
proxy: { "<%= apiBasePath %>": "<%= viteConfigProxyTarget %>" },
|
|
1484
1497
|
},
|
|
1485
1498
|
});
|
|
1486
|
-
`;function
|
|
1499
|
+
`;function Hc(e,t){let n={formId:X(e.name),formClass:e.name,formTitle:Qo(e.name),useReactCompiler:t.useReactCompiler,ostackUiVersion:`1.2.0`,kFormVersion:`1.2.0`,dependencyVersions:JSON.parse(`{"@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.2.0","@ostack.tech/kform-react":"^1.2.0","@ostack.tech/kform-scaffolder":"^1.2.0","@storybook/addon-a11y":"^10.6.0","@storybook/addon-docs":"^10.6.0","@storybook/addon-links":"^10.6.0","@storybook/react-vite":"^10.6.0","@testing-library/react":"^16.3.3","@types/node":"^24.13.4","@types/react":"^19.3.0","@types/react-dom":"^19.3.0","@vitejs/plugin-react":"^6.1.1","change-case":"^5.4.4","cpy-cli":"^7.0.0","date-fns":"^4.4.0","happy-dom":"^20.14.5","lint-staged":"^17.5.1","oxc-transform-react":"^0.150.0","oxfmt":"^0.68.0","oxlint":"^1.83.0","oxlint-tsgolint":"^7.0.2001","prettier":"^3.9.7","react":"^19.3.0","react-dom":"^19.3.0","refractor":"^5.0.0","rimraf":"^6.1.3","sass-embedded":"^1.104.1","simple-git-hooks":"^2.14.0","storybook":"^10.6.0","terser":"^5.51.2","tslib":"^2.8.1","typescript":"~6.0.3","vite":"^8.3.0","vitest":"^5.0.1","write-excel-file":"^4.1.1","zod":"^4.6.5","zustand":"^5.0.15"}`),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/`};co(t,`react-app/package.json`,Ic,n),co(t,`react-app/vite.config.ts`,Vc,n),ko(t,`react-app/tsconfig.json`,zc),ko(t,`react-app/tsconfig.app.json`,Rc),ko(t,`react-app/tsconfig.node.json`,Bc),ko(t,`react-app/.oxlintrc.json`,Pc),co(t,`react-app/index.html`,Fc,n),ko(t,`react-app/public/favicon.svg`,Lc)}var Uc={currentDir:`shared/src/commonMain/kotlin`},Wc={currentDir:`shared/src/commonTest/kotlin`},Gc={currentDir:`react-app/src`},Kc=`1.2.0`,qc=[kc,Cc,gc,Hc,Ur(no,Uc),Ur(li,Uc),Ur(jc,Uc),Ur(ic,Uc),Ur(bs,Uc),Ur(fo,Wc),Ur(wc,Gc),Ur(Nc,Gc),Ur(Js,Gc),Ur(nc,Gc),Ur(ls,Gc),Ur(ms,Gc)],Jc=e=>({useFileBase64Serializer:!0,useReactCompiler:!0,...e.config}),Yc=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Fo,{}),(0,q.jsx)(Ro,{}),(0,q.jsx)(Bo,{}),(0,q.jsx)(zo,{defaultValue:!0})]});function Xc(e){let t=(0,T.c)(16),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({name:r,schematicKinds:i,scaffolders:a,scaffoldingData:o,configs:s,version:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=r===void 0?`ostack-ui-kform`:r,u=i===void 0?Ws:i,d=a===void 0?qc:a,f=o===void 0?Jc:o,p=s===void 0?Yc:s,m=c===void 0?Kc:c,h;return t[8]!==p||t[9]!==l||t[10]!==n||t[11]!==d||t[12]!==f||t[13]!==u||t[14]!==m?(h=(0,q.jsx)(Co,{name:l,schematicKinds:u,scaffolders:d,scaffoldingData:f,configs:p,version:m,...n}),t[8]=p,t[9]=l,t[10]=n,t[11]=d,t[12]=f,t[13]=u,t[14]=m,t[15]=h):h=t[15],h}(0,w.createRoot)(document.getElementById(`root`)).render((0,q.jsx)(E.StrictMode,{children:(0,q.jsx)(Xc,{})}));
|