@streamline-pulse/formkrafter-wc 0.13.4 → 0.14.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/components/fk-brick-actions.js +1 -1
- package/dist/components/fk-brick-list.js +1 -1
- package/dist/components/fk-brick-mold-item.js +1 -1
- package/dist/components/fk-brick-render.js +1 -1
- package/dist/components/fk-data-grid.js +1 -1
- package/dist/components/fk-drop-area.js +1 -1
- package/dist/components/fk-empty-form.js +1 -1
- package/dist/components/fk-file-input.js +1 -1
- package/dist/components/fk-form-builder.js +1 -1
- package/dist/components/fk-form-render.js +1 -1
- package/dist/components/fk-property-panel.js +1 -1
- package/dist/components/fk-rules-editor.js +1 -1
- package/dist/components/fk-select-input.js +1 -1
- package/dist/components/fk-signature-input.js +1 -1
- package/dist/components/fk-stepper.js +1 -1
- package/dist/components/fk-tabs.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-BPP0y52t.js → p-1uIWCEFX.js} +1 -1
- package/dist/components/{p-B8_VejrH.js → p-BCKF50Wl.js} +1 -1
- package/dist/components/{p-CBiO1n5p.js → p-BQNLm3VZ.js} +1 -1
- package/dist/components/{p-41ZAgXdw.js → p-BZtRpjkI.js} +1 -1
- package/dist/components/{p-D-qXNwEv.js → p-C2BQJ4lG.js} +1 -1
- package/dist/components/{p-DJHpJnQi.js → p-CG5_blV_.js} +1 -1
- package/dist/components/{p-tmiXb4B6.js → p-Cw0gv37q.js} +1 -1
- package/dist/components/{p-DjU-98-4.js → p-DBDKSYBE.js} +1 -1
- package/dist/components/{p-ClhkEa1w.js → p-DR_hFYe6.js} +1 -1
- package/dist/components/{p-BHGhAm18.js → p-DbuOohkN.js} +1 -1
- package/dist/components/{p-BfIdNmFU.js → p-DjCHGcK-.js} +1 -1
- package/dist/components/{p-BUU6P6RP.js → p-Dz-U6j8q.js} +1 -1
- package/dist/components/{p-D8in2Ees.js → p-H9MXQEyO.js} +1 -1
- package/dist/components/{p-BojpABGI.js → p-heCFCh4Y.js} +1 -1
- package/dist/components/{p-DkiEHSWX.js → p-jQ1X1HyU.js} +1 -1
- package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
- package/dist/formkrafter-wc/index.esm.js +1 -1
- package/dist/formkrafter-wc/p-1e48d41c.entry.js +1 -0
- package/dist/formkrafter-wc/{p-Chx-kv5R.js → p-C0wG_mBb.js} +1 -1
- package/dist/formkrafter-wc/{p-ead98812.entry.js → p-f360c57a.entry.js} +1 -1
- package/dist/types/components/fk-form-builder/fk-form-builder.d.ts +1 -1
- package/package.json +1 -1
- package/dist/formkrafter-wc/p-7fd4147d.entry.js +0 -1
|
@@ -9,4 +9,4 @@ function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"de
|
|
|
9
9
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
10
10
|
* (c) 2017-2021 Joachim Wester
|
|
11
11
|
* MIT license
|
|
12
|
-
*/function ws(t,e){e.unobserve()}function bs(t,e){var i,r=function(t){return ys.get(t)}(t);if(r){var n=function(t,e){return t.observers.get(e)}(r,e);i=n&&n.observer}else r=new gs(t),ys.set(t,r);if(i)return i;if(i={},r.value=Xn(t),e){i.callback=e,i.next=null;var s=function(){_s(i)},o=function(){clearTimeout(i.next),i.next=setTimeout(s)};"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return i.patches=[],i.object=t,i.unobserve=function(){_s(i),clearTimeout(i.next),function(t,e){t.observers.delete(e.callback)}(r,i),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},r.observers.set(e,new $s(e,i)),i}function _s(t,e){void 0===e&&(e=!1);var i=ys.get(t.object);Es(i.value,t.object,t.patches,"",e),t.patches.length&&fs(i.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function Es(t,e,i,r,n){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var s=Qn(e),o=Qn(t),a=!1,h=o.length-1;h>=0;h--){var u=t[f=o[h]];if(!Yn(e,f)||void 0===e[f]&&void 0!==u&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(n&&i.push({op:"test",path:r+"/"+es(f),value:Xn(u)}),i.push({op:"remove",path:r+"/"+es(f)}),a=!0):(n&&i.push({op:"test",path:r,value:t}),i.push({op:"replace",path:r,value:e}));else{var c=e[f];"object"==typeof u&&null!=u&&"object"==typeof c&&null!=c&&Array.isArray(u)===Array.isArray(c)?Es(u,c,i,r+"/"+es(f),n):u!==c&&(n&&i.push({op:"test",path:r+"/"+es(f),value:Xn(u)}),i.push({op:"replace",path:r+"/"+es(f),value:Xn(c)}))}}if(a||s.length!=o.length)for(h=0;h<s.length;h++){var f;Yn(t,f=s[h])||void 0===e[f]||i.push({op:"add",path:r+"/"+es(f),value:Xn(e[f])})}}}function ks(t,e,i){void 0===i&&(i=!1);var r=[];return Es(t,e,r,"",i),r}var Ss=Object.assign({},vs,Object.freeze({__proto__:null,compare:ks,generate:_s,observe:bs,unobserve:ws}),{JsonPatchError:ss,deepClone:Xn,escapePathComponent:es,unescapePathComponent:is}),xs=Object.freeze({__proto__:null,JsonPatchError:ss,_areEquals:ms,applyOperation:cs,applyPatch:fs,applyReducer:ls,compare:ks,deepClone:Xn,default:Ss,escapePathComponent:es,generate:_s,getValueByPointer:us,observe:bs,unescapePathComponent:is,unobserve:ws,validate:ps,validator:ds});function Os(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Object.keys(t).length>0&&Object.values(t).every((t=>"string"==typeof t))}function js(t,e){return Os(t)?e&&void 0!==t[e]?t[e]:Object.values(t)[0]:t}function Ps(t,e){if(!t)return t;const i={};for(const[r,n]of Object.entries(t))i[r]=js(n,e);return i}var Is={en:{required:"This field is required",minLength:"Must be at least {value} characters",maxLength:"Must be at most {value} characters",min:"Must be at least {value}",max:"Must be at most {value}",pattern:"Invalid format",minItems:"Select at least {value} item(s)",maxItems:"Select at most {value} item(s)",email:"Invalid email address",url:"Invalid URL",type:"Invalid value",custom:"Invalid value"},fr:{required:"Ce champ est obligatoire",minLength:"Minimum {value} caractères",maxLength:"Maximum {value} caractères",min:"Minimum {value}",max:"Maximum {value}",pattern:"Format invalide",minItems:"Sélectionnez au moins {value} élément(s)",maxItems:"Sélectionnez au plus {value} élément(s)",email:"Adresse email invalide",url:"URL invalide",type:"Valeur invalide",custom:"Valeur invalide"}};function Cs(t,e,i){return((Is[e??"en"]??Is.en)[t]??Is.en[t]??"Invalid value").replace("{value}",String(i??""))}function*As(t,e="0"){if(t){yield{brick:t,path:e};for(const[i,r]of(t.children??[]).entries())yield*As(r,`${e}.${i}`)}}function*Ns(t){if(t&&(yield t,"collection"!==t.type))for(const e of t.children??[])yield*Ns(e)}function Ts(t,e){if(t.configs?.key&&e)return t.unWrapData?e:e[t.configs.key]}function Ms(t,e){if(t.configs?.key)return t.unWrapData?e:{[t.configs.key]:e}}var Rs=(t,e)=>{if(!e.includes("."))return t[e];let i=t;for(const t of e.split(".")){if("object"!=typeof i||null===i)return;i=i[t]}return i};function Ds(t,e="label",i="value"){return Array.isArray(t)?t.map((t=>{if("object"==typeof t&&null!==t){const r=t,n=Rs(r,e)??Rs(r,i),s=Rs(r,i)??Rs(r,e);return{label:String(n??""),value:String(s??"")}}return{label:String(t),value:String(t)}})).filter((t=>""!==t.label)):String(t??"").split("\n").map((t=>t.trim())).filter(Boolean).map((t=>({label:t,value:t})))}var Ls={"palette.search":"Search bricks…","palette.empty":"No brick matches “{query}”","builder.undo":"Undo","builder.redo":"Redo","builder.editLocale":"Editing language","builder.copyJson":"Copy JSON","builder.importJson":"Import JSON","builder.importInvalid":"Invalid form JSON","builder.pasteHint":"Press Ctrl+V to paste a spec","builder.copied":"Copied!","builder.downloadJson":"Download .json","builder.hint":"Select a brick to edit its properties","drop.hint":"Drop a brick here","empty.title":"Your form is empty","empty.hint":"Drag a brick from the palette to get started","actions.move":"Move","actions.duplicate":"Duplicate","actions.delete":"Delete","stepper.back":"← Back","stepper.next":"Next →","stepper.submit":"Submit","panel.cfg.validateSteps":"Validate each step","panel.cfg.allowStepClick":"Allow clicking steps to jump","panel.cfg.showSubmit":"Submit button on last step","panel.cfg.validateTabs":"Validate tab before leaving it","signature.clear":"Clear","panel.tab.config":"Config","panel.tab.validation":"Validation","panel.tab.styles":"Styles","panel.tab.rules":"Rules","panel.key":"Key","panel.label":"Label","panel.placeholder":"Placeholder","panel.prefix":"Prefix","panel.suffix":"Suffix","panel.accept":"Accepted file types","panel.mask":"Input mask (9=digit, a=letter, *=any)","panel.uploadUrl":"Upload URL","panel.cfg.multiple":"Allow multiple files","panel.optionsSource":"Options source","panel.options":"Options (one per line)","panel.content":"Content","panel.dataKey":"Data key","panel.url":"URL","panel.headers":"Headers ({token} reads form data)","panel.searchParam":"Server search param","panel.labelKey":"Label key","panel.valueKey":"Value key","panel.errorMessage":"Error message","panel.required":"Required","panel.minLength":"Min length","panel.maxLength":"Max length","panel.min":"Min","panel.max":"Max","panel.pattern":"Pattern (regex)","panel.minItems":"Min items","panel.maxItems":"Max items","panel.emailFormat":"Email format","panel.urlFormat":"URL format","panel.custom":"Custom (JavaScript)","panel.fallbackMessage":"Fallback message","panel.styleProperty":"property","panel.styleValue":"value","file.choose":"Choose a file…","file.uploading":"Uploading…","file.remove":"Remove file","file.addAnother":"+ Add a file","address.street":"Street","address.city":"City","address.zip":"Postal code","address.country":"Country","grid.addRow":"+ Add row","grid.moveUp":"Move row up","grid.moveDown":"Move row down","grid.removeRow":"Remove row","grid.empty":"No rows yet","grid.columns":"Row template","select.search":"Search…","select.empty":"No options","select.clear":"Clear","rules.when":"When","rules.then":"Then","rules.addRule":"+ Add rule","rules.addEffect":"+ Effect","rules.removeRule":"Remove rule","rules.removeEffect":"Remove effect","rules.mode.simple":"simple","rules.mode.json":"json","rules.mode.js":"JS","category.Inputs":"Inputs","category.Layout":"Layout","category.Data":"Data","brick.text.name":"Text","brick.email.name":"Email","brick.password.name":"Password","brick.url.name":"URL","brick.phone.name":"Phone","brick.textarea.name":"Text area","brick.number.name":"Number","brick.date.name":"Date","brick.time.name":"Time","brick.datetime.name":"Date / Time","brick.select.name":"Select","brick.multi-select.name":"Multi select","brick.radio.name":"Radio","brick.select-boxes.name":"Select boxes","brick.checkbox.name":"Checkbox","brick.tags.name":"Tags","brick.signature.name":"Signature","brick.data-grid.name":"Data grid","brick.address.name":"Address","brick.file.name":"File","brick.hidden.name":"Hidden","brick.content.name":"Content","brick.recap.name":"Recap","brick.nested-form.name":"Nested form","brick.code.name":"Code","nestedForm.ref":"Referenced form","nestedForm.missing":"Set the specRef config to reference a form.","nestedForm.loading":"Loading nested forms…","panel.specRef":"Referenced form (specRef)","panel.optionsRef":"Options catalog (optionsRef)","recap.empty":"Nothing to summarize yet.","recap.yes":"Yes","recap.no":"No","panel.cfg.showEmpty":"Show empty fields","panel.cfg.groupBySections":"Group by section","brick.group.name":"Group","brick.row.name":"Row","brick.column.name":"Column","brick.stepper.name":"Stepper","brick.tabs.name":"Tabs"},zs={"palette.search":"Rechercher une brique…","palette.empty":"Aucune brique ne correspond à « {query} »","builder.undo":"Annuler","builder.editLocale":"Langue d'édition","builder.redo":"Rétablir","builder.copyJson":"Copier le JSON","builder.importJson":"Importer le JSON","builder.importInvalid":"JSON de formulaire invalide","builder.pasteHint":"Collez avec Ctrl+V pour importer une spec","builder.copied":"Copié !","builder.downloadJson":"Télécharger le .json","builder.hint":"Sélectionnez une brique pour éditer ses propriétés","drop.hint":"Déposez une brique ici","empty.title":"Votre formulaire est vide","empty.hint":"Glissez une brique depuis la palette pour commencer","actions.move":"Déplacer","actions.duplicate":"Dupliquer","actions.delete":"Supprimer","stepper.back":"← Précédent","stepper.next":"Suivant →","stepper.submit":"Envoyer","panel.cfg.validateSteps":"Valider chaque étape","panel.cfg.allowStepClick":"Autoriser le saut d’étapes au clic","panel.cfg.showSubmit":"Bouton d’envoi à la dernière étape","panel.cfg.validateTabs":"Valider l’onglet avant de le quitter","signature.clear":"Effacer","panel.tab.config":"Config","panel.tab.validation":"Validation","panel.tab.styles":"Styles","panel.tab.rules":"Règles","panel.key":"Clé","panel.label":"Libellé","panel.placeholder":"Placeholder","panel.prefix":"Préfixe","panel.suffix":"Suffixe","panel.accept":"Types de fichiers acceptés","panel.mask":"Masque de saisie (9=chiffre, a=lettre, *=tout)","panel.uploadUrl":"URL d'upload","panel.cfg.multiple":"Autoriser plusieurs fichiers","panel.optionsSource":"Source des options","panel.options":"Options (une par ligne)","panel.content":"Contenu","panel.dataKey":"Clé de données","panel.url":"URL","panel.headers":"En-têtes ({token} lit les données du formulaire)","panel.searchParam":"Paramètre de recherche serveur","panel.labelKey":"Clé du libellé","panel.valueKey":"Clé de la valeur","panel.errorMessage":"Message d'erreur","panel.required":"Obligatoire","panel.minLength":"Longueur min","panel.maxLength":"Longueur max","panel.min":"Min","panel.max":"Max","panel.pattern":"Motif (regex)","panel.minItems":"Éléments min","panel.maxItems":"Éléments max","panel.emailFormat":"Format email","panel.urlFormat":"Format URL","panel.custom":"Personnalisé (JavaScript)","panel.fallbackMessage":"Message par défaut","panel.styleProperty":"propriété","panel.styleValue":"valeur","file.choose":"Choisir un fichier…","file.uploading":"Envoi en cours…","file.remove":"Retirer le fichier","file.addAnother":"+ Ajouter un fichier","address.street":"Rue","address.city":"Ville","address.zip":"Code postal","address.country":"Pays","grid.addRow":"+ Ajouter une ligne","grid.moveUp":"Monter la ligne","grid.moveDown":"Descendre la ligne","grid.removeRow":"Supprimer la ligne","grid.empty":"Aucune ligne","grid.columns":"Modèle de ligne","select.search":"Rechercher…","select.empty":"Aucune option","select.clear":"Effacer","rules.when":"Quand","rules.then":"Alors","rules.addRule":"+ Ajouter une règle","rules.addEffect":"+ Effet","rules.removeRule":"Supprimer la règle","rules.removeEffect":"Supprimer l'effet","rules.mode.simple":"simple","rules.mode.json":"json","rules.mode.js":"JS","category.Inputs":"Champs","category.Layout":"Mise en page","category.Data":"Données","brick.text.name":"Texte","brick.email.name":"Email","brick.password.name":"Mot de passe","brick.url.name":"URL","brick.phone.name":"Téléphone","brick.textarea.name":"Zone de texte","brick.number.name":"Nombre","brick.date.name":"Date","brick.time.name":"Heure","brick.datetime.name":"Date / Heure","brick.select.name":"Liste déroulante","brick.multi-select.name":"Sélection multiple","brick.radio.name":"Boutons radio","brick.select-boxes.name":"Cases à cocher","brick.checkbox.name":"Case à cocher","brick.tags.name":"Étiquettes","brick.signature.name":"Signature","brick.data-grid.name":"Grille de données","brick.address.name":"Adresse","brick.file.name":"Fichier","brick.hidden.name":"Caché","brick.content.name":"Contenu","brick.recap.name":"Récapitulatif","brick.nested-form.name":"Formulaire imbriqué","brick.code.name":"Code","nestedForm.ref":"Formulaire référencé","nestedForm.missing":"Renseignez la config specRef pour référencer un formulaire.","nestedForm.loading":"Chargement des formulaires imbriqués…","panel.specRef":"Formulaire référencé (specRef)","panel.optionsRef":"Catalogue d'options (optionsRef)","recap.empty":"Rien à récapituler pour le moment.","recap.yes":"Oui","recap.no":"Non","panel.cfg.showEmpty":"Afficher les champs vides","panel.cfg.groupBySections":"Regrouper par section","brick.group.name":"Groupe","brick.row.name":"Ligne","brick.column.name":"Colonne","brick.stepper.name":"Étapes","brick.tabs.name":"Onglets"},Us=Symbol.for("formkrafter.i18n"),qs=globalThis,Fs=qs[Us]??={current:{...Ls}};function Vs(t={}){Fs.current={...Ls,...t}}function Bs(t,e){let i=Fs.current[t]??t;for(const[t,r]of Object.entries(e??{}))i=i.replace(`{${t}}`,String(r));return i}function Gs(t,e){return Fs.current[t]??e}var Hs=new Set(["__proto__","constructor","prototype"]);class Ks{value;constructor(t){this.value=t}}var Js=(t,e,i)=>{t.scopes[t.scopes.length-1].set(e,i)},Ws=t=>{if("number"==typeof t)return t;const e=String(t);if(Hs.has(e))throw new Error(`Access to "${e}" is not allowed`);return e},Zs=(t,e)=>({object:Ys(t,e.object),prop:Ws(e.computed?Ys(t,e.property):e.property.name),optional:!0===e.optional}),Ys=(t,e)=>{if(++t.steps>1e5)throw new Error("Sandbox execution budget exceeded");switch(e.type){case"Program":case"BlockStatement":for(const i of e.body){const e=Ys(t,i);if(e instanceof Ks)return e}return;case"ReturnStatement":return new Ks(e.argument?Ys(t,e.argument):void 0);case"IfStatement":return Ys(t,e.test)?Ys(t,e.consequent):e.alternate?Ys(t,e.alternate):void 0;case"VariableDeclaration":for(const i of e.declarations){const e=i.id;if("Identifier"!==e.type)throw new Error("Only simple variable names are supported");Js(t,e.name,i.init?Ys(t,i.init):void 0)}return;case"ExpressionStatement":return void Ys(t,e.expression);case"Literal":return e.value;case"TemplateLiteral":{const i=e.expressions;let r="";return e.quasis.forEach(((e,n)=>{r+=e.value.cooked??"",n<i.length&&(r+=String(Ys(t,i[n])))})),r}case"Identifier":return((t,e)=>{for(let i=t.scopes.length-1;i>=0;i--)if(t.scopes[i].has(e))return t.scopes[i].get(e);throw new Error(`Unknown identifier "${e}"`)})(t,e.name);case"ThisExpression":return;case"ChainExpression":return Ys(t,e.expression);case"MemberExpression":return((t,e)=>{const{object:i,prop:r,optional:n}=Zs(t,e);if(null==i){if(n)return;throw new Error(`Cannot read "${String(r)}" of ${String(i)}`)}return i[r]})(t,e);case"CallExpression":{const i=e.callee,r=[];for(const i of e.arguments)if("SpreadElement"===i.type){const e=Ys(t,i.argument);Array.isArray(e)&&r.push(...e)}else r.push(Ys(t,i));if("MemberExpression"===i.type){const{object:n,prop:s,optional:o}=Zs(t,i);if(null==n){if(o||!0===e.optional)return;throw new Error(`Cannot call "${String(s)}" of ${String(n)}`)}const a=n[s];if("function"!=typeof a){if(!0===e.optional&&null==a)return;throw new Error(`"${String(s)}" is not a function`)}if(a===Function||a===eval)throw new Error("This function is not allowed");return a.apply(n,r)}const n=Ys(t,i);if("function"!=typeof n){if(!0===e.optional&&null==n)return;throw new Error("Value is not a function")}if(n===Function||n===eval)throw new Error("This function is not allowed");return n(...r)}case"ArrowFunctionExpression":{const i=e.params,r=e.body,n=[...t.scopes];return(...s)=>{const o=new Map;i.forEach(((t,e)=>{if("Identifier"!==t.type)throw new Error("Only simple parameters are supported");o.set(t.name,s[e])}));const a={steps:t.steps,scopes:[...n,o]},h=Ys(a,r);return t.steps=a.steps,h instanceof Ks?h.value:!0===e.expression?h:void 0}}case"BinaryExpression":{const i=Ys(t,e.left),r=Ys(t,e.right);switch(e.operator){case"===":return i===r;case"!==":return i!==r;case"==":return i==r;case"!=":return i!=r;case"<":return i<r;case"<=":return i<=r;case">":return i>r;case">=":return i>=r;case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r;case"%":return i%r;case"**":return i**r;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"LogicalExpression":{const i=Ys(t,e.left);switch(e.operator){case"&&":return i&&Ys(t,e.right);case"||":return i||Ys(t,e.right);case"??":return i??Ys(t,e.right);default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"UnaryExpression":{const i=Ys(t,e.argument);switch(e.operator){case"!":return!i;case"-":return-i;case"+":return+i;case"typeof":return typeof i;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"ConditionalExpression":return Ys(t,e.test)?Ys(t,e.consequent):Ys(t,e.alternate);case"AssignmentExpression":{const i=e.left;if("Identifier"!==i.type||"="!==e.operator)throw new Error("Only simple assignments are supported");const r=Ys(t,e.right);return((t,e,i)=>{for(let r=t.scopes.length-1;r>=0;r--)if(t.scopes[r].has(e))return void t.scopes[r].set(e,i);throw new Error(`Cannot assign to unknown identifier "${e}"`)})(t,i.name,r),r}case"ArrayExpression":{const i=[];for(const r of e.elements)if(r)if("SpreadElement"===r.type){const e=Ys(t,r.argument);Array.isArray(e)&&i.push(...e)}else i.push(Ys(t,r));return i}case"ObjectExpression":{const i={};for(const r of e.properties){if("SpreadElement"===r.type){const e=Ys(t,r.argument);if(e&&"object"==typeof e)for(const[t,r]of Object.entries(e))i[String(Ws(t))]=r;continue}const e=r.key,n=Ws(r.computed?Ys(t,e):"Identifier"===e.type?e.name:e.value);i[String(n)]=Ys(t,r.value)}return i}default:throw new Error(`Unsupported syntax: ${e.type}`)}},Qs={undefined:void 0,NaN:NaN,Infinity:1/0,Math,JSON,Number,String,Boolean,Array,Object,Date,parseInt,parseFloat,isNaN,isFinite};class Xs{defaults;cache=new Map;constructor(t={}){this.defaults=t}resolveUrl(t){return/^https?:\/\//.test(t)||!this.defaults.baseUrl?t:`${this.defaults.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}fetchSpec(t){const e=this.resolveUrl(t);let i=this.cache.get(e);return i||(i=(this.defaults.fetch??globalThis.fetch.bind(globalThis))(e,{headers:this.defaults.headers,credentials:this.defaults.credentials}).then((async e=>{if(!e.ok)throw new Error(`Failed to load spec "${t}" (${e.status})`);return await e.json()})),i.catch((()=>this.cache.delete(e))),this.cache.set(e,i)),i}}class to{defaults;cache=new Map;constructor(t={}){this.defaults=t}resolveUrl(t){return/^https?:\/\//.test(t)||!this.defaults.baseUrl?t:`${this.defaults.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}fetchOptions(t){const e=this.resolveUrl(t);let i=this.cache.get(e);return i||(i=(this.defaults.fetch??globalThis.fetch.bind(globalThis))(e,{headers:this.defaults.headers,credentials:this.defaults.credentials}).then((async e=>{if(!e.ok)throw new Error(`Failed to load options "${t}" (${e.status})`);return await e.json()})),i.catch((()=>this.cache.delete(e))),this.cache.set(e,i)),i}}var eo=Symbol.for("formkrafter.core.services"),io=globalThis,ro=io[eo]??={jsRunnerService:new class{validateJs(t,e={ecmaVersion:"latest",allowReturnOutsideFunction:!0}){try{return Yt(t,e),{valid:!0}}catch(t){return{valid:!1,error:t instanceof Error?t:new Error(String(t))}}}eval(t,e={}){return function(t,e={}){const i=Yt(t,{ecmaVersion:"latest",allowReturnOutsideFunction:!0}),r={steps:0,scopes:[new Map(Object.entries({...Qs,...e})),new Map]},n=Ys(r,i);return n instanceof Ks?n.value:void 0}(t,e)}},dataSourceService:new class{defaults;cache=new Map;constructor(t={}){this.defaults=t}fetchOptions(t,e){const i={...this.defaults.headers,...e?.headers},r={};Object.keys(i).length&&(r.headers=i),this.defaults.credentials&&(r.credentials=this.defaults.credentials);const n=`${t}|${JSON.stringify(r)}`;let s=this.cache.get(n);return s||(s=fetch(t,Object.keys(r).length?r:void 0).then((e=>{if(!e.ok)throw new Error(`Data source request failed (${e.status}): ${t}`);return e.json()})).then((e=>{if(!Array.isArray(e))throw new Error(`Data source did not return an array: ${t}`);return e})).catch((t=>{throw this.cache.delete(n),t})),this.cache.set(n,s)),s}},fileUploadService:new class{async upload(t){const e=globalThis.btoa;if(!e)throw new Error("No base64 encoder available");const i=new Uint8Array(await t.arrayBuffer());let r="";for(const t of i)r+=String.fromCharCode(t);return{name:t.name,type:t.type,size:t.size,url:`data:${t.type};base64,${e(r)}`}}},specSourceService:new Xs,optionSourceService:new to};ro.specSourceService??=new Xs,ro.optionSourceService??=new to;var no=(t,e)=>{try{return ro.jsRunnerService.eval(t,{dataMap:e??{}})}catch(t){return t instanceof Error?t:new Error(String(t))}},so=(t,e)=>((t,e)=>((t,e)=>t?.filter((t=>((t,e)=>"jsonLogic"===t.type?null!=t.logic&&!0===n.apply(t.logic,e):"javaScript"===t.type&&!!t.code&&!0===no(t.code,e))(t,e))))(t,e)?.map((t=>t.effects)).flat().filter((t=>null!=t)))(t,e)?.map((t=>{let i;return t.property?("boolean"===t.property.type?i=t.boolean:"logic"===t.property.type&&null!=t.logic?i=n.apply(t.logic,e):"code"===t.property.type&&t.code?i=no(t.code,e):"string"===t.property.type&&(i=t.string),{[t.property.target]:i}):{}})).flat().reduce(((t,e)=>({...t,...e})),{})??{hidden:!1},oo=(t,e)=>{if(Array.isArray(e))return e.map((e=>oo(t,e))).filter(Boolean).join(", ");if(!0===e)return Gs("recap.yes","Yes");if(!1===e)return Gs("recap.no","No");if(e&&"object"==typeof e)return"string"==typeof e.name&&"url"in e?e.name:Object.values(e).filter((t=>"string"==typeof t&&t)).join(" ");const i=String(e??"");if(null!=t.configs?.options){const e=Ds(t.configs.options,"string"==typeof t.configs.labelKey?t.configs.labelKey:"label","string"==typeof t.configs.valueKey?t.configs.valueKey:"value").find((t=>t.value===i));if(e)return e.label}return i},ao=t=>null==t||""===t||Array.isArray(t)&&0===t.length,ho=(t,e)=>String(js(t.configs?.label,e)??t.name??t.configs?.key??""),uo=t=>{const e=[];for(const i of t.children??[]){const t=i.configs?.key;"input"===i.type&&t&&!t.startsWith("_")&&e.push(i)}return e},co=(t,e,i,r,n=!1)=>{if(!t)return[];const s=[];for(const o of t.children??[]){if("recap"===o.id||"action"===o.type)continue;if(!0===so(o.rules,e).hidden)continue;const t=o.configs?.key,a=ho(o,i);if("collection"===o.type){const n=t&&Array.isArray(e?.[t])?e[t]:[];if(!n.length&&!r)continue;const h=uo(o);s.push({kind:"collection",label:a,columns:h.map((t=>ho(t,i))),rows:n.map((t=>h.map((e=>{const i=t?.[e.configs.key];return ao(i)?"—":oo(e,i)}))))});continue}if("panel"===o.type){const t=js(o.configs?.label,i);if(n&&"string"==typeof t&&t.trim()){const n=co(o,e,i,r);n.length&&(s.push({kind:"section",label:t}),s.push(...n));continue}s.push(...co(o,e,i,r,n));continue}if("input"!==o.type||!t||t.startsWith("_"))continue;const h=e?.[t];ao(h)&&!r||s.push({kind:"field",label:a,value:ao(h)?"—":oo(o,h)})}return s};function fo(t,e){return t.replace(/\{(\w+)\}/g,((t,i)=>{const r=e?.[i];return null==r?"":String(r)}))}function lo(t,e){if("string"!=typeof t||!t.trim())return;const i={};for(const r of t.split("\n")){const t=r.indexOf(":");if(t<=0)continue;const n=r.slice(0,t).trim(),s=fo(r.slice(t+1).trim(),e);n&&(i[n]=s)}return Object.keys(i).length?i:void 0}function po(t,e,i){if(!i)return t;const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(i)}`}class mo{type;dataType;id;name;configsForm;category;styles;unWrapData;isPrivate;validators;defaultConfigs;constructor(t){this.type=t.type,this.dataType=t.dataType,this.id=t.id,this.name=t.name,this.configsForm=t.configsForm,this.category=t.category,this.styles=t.styles,this.unWrapData=t.unWrapData??!1,this.isPrivate=t.isPrivate??!1,this.validators=t.validators??[],this.defaultConfigs=t.defaultConfigs}getBrickEmptySpec(){return{type:this.type,dataType:this.dataType,id:this.id,name:this.name,...void 0!==this.category?{category:this.category}:{},...void 0!==this.configsForm?{configsForm:this.configsForm}:{},...void 0!==this.styles?{styles:this.styles}:{},...void 0!==this.defaultConfigs?{configs:{...this.defaultConfigs}}:{},validators:this.validators}}}var vo=new Un.Ajv({allErrors:!0});Jn(vo,["email","uri"]),Vn(vo);var yo=new WeakMap,go=t=>{if("required"===t.keyword)return t.params.missingProperty;if("errorMessage"===t.keyword){const e=t.params.errors?.[0];return e?go(e):void 0}return t.instancePath.split("/").filter(Boolean)[0]},$o=(t,e,i)=>{const r={},n=((t,e)=>{let i=yo.get(t);i||(i=new Map,yo.set(t,i));const r=e??"";let n=i.get(r);if(!n){const s=function(t,e){if(!t)return;const i={},r=[],n={},s=t=>{const i=js(t,e);return"string"==typeof i?i:void 0};for(const o of Ns(t)){const t=o.configs?.key,a=!0===o.configs?.multiple&&"object"===o.dataType?"array":o.dataType;if(!t||!a||"void"===a)continue;const h=o.validations?.find((t=>"required"===t.validator)),u={type:a,nullable:!h},c={type:Cs("type",e)};for(const t of o.validations??[]){const{validator:i,value:r}=t,n=s(t.message)??Cs(i,e,r);"minLength"===i&&null!=r?(u.minLength=Number(r),c.minLength=n):"maxLength"===i&&null!=r?(u.maxLength=Number(r),c.maxLength=n):"min"===i&&null!=r?(u.minimum=Number(r),c.minimum=n):"max"===i&&null!=r?(u.maximum=Number(r),c.maximum=n):"pattern"===i&&"string"==typeof r&&r?(u.pattern=r,c.pattern=n):"minItems"===i&&null!=r?(u.minItems=Number(r),c.minItems=n):"maxItems"===i&&null!=r?(u.maxItems=Number(r),c.maxItems=n):"email"===i?(u.format="email",c.format=n):"url"===i&&(u.format="uri",c.format=n)}u.errorMessage=c,i[t]=u,h&&(r.push(t),n[t]=s(h.message)??Cs("required",e))}return{type:"object",properties:i,required:r,...Object.keys(n).length?{errorMessage:{required:n}}:{},additionalProperties:!1}}(t,e);if(!s)return;try{n=vo.compile(s)}catch{return}i.set(r,n)}return n})(t,i);if(n&&!n(e))for(const t of n.errors??[]){const e=go(t);e&&!(e in r)&&t.message&&(r[e]=t.message)}for(const[n,s]of Object.entries(((t,e,i)=>{const r={},n=e??{};for(const e of Ns(t)){const t=e.configs?.key;if(t)for(const s of e.validations??[]){if("custom"!==s.validator||!s.customValidator)continue;const e=no(`const value = dataMap?.[${JSON.stringify(t)}];\n${s.customValidator}`,n);if(!0!==e&&null!=e&&!(t in r))if("string"==typeof e)r[t]=e;else if(e instanceof Error)r[t]=e.message;else{const e=js(s.message,i);r[t]="string"==typeof e?e:Cs("custom",i)}}}return r})(t,e,i)))n in r||(r[n]=s);const s="object"==typeof e&&null!==e?e:void 0;for(const e of((t,e)=>{const i=new Set,r=(t,n)=>{const s=n||!!t.rules?.length&&!0===so(t.rules,e).hidden,o=t.configs?.key;if(s&&o&&i.add(o),"collection"!==t.type)for(const e of t.children??[])r(e,s)};return r(t,!1),i})(t,s))delete r[e];return{valid:0===Object.keys(r).length,errors:r}};function wo(t){return t.split(".").slice(1).map((t=>`/children/${t}`)).join("")}function bo(t,e){if(t.configs?.uid===e)return"";for(const[i,r]of(t.children??[]).entries()){const t=bo(r,e);if(void 0!==t)return`/children/${i}${t}`}}function _o(t,e){let i=t;for(const t of e.split(".").slice(1))i=i?.children?.[Number(t)];return i}var Eo=(Ss??xs).applyPatch,ko=(t,e,i)=>({spec:Eo(t,e,!0,!1).newDocument,patches:e,inverse:i}),So=(t,e)=>{const i=_o(t,e);if(!i)throw new Error(`No brick at path "${e}"`);return i},xo=(t,e)=>{const i=bo(t,e);if(void 0===i)throw new Error(`No brick with uid "${e}"`);let r=t;for(const t of i.split("/children/").slice(1))r=r.children[Number(t)];return{pointer:i,brick:r}},Oo=t=>JSON.parse(JSON.stringify(t));function jo(t,e,i,r){const n=So(t,i),s=wo(i),o=Oo(e);if(!n.children){const e=`${s}/children`;return ko(t,[{op:"add",path:e,value:[o]}],[{op:"remove",path:e}])}const a=`${s}/children/${Math.min(r??n.children.length,n.children.length)}`;return ko(t,[{op:"add",path:a,value:o}],[{op:"remove",path:a}])}function Po(t,e){if("0"===e)throw new Error("Cannot remove the root brick");const i=So(t,e),r=wo(e);return ko(t,[{op:"remove",path:r}],[{op:"add",path:r,value:i}])}function Io(t,e,i){if("0"===e||"0"===i)throw new Error("Cannot move the root brick");const r=So(t,e),n=e.split(".").map(Number),s=i.split(".").map(Number),o=n.length-1,a=n[o],h=s.length>o&&n.slice(0,o).every(((t,e)=>t===s[e])),u=[...s];if(h){if(u[o]===a&&u.length>n.length)throw new Error(`Cannot move a brick into its own subtree ("${e}" → "${i}")`);u[o]>a&&(u[o]-=1)}const c=wo(e),f=wo(u.join("."));return ko(t,[{op:"remove",path:c},{op:"add",path:f,value:r}],[{op:"remove",path:f},{op:"add",path:c,value:r}])}var Co=t=>({...t,...t.configs?{configs:{...t.configs,uid:crypto.randomUUID()}}:{},...t.children?{children:t.children.map(Co)}:{}});function Ao(t,e){if("0"===e)throw new Error("Cannot duplicate the root brick");const i=So(t,e),r=e.split("."),n=Number(r[r.length-1])+1,s=wo([...r.slice(0,-1),String(n)].join(".")),o=Co(Oo(i));return ko(t,[{op:"add",path:s,value:o}],[{op:"remove",path:s}])}var No=(t,e,i,r,n)=>{const s=`${e}/${i}`;return void 0===n?ko(t,[{op:"add",path:s,value:r}],[{op:"remove",path:s}]):ko(t,[{op:"replace",path:s,value:r}],[{op:"replace",path:s,value:n}])};function To(t,e,i){const{pointer:r,brick:n}=xo(t,e),s={...n.configs,...i};return No(t,r,"configs",s,n.configs)}function Mo(t,e,i){const{pointer:r,brick:n}=xo(t,e),s={...n.styles,...i};return No(t,r,"styles",s,n.styles)}function Ro(t,e,i){const{pointer:r,brick:n}=xo(t,e);return No(t,r,"validations",i,n.validations)}function Do(t,e,i){const{pointer:r,brick:n}=xo(t,e);return No(t,r,"rules",i,n.rules)}class Lo{past=[];future=[];record(t){this.past.push({patches:t.patches,inverse:t.inverse}),this.future=[]}get canUndo(){return this.past.length>0}get canRedo(){return this.future.length>0}undo(t){const e=this.past.pop();if(e)return this.future.push(e),Eo(t,e.inverse,!0,!1).newDocument}redo(t){const e=this.future.pop();if(e)return this.past.push(e),Eo(t,e.patches,!0,!1).newDocument}clear(){this.past=[],this.future=[]}}var zo=t=>"nested-form"===t.id&&"string"==typeof t.configs?.specRef,Uo=t=>{if(!t)return!1;for(const{brick:e}of As(t))if(zo(e)&&e.configs?.specRef)return!0;return!1};async function qo(t,e={}){const i=e.specSourceService??ro.specSourceService,r=e.maxDepth??5,n=async(t,e)=>{if(zo(t)&&t.configs?.specRef){const s=String(t.configs.specRef);if(e.includes(s))throw new Error(`Circular nested form reference: ${[...e,s].join(" → ")}`);if(e.length>=r)throw new Error(`Nested forms exceed the maximum depth of ${r} (${s})`);const o=await i.fetchSpec(s),a=await n(structuredClone(o),[...e,s]);return{type:"panel",id:"group",name:t.name,configs:{...t.configs,label:t.configs.label??a.name},styles:t.styles,rules:t.rules,children:a.children??[]}}return t.children?.length?{...t,children:await Promise.all(t.children.map((t=>n(t,e))))}:t};return n(structuredClone(t),[])}export{Do as A,mo as B,co as C,js as D,Vs as E,zs as F,Lo as S,Ts as a,Bs as b,Os as c,fo as d,qo as e,Gs as f,so as g,Uo as h,As as i,po as j,no as k,Ns as l,jo as m,Ds as n,_o as o,lo as p,Io as q,Ps as r,ro as s,Po as t,Ao as u,$o as v,Ms as w,To as x,Mo as y,Ro as z}
|
|
12
|
+
*/function ws(t,e){e.unobserve()}function bs(t,e){var i,r=function(t){return ys.get(t)}(t);if(r){var n=function(t,e){return t.observers.get(e)}(r,e);i=n&&n.observer}else r=new gs(t),ys.set(t,r);if(i)return i;if(i={},r.value=Xn(t),e){i.callback=e,i.next=null;var s=function(){_s(i)},o=function(){clearTimeout(i.next),i.next=setTimeout(s)};"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return i.patches=[],i.object=t,i.unobserve=function(){_s(i),clearTimeout(i.next),function(t,e){t.observers.delete(e.callback)}(r,i),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},r.observers.set(e,new $s(e,i)),i}function _s(t,e){void 0===e&&(e=!1);var i=ys.get(t.object);Es(i.value,t.object,t.patches,"",e),t.patches.length&&fs(i.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function Es(t,e,i,r,n){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var s=Qn(e),o=Qn(t),a=!1,h=o.length-1;h>=0;h--){var u=t[f=o[h]];if(!Yn(e,f)||void 0===e[f]&&void 0!==u&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(n&&i.push({op:"test",path:r+"/"+es(f),value:Xn(u)}),i.push({op:"remove",path:r+"/"+es(f)}),a=!0):(n&&i.push({op:"test",path:r,value:t}),i.push({op:"replace",path:r,value:e}));else{var c=e[f];"object"==typeof u&&null!=u&&"object"==typeof c&&null!=c&&Array.isArray(u)===Array.isArray(c)?Es(u,c,i,r+"/"+es(f),n):u!==c&&(n&&i.push({op:"test",path:r+"/"+es(f),value:Xn(u)}),i.push({op:"replace",path:r+"/"+es(f),value:Xn(c)}))}}if(a||s.length!=o.length)for(h=0;h<s.length;h++){var f;Yn(t,f=s[h])||void 0===e[f]||i.push({op:"add",path:r+"/"+es(f),value:Xn(e[f])})}}}function ks(t,e,i){void 0===i&&(i=!1);var r=[];return Es(t,e,r,"",i),r}var Ss=Object.assign({},vs,Object.freeze({__proto__:null,compare:ks,generate:_s,observe:bs,unobserve:ws}),{JsonPatchError:ss,deepClone:Xn,escapePathComponent:es,unescapePathComponent:is}),xs=Object.freeze({__proto__:null,JsonPatchError:ss,_areEquals:ms,applyOperation:cs,applyPatch:fs,applyReducer:ls,compare:ks,deepClone:Xn,default:Ss,escapePathComponent:es,generate:_s,getValueByPointer:us,observe:bs,unescapePathComponent:is,unobserve:ws,validate:ps,validator:ds});function Os(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Object.keys(t).length>0&&Object.values(t).every((t=>"string"==typeof t))}function js(t,e){return Os(t)?e&&void 0!==t[e]?t[e]:Object.values(t)[0]:t}function Ps(t,e){if(!t)return t;const i={};for(const[r,n]of Object.entries(t))i[r]=js(n,e);return i}var Is={en:{required:"This field is required",minLength:"Must be at least {value} characters",maxLength:"Must be at most {value} characters",min:"Must be at least {value}",max:"Must be at most {value}",pattern:"Invalid format",minItems:"Select at least {value} item(s)",maxItems:"Select at most {value} item(s)",email:"Invalid email address",url:"Invalid URL",type:"Invalid value",custom:"Invalid value"},fr:{required:"Ce champ est obligatoire",minLength:"Minimum {value} caractères",maxLength:"Maximum {value} caractères",min:"Minimum {value}",max:"Maximum {value}",pattern:"Format invalide",minItems:"Sélectionnez au moins {value} élément(s)",maxItems:"Sélectionnez au plus {value} élément(s)",email:"Adresse email invalide",url:"URL invalide",type:"Valeur invalide",custom:"Valeur invalide"}};function Cs(t,e,i){return((Is[e??"en"]??Is.en)[t]??Is.en[t]??"Invalid value").replace("{value}",String(i??""))}function*As(t,e="0"){if(t){yield{brick:t,path:e};for(const[i,r]of(t.children??[]).entries())yield*As(r,`${e}.${i}`)}}function*Ns(t){if(t&&(yield t,"collection"!==t.type))for(const e of t.children??[])yield*Ns(e)}function Ts(t,e){if(t.configs?.key&&e)return t.unWrapData?e:e[t.configs.key]}function Ms(t,e){if(t.configs?.key)return t.unWrapData?e:{[t.configs.key]:e}}var Rs=(t,e)=>{if(!e.includes("."))return t[e];let i=t;for(const t of e.split(".")){if("object"!=typeof i||null===i)return;i=i[t]}return i};function Ds(t,e="label",i="value"){return Array.isArray(t)?t.map((t=>{if("object"==typeof t&&null!==t){const r=t,n=Rs(r,e)??Rs(r,i),s=Rs(r,i)??Rs(r,e);return{label:String(n??""),value:String(s??"")}}return{label:String(t),value:String(t)}})).filter((t=>""!==t.label)):String(t??"").split("\n").map((t=>t.trim())).filter(Boolean).map((t=>({label:t,value:t})))}var Ls={"palette.search":"Search bricks…","palette.empty":"No brick matches “{query}”","builder.undo":"Undo","builder.redo":"Redo","builder.editLocale":"Editing language","builder.copyJson":"Copy JSON","builder.importJson":"Import JSON","builder.importInvalid":"Invalid form JSON","builder.pasteHint":"Press Ctrl+V to paste a spec","builder.copied":"Copied!","builder.downloadJson":"Download .json","builder.hint":"Select a brick to edit its properties","drop.hint":"Drop a brick here","empty.title":"Your form is empty","empty.hint":"Drag a brick from the palette to get started","actions.move":"Move","actions.duplicate":"Duplicate","actions.delete":"Delete","stepper.back":"← Back","stepper.next":"Next →","stepper.submit":"Submit","panel.cfg.validateSteps":"Validate each step","panel.cfg.allowStepClick":"Allow clicking steps to jump","panel.cfg.showSubmit":"Submit button on last step","panel.cfg.validateTabs":"Validate tab before leaving it","signature.clear":"Clear","panel.tab.config":"Config","panel.tab.validation":"Validation","panel.tab.styles":"Styles","panel.tab.rules":"Rules","panel.key":"Key","panel.label":"Label","panel.placeholder":"Placeholder","panel.prefix":"Prefix","panel.suffix":"Suffix","panel.accept":"Accepted file types","panel.mask":"Input mask (9=digit, a=letter, *=any)","panel.uploadUrl":"Upload URL","panel.cfg.multiple":"Allow multiple files","panel.optionsSource":"Options source","panel.options":"Options (one per line)","panel.content":"Content","panel.dataKey":"Data key","panel.url":"URL","panel.headers":"Headers ({token} reads form data)","panel.searchParam":"Server search param","panel.labelKey":"Label key","panel.valueKey":"Value key","panel.errorMessage":"Error message","panel.required":"Required","panel.minLength":"Min length","panel.maxLength":"Max length","panel.min":"Min","panel.max":"Max","panel.pattern":"Pattern (regex)","panel.minItems":"Min items","panel.maxItems":"Max items","panel.emailFormat":"Email format","panel.urlFormat":"URL format","panel.custom":"Custom (JavaScript)","panel.fallbackMessage":"Fallback message","panel.styleProperty":"property","panel.styleValue":"value","file.choose":"Choose a file…","file.uploading":"Uploading…","file.remove":"Remove file","file.addAnother":"+ Add a file","address.street":"Street","address.city":"City","address.zip":"Postal code","address.country":"Country","grid.addRow":"+ Add row","grid.moveUp":"Move row up","grid.moveDown":"Move row down","grid.removeRow":"Remove row","grid.empty":"No rows yet","grid.columns":"Row template","select.search":"Search…","select.empty":"No options","select.clear":"Clear","rules.when":"When","rules.then":"Then","rules.addRule":"+ Add rule","rules.addEffect":"+ Effect","rules.removeRule":"Remove rule","rules.removeEffect":"Remove effect","rules.mode.simple":"simple","rules.mode.json":"json","rules.mode.js":"JS","category.Inputs":"Inputs","category.Layout":"Layout","category.Data":"Data","brick.text.name":"Text","brick.email.name":"Email","brick.password.name":"Password","brick.url.name":"URL","brick.phone.name":"Phone","brick.textarea.name":"Text area","brick.number.name":"Number","brick.date.name":"Date","brick.time.name":"Time","brick.datetime.name":"Date / Time","brick.select.name":"Select","brick.multi-select.name":"Multi select","brick.radio.name":"Radio","brick.select-boxes.name":"Select boxes","brick.checkbox.name":"Checkbox","brick.tags.name":"Tags","brick.signature.name":"Signature","brick.data-grid.name":"Data grid","brick.address.name":"Address","brick.file.name":"File","brick.hidden.name":"Hidden","brick.content.name":"Content","brick.recap.name":"Recap","brick.nested-form.name":"Nested form","brick.code.name":"Code","nestedForm.ref":"Referenced form","nestedForm.missing":"Set the specRef config to reference a form.","nestedForm.loading":"Loading nested forms…","panel.specRef":"Referenced form (specRef)","panel.optionsRef":"Options catalog (optionsRef)","recap.empty":"Nothing to summarize yet.","recap.yes":"Yes","recap.no":"No","panel.cfg.showEmpty":"Show empty fields","panel.cfg.groupBySections":"Group by section","brick.group.name":"Group","brick.row.name":"Row","brick.column.name":"Column","brick.stepper.name":"Stepper","brick.tabs.name":"Tabs"},zs={"palette.search":"Rechercher une brique…","palette.empty":"Aucune brique ne correspond à « {query} »","builder.undo":"Annuler","builder.editLocale":"Langue d'édition","builder.redo":"Rétablir","builder.copyJson":"Copier le JSON","builder.importJson":"Importer le JSON","builder.importInvalid":"JSON de formulaire invalide","builder.pasteHint":"Collez avec Ctrl+V pour importer une spec","builder.copied":"Copié !","builder.downloadJson":"Télécharger le .json","builder.hint":"Sélectionnez une brique pour éditer ses propriétés","drop.hint":"Déposez une brique ici","empty.title":"Votre formulaire est vide","empty.hint":"Glissez une brique depuis la palette pour commencer","actions.move":"Déplacer","actions.duplicate":"Dupliquer","actions.delete":"Supprimer","stepper.back":"← Précédent","stepper.next":"Suivant →","stepper.submit":"Envoyer","panel.cfg.validateSteps":"Valider chaque étape","panel.cfg.allowStepClick":"Autoriser le saut d’étapes au clic","panel.cfg.showSubmit":"Bouton d’envoi à la dernière étape","panel.cfg.validateTabs":"Valider l’onglet avant de le quitter","signature.clear":"Effacer","panel.tab.config":"Config","panel.tab.validation":"Validation","panel.tab.styles":"Styles","panel.tab.rules":"Règles","panel.key":"Clé","panel.label":"Libellé","panel.placeholder":"Placeholder","panel.prefix":"Préfixe","panel.suffix":"Suffixe","panel.accept":"Types de fichiers acceptés","panel.mask":"Masque de saisie (9=chiffre, a=lettre, *=tout)","panel.uploadUrl":"URL d'upload","panel.cfg.multiple":"Autoriser plusieurs fichiers","panel.optionsSource":"Source des options","panel.options":"Options (une par ligne)","panel.content":"Contenu","panel.dataKey":"Clé de données","panel.url":"URL","panel.headers":"En-têtes ({token} lit les données du formulaire)","panel.searchParam":"Paramètre de recherche serveur","panel.labelKey":"Clé du libellé","panel.valueKey":"Clé de la valeur","panel.errorMessage":"Message d'erreur","panel.required":"Obligatoire","panel.minLength":"Longueur min","panel.maxLength":"Longueur max","panel.min":"Min","panel.max":"Max","panel.pattern":"Motif (regex)","panel.minItems":"Éléments min","panel.maxItems":"Éléments max","panel.emailFormat":"Format email","panel.urlFormat":"Format URL","panel.custom":"Personnalisé (JavaScript)","panel.fallbackMessage":"Message par défaut","panel.styleProperty":"propriété","panel.styleValue":"valeur","file.choose":"Choisir un fichier…","file.uploading":"Envoi en cours…","file.remove":"Retirer le fichier","file.addAnother":"+ Ajouter un fichier","address.street":"Rue","address.city":"Ville","address.zip":"Code postal","address.country":"Pays","grid.addRow":"+ Ajouter une ligne","grid.moveUp":"Monter la ligne","grid.moveDown":"Descendre la ligne","grid.removeRow":"Supprimer la ligne","grid.empty":"Aucune ligne","grid.columns":"Modèle de ligne","select.search":"Rechercher…","select.empty":"Aucune option","select.clear":"Effacer","rules.when":"Quand","rules.then":"Alors","rules.addRule":"+ Ajouter une règle","rules.addEffect":"+ Effet","rules.removeRule":"Supprimer la règle","rules.removeEffect":"Supprimer l'effet","rules.mode.simple":"simple","rules.mode.json":"json","rules.mode.js":"JS","category.Inputs":"Champs","category.Layout":"Mise en page","category.Data":"Données","brick.text.name":"Texte","brick.email.name":"Email","brick.password.name":"Mot de passe","brick.url.name":"URL","brick.phone.name":"Téléphone","brick.textarea.name":"Zone de texte","brick.number.name":"Nombre","brick.date.name":"Date","brick.time.name":"Heure","brick.datetime.name":"Date / Heure","brick.select.name":"Liste déroulante","brick.multi-select.name":"Sélection multiple","brick.radio.name":"Boutons radio","brick.select-boxes.name":"Cases à cocher","brick.checkbox.name":"Case à cocher","brick.tags.name":"Étiquettes","brick.signature.name":"Signature","brick.data-grid.name":"Grille de données","brick.address.name":"Adresse","brick.file.name":"Fichier","brick.hidden.name":"Caché","brick.content.name":"Contenu","brick.recap.name":"Récapitulatif","brick.nested-form.name":"Formulaire imbriqué","brick.code.name":"Code","nestedForm.ref":"Formulaire référencé","nestedForm.missing":"Renseignez la config specRef pour référencer un formulaire.","nestedForm.loading":"Chargement des formulaires imbriqués…","panel.specRef":"Formulaire référencé (specRef)","panel.optionsRef":"Catalogue d'options (optionsRef)","recap.empty":"Rien à récapituler pour le moment.","recap.yes":"Oui","recap.no":"Non","panel.cfg.showEmpty":"Afficher les champs vides","panel.cfg.groupBySections":"Regrouper par section","brick.group.name":"Groupe","brick.row.name":"Ligne","brick.column.name":"Colonne","brick.stepper.name":"Étapes","brick.tabs.name":"Onglets"},Us=Symbol.for("formkrafter.i18n"),qs=globalThis,Fs=qs[Us]??={current:{...Ls}};function Vs(t={}){Fs.current={...Ls,...t}}function Bs(t,e){let i=Fs.current[t]??t;for(const[t,r]of Object.entries(e??{}))i=i.replace(`{${t}}`,String(r));return i}function Gs(t,e){return Fs.current[t]??e}var Hs=new Set(["__proto__","constructor","prototype"]);class Ks{value;constructor(t){this.value=t}}var Js=(t,e,i)=>{t.scopes[t.scopes.length-1].set(e,i)},Ws=t=>{if("number"==typeof t)return t;const e=String(t);if(Hs.has(e))throw new Error(`Access to "${e}" is not allowed`);return e},Zs=(t,e)=>({object:Ys(t,e.object),prop:Ws(e.computed?Ys(t,e.property):e.property.name),optional:!0===e.optional}),Ys=(t,e)=>{if(++t.steps>1e5)throw new Error("Sandbox execution budget exceeded");switch(e.type){case"Program":case"BlockStatement":for(const i of e.body){const e=Ys(t,i);if(e instanceof Ks)return e}return;case"ReturnStatement":return new Ks(e.argument?Ys(t,e.argument):void 0);case"IfStatement":return Ys(t,e.test)?Ys(t,e.consequent):e.alternate?Ys(t,e.alternate):void 0;case"VariableDeclaration":for(const i of e.declarations){const e=i.id;if("Identifier"!==e.type)throw new Error("Only simple variable names are supported");Js(t,e.name,i.init?Ys(t,i.init):void 0)}return;case"ExpressionStatement":return void Ys(t,e.expression);case"Literal":return e.value;case"TemplateLiteral":{const i=e.expressions;let r="";return e.quasis.forEach(((e,n)=>{r+=e.value.cooked??"",n<i.length&&(r+=String(Ys(t,i[n])))})),r}case"Identifier":return((t,e)=>{for(let i=t.scopes.length-1;i>=0;i--)if(t.scopes[i].has(e))return t.scopes[i].get(e);throw new Error(`Unknown identifier "${e}"`)})(t,e.name);case"ThisExpression":return;case"ChainExpression":return Ys(t,e.expression);case"MemberExpression":return((t,e)=>{const{object:i,prop:r,optional:n}=Zs(t,e);if(null==i){if(n)return;throw new Error(`Cannot read "${String(r)}" of ${String(i)}`)}return i[r]})(t,e);case"CallExpression":{const i=e.callee,r=[];for(const i of e.arguments)if("SpreadElement"===i.type){const e=Ys(t,i.argument);Array.isArray(e)&&r.push(...e)}else r.push(Ys(t,i));if("MemberExpression"===i.type){const{object:n,prop:s,optional:o}=Zs(t,i);if(null==n){if(o||!0===e.optional)return;throw new Error(`Cannot call "${String(s)}" of ${String(n)}`)}const a=n[s];if("function"!=typeof a){if(!0===e.optional&&null==a)return;throw new Error(`"${String(s)}" is not a function`)}if(a===Function||a===eval)throw new Error("This function is not allowed");return a.apply(n,r)}const n=Ys(t,i);if("function"!=typeof n){if(!0===e.optional&&null==n)return;throw new Error("Value is not a function")}if(n===Function||n===eval)throw new Error("This function is not allowed");return n(...r)}case"ArrowFunctionExpression":{const i=e.params,r=e.body,n=[...t.scopes];return(...s)=>{const o=new Map;i.forEach(((t,e)=>{if("Identifier"!==t.type)throw new Error("Only simple parameters are supported");o.set(t.name,s[e])}));const a={steps:t.steps,scopes:[...n,o]},h=Ys(a,r);return t.steps=a.steps,h instanceof Ks?h.value:!0===e.expression?h:void 0}}case"BinaryExpression":{const i=Ys(t,e.left),r=Ys(t,e.right);switch(e.operator){case"===":return i===r;case"!==":return i!==r;case"==":return i==r;case"!=":return i!=r;case"<":return i<r;case"<=":return i<=r;case">":return i>r;case">=":return i>=r;case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r;case"%":return i%r;case"**":return i**r;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"LogicalExpression":{const i=Ys(t,e.left);switch(e.operator){case"&&":return i&&Ys(t,e.right);case"||":return i||Ys(t,e.right);case"??":return i??Ys(t,e.right);default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"UnaryExpression":{const i=Ys(t,e.argument);switch(e.operator){case"!":return!i;case"-":return-i;case"+":return+i;case"typeof":return typeof i;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"ConditionalExpression":return Ys(t,e.test)?Ys(t,e.consequent):Ys(t,e.alternate);case"AssignmentExpression":{const i=e.left;if("Identifier"!==i.type||"="!==e.operator)throw new Error("Only simple assignments are supported");const r=Ys(t,e.right);return((t,e,i)=>{for(let r=t.scopes.length-1;r>=0;r--)if(t.scopes[r].has(e))return void t.scopes[r].set(e,i);throw new Error(`Cannot assign to unknown identifier "${e}"`)})(t,i.name,r),r}case"ArrayExpression":{const i=[];for(const r of e.elements)if(r)if("SpreadElement"===r.type){const e=Ys(t,r.argument);Array.isArray(e)&&i.push(...e)}else i.push(Ys(t,r));return i}case"ObjectExpression":{const i={};for(const r of e.properties){if("SpreadElement"===r.type){const e=Ys(t,r.argument);if(e&&"object"==typeof e)for(const[t,r]of Object.entries(e))i[String(Ws(t))]=r;continue}const e=r.key,n=Ws(r.computed?Ys(t,e):"Identifier"===e.type?e.name:e.value);i[String(n)]=Ys(t,r.value)}return i}default:throw new Error(`Unsupported syntax: ${e.type}`)}},Qs={undefined:void 0,NaN:NaN,Infinity:1/0,Math,JSON,Number,String,Boolean,Array,Object,Date,parseInt,parseFloat,isNaN,isFinite};class Xs{defaults;cache=new Map;constructor(t={}){this.defaults=t}resolveUrl(t){return/^https?:\/\//.test(t)||!this.defaults.baseUrl?t:`${this.defaults.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}fetchSpec(t){const e=this.resolveUrl(t);let i=this.cache.get(e);return i||(i=(this.defaults.fetch??globalThis.fetch.bind(globalThis))(e,{headers:this.defaults.headers,credentials:this.defaults.credentials}).then((async e=>{if(!e.ok)throw new Error(`Failed to load spec "${t}" (${e.status})`);return await e.json()})),i.catch((()=>this.cache.delete(e))),this.cache.set(e,i)),i}}class to{defaults;cache=new Map;constructor(t={}){this.defaults=t}resolveUrl(t){return/^https?:\/\//.test(t)||!this.defaults.baseUrl?t:`${this.defaults.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}fetchOptions(t){const e=this.resolveUrl(t);let i=this.cache.get(e);return i||(i=(this.defaults.fetch??globalThis.fetch.bind(globalThis))(e,{headers:this.defaults.headers,credentials:this.defaults.credentials}).then((async e=>{if(!e.ok)throw new Error(`Failed to load options "${t}" (${e.status})`);return await e.json()})),i.catch((()=>this.cache.delete(e))),this.cache.set(e,i)),i}}var eo=Symbol.for("formkrafter.core.services"),io=globalThis,ro=io[eo]??={jsRunnerService:new class{validateJs(t,e={ecmaVersion:"latest",allowReturnOutsideFunction:!0}){try{return Yt(t,e),{valid:!0}}catch(t){return{valid:!1,error:t instanceof Error?t:new Error(String(t))}}}eval(t,e={}){return function(t,e={}){const i=Yt(t,{ecmaVersion:"latest",allowReturnOutsideFunction:!0}),r={steps:0,scopes:[new Map(Object.entries({...Qs,...e})),new Map]},n=Ys(r,i);return n instanceof Ks?n.value:void 0}(t,e)}},dataSourceService:new class{defaults;cache=new Map;constructor(t={}){this.defaults=t}fetchOptions(t,e){const i={...this.defaults.headers,...e?.headers},r={};Object.keys(i).length&&(r.headers=i),this.defaults.credentials&&(r.credentials=this.defaults.credentials);const n=`${t}|${JSON.stringify(r)}`;let s=this.cache.get(n);return s||(s=fetch(t,Object.keys(r).length?r:void 0).then((e=>{if(!e.ok)throw new Error(`Data source request failed (${e.status}): ${t}`);return e.json()})).then((e=>{if(!Array.isArray(e))throw new Error(`Data source did not return an array: ${t}`);return e})).catch((t=>{throw this.cache.delete(n),t})),this.cache.set(n,s)),s}},fileUploadService:new class{async upload(t){const e=globalThis.btoa;if(!e)throw new Error("No base64 encoder available");const i=new Uint8Array(await t.arrayBuffer());let r="";for(const t of i)r+=String.fromCharCode(t);return{name:t.name,type:t.type,size:t.size,url:`data:${t.type};base64,${e(r)}`}}},specSourceService:new Xs,optionSourceService:new to};ro.specSourceService??=new Xs,ro.optionSourceService??=new to;var no=(t,e)=>{try{return ro.jsRunnerService.eval(t,{dataMap:e??{}})}catch(t){return t instanceof Error?t:new Error(String(t))}},so=(t,e)=>((t,e)=>((t,e)=>t?.filter((t=>((t,e)=>"jsonLogic"===t.type?null!=t.logic&&!0===n.apply(t.logic,e):"javaScript"===t.type&&!!t.code&&!0===no(t.code,e))(t,e))))(t,e)?.map((t=>t.effects)).flat().filter((t=>null!=t)))(t,e)?.map((t=>{let i;return t.property?("boolean"===t.property.type?i=t.boolean:"logic"===t.property.type&&null!=t.logic?i=n.apply(t.logic,e):"code"===t.property.type&&t.code?i=no(t.code,e):"string"===t.property.type&&(i=t.string),{[t.property.target]:i}):{}})).flat().reduce(((t,e)=>({...t,...e})),{})??{hidden:!1},oo=(t,e)=>{if(Array.isArray(e))return e.map((e=>oo(t,e))).filter(Boolean).join(", ");if(!0===e)return Gs("recap.yes","Yes");if(!1===e)return Gs("recap.no","No");if(e&&"object"==typeof e)return"string"==typeof e.name&&"url"in e?e.name:Object.values(e).filter((t=>"string"==typeof t&&t)).join(" ");const i=String(e??"");if(null!=t.configs?.options){const e=Ds(t.configs.options,"string"==typeof t.configs.labelKey?t.configs.labelKey:"label","string"==typeof t.configs.valueKey?t.configs.valueKey:"value").find((t=>t.value===i));if(e)return e.label}return i},ao=t=>null==t||""===t||Array.isArray(t)&&0===t.length,ho=(t,e)=>String(js(t.configs?.label,e)??t.name??t.configs?.key??""),uo=t=>{const e=[];for(const i of t.children??[]){const t=i.configs?.key;"input"===i.type&&t&&!t.startsWith("_")&&e.push(i)}return e},co=(t,e,i,r,n=!1)=>{if(!t)return[];const s=[];for(const o of t.children??[]){if("recap"===o.id||"action"===o.type)continue;if(!0===so(o.rules,e).hidden)continue;const t=o.configs?.key,a=ho(o,i);if("collection"===o.type){const n=t&&Array.isArray(e?.[t])?e[t]:[];if(!n.length&&!r)continue;const h=uo(o);s.push({kind:"collection",label:a,columns:h.map((t=>ho(t,i))),rows:n.map((t=>h.map((e=>{const i=t?.[e.configs.key];return ao(i)?"—":oo(e,i)}))))});continue}if("panel"===o.type){const t=js(o.configs?.label,i);if(n&&"string"==typeof t&&t.trim()){const n=co(o,e,i,r);n.length&&(s.push({kind:"section",label:t}),s.push(...n));continue}s.push(...co(o,e,i,r,n));continue}if("input"!==o.type||!t||t.startsWith("_"))continue;const h=e?.[t];ao(h)&&!r||s.push({kind:"field",label:a,value:ao(h)?"—":oo(o,h)})}return s},fo=(t,e)=>{const i=e(t),r=t.children?.map((t=>fo(t,e)));if(i===t.configs&&r===t.children)return t;const n={...t};return void 0===i?delete n.configs:n.configs=i,r&&(n.children=r),n};function lo(t){return fo(t,(t=>t.configs?.uid?t.configs:{...t.configs,uid:crypto.randomUUID()}))}function po(t){return fo(t,(t=>{if(!t.configs||!("uid"in t.configs))return t.configs;const{uid:e,...i}=t.configs;return Object.keys(i).length>0?i:void 0}))}var mo=(t,e)=>Array.isArray(t)?t.map((t=>mo(t,e))):(t=>null!=t&&"object"==typeof t&&!Array.isArray(t)&&"string"==typeof t.type&&"string"==typeof t.id)(t)?po(t):e.endsWith("/configs")&&null!=t&&"object"==typeof t?(t=>{const{uid:e,...i}=t;return i})(t):t;function vo(t){return t.map((t=>"value"in t?{...t,value:mo(t.value,t.path)}:t))}function yo(t,e){return t.replace(/\{(\w+)\}/g,((t,i)=>{const r=e?.[i];return null==r?"":String(r)}))}function go(t,e){if("string"!=typeof t||!t.trim())return;const i={};for(const r of t.split("\n")){const t=r.indexOf(":");if(t<=0)continue;const n=r.slice(0,t).trim(),s=yo(r.slice(t+1).trim(),e);n&&(i[n]=s)}return Object.keys(i).length?i:void 0}function $o(t,e,i){if(!i)return t;const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(i)}`}class wo{type;dataType;id;name;configsForm;category;styles;unWrapData;isPrivate;validators;defaultConfigs;constructor(t){this.type=t.type,this.dataType=t.dataType,this.id=t.id,this.name=t.name,this.configsForm=t.configsForm,this.category=t.category,this.styles=t.styles,this.unWrapData=t.unWrapData??!1,this.isPrivate=t.isPrivate??!1,this.validators=t.validators??[],this.defaultConfigs=t.defaultConfigs}getBrickEmptySpec(){return{type:this.type,dataType:this.dataType,id:this.id,name:this.name,...void 0!==this.category?{category:this.category}:{},...void 0!==this.configsForm?{configsForm:this.configsForm}:{},...void 0!==this.styles?{styles:this.styles}:{},...void 0!==this.defaultConfigs?{configs:{...this.defaultConfigs}}:{},validators:this.validators}}}var bo=new Un.Ajv({allErrors:!0});Jn(bo,["email","uri"]),Vn(bo);var _o=new WeakMap,Eo=t=>{if("required"===t.keyword)return t.params.missingProperty;if("errorMessage"===t.keyword){const e=t.params.errors?.[0];return e?Eo(e):void 0}return t.instancePath.split("/").filter(Boolean)[0]},ko=(t,e,i)=>{const r={},n=((t,e)=>{let i=_o.get(t);i||(i=new Map,_o.set(t,i));const r=e??"";let n=i.get(r);if(!n){const s=function(t,e){if(!t)return;const i={},r=[],n={},s=t=>{const i=js(t,e);return"string"==typeof i?i:void 0};for(const o of Ns(t)){const t=o.configs?.key,a=!0===o.configs?.multiple&&"object"===o.dataType?"array":o.dataType;if(!t||!a||"void"===a)continue;const h=o.validations?.find((t=>"required"===t.validator)),u={type:a,nullable:!h},c={type:Cs("type",e)};for(const t of o.validations??[]){const{validator:i,value:r}=t,n=s(t.message)??Cs(i,e,r);"minLength"===i&&null!=r?(u.minLength=Number(r),c.minLength=n):"maxLength"===i&&null!=r?(u.maxLength=Number(r),c.maxLength=n):"min"===i&&null!=r?(u.minimum=Number(r),c.minimum=n):"max"===i&&null!=r?(u.maximum=Number(r),c.maximum=n):"pattern"===i&&"string"==typeof r&&r?(u.pattern=r,c.pattern=n):"minItems"===i&&null!=r?(u.minItems=Number(r),c.minItems=n):"maxItems"===i&&null!=r?(u.maxItems=Number(r),c.maxItems=n):"email"===i?(u.format="email",c.format=n):"url"===i&&(u.format="uri",c.format=n)}u.errorMessage=c,i[t]=u,h&&(r.push(t),n[t]=s(h.message)??Cs("required",e))}return{type:"object",properties:i,required:r,...Object.keys(n).length?{errorMessage:{required:n}}:{},additionalProperties:!1}}(t,e);if(!s)return;try{n=bo.compile(s)}catch{return}i.set(r,n)}return n})(t,i);if(n&&!n(e))for(const t of n.errors??[]){const e=Eo(t);e&&!(e in r)&&t.message&&(r[e]=t.message)}for(const[n,s]of Object.entries(((t,e,i)=>{const r={},n=e??{};for(const e of Ns(t)){const t=e.configs?.key;if(t)for(const s of e.validations??[]){if("custom"!==s.validator||!s.customValidator)continue;const e=no(`const value = dataMap?.[${JSON.stringify(t)}];\n${s.customValidator}`,n);if(!0!==e&&null!=e&&!(t in r))if("string"==typeof e)r[t]=e;else if(e instanceof Error)r[t]=e.message;else{const e=js(s.message,i);r[t]="string"==typeof e?e:Cs("custom",i)}}}return r})(t,e,i)))n in r||(r[n]=s);const s="object"==typeof e&&null!==e?e:void 0;for(const e of((t,e)=>{const i=new Set,r=(t,n)=>{const s=n||!!t.rules?.length&&!0===so(t.rules,e).hidden,o=t.configs?.key;if(s&&o&&i.add(o),"collection"!==t.type)for(const e of t.children??[])r(e,s)};return r(t,!1),i})(t,s))delete r[e];return{valid:0===Object.keys(r).length,errors:r}};function So(t){return t.split(".").slice(1).map((t=>`/children/${t}`)).join("")}function xo(t,e){if(t.configs?.uid===e)return"";for(const[i,r]of(t.children??[]).entries()){const t=xo(r,e);if(void 0!==t)return`/children/${i}${t}`}}function Oo(t,e){let i=t;for(const t of e.split(".").slice(1))i=i?.children?.[Number(t)];return i}var jo=(Ss??xs).applyPatch,Po=(t,e,i)=>({spec:jo(t,e,!0,!1).newDocument,patches:e,inverse:i}),Io=(t,e)=>{const i=Oo(t,e);if(!i)throw new Error(`No brick at path "${e}"`);return i},Co=(t,e)=>{const i=xo(t,e);if(void 0===i)throw new Error(`No brick with uid "${e}"`);let r=t;for(const t of i.split("/children/").slice(1))r=r.children[Number(t)];return{pointer:i,brick:r}},Ao=t=>JSON.parse(JSON.stringify(t));function No(t,e,i,r){const n=Io(t,i),s=So(i),o=Ao(e);if(!n.children){const e=`${s}/children`;return Po(t,[{op:"add",path:e,value:[o]}],[{op:"remove",path:e}])}const a=`${s}/children/${Math.min(r??n.children.length,n.children.length)}`;return Po(t,[{op:"add",path:a,value:o}],[{op:"remove",path:a}])}function To(t,e){if("0"===e)throw new Error("Cannot remove the root brick");const i=Io(t,e),r=So(e);return Po(t,[{op:"remove",path:r}],[{op:"add",path:r,value:i}])}function Mo(t,e,i){if("0"===e||"0"===i)throw new Error("Cannot move the root brick");const r=Io(t,e),n=e.split(".").map(Number),s=i.split(".").map(Number),o=n.length-1,a=n[o],h=s.length>o&&n.slice(0,o).every(((t,e)=>t===s[e])),u=[...s];if(h){if(u[o]===a&&u.length>n.length)throw new Error(`Cannot move a brick into its own subtree ("${e}" → "${i}")`);u[o]>a&&(u[o]-=1)}const c=So(e),f=So(u.join("."));return Po(t,[{op:"remove",path:c},{op:"add",path:f,value:r}],[{op:"remove",path:f},{op:"add",path:c,value:r}])}var Ro=t=>({...t,...t.configs?{configs:{...t.configs,uid:crypto.randomUUID()}}:{},...t.children?{children:t.children.map(Ro)}:{}});function Do(t,e){if("0"===e)throw new Error("Cannot duplicate the root brick");const i=Io(t,e),r=e.split("."),n=Number(r[r.length-1])+1,s=So([...r.slice(0,-1),String(n)].join(".")),o=Ro(Ao(i));return Po(t,[{op:"add",path:s,value:o}],[{op:"remove",path:s}])}var Lo=(t,e,i,r,n)=>{const s=`${e}/${i}`;return void 0===n?Po(t,[{op:"add",path:s,value:r}],[{op:"remove",path:s}]):Po(t,[{op:"replace",path:s,value:r}],[{op:"replace",path:s,value:n}])};function zo(t,e,i){const{pointer:r,brick:n}=Co(t,e),s={...n.configs,...i};return Lo(t,r,"configs",s,n.configs)}function Uo(t,e,i){const{pointer:r,brick:n}=Co(t,e),s={...n.styles,...i};return Lo(t,r,"styles",s,n.styles)}function qo(t,e,i){const{pointer:r,brick:n}=Co(t,e);return Lo(t,r,"validations",i,n.validations)}function Fo(t,e,i){const{pointer:r,brick:n}=Co(t,e);return Lo(t,r,"rules",i,n.rules)}class Vo{past=[];future=[];record(t){this.past.push({patches:t.patches,inverse:t.inverse}),this.future=[]}get canUndo(){return this.past.length>0}get canRedo(){return this.future.length>0}undo(t){const e=this.past.pop();if(e)return this.future.push(e),jo(t,e.inverse,!0,!1).newDocument}redo(t){const e=this.future.pop();if(e)return this.past.push(e),jo(t,e.patches,!0,!1).newDocument}clear(){this.past=[],this.future=[]}}var Bo=t=>"nested-form"===t.id&&"string"==typeof t.configs?.specRef,Go=t=>{if(!t)return!1;for(const{brick:e}of As(t))if(Bo(e)&&e.configs?.specRef)return!0;return!1};async function Ho(t,e={}){const i=e.specSourceService??ro.specSourceService,r=e.maxDepth??5,n=async(t,e)=>{if(Bo(t)&&t.configs?.specRef){const s=String(t.configs.specRef);if(e.includes(s))throw new Error(`Circular nested form reference: ${[...e,s].join(" → ")}`);if(e.length>=r)throw new Error(`Nested forms exceed the maximum depth of ${r} (${s})`);const o=await i.fetchSpec(s),a=await n(structuredClone(o),[...e,s]);return{type:"panel",id:"group",name:t.name,configs:{...t.configs,label:t.configs.label??a.name},styles:t.styles,rules:t.rules,children:a.children??[]}}return t.children?.length?{...t,children:await Promise.all(t.children.map((t=>n(t,e))))}:t};return n(structuredClone(t),[])}export{qo as A,Fo as B,vo as C,po as D,wo as E,co as F,js as G,Vs as H,zs as I,Vo as S,Ts as a,Bs as b,Os as c,yo as d,Ho as e,Gs as f,so as g,Go as h,As as i,$o as j,no as k,Ns as l,lo as m,Ds as n,No as o,go as p,Oo as q,Ps as r,ro as s,Mo as t,To as u,ko as v,Ms as w,Do as x,zo as y,Uo as z}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as
|
|
1
|
+
import{t,p as s,H as i,c as e,h as r}from"./p-BB4Llg42.js";import{g as a,r as o,a as n,w as l}from"./p-DBDKSYBE.js";import{g as c}from"./p-BMtyMU2R.js";import{d as h}from"./p-jQ1X1HyU.js";import{d}from"./p-NDbmiiYk.js";import{d as u}from"./p-BZtRpjkI.js";const k=s(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.brickDataChange=e(this,"brickDataChange"),this.brickConfigsChange=e(this,"brickConfigsChange"),this.brickStylesChange=e(this,"brickStylesChange"),this.brickValidationsChange=e(this,"brickValidationsChange"),this.brickRulesChange=e(this,"brickRulesChange"),this.brickRemove=e(this,"brickRemove"),this.brickDuplicate=e(this,"brickDuplicate"),this.path="0",this.editable=!1,this.errors={}}render(){var t,s,i,e,h,d;const u=this.brickSpec;if(!u)return null;const k=c(u.type,u.id);if(!k)return r("fk-brick-not-found",null,`${u.type}:${u.id}`);const p=this.editable&&(null===(t=u.editable)||void 0===t||t),f=a(u.rules,this.dataMap);if(!p&&!0===f.hidden)return null;const b="panel"===u.type||"collection"===u.type,m=null===(s=u.configs)||void 0===s?void 0:s.uid,g=(null!==(i=u.children)&&void 0!==i?i:[]).map(((t,s)=>{var i;return r("fk-brick-render",{brickSpec:t,rootSpec:null!==(i=this.rootSpec)&&void 0!==i?i:this.brickSpec,data:this.data,dataMap:this.dataMap,errors:this.errors,locale:this.locale,path:`${this.path}.${s}`,editable:this.editable,selectedUid:this.selectedUid,utils:this.utils})}));p&&b&&g.push(r("fk-drop-area",{path:this.path}));const v={brickSpec:u,configsForm:u.configsForm,configs:o(u.configs,this.locale),locale:this.locale,styles:null!==(e=u.styles)&&void 0!==e?e:{},data:n(u,this.data),dataMap:this.dataMap,rootSpec:null!==(h=this.rootSpec)&&void 0!==h?h:this.brickSpec,error:(null===(d=u.configs)||void 0===d?void 0:d.key)?this.errors[u.configs.key]:void 0,disabled:!p&&!0===f.disabled,path:this.path,editable:p,children:g,validations:u.validations,rules:u.rules,utils:this.utils,onDataChange:t=>{const s=l(u,t);void 0!==s&&this.brickDataChange.emit(s)},onConfigsChange:(t,s)=>this.brickConfigsChange.emit({configs:t,uid:null!=s?s:m}),onStylesChange:(t,s)=>this.brickStylesChange.emit({styles:t,uid:null!=s?s:m}),onValidationsChange:(t,s)=>this.brickValidationsChange.emit({validations:t,uid:null!=s?s:m}),onRulesChange:(t,s)=>this.brickRulesChange.emit({rules:t,uid:null!=s?s:m}),onDelete:t=>this.brickRemove.emit({path:t}),onDuplicate:t=>this.brickDuplicate.emit({path:t})},C=p?k.renderBuilder(v):k.render(v);return p&&"0"!==this.path?r("fk-brick-actions",{path:this.path,selected:void 0!==m&&m===this.selectedUid},C):C}},[0,"fk-brick-render",{brickSpec:[16],rootSpec:[16],data:[16],dataMap:[16],path:[1],editable:[4],selectedUid:[1,"selected-uid"],errors:[16],locale:[1],utils:[16]}]);function p(){"undefined"!=typeof customElements&&["fk-brick-render","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-drop-area"].forEach((s=>{switch(s){case"fk-brick-render":customElements.get(t(s))||customElements.define(t(s),k);break;case"fk-brick-actions":customElements.get(t(s))||h();break;case"fk-brick-not-found":customElements.get(t(s))||d();break;case"fk-brick-render":customElements.get(t(s))||p();break;case"fk-drop-area":customElements.get(t(s))||u()}}))}p();export{k as F,p as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as s,c as o,h as r}from"./p-BB4Llg42.js";import{b as a,c as l,f as i}from"./p-DjU-98-4.js";import{d as p}from"./p-8ZeGXEsz.js";import{d as n}from"./p-BPP0y52t.js";const c=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.brickConfigsChange=o(this,"brickConfigsChange"),this.brickValidationsChange=o(this,"brickValidationsChange"),this.brickStylesChange=o(this,"brickStylesChange"),this.fields=[],this.locales=[],this.activeTab="config",this.newStyleKey=""}onBrickChange(){this.availableTabs().some((e=>e.id===this.activeTab))||(this.activeTab="config")}availableTabs(){const e=[{id:"config",label:a("panel.tab.config")}];return"input"===this.brick.type&&e.push({id:"validation",label:a("panel.tab.validation")}),e.push({id:"styles",label:a("panel.tab.styles")},{id:"rules",label:a("panel.tab.rules")}),e}localized(e,t){var s;if(this.locales.length<=1)return t||void 0;const o=l(e)?Object.assign({},e):{};return"string"==typeof e&&e&&!l(e)&&(o[this.locales[0]]=e),o[null!==(s=this.editLocale)&&void 0!==s?s:this.locales[0]]=t,o}readLocalized(e){var t,s,o;return l(e)?null!==(s=e[null!==(t=this.editLocale)&&void 0!==t?t:this.locales[0]])&&void 0!==s?s:"":null!==(o=e)&&void 0!==o?o:""}writeTextConfig(e,t){var s;this.emitConfigs({[e]:this.localized(null===(s=this.brick.configs)||void 0===s?void 0:s[e],t)})}emitConfigs(e){var t;const s=null===(t=this.brick.configs)||void 0===t?void 0:t.uid;s&&this.brickConfigsChange.emit({configs:e,uid:s})}emitValidations(e){var t;const s=null===(t=this.brick.configs)||void 0===t?void 0:t.uid;s&&this.brickValidationsChange.emit({validations:e,uid:s})}emitStyles(e){var t;const s=null===(t=this.brick.configs)||void 0===t?void 0:t.uid;s&&this.brickStylesChange.emit({styles:e,uid:s})}validationOf(e){var t;return null===(t=this.brick.validations)||void 0===t?void 0:t.find((t=>t.validator===e))}setValidation(e,t,s={}){var o;const r=this.validationOf(e),a=(null!==(o=this.brick.validations)&&void 0!==o?o:[]).filter((t=>t.validator!==e));this.emitValidations(t?[...a,Object.assign(Object.assign(Object.assign({},r),{validator:e}),s)]:a)}addStyle(e){const t=this.newStyleKey.trim();t&&(this.emitStyles({[t]:e}),this.newStyleKey="")}textField(e,t,s){var o;return r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},e),r("input",{class:"fk-props__input",type:"text",value:null!==(o=t)&&void 0!==o?o:"",onChange:e=>s(e.target.value)}))}optionsFields(){var e,t,s;const o=this.brick.configs;if(!o||!("options"in o)&&!("optionsSource"in o))return[];const l="optionsSource"in o,i=l&&null!==(e=o.optionsSource)&&void 0!==e?e:"static",p=l?[r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.optionsSource")),r("select",{class:"fk-props__input",onChange:e=>this.emitConfigs({optionsSource:e.target.value})},["static","dataMap","remote","js","catalog"].map((e=>r("option",{value:e,selected:e===i},e)))))]:[];return"static"===i&&p.push(r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.options")),r("textarea",{class:"fk-props__input fk-props__input--textarea",onChange:e=>this.writeTextConfig("options",e.target.value)},this.readLocalized(o.options)))),"dataMap"===i&&p.push(this.textField(a("panel.dataKey"),o.optionsPath,(e=>this.emitConfigs({optionsPath:e})))),"remote"===i&&p.push(this.textField(a("panel.url"),o.optionsUrl,(e=>this.emitConfigs({optionsUrl:e}))),r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.headers")),r("textarea",{class:"fk-props__input fk-props__input--textarea",placeholder:"Authorization: Bearer {token}",onChange:e=>this.emitConfigs({optionsHeaders:e.target.value||void 0})},null!==(t=o.optionsHeaders)&&void 0!==t?t:"")),this.textField(a("panel.searchParam"),o.searchParam,(e=>this.emitConfigs({searchParam:e||void 0})))),"js"===i&&p.push(r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},"Code"),r("fk-code-editor",{completions:this.fields,value:null!==(s=o.optionsCode)&&void 0!==s?s:"",placeholder:"return dataMap.country === 'BJ' ? ['Cotonou'] : ['Paris'];",onCodeChange:e=>this.emitConfigs({optionsCode:e.detail})}))),"catalog"===i&&p.push(this.textField(a("panel.optionsRef"),o.optionsRef,(e=>this.emitConfigs({optionsRef:e})))),"remote"!==i&&"js"!==i&&"catalog"!==i||p.push(this.textField(a("panel.labelKey"),o.labelKey,(e=>this.emitConfigs({labelKey:e}))),this.textField(a("panel.valueKey"),o.valueKey,(e=>this.emitConfigs({valueKey:e})))),p}renderConfigTab(){const e=this.brick.configs,t="input"===this.brick.type;return r("section",{class:"fk-props__section"},this.textField(a("panel.key"),null==e?void 0:e.key,(e=>this.emitConfigs({key:e}))),this.textField(a("panel.label"),this.readLocalized(null==e?void 0:e.label),(e=>this.writeTextConfig("label",e))),t?[this.textField(a("panel.placeholder"),this.readLocalized(null==e?void 0:e.placeholder),(e=>this.writeTextConfig("placeholder",e))),this.textField(a("panel.prefix"),null==e?void 0:e.prefix,(e=>this.emitConfigs({prefix:e||void 0}))),this.textField(a("panel.suffix"),null==e?void 0:e.suffix,(e=>this.emitConfigs({suffix:e||void 0})))]:null,e&&"specRef"in e?this.textField(i("panel.specRef","Referenced form (specRef)"),e.specRef,(e=>this.emitConfigs({specRef:e}))):null,e&&"mask"in e?this.textField(i("panel.mask","Input mask (9=digit, a=letter, *=any)"),e.mask,(e=>this.emitConfigs({mask:e}))):null,e&&"accept"in e?this.textField(i("panel.accept","Accepted file types"),e.accept,(e=>this.emitConfigs({accept:e}))):null,e&&"uploadUrl"in e?this.textField(i("panel.uploadUrl","Upload URL"),e.uploadUrl,(e=>this.emitConfigs({uploadUrl:e}))):null,this.optionsFields(),Object.entries(null!=e?e:{}).filter((([,e])=>"boolean"==typeof e)).map((([e,t])=>r("label",{class:"fk-props__field fk-props__field--inline",key:e},r("input",{type:"checkbox",checked:!0===t,onChange:t=>this.emitConfigs({[e]:t.target.checked})}),r("span",{class:"fk-props__label"},i(`panel.cfg.${e}`,e))))),e&&"content"in e?r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.content")),r("textarea",{class:"fk-props__input fk-props__input--textarea",onChange:e=>this.writeTextConfig("content",e.target.value)},this.readLocalized(e.content))):null)}validationRow(e,t,s){const o=this.validationOf(e);return r("div",{class:"fk-props__vrule"},r("label",{class:"fk-props__field fk-props__field--inline"},r("input",{type:"checkbox",checked:!!o,onChange:t=>this.setValidation(e,t.target.checked)}),r("span",{class:"fk-props__label"},t)),o&&s?r("input",{class:"fk-props__input",type:s,placeholder:"number"===s?"value":"regex",value:null==o.value?"":String(o.value),onChange:t=>{const o=t.target.value;this.setValidation(e,!0,{value:"number"===s?""===o?void 0:Number(o):o||void 0})}}):null,o?this.textField(a("panel.errorMessage"),this.readLocalized(o.message),(t=>this.setValidation(e,!0,{message:this.localized(o.message,t)}))):null)}renderValidationTab(){var e;const t=this.brick.dataType,s=this.validationOf("custom");return r("section",{class:"fk-props__section"},this.validationRow("required",a("panel.required")),"string"===t?[this.validationRow("minLength",a("panel.minLength"),"number"),this.validationRow("maxLength",a("panel.maxLength"),"number"),this.validationRow("pattern",a("panel.pattern"),"text"),this.validationRow("email",a("panel.emailFormat")),this.validationRow("url",a("panel.urlFormat"))]:null,"number"===t?[this.validationRow("min",a("panel.min"),"number"),this.validationRow("max",a("panel.max"),"number")]:null,"array"===t?[this.validationRow("minItems",a("panel.minItems"),"number"),this.validationRow("maxItems",a("panel.maxItems"),"number")]:null,r("div",{class:"fk-props__vrule"},r("label",{class:"fk-props__field fk-props__field--inline"},r("input",{type:"checkbox",checked:!!s,onChange:e=>{var t;return this.setValidation("custom",e.target.checked,{customValidator:null!==(t=null==s?void 0:s.customValidator)&&void 0!==t?t:"return true;"})}}),r("span",{class:"fk-props__label"},a("panel.custom"))),s?r("fk-code-editor",{completions:this.fields,value:null!==(e=s.customValidator)&&void 0!==e?e:"",placeholder:'return value?.startsWith("BJ-") ? true : "Must start with BJ-";',onCodeChange:e=>this.setValidation("custom",!0,{customValidator:e.detail})}):null,s?this.textField(a("panel.fallbackMessage"),this.readLocalized(s.message),(e=>this.setValidation("custom",!0,{message:this.localized(s.message,e)}))):null))}renderStylesTab(){var e;return r("section",{class:"fk-props__section"},Object.entries(null!==(e=this.brick.styles)&&void 0!==e?e:{}).map((([e,t])=>r("div",{class:"fk-props__style-row",key:e},r("span",{class:"fk-props__style-key"},e),r("input",{class:"fk-props__input fk-props__input--grow",type:"text",value:String(null!=t?t:""),onChange:t=>this.emitStyles({[e]:t.target.value})}),r("button",{type:"button",class:"fk-props__remove",title:"Remove style",onClick:()=>this.emitStyles({[e]:void 0})},"✕")))),r("div",{class:"fk-props__style-row"},r("input",{class:"fk-props__input",type:"text",placeholder:a("panel.styleProperty"),value:this.newStyleKey,onInput:e=>this.newStyleKey=e.target.value}),r("input",{class:"fk-props__input fk-props__input--grow",type:"text",placeholder:a("panel.styleValue"),onChange:e=>{const t=e.target;this.addStyle(t.value),t.value=""}})))}render(){return r("div",{key:"63f3cd86b0898ce6108378c8510395a6611b5f07",class:"fk-props"},r("header",{key:"ad82d731d10955063e51ad695f0de7d44c7d5fc1",class:"fk-props__header"},r("span",{key:"9e502e5224f8dedf05d8075f995e7778bf18227d",class:"fk-props__type"},this.brick.type),r("h4",{key:"b373bac9ceebab82730d186d665954ac087972fe",class:"fk-props__title"},i(`brick.${this.brick.id}.name`,this.brick.name))),r("div",{key:"81d3770256d746e85270676c1dad68aeebc2389b",class:"fk-props__tabs"},this.availableTabs().map((e=>r("button",{key:e.id,type:"button",class:{"fk-props__tab":!0,"fk-props__tab--active":this.activeTab===e.id},onClick:()=>this.activeTab=e.id},e.label)))),"config"===this.activeTab?this.renderConfigTab():null,"validation"===this.activeTab?this.renderValidationTab():null,"styles"===this.activeTab?this.renderStylesTab():null,"rules"===this.activeTab?r("section",{class:"fk-props__section"},r("fk-rules-editor",{brick:this.brick,fields:this.fields})):null)}static get watchers(){return{brick:[{onBrickChange:0}]}}static get style(){return".sc-fk-property-panel-h{display:block}.fk-props.sc-fk-property-panel{display:flex;flex-direction:column;gap:calc(var(--fk-spacing) * 1.5)}.fk-props__header.sc-fk-property-panel{display:flex;flex-direction:column;gap:2px}.fk-props__type.sc-fk-property-panel{font-size:0.65rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--fk-color-primary)}.fk-props__title.sc-fk-property-panel{margin:0;font-size:0.95rem;color:var(--fk-color-text)}.fk-props__section.sc-fk-property-panel{display:flex;flex-direction:column;gap:var(--fk-spacing);padding-top:var(--fk-spacing)}.fk-props__tabs.sc-fk-property-panel{display:flex;gap:2px;border-bottom:1px solid var(--fk-color-border)}.fk-props__tab.sc-fk-property-panel{font:inherit;font-size:0.72rem;font-weight:600;padding:5px 9px;border:none;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--fk-color-muted);text-transform:none;letter-spacing:normal;cursor:pointer}.fk-props__tab.sc-fk-property-panel:hover{color:var(--fk-color-text)}.fk-props__tab--active.sc-fk-property-panel{color:var(--fk-color-primary);border-bottom-color:var(--fk-color-primary)}.fk-props__section-title.sc-fk-property-panel{margin:0;font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--fk-color-muted)}.fk-props__field.sc-fk-property-panel{display:flex;flex-direction:column;gap:4px;font-style:normal;text-decoration:none}.fk-props__field--inline.sc-fk-property-panel{flex-direction:row;align-items:center;gap:8px}.fk-props__label.sc-fk-property-panel{font-size:0.75rem;font-weight:600;color:var(--fk-color-muted);font-style:normal;text-decoration:none}.fk-props__input.sc-fk-property-panel{font:inherit;font-size:0.85rem;padding:6px 8px;border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 2);background:var(--fk-color-surface);color:var(--fk-color-text)}.fk-props__input.sc-fk-property-panel:focus{outline:none;border-color:var(--fk-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--fk-color-primary) 20%, transparent)}.fk-props__input--textarea.sc-fk-property-panel{min-height:72px;resize:vertical}.fk-props__vrule.sc-fk-property-panel{display:flex;flex-direction:column;gap:6px;padding:calc(var(--fk-spacing) / 1.5);border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 1.5)}.fk-props__style-row.sc-fk-property-panel{display:flex;align-items:center;gap:6px}.fk-props__style-key.sc-fk-property-panel{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:0.75rem;color:var(--fk-color-text);min-width:72px}.fk-props__input--grow.sc-fk-property-panel{flex:1;min-width:0}.fk-props__remove.sc-fk-property-panel{border:none;background:transparent;color:var(--fk-color-muted);font-size:0.75rem;cursor:pointer;padding:2px 4px;border-radius:calc(var(--fk-radius) / 2)}.fk-props__remove.sc-fk-property-panel:hover{color:var(--fk-color-danger);background:color-mix(in srgb, var(--fk-color-danger) 10%, transparent)}"}},[2,"fk-property-panel",{brick:[16],fields:[16],locales:[16],locale:[1],editLocale:[1,"edit-locale"],activeTab:[32],newStyleKey:[32]},void 0,{brick:[{onBrickChange:0}]}]);function f(){"undefined"!=typeof customElements&&["fk-property-panel","fk-code-editor","fk-rules-editor"].forEach((t=>{switch(t){case"fk-property-panel":customElements.get(e(t))||customElements.define(e(t),c);break;case"fk-code-editor":customElements.get(e(t))||p();break;case"fk-rules-editor":customElements.get(e(t))||n()}}))}f();export{c as F,f as d}
|
|
1
|
+
import{t as e,p as t,H as s,c as o,h as r}from"./p-BB4Llg42.js";import{b as a,c as l,f as i}from"./p-DBDKSYBE.js";import{d as p}from"./p-8ZeGXEsz.js";import{d as n}from"./p-1uIWCEFX.js";const c=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.brickConfigsChange=o(this,"brickConfigsChange"),this.brickValidationsChange=o(this,"brickValidationsChange"),this.brickStylesChange=o(this,"brickStylesChange"),this.fields=[],this.locales=[],this.activeTab="config",this.newStyleKey=""}onBrickChange(){this.availableTabs().some((e=>e.id===this.activeTab))||(this.activeTab="config")}availableTabs(){const e=[{id:"config",label:a("panel.tab.config")}];return"input"===this.brick.type&&e.push({id:"validation",label:a("panel.tab.validation")}),e.push({id:"styles",label:a("panel.tab.styles")},{id:"rules",label:a("panel.tab.rules")}),e}localized(e,t){var s;if(this.locales.length<=1)return t||void 0;const o=l(e)?Object.assign({},e):{};return"string"==typeof e&&e&&!l(e)&&(o[this.locales[0]]=e),o[null!==(s=this.editLocale)&&void 0!==s?s:this.locales[0]]=t,o}readLocalized(e){var t,s,o;return l(e)?null!==(s=e[null!==(t=this.editLocale)&&void 0!==t?t:this.locales[0]])&&void 0!==s?s:"":null!==(o=e)&&void 0!==o?o:""}writeTextConfig(e,t){var s;this.emitConfigs({[e]:this.localized(null===(s=this.brick.configs)||void 0===s?void 0:s[e],t)})}emitConfigs(e){var t;const s=null===(t=this.brick.configs)||void 0===t?void 0:t.uid;s&&this.brickConfigsChange.emit({configs:e,uid:s})}emitValidations(e){var t;const s=null===(t=this.brick.configs)||void 0===t?void 0:t.uid;s&&this.brickValidationsChange.emit({validations:e,uid:s})}emitStyles(e){var t;const s=null===(t=this.brick.configs)||void 0===t?void 0:t.uid;s&&this.brickStylesChange.emit({styles:e,uid:s})}validationOf(e){var t;return null===(t=this.brick.validations)||void 0===t?void 0:t.find((t=>t.validator===e))}setValidation(e,t,s={}){var o;const r=this.validationOf(e),a=(null!==(o=this.brick.validations)&&void 0!==o?o:[]).filter((t=>t.validator!==e));this.emitValidations(t?[...a,Object.assign(Object.assign(Object.assign({},r),{validator:e}),s)]:a)}addStyle(e){const t=this.newStyleKey.trim();t&&(this.emitStyles({[t]:e}),this.newStyleKey="")}textField(e,t,s){var o;return r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},e),r("input",{class:"fk-props__input",type:"text",value:null!==(o=t)&&void 0!==o?o:"",onChange:e=>s(e.target.value)}))}optionsFields(){var e,t,s;const o=this.brick.configs;if(!o||!("options"in o)&&!("optionsSource"in o))return[];const l="optionsSource"in o,i=l&&null!==(e=o.optionsSource)&&void 0!==e?e:"static",p=l?[r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.optionsSource")),r("select",{class:"fk-props__input",onChange:e=>this.emitConfigs({optionsSource:e.target.value})},["static","dataMap","remote","js","catalog"].map((e=>r("option",{value:e,selected:e===i},e)))))]:[];return"static"===i&&p.push(r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.options")),r("textarea",{class:"fk-props__input fk-props__input--textarea",onChange:e=>this.writeTextConfig("options",e.target.value)},this.readLocalized(o.options)))),"dataMap"===i&&p.push(this.textField(a("panel.dataKey"),o.optionsPath,(e=>this.emitConfigs({optionsPath:e})))),"remote"===i&&p.push(this.textField(a("panel.url"),o.optionsUrl,(e=>this.emitConfigs({optionsUrl:e}))),r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.headers")),r("textarea",{class:"fk-props__input fk-props__input--textarea",placeholder:"Authorization: Bearer {token}",onChange:e=>this.emitConfigs({optionsHeaders:e.target.value||void 0})},null!==(t=o.optionsHeaders)&&void 0!==t?t:"")),this.textField(a("panel.searchParam"),o.searchParam,(e=>this.emitConfigs({searchParam:e||void 0})))),"js"===i&&p.push(r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},"Code"),r("fk-code-editor",{completions:this.fields,value:null!==(s=o.optionsCode)&&void 0!==s?s:"",placeholder:"return dataMap.country === 'BJ' ? ['Cotonou'] : ['Paris'];",onCodeChange:e=>this.emitConfigs({optionsCode:e.detail})}))),"catalog"===i&&p.push(this.textField(a("panel.optionsRef"),o.optionsRef,(e=>this.emitConfigs({optionsRef:e})))),"remote"!==i&&"js"!==i&&"catalog"!==i||p.push(this.textField(a("panel.labelKey"),o.labelKey,(e=>this.emitConfigs({labelKey:e}))),this.textField(a("panel.valueKey"),o.valueKey,(e=>this.emitConfigs({valueKey:e})))),p}renderConfigTab(){const e=this.brick.configs,t="input"===this.brick.type;return r("section",{class:"fk-props__section"},this.textField(a("panel.key"),null==e?void 0:e.key,(e=>this.emitConfigs({key:e}))),this.textField(a("panel.label"),this.readLocalized(null==e?void 0:e.label),(e=>this.writeTextConfig("label",e))),t?[this.textField(a("panel.placeholder"),this.readLocalized(null==e?void 0:e.placeholder),(e=>this.writeTextConfig("placeholder",e))),this.textField(a("panel.prefix"),null==e?void 0:e.prefix,(e=>this.emitConfigs({prefix:e||void 0}))),this.textField(a("panel.suffix"),null==e?void 0:e.suffix,(e=>this.emitConfigs({suffix:e||void 0})))]:null,e&&"specRef"in e?this.textField(i("panel.specRef","Referenced form (specRef)"),e.specRef,(e=>this.emitConfigs({specRef:e}))):null,e&&"mask"in e?this.textField(i("panel.mask","Input mask (9=digit, a=letter, *=any)"),e.mask,(e=>this.emitConfigs({mask:e}))):null,e&&"accept"in e?this.textField(i("panel.accept","Accepted file types"),e.accept,(e=>this.emitConfigs({accept:e}))):null,e&&"uploadUrl"in e?this.textField(i("panel.uploadUrl","Upload URL"),e.uploadUrl,(e=>this.emitConfigs({uploadUrl:e}))):null,this.optionsFields(),Object.entries(null!=e?e:{}).filter((([,e])=>"boolean"==typeof e)).map((([e,t])=>r("label",{class:"fk-props__field fk-props__field--inline",key:e},r("input",{type:"checkbox",checked:!0===t,onChange:t=>this.emitConfigs({[e]:t.target.checked})}),r("span",{class:"fk-props__label"},i(`panel.cfg.${e}`,e))))),e&&"content"in e?r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.content")),r("textarea",{class:"fk-props__input fk-props__input--textarea",onChange:e=>this.writeTextConfig("content",e.target.value)},this.readLocalized(e.content))):null)}validationRow(e,t,s){const o=this.validationOf(e);return r("div",{class:"fk-props__vrule"},r("label",{class:"fk-props__field fk-props__field--inline"},r("input",{type:"checkbox",checked:!!o,onChange:t=>this.setValidation(e,t.target.checked)}),r("span",{class:"fk-props__label"},t)),o&&s?r("input",{class:"fk-props__input",type:s,placeholder:"number"===s?"value":"regex",value:null==o.value?"":String(o.value),onChange:t=>{const o=t.target.value;this.setValidation(e,!0,{value:"number"===s?""===o?void 0:Number(o):o||void 0})}}):null,o?this.textField(a("panel.errorMessage"),this.readLocalized(o.message),(t=>this.setValidation(e,!0,{message:this.localized(o.message,t)}))):null)}renderValidationTab(){var e;const t=this.brick.dataType,s=this.validationOf("custom");return r("section",{class:"fk-props__section"},this.validationRow("required",a("panel.required")),"string"===t?[this.validationRow("minLength",a("panel.minLength"),"number"),this.validationRow("maxLength",a("panel.maxLength"),"number"),this.validationRow("pattern",a("panel.pattern"),"text"),this.validationRow("email",a("panel.emailFormat")),this.validationRow("url",a("panel.urlFormat"))]:null,"number"===t?[this.validationRow("min",a("panel.min"),"number"),this.validationRow("max",a("panel.max"),"number")]:null,"array"===t?[this.validationRow("minItems",a("panel.minItems"),"number"),this.validationRow("maxItems",a("panel.maxItems"),"number")]:null,r("div",{class:"fk-props__vrule"},r("label",{class:"fk-props__field fk-props__field--inline"},r("input",{type:"checkbox",checked:!!s,onChange:e=>{var t;return this.setValidation("custom",e.target.checked,{customValidator:null!==(t=null==s?void 0:s.customValidator)&&void 0!==t?t:"return true;"})}}),r("span",{class:"fk-props__label"},a("panel.custom"))),s?r("fk-code-editor",{completions:this.fields,value:null!==(e=s.customValidator)&&void 0!==e?e:"",placeholder:'return value?.startsWith("BJ-") ? true : "Must start with BJ-";',onCodeChange:e=>this.setValidation("custom",!0,{customValidator:e.detail})}):null,s?this.textField(a("panel.fallbackMessage"),this.readLocalized(s.message),(e=>this.setValidation("custom",!0,{message:this.localized(s.message,e)}))):null))}renderStylesTab(){var e;return r("section",{class:"fk-props__section"},Object.entries(null!==(e=this.brick.styles)&&void 0!==e?e:{}).map((([e,t])=>r("div",{class:"fk-props__style-row",key:e},r("span",{class:"fk-props__style-key"},e),r("input",{class:"fk-props__input fk-props__input--grow",type:"text",value:String(null!=t?t:""),onChange:t=>this.emitStyles({[e]:t.target.value})}),r("button",{type:"button",class:"fk-props__remove",title:"Remove style",onClick:()=>this.emitStyles({[e]:void 0})},"✕")))),r("div",{class:"fk-props__style-row"},r("input",{class:"fk-props__input",type:"text",placeholder:a("panel.styleProperty"),value:this.newStyleKey,onInput:e=>this.newStyleKey=e.target.value}),r("input",{class:"fk-props__input fk-props__input--grow",type:"text",placeholder:a("panel.styleValue"),onChange:e=>{const t=e.target;this.addStyle(t.value),t.value=""}})))}render(){return r("div",{key:"63f3cd86b0898ce6108378c8510395a6611b5f07",class:"fk-props"},r("header",{key:"ad82d731d10955063e51ad695f0de7d44c7d5fc1",class:"fk-props__header"},r("span",{key:"9e502e5224f8dedf05d8075f995e7778bf18227d",class:"fk-props__type"},this.brick.type),r("h4",{key:"b373bac9ceebab82730d186d665954ac087972fe",class:"fk-props__title"},i(`brick.${this.brick.id}.name`,this.brick.name))),r("div",{key:"81d3770256d746e85270676c1dad68aeebc2389b",class:"fk-props__tabs"},this.availableTabs().map((e=>r("button",{key:e.id,type:"button",class:{"fk-props__tab":!0,"fk-props__tab--active":this.activeTab===e.id},onClick:()=>this.activeTab=e.id},e.label)))),"config"===this.activeTab?this.renderConfigTab():null,"validation"===this.activeTab?this.renderValidationTab():null,"styles"===this.activeTab?this.renderStylesTab():null,"rules"===this.activeTab?r("section",{class:"fk-props__section"},r("fk-rules-editor",{brick:this.brick,fields:this.fields})):null)}static get watchers(){return{brick:[{onBrickChange:0}]}}static get style(){return".sc-fk-property-panel-h{display:block}.fk-props.sc-fk-property-panel{display:flex;flex-direction:column;gap:calc(var(--fk-spacing) * 1.5)}.fk-props__header.sc-fk-property-panel{display:flex;flex-direction:column;gap:2px}.fk-props__type.sc-fk-property-panel{font-size:0.65rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--fk-color-primary)}.fk-props__title.sc-fk-property-panel{margin:0;font-size:0.95rem;color:var(--fk-color-text)}.fk-props__section.sc-fk-property-panel{display:flex;flex-direction:column;gap:var(--fk-spacing);padding-top:var(--fk-spacing)}.fk-props__tabs.sc-fk-property-panel{display:flex;gap:2px;border-bottom:1px solid var(--fk-color-border)}.fk-props__tab.sc-fk-property-panel{font:inherit;font-size:0.72rem;font-weight:600;padding:5px 9px;border:none;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--fk-color-muted);text-transform:none;letter-spacing:normal;cursor:pointer}.fk-props__tab.sc-fk-property-panel:hover{color:var(--fk-color-text)}.fk-props__tab--active.sc-fk-property-panel{color:var(--fk-color-primary);border-bottom-color:var(--fk-color-primary)}.fk-props__section-title.sc-fk-property-panel{margin:0;font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--fk-color-muted)}.fk-props__field.sc-fk-property-panel{display:flex;flex-direction:column;gap:4px;font-style:normal;text-decoration:none}.fk-props__field--inline.sc-fk-property-panel{flex-direction:row;align-items:center;gap:8px}.fk-props__label.sc-fk-property-panel{font-size:0.75rem;font-weight:600;color:var(--fk-color-muted);font-style:normal;text-decoration:none}.fk-props__input.sc-fk-property-panel{font:inherit;font-size:0.85rem;padding:6px 8px;border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 2);background:var(--fk-color-surface);color:var(--fk-color-text)}.fk-props__input.sc-fk-property-panel:focus{outline:none;border-color:var(--fk-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--fk-color-primary) 20%, transparent)}.fk-props__input--textarea.sc-fk-property-panel{min-height:72px;resize:vertical}.fk-props__vrule.sc-fk-property-panel{display:flex;flex-direction:column;gap:6px;padding:calc(var(--fk-spacing) / 1.5);border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 1.5)}.fk-props__style-row.sc-fk-property-panel{display:flex;align-items:center;gap:6px}.fk-props__style-key.sc-fk-property-panel{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:0.75rem;color:var(--fk-color-text);min-width:72px}.fk-props__input--grow.sc-fk-property-panel{flex:1;min-width:0}.fk-props__remove.sc-fk-property-panel{border:none;background:transparent;color:var(--fk-color-muted);font-size:0.75rem;cursor:pointer;padding:2px 4px;border-radius:calc(var(--fk-radius) / 2)}.fk-props__remove.sc-fk-property-panel:hover{color:var(--fk-color-danger);background:color-mix(in srgb, var(--fk-color-danger) 10%, transparent)}"}},[2,"fk-property-panel",{brick:[16],fields:[16],locales:[16],locale:[1],editLocale:[1,"edit-locale"],activeTab:[32],newStyleKey:[32]},void 0,{brick:[{onBrickChange:0}]}]);function f(){"undefined"!=typeof customElements&&["fk-property-panel","fk-code-editor","fk-rules-editor"].forEach((t=>{switch(t){case"fk-property-panel":customElements.get(e(t))||customElements.define(e(t),c);break;case"fk-code-editor":customElements.get(e(t))||p();break;case"fk-rules-editor":customElements.get(e(t))||n()}}))}f();export{c as F,f as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as s,H as e,c as i,h as r}from"./p-BB4Llg42.js";import{h as a,e as o,i as n,g as c,v as h,b as d}from"./p-
|
|
1
|
+
import{t,p as s,H as e,c as i,h as r}from"./p-BB4Llg42.js";import{h as a,e as o,i as n,g as c,v as h,b as d}from"./p-DBDKSYBE.js";import{registerDefaultBricks as f}from"./index.js";import{d as l}from"./p-jQ1X1HyU.js";import{d as p}from"./p-NDbmiiYk.js";import{d as m}from"./p-DR_hFYe6.js";import{d as u}from"./p-8ZeGXEsz.js";import{d as k}from"./p-Cw0gv37q.js";import{d as b}from"./p-BZtRpjkI.js";import{d as j}from"./p-CG5_blV_.js";import{d as v}from"./p-Dz-U6j8q.js";import{d as g}from"./p-C2BQJ4lG.js";import{d as E}from"./p-H9MXQEyO.js";import{d as S}from"./p-BCKF50Wl.js";const O=s(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.formDataChange=i(this,"formDataChange"),this.formSubmit=i(this,"formSubmit"),this.editable=!1,this.currentData={},this.touched={},this.expanding=!1,this.utils={validateForm:()=>({isValid:this.runValidation().valid})}}componentWillLoad(){return f(),this.currentData=Object.assign({},this.data),this.runExpansion()}syncData(t){this.currentData=Object.assign({},t)}onSpecChange(){this.runExpansion()}effectiveSpec(){var t;return null!==(t=this.expandedSpec)&&void 0!==t?t:this.spec}async runExpansion(){if(this.expandError=void 0,this.editable||!a(this.spec))return void(this.expandedSpec=void 0);const t=this.spec;this.expanding=!0;try{const s=await o(t);this.spec===t&&(this.expandedSpec=s)}catch(s){this.spec===t&&(this.expandedSpec=void 0,this.expandError=s instanceof Error?s.message:String(s))}finally{this.spec===t&&(this.expanding=!1)}}publicData(){return Object.fromEntries(Object.entries(this.currentData).filter((([t])=>!t.startsWith("_"))))}handleBrickDataChange(t){t.stopPropagation(),this.currentData=this.applyValueEffects(Object.assign(Object.assign({},this.currentData),t.detail));const s=Object.assign({},this.touched);for(const e of Object.keys(t.detail))s[e]=!0;this.touched=s;const{valid:e,errors:i}=this.runValidation();this.formDataChange.emit({data:this.publicData(),isValid:e,errors:i})}applyValueEffects(t){var s,e;let i=t;for(const{brick:t}of n(this.effectiveSpec())){const r=null===(s=t.configs)||void 0===s?void 0:s.key;if(!r||!(null===(e=t.rules)||void 0===e?void 0:e.length))continue;const a=c(t.rules,i);void 0!==a.value&&i[r]!==a.value&&(i=Object.assign(Object.assign({},i),{[r]:a.value}))}return i}async validate(){var t;const s={};for(const{brick:e}of n(this.effectiveSpec())){const i=null===(t=e.configs)||void 0===t?void 0:t.key;i&&(s[i]=!0)}this.touched=s;const e=this.runValidation(),i=Object.assign({},e.errors);let r=e.valid;const a=Array.from(this.host.querySelectorAll("fk-data-grid"));for(const t of a){const s=await t.validateRows();r=r&&s.valid,Object.assign(i,s.errors)}const o={valid:r,errors:i};return this.formDataChange.emit({data:this.publicData(),isValid:o.valid,errors:o.errors}),o}handleStepTouch(t){t.stopPropagation();const s=Object.assign({},this.touched);for(const e of t.detail.keys)s[e]=!0;this.touched=s}async handleStepperSubmit(t){t.stopPropagation();const s=await this.validate();this.formSubmit.emit({data:this.publicData(),isValid:s.valid,errors:s.errors})}runValidation(){const t=Object.fromEntries(Object.entries(this.currentData).filter((([,t])=>""!==t&&null!=t)));return h(this.effectiveSpec(),t,this.locale)}visibleErrors(){if(this.editable)return{};const t={};for(const[s,e]of Object.entries(this.runValidation().errors))this.touched[s]&&(t[s]=e);return t}render(){return this.spec?this.expanding?r("p",{class:"fk-form__expanding"},d("nestedForm.loading")):r("form",{class:"fk-form",onSubmit:t=>t.preventDefault()},this.expandError?r("span",{class:"fk-field__error",role:"alert"},this.expandError):null,r("fk-brick-render",{brickSpec:this.effectiveSpec(),rootSpec:this.effectiveSpec(),data:this.currentData,dataMap:this.currentData,errors:this.visibleErrors(),locale:this.locale,path:"0",editable:this.editable,selectedUid:this.selectedUid,utils:this.utils})):null}get host(){return this}static get watchers(){return{data:[{syncData:0}],spec:[{onSpecChange:0}]}}static get style(){return".fk-form.sc-fk-form-render{display:flex;flex-direction:column;gap:var(--fk-spacing);font-family:var(--fk-font);color:var(--fk-color-text)}"}},[2,"fk-form-render",{spec:[16],data:[16],editable:[4],selectedUid:[1,"selected-uid"],locale:[1],currentData:[32],touched:[32],expandedSpec:[32],expanding:[32],expandError:[32],validate:[64]},[[0,"brickDataChange","handleBrickDataChange"],[0,"stepTouch","handleStepTouch"],[0,"stepperSubmit","handleStepperSubmit"]],{data:[{syncData:0}],spec:[{onSpecChange:0}]}]);function y(){"undefined"!=typeof customElements&&["fk-form-render","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-code-editor","fk-data-grid","fk-drop-area","fk-file-input","fk-select-input","fk-signature-input","fk-stepper","fk-tabs"].forEach((s=>{switch(s){case"fk-form-render":customElements.get(t(s))||customElements.define(t(s),O);break;case"fk-brick-actions":customElements.get(t(s))||l();break;case"fk-brick-not-found":customElements.get(t(s))||p();break;case"fk-brick-render":customElements.get(t(s))||m();break;case"fk-code-editor":customElements.get(t(s))||u();break;case"fk-data-grid":customElements.get(t(s))||k();break;case"fk-drop-area":customElements.get(t(s))||b();break;case"fk-file-input":customElements.get(t(s))||j();break;case"fk-select-input":customElements.get(t(s))||v();break;case"fk-signature-input":customElements.get(t(s))||g();break;case"fk-stepper":customElements.get(t(s))||E();break;case"fk-tabs":customElements.get(t(s))||S()}}))}y();export{O as F,y as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as s,c as i,h as o}from"./p-BB4Llg42.js";import{d as r,j as a,p as c,s as l,n,k as h,b as d}from"./p-DjU-98-4.js";let f=0;const p=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectValueChange=i(this,"selectValueChange"),this.disabled=!1,this.multiple=!1,this.invalid=!1,this.open=!1,this.query="",this.activeIndex=0,this.instanceId="fk-select-"+ ++f,this.remoteOptions=[],this.catalogOptions=[],this.outsideClick=t=>{this.host.contains(t.target)||this.close()},this.onTriggerKeyDown=t=>{this.disabled||(["Enter"," ","ArrowDown","ArrowUp"].includes(t.key)?(t.preventDefault(),this.openDropdown()):"Escape"===t.key&&this.open&&(t.preventDefault(),this.close()))}}componentWillLoad(){return Promise.all([this.resolveRemote(),this.resolveCatalog()])}disconnectedCallback(){this.unbindOutsideClick()}onConfigsChange(){this.resolveRemote(),this.resolveCatalog()}onDataMapChange(){this.resolveRemote()}searchParam(){var t;return(null===(t=this.configs)||void 0===t?void 0:t.searchParam)||void 0}remoteUrl(){var t;const e=null===(t=this.configs)||void 0===t?void 0:t.optionsUrl;if(!e)return;let s=r(e,this.dataMap);const i=this.searchParam();return i&&(s=a(s,i,this.query.trim())),s}bindOutsideClick(){document.addEventListener("mousedown",this.outsideClick)}unbindOutsideClick(){document.removeEventListener("mousedown",this.outsideClick)}toggleOpen(){this.disabled||(this.open?this.close():this.openDropdown())}openDropdown(){if(this.disabled||this.open)return;this.open=!0,this.query="";const{options:t}=this.resolve(),e=this.selectedValues(),s=t.findIndex((t=>e.includes(t.value)));this.activeIndex=s>=0?s:0,this.bindOutsideClick()}close(t=!1){var e;this.open=!1,this.unbindOutsideClick(),t&&(null===(e=this.triggerEl)||void 0===e||e.focus())}moveActive(t,e){e&&(this.activeIndex=(this.activeIndex+t+e)%e,this.scrollActiveIntoView())}scrollActiveIntoView(){requestAnimationFrame((()=>{var t;const e=this.host.querySelector(`#${this.instanceId}-opt-${this.activeIndex}`);null===(t=null==e?void 0:e.scrollIntoView)||void 0===t||t.call(e,{block:"nearest"})}))}onSearchKeyDown(t,e){var s;switch(t.key){case"ArrowDown":t.preventDefault(),this.moveActive(1,e.length);break;case"ArrowUp":t.preventDefault(),this.moveActive(-1,e.length);break;case"Home":t.preventDefault(),this.activeIndex=0,this.scrollActiveIntoView();break;case"End":t.preventDefault(),this.activeIndex=Math.max(e.length-1,0),this.scrollActiveIntoView();break;case"Enter":{t.preventDefault();const i=null!==(s=e[this.activeIndex])&&void 0!==s?s:e[0];i&&this.pick(i);break}case"Escape":t.preventDefault(),this.close(!0);break;case"Tab":this.close()}}source(){var t,e;return null!==(e=null===(t=this.configs)||void 0===t?void 0:t.optionsSource)&&void 0!==e?e:"static"}async resolveRemote(t=!1){var e;if("remote"!==this.source())return;const s=this.remoteUrl();if(!s)return void(this.remoteOptions=[]);const i=c(null===(e=this.configs)||void 0===e?void 0:e.optionsHeaders,this.dataMap),o=`${s}|${JSON.stringify(null!=i?i:{})}`;if(t||o!==this.lastRemoteSignature){this.lastRemoteSignature=o;try{this.remoteError=void 0,this.remoteOptions=await l.dataSourceService.fetchOptions(s,i?{headers:i}:void 0)}catch(t){this.remoteOptions=[],this.remoteError=t instanceof Error?t.message:String(t)}}}async resolveCatalog(t=!1){var e;if("catalog"!==this.source())return;const s=(null===(e=this.configs)||void 0===e?void 0:e.optionsRef)||"";if(s){if(t||s!==this.lastCatalogRef){this.lastCatalogRef=s;try{this.catalogError=void 0,this.catalogOptions=await l.optionSourceService.fetchOptions(s)}catch(t){this.catalogOptions=[],this.catalogError=t instanceof Error?t.message:String(t)}}}else this.catalogOptions=[]}onSearchInput(t){this.query=t,"remote"===this.source()&&this.searchParam()&&(this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>this.resolveRemote()),250))}resolve(){var t,e,s,i,o,r;const a=(null===(t=this.configs)||void 0===t?void 0:t.labelKey)||void 0,c=(null===(e=this.configs)||void 0===e?void 0:e.valueKey)||void 0;switch(this.source()){case"remote":return{options:n(this.remoteOptions,a,c),error:this.remoteError};case"catalog":return{options:n(this.catalogOptions,a,c),error:this.catalogError};case"dataMap":{const t=null===(s=this.configs)||void 0===s?void 0:s.optionsPath;return{options:n(t?null===(i=this.dataMap)||void 0===i?void 0:i[t]:[],a,c)}}case"js":{const t=null===(o=this.configs)||void 0===o?void 0:o.optionsCode;if(!t)return{options:[]};const e=h(t,this.dataMap);return e instanceof Error?{options:[],error:e.message}:{options:n(e,a,c)}}default:return{options:n(null===(r=this.configs)||void 0===r?void 0:r.options,a,c)}}}selectedValues(){return this.multiple?Array.isArray(this.value)?this.value:[]:"string"==typeof this.value&&""!==this.value?[this.value]:[]}labelOf(t,e){var s,i;return null!==(i=null===(s=e.find((e=>e.value===t)))||void 0===s?void 0:s.label)&&void 0!==i?i:t}pick(t){if(this.multiple){const e=this.selectedValues(),s=e.includes(t.value)?e.filter((e=>e!==t.value)):[...e,t.value];this.selectValueChange.emit(s.length?s:void 0)}else this.selectValueChange.emit(t.value),this.close(!0)}unpick(t){const e=this.selectedValues().filter((e=>e!==t));this.selectValueChange.emit(e.length?e:void 0)}filteredOptions(t){if("remote"===this.source()&&this.searchParam())return t;const e=this.query.trim().toLowerCase();return e?t.filter((t=>t.label.toLowerCase().includes(e))):t}render(){var t,e;const{options:s,error:i}=this.resolve(),r=this.selectedValues(),a=this.filteredOptions(s);return o("div",{key:"ddf7dfe94b227c3cd965b622bdae28620de02b30",class:{"fk-select":!0,"fk-select--disabled":this.disabled}},o("div",{key:"80526138a1f058c1f87a5d94cb9d9fa18ff34f8d",class:{"fk-select__trigger":!0,"fk-select__trigger--open":this.open},role:"combobox",tabIndex:this.disabled?void 0:0,"aria-label":this.accessibleLabel,"aria-expanded":this.open?"true":"false","aria-haspopup":"listbox","aria-controls":`${this.instanceId}-listbox`,"aria-disabled":this.disabled?"true":void 0,"aria-invalid":this.invalid?"true":void 0,ref:t=>this.triggerEl=t,onKeyDown:this.onTriggerKeyDown,onClick:t=>{t.preventDefault(),this.toggleOpen()}},o("div",{key:"9a57ddcf19d3e8cf185e7f6e97368245ec25bfc4",class:"fk-select__values"},0===r.length?o("span",{class:"fk-select__placeholder"},String(null!==(e=null===(t=this.configs)||void 0===t?void 0:t.placeholder)&&void 0!==e?e:"")):this.multiple?r.map((t=>o("span",{class:"fk-select__chip",key:t},this.labelOf(t,s),o("button",{type:"button",class:"fk-select__chip-remove","aria-label":`${d("select.clear")} — ${this.labelOf(t,s)}`,disabled:this.disabled,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.unpick(t)}},"✕")))):o("span",{class:"fk-select__value"},this.labelOf(r[0],s))),!this.multiple&&r.length>0&&!this.disabled?o("button",{type:"button",class:"fk-select__clear",title:d("select.clear"),"aria-label":d("select.clear"),onClick:t=>{t.preventDefault(),t.stopPropagation(),this.selectValueChange.emit(void 0)}},"✕"):null,o("span",{key:"7e14336fb18c26aa2ed15938d917570639b8819d",class:"fk-select__caret"},"▾")),this.open?o("div",{class:"fk-select__dropdown"},o("input",{class:"fk-select__search",type:"text",placeholder:d("select.search"),value:this.query,role:"combobox","aria-label":this.accessibleLabel,"aria-expanded":"true","aria-autocomplete":"list","aria-controls":`${this.instanceId}-listbox`,"aria-activedescendant":a.length?`${this.instanceId}-opt-${Math.min(this.activeIndex,a.length-1)}`:void 0,ref:t=>setTimeout((()=>null==t?void 0:t.focus()),0),onInput:t=>{this.activeIndex=0,this.onSearchInput(t.target.value)},onKeyDown:t=>this.onSearchKeyDown(t,a)}),o("div",{class:"fk-select__options",role:"listbox",id:`${this.instanceId}-listbox`,"aria-multiselectable":this.multiple?"true":void 0},a.map(((t,e)=>{const s=r.includes(t.value),i=e===Math.min(this.activeIndex,a.length-1);return o("div",{key:t.value,id:`${this.instanceId}-opt-${e}`,role:"option","aria-selected":s?"true":"false",class:{"fk-select__option":!0,"fk-select__option--selected":s,"fk-select__option--active":i},onMouseEnter:()=>this.activeIndex=e,onClick:e=>{e.preventDefault(),this.pick(t)}},o("span",{class:"fk-select__option-label"},t.label),s?o("span",{class:"fk-select__check"},"✓"):null)})),0===a.length?o("p",{class:"fk-select__empty"},d("select.empty")):null)):null,i?o("span",{class:"fk-field__error"},i):null)}get host(){return this}static get watchers(){return{configs:[{onConfigsChange:0}],dataMap:[{onDataMapChange:0}]}}static get style(){return".sc-fk-select-input-h{display:block}.fk-select.sc-fk-select-input{position:relative;font-family:var(--fk-font)}.fk-select__trigger.sc-fk-select-input{display:flex;align-items:center;gap:calc(var(--fk-spacing) / 2);min-height:38px;padding:calc(var(--fk-spacing) / 2) var(--fk-spacing);border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:var(--fk-color-surface);color:var(--fk-color-text);cursor:pointer}.fk-select--disabled.sc-fk-select-input .fk-select__trigger.sc-fk-select-input{cursor:not-allowed;opacity:0.6}.fk-select__trigger--open.sc-fk-select-input{border-color:var(--fk-color-primary)}.fk-select__values.sc-fk-select-input{display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:4px;min-width:0;font-size:0.9rem}.fk-select__placeholder.sc-fk-select-input{color:var(--fk-color-muted)}.fk-select__chip.sc-fk-select-input{display:inline-flex;align-items:center;gap:4px;padding:1px 8px;border-radius:999px;background:color-mix(in srgb, var(--fk-color-primary) 14%, transparent);color:var(--fk-color-primary);font-size:0.8rem;font-weight:600}.fk-select__chip-remove.sc-fk-select-input,.fk-select__clear.sc-fk-select-input{border:none;background:transparent;color:inherit;font-size:0.7rem;cursor:pointer;padding:0 2px}.fk-select__clear.sc-fk-select-input{color:var(--fk-color-muted)}.fk-select__clear.sc-fk-select-input:hover{color:var(--fk-color-danger)}.fk-select__caret.sc-fk-select-input{color:var(--fk-color-muted);font-size:0.8rem}.fk-select__dropdown.sc-fk-select-input{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:20;display:flex;flex-direction:column;border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:var(--fk-color-surface);box-shadow:0 8px 24px var(--fk-color-shadow);overflow:hidden}.fk-select__search.sc-fk-select-input{font:inherit;font-size:0.85rem;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);border:none;border-bottom:1px solid var(--fk-color-border);background:transparent;color:var(--fk-color-text)}.fk-select__search.sc-fk-select-input:focus{outline:none}.fk-select__options.sc-fk-select-input{max-height:220px;overflow-y:auto}.fk-select__option.sc-fk-select-input{display:flex;align-items:center;justify-content:space-between;gap:var(--fk-spacing);padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);font-size:0.9rem;color:var(--fk-color-text);cursor:pointer}.fk-select__option.sc-fk-select-input:hover{background:color-mix(in srgb, var(--fk-color-primary) 8%, transparent)}.fk-select__option--selected.sc-fk-select-input{color:var(--fk-color-primary);font-weight:600}.fk-select__check.sc-fk-select-input{font-size:0.8rem}.fk-select__empty.sc-fk-select-input{margin:0;padding:var(--fk-spacing);font-size:0.85rem;color:var(--fk-color-muted)}.fk-select__trigger.sc-fk-select-input:focus-visible{outline:2px solid color-mix(in srgb, var(--fk-color-primary) 55%, transparent);outline-offset:1px}.fk-select__option--active.sc-fk-select-input{background:color-mix(in srgb, var(--fk-color-primary) 12%, transparent)}"}},[2,"fk-select-input",{configs:[16],value:[1],disabled:[4],multiple:[4],invalid:[4],dataMap:[16],accessibleLabel:[1,"accessible-label"],open:[32],query:[32],activeIndex:[32],remoteOptions:[32],remoteError:[32],catalogOptions:[32],catalogError:[32]},void 0,{configs:[{onConfigsChange:0}],dataMap:[{onDataMapChange:0}]}]);function u(){"undefined"!=typeof customElements&&["fk-select-input"].forEach((e=>{"fk-select-input"===e&&(customElements.get(t(e))||customElements.define(t(e),p))}))}u();export{p as F,u as d}
|
|
1
|
+
import{t,p as e,H as s,c as i,h as o}from"./p-BB4Llg42.js";import{d as r,j as a,p as c,s as l,n,k as h,b as d}from"./p-DBDKSYBE.js";let f=0;const p=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectValueChange=i(this,"selectValueChange"),this.disabled=!1,this.multiple=!1,this.invalid=!1,this.open=!1,this.query="",this.activeIndex=0,this.instanceId="fk-select-"+ ++f,this.remoteOptions=[],this.catalogOptions=[],this.outsideClick=t=>{this.host.contains(t.target)||this.close()},this.onTriggerKeyDown=t=>{this.disabled||(["Enter"," ","ArrowDown","ArrowUp"].includes(t.key)?(t.preventDefault(),this.openDropdown()):"Escape"===t.key&&this.open&&(t.preventDefault(),this.close()))}}componentWillLoad(){return Promise.all([this.resolveRemote(),this.resolveCatalog()])}disconnectedCallback(){this.unbindOutsideClick()}onConfigsChange(){this.resolveRemote(),this.resolveCatalog()}onDataMapChange(){this.resolveRemote()}searchParam(){var t;return(null===(t=this.configs)||void 0===t?void 0:t.searchParam)||void 0}remoteUrl(){var t;const e=null===(t=this.configs)||void 0===t?void 0:t.optionsUrl;if(!e)return;let s=r(e,this.dataMap);const i=this.searchParam();return i&&(s=a(s,i,this.query.trim())),s}bindOutsideClick(){document.addEventListener("mousedown",this.outsideClick)}unbindOutsideClick(){document.removeEventListener("mousedown",this.outsideClick)}toggleOpen(){this.disabled||(this.open?this.close():this.openDropdown())}openDropdown(){if(this.disabled||this.open)return;this.open=!0,this.query="";const{options:t}=this.resolve(),e=this.selectedValues(),s=t.findIndex((t=>e.includes(t.value)));this.activeIndex=s>=0?s:0,this.bindOutsideClick()}close(t=!1){var e;this.open=!1,this.unbindOutsideClick(),t&&(null===(e=this.triggerEl)||void 0===e||e.focus())}moveActive(t,e){e&&(this.activeIndex=(this.activeIndex+t+e)%e,this.scrollActiveIntoView())}scrollActiveIntoView(){requestAnimationFrame((()=>{var t;const e=this.host.querySelector(`#${this.instanceId}-opt-${this.activeIndex}`);null===(t=null==e?void 0:e.scrollIntoView)||void 0===t||t.call(e,{block:"nearest"})}))}onSearchKeyDown(t,e){var s;switch(t.key){case"ArrowDown":t.preventDefault(),this.moveActive(1,e.length);break;case"ArrowUp":t.preventDefault(),this.moveActive(-1,e.length);break;case"Home":t.preventDefault(),this.activeIndex=0,this.scrollActiveIntoView();break;case"End":t.preventDefault(),this.activeIndex=Math.max(e.length-1,0),this.scrollActiveIntoView();break;case"Enter":{t.preventDefault();const i=null!==(s=e[this.activeIndex])&&void 0!==s?s:e[0];i&&this.pick(i);break}case"Escape":t.preventDefault(),this.close(!0);break;case"Tab":this.close()}}source(){var t,e;return null!==(e=null===(t=this.configs)||void 0===t?void 0:t.optionsSource)&&void 0!==e?e:"static"}async resolveRemote(t=!1){var e;if("remote"!==this.source())return;const s=this.remoteUrl();if(!s)return void(this.remoteOptions=[]);const i=c(null===(e=this.configs)||void 0===e?void 0:e.optionsHeaders,this.dataMap),o=`${s}|${JSON.stringify(null!=i?i:{})}`;if(t||o!==this.lastRemoteSignature){this.lastRemoteSignature=o;try{this.remoteError=void 0,this.remoteOptions=await l.dataSourceService.fetchOptions(s,i?{headers:i}:void 0)}catch(t){this.remoteOptions=[],this.remoteError=t instanceof Error?t.message:String(t)}}}async resolveCatalog(t=!1){var e;if("catalog"!==this.source())return;const s=(null===(e=this.configs)||void 0===e?void 0:e.optionsRef)||"";if(s){if(t||s!==this.lastCatalogRef){this.lastCatalogRef=s;try{this.catalogError=void 0,this.catalogOptions=await l.optionSourceService.fetchOptions(s)}catch(t){this.catalogOptions=[],this.catalogError=t instanceof Error?t.message:String(t)}}}else this.catalogOptions=[]}onSearchInput(t){this.query=t,"remote"===this.source()&&this.searchParam()&&(this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>this.resolveRemote()),250))}resolve(){var t,e,s,i,o,r;const a=(null===(t=this.configs)||void 0===t?void 0:t.labelKey)||void 0,c=(null===(e=this.configs)||void 0===e?void 0:e.valueKey)||void 0;switch(this.source()){case"remote":return{options:n(this.remoteOptions,a,c),error:this.remoteError};case"catalog":return{options:n(this.catalogOptions,a,c),error:this.catalogError};case"dataMap":{const t=null===(s=this.configs)||void 0===s?void 0:s.optionsPath;return{options:n(t?null===(i=this.dataMap)||void 0===i?void 0:i[t]:[],a,c)}}case"js":{const t=null===(o=this.configs)||void 0===o?void 0:o.optionsCode;if(!t)return{options:[]};const e=h(t,this.dataMap);return e instanceof Error?{options:[],error:e.message}:{options:n(e,a,c)}}default:return{options:n(null===(r=this.configs)||void 0===r?void 0:r.options,a,c)}}}selectedValues(){return this.multiple?Array.isArray(this.value)?this.value:[]:"string"==typeof this.value&&""!==this.value?[this.value]:[]}labelOf(t,e){var s,i;return null!==(i=null===(s=e.find((e=>e.value===t)))||void 0===s?void 0:s.label)&&void 0!==i?i:t}pick(t){if(this.multiple){const e=this.selectedValues(),s=e.includes(t.value)?e.filter((e=>e!==t.value)):[...e,t.value];this.selectValueChange.emit(s.length?s:void 0)}else this.selectValueChange.emit(t.value),this.close(!0)}unpick(t){const e=this.selectedValues().filter((e=>e!==t));this.selectValueChange.emit(e.length?e:void 0)}filteredOptions(t){if("remote"===this.source()&&this.searchParam())return t;const e=this.query.trim().toLowerCase();return e?t.filter((t=>t.label.toLowerCase().includes(e))):t}render(){var t,e;const{options:s,error:i}=this.resolve(),r=this.selectedValues(),a=this.filteredOptions(s);return o("div",{key:"ddf7dfe94b227c3cd965b622bdae28620de02b30",class:{"fk-select":!0,"fk-select--disabled":this.disabled}},o("div",{key:"80526138a1f058c1f87a5d94cb9d9fa18ff34f8d",class:{"fk-select__trigger":!0,"fk-select__trigger--open":this.open},role:"combobox",tabIndex:this.disabled?void 0:0,"aria-label":this.accessibleLabel,"aria-expanded":this.open?"true":"false","aria-haspopup":"listbox","aria-controls":`${this.instanceId}-listbox`,"aria-disabled":this.disabled?"true":void 0,"aria-invalid":this.invalid?"true":void 0,ref:t=>this.triggerEl=t,onKeyDown:this.onTriggerKeyDown,onClick:t=>{t.preventDefault(),this.toggleOpen()}},o("div",{key:"9a57ddcf19d3e8cf185e7f6e97368245ec25bfc4",class:"fk-select__values"},0===r.length?o("span",{class:"fk-select__placeholder"},String(null!==(e=null===(t=this.configs)||void 0===t?void 0:t.placeholder)&&void 0!==e?e:"")):this.multiple?r.map((t=>o("span",{class:"fk-select__chip",key:t},this.labelOf(t,s),o("button",{type:"button",class:"fk-select__chip-remove","aria-label":`${d("select.clear")} — ${this.labelOf(t,s)}`,disabled:this.disabled,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.unpick(t)}},"✕")))):o("span",{class:"fk-select__value"},this.labelOf(r[0],s))),!this.multiple&&r.length>0&&!this.disabled?o("button",{type:"button",class:"fk-select__clear",title:d("select.clear"),"aria-label":d("select.clear"),onClick:t=>{t.preventDefault(),t.stopPropagation(),this.selectValueChange.emit(void 0)}},"✕"):null,o("span",{key:"7e14336fb18c26aa2ed15938d917570639b8819d",class:"fk-select__caret"},"▾")),this.open?o("div",{class:"fk-select__dropdown"},o("input",{class:"fk-select__search",type:"text",placeholder:d("select.search"),value:this.query,role:"combobox","aria-label":this.accessibleLabel,"aria-expanded":"true","aria-autocomplete":"list","aria-controls":`${this.instanceId}-listbox`,"aria-activedescendant":a.length?`${this.instanceId}-opt-${Math.min(this.activeIndex,a.length-1)}`:void 0,ref:t=>setTimeout((()=>null==t?void 0:t.focus()),0),onInput:t=>{this.activeIndex=0,this.onSearchInput(t.target.value)},onKeyDown:t=>this.onSearchKeyDown(t,a)}),o("div",{class:"fk-select__options",role:"listbox",id:`${this.instanceId}-listbox`,"aria-multiselectable":this.multiple?"true":void 0},a.map(((t,e)=>{const s=r.includes(t.value),i=e===Math.min(this.activeIndex,a.length-1);return o("div",{key:t.value,id:`${this.instanceId}-opt-${e}`,role:"option","aria-selected":s?"true":"false",class:{"fk-select__option":!0,"fk-select__option--selected":s,"fk-select__option--active":i},onMouseEnter:()=>this.activeIndex=e,onClick:e=>{e.preventDefault(),this.pick(t)}},o("span",{class:"fk-select__option-label"},t.label),s?o("span",{class:"fk-select__check"},"✓"):null)})),0===a.length?o("p",{class:"fk-select__empty"},d("select.empty")):null)):null,i?o("span",{class:"fk-field__error"},i):null)}get host(){return this}static get watchers(){return{configs:[{onConfigsChange:0}],dataMap:[{onDataMapChange:0}]}}static get style(){return".sc-fk-select-input-h{display:block}.fk-select.sc-fk-select-input{position:relative;font-family:var(--fk-font)}.fk-select__trigger.sc-fk-select-input{display:flex;align-items:center;gap:calc(var(--fk-spacing) / 2);min-height:38px;padding:calc(var(--fk-spacing) / 2) var(--fk-spacing);border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:var(--fk-color-surface);color:var(--fk-color-text);cursor:pointer}.fk-select--disabled.sc-fk-select-input .fk-select__trigger.sc-fk-select-input{cursor:not-allowed;opacity:0.6}.fk-select__trigger--open.sc-fk-select-input{border-color:var(--fk-color-primary)}.fk-select__values.sc-fk-select-input{display:flex;flex:1;flex-wrap:wrap;align-items:center;gap:4px;min-width:0;font-size:0.9rem}.fk-select__placeholder.sc-fk-select-input{color:var(--fk-color-muted)}.fk-select__chip.sc-fk-select-input{display:inline-flex;align-items:center;gap:4px;padding:1px 8px;border-radius:999px;background:color-mix(in srgb, var(--fk-color-primary) 14%, transparent);color:var(--fk-color-primary);font-size:0.8rem;font-weight:600}.fk-select__chip-remove.sc-fk-select-input,.fk-select__clear.sc-fk-select-input{border:none;background:transparent;color:inherit;font-size:0.7rem;cursor:pointer;padding:0 2px}.fk-select__clear.sc-fk-select-input{color:var(--fk-color-muted)}.fk-select__clear.sc-fk-select-input:hover{color:var(--fk-color-danger)}.fk-select__caret.sc-fk-select-input{color:var(--fk-color-muted);font-size:0.8rem}.fk-select__dropdown.sc-fk-select-input{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:20;display:flex;flex-direction:column;border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:var(--fk-color-surface);box-shadow:0 8px 24px var(--fk-color-shadow);overflow:hidden}.fk-select__search.sc-fk-select-input{font:inherit;font-size:0.85rem;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);border:none;border-bottom:1px solid var(--fk-color-border);background:transparent;color:var(--fk-color-text)}.fk-select__search.sc-fk-select-input:focus{outline:none}.fk-select__options.sc-fk-select-input{max-height:220px;overflow-y:auto}.fk-select__option.sc-fk-select-input{display:flex;align-items:center;justify-content:space-between;gap:var(--fk-spacing);padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);font-size:0.9rem;color:var(--fk-color-text);cursor:pointer}.fk-select__option.sc-fk-select-input:hover{background:color-mix(in srgb, var(--fk-color-primary) 8%, transparent)}.fk-select__option--selected.sc-fk-select-input{color:var(--fk-color-primary);font-weight:600}.fk-select__check.sc-fk-select-input{font-size:0.8rem}.fk-select__empty.sc-fk-select-input{margin:0;padding:var(--fk-spacing);font-size:0.85rem;color:var(--fk-color-muted)}.fk-select__trigger.sc-fk-select-input:focus-visible{outline:2px solid color-mix(in srgb, var(--fk-color-primary) 55%, transparent);outline-offset:1px}.fk-select__option--active.sc-fk-select-input{background:color-mix(in srgb, var(--fk-color-primary) 12%, transparent)}"}},[2,"fk-select-input",{configs:[16],value:[1],disabled:[4],multiple:[4],invalid:[4],dataMap:[16],accessibleLabel:[1,"accessible-label"],open:[32],query:[32],activeIndex:[32],remoteOptions:[32],remoteError:[32],catalogOptions:[32],catalogError:[32]},void 0,{configs:[{onConfigsChange:0}],dataMap:[{onDataMapChange:0}]}]);function u(){"undefined"!=typeof customElements&&["fk-select-input"].forEach((e=>{"fk-select-input"===e&&(customElements.get(t(e))||customElements.define(t(e),p))}))}u();export{p as F,u as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as s,c as r,h as i}from"./p-BB4Llg42.js";import{l as p,v as o,b as a}from"./p-
|
|
1
|
+
import{t,p as e,H as s,c as r,h as i}from"./p-BB4Llg42.js";import{l as p,v as o,b as a}from"./p-DBDKSYBE.js";const c=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.stepTouch=r(this,"stepTouch"),this.stepperSubmit=r(this,"stepperSubmit"),this.stepLabels=[],this.editable=!1,this.active=0,this.next=t=>{t.preventDefault(),!this.config("validateSteps",!1)||this.stepValid(this.active)?this.active=Math.min(this.active+1,this.stepLabels.length-1):this.stepTouch.emit({keys:this.stepKeys(this.active)})},this.back=t=>{t.preventDefault(),this.active=Math.max(this.active-1,0)},this.submit=t=>{t.preventDefault(),!this.config("validateSteps",!1)||this.stepValid(this.active)?this.stepperSubmit.emit():this.stepTouch.emit({keys:this.stepKeys(this.active)})}}clampActive(){this.active>Math.max(this.stepLabels.length-1,0)&&(this.active=0)}componentDidRender(){const t=this.host.querySelector(".fk-stepper__body");t&&Array.from(t.children).forEach(((t,e)=>{const s=t;this.editable?s.style.removeProperty("display"):s.style.display=e===this.active?"":"none"}))}config(t,e){var s,r;const i=null===(r=null===(s=this.spec)||void 0===s?void 0:s.configs)||void 0===r?void 0:r[t];return"boolean"==typeof i?i:e}stepSpec(t){var e,s,r;const i=null===(s=null===(e=this.spec)||void 0===e?void 0:e.children)||void 0===s?void 0:s[t];if(i&&this.spec)return(null===(r=this.stepCache)||void 0===r?void 0:r.source)!==this.spec&&(this.stepCache={source:this.spec,specs:[]}),this.stepCache.specs[t]||(this.stepCache.specs[t]={type:"panel",id:"step",name:"Step",configs:{key:`step_${t}`},children:[i]}),this.stepCache.specs[t]}stepKeys(t){var e,s,r;const i=null===(s=null===(e=this.spec)||void 0===e?void 0:e.children)||void 0===s?void 0:s[t];if(!i)return[];const o=[];for(const t of p(i))(null===(r=t.configs)||void 0===r?void 0:r.key)&&o.push(t.configs.key);return o}stepValid(t){var e;const s=this.stepSpec(t);if(!s)return!0;const r=Object.fromEntries(Object.entries(null!==(e=this.dataMap)&&void 0!==e?e:{}).filter((([,t])=>""!==t&&null!=t)));return o(s,r,this.locale).valid}goToStep(t){if(this.editable||t<=this.active)this.active=t;else if(this.config("allowStepClick",!0)){if(this.config("validateSteps",!1))for(let e=this.active;e<t;e++)if(!this.stepValid(e))return this.active=e,void this.stepTouch.emit({keys:this.stepKeys(e)});this.active=t}}render(){const t=Math.max(this.stepLabels.length-1,0),e=!this.editable&&this.config("showSubmit",!1)&&this.active===t;return i("div",{key:"e053abb2a58d5d1a9072bac99e8ecf676b07e583",class:"fk-stepper"},i("ol",{key:"b3128e48f60b756cb2ef68d69f7d63172eb304e0",class:"fk-stepper__nav"},this.stepLabels.map(((t,e)=>i("li",{key:`${e}-${t}`,class:{"fk-stepper__step":!0,"fk-stepper__step--active":e===this.active,"fk-stepper__step--done":!this.editable&&e<this.active}},i("button",{type:"button",class:"fk-stepper__step-button","aria-current":e===this.active?"step":void 0,onClick:t=>{t.preventDefault(),this.goToStep(e)}},i("span",{class:"fk-stepper__index"},e+1),i("span",{class:"fk-stepper__label"},t)))))),i("div",{key:"2da56f865c1919777ec34954ccbceac4985694af",class:"fk-stepper__body"},i("slot",{key:"bca4f9af6e507c0f47fef5251426e19acf84f8e5"})),!this.editable&&this.stepLabels.length>1?i("div",{class:"fk-stepper__actions"},i("button",{type:"button",class:"fk-stepper__button",disabled:0===this.active,onClick:this.back},a("stepper.back")),this.active<t?i("button",{type:"button",class:"fk-stepper__button fk-stepper__button--primary",onClick:this.next},a("stepper.next")):null,e?i("button",{type:"button",class:"fk-stepper__button fk-stepper__button--primary",onClick:this.submit},a("stepper.submit")):null):null)}get host(){return this}static get watchers(){return{stepLabels:[{clampActive:0}]}}static get style(){return".sc-fk-stepper-h{display:block}.fk-stepper.sc-fk-stepper{display:flex;flex-direction:column;gap:var(--fk-spacing)}.fk-stepper__nav.sc-fk-stepper{display:flex;flex-wrap:wrap;gap:calc(var(--fk-spacing) * 1.5);margin:0;padding:0 0 var(--fk-spacing);list-style:none;border-bottom:1px solid var(--fk-color-border)}.fk-stepper__step.sc-fk-stepper{display:flex;align-items:center;gap:calc(var(--fk-spacing) / 2);cursor:pointer;color:var(--fk-color-muted);font-size:0.85rem}.fk-stepper__index.sc-fk-stepper{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;border:1px solid var(--fk-color-border);font-size:0.72rem;font-weight:700}.fk-stepper__step--active.sc-fk-stepper{color:var(--fk-color-text);font-weight:600}.fk-stepper__step--active.sc-fk-stepper .fk-stepper__index.sc-fk-stepper{border-color:var(--fk-color-primary);background:var(--fk-color-primary);color:var(--fk-color-surface)}.fk-stepper__step--done.sc-fk-stepper .fk-stepper__index.sc-fk-stepper{border-color:var(--fk-color-primary);color:var(--fk-color-primary)}.fk-stepper__actions.sc-fk-stepper{display:flex;justify-content:space-between;padding-top:var(--fk-spacing);border-top:1px solid var(--fk-color-border)}.fk-stepper__button.sc-fk-stepper{font:inherit;font-size:0.85rem;padding:calc(var(--fk-spacing) / 1.5) calc(var(--fk-spacing) * 1.5);border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:var(--fk-color-surface);color:var(--fk-color-text);cursor:pointer}.fk-stepper__button--primary.sc-fk-stepper{border-color:var(--fk-color-primary);background:var(--fk-color-primary);color:var(--fk-color-surface)}.fk-stepper__button.sc-fk-stepper:disabled{opacity:0.45;cursor:not-allowed}.fk-stepper__step-button.sc-fk-stepper{all:unset;display:inline-flex;align-items:center;gap:inherit;cursor:pointer}.fk-stepper__step-button.sc-fk-stepper:focus-visible{outline:2px solid color-mix(in srgb, var(--fk-color-primary) 55%, transparent);outline-offset:2px;border-radius:calc(var(--fk-radius) / 2)}"}},[262,"fk-stepper",{stepLabels:[16],editable:[4],spec:[16],dataMap:[16],locale:[1],active:[32]},void 0,{stepLabels:[{clampActive:0}]}]);function l(){"undefined"!=typeof customElements&&["fk-stepper"].forEach((e=>{"fk-stepper"===e&&(customElements.get(t(e))||customElements.define(t(e),c))}))}l();export{c as F,l as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as r,h as a,a as c}from"./p-BB4Llg42.js";import{b as s}from"./p-BMtyMU2R.js";import{f as o,b as l}from"./p-
|
|
1
|
+
import{t,p as e,H as r,h as a,a as c}from"./p-BB4Llg42.js";import{b as s}from"./p-BMtyMU2R.js";import{f as o,b as l}from"./p-DBDKSYBE.js";import{d as i}from"./p-BQNLm3VZ.js";const f=e(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.query="",this.collapsed={}}toggle(t){this.collapsed=Object.assign(Object.assign({},this.collapsed),{[t]:!this.collapsed[t]})}render(){const t=s(),e=this.query.trim().toLowerCase(),r=Object.entries(t).map((([t,r])=>({category:t,molds:e?r.filter((r=>[r.name,o(`brick.${r.id}.name`,r.name),r.id,t,o(`category.${t}`,t)].some((t=>t.toLowerCase().includes(e))))):r}))).filter((t=>t.molds.length>0));return a(c,{key:"65362cc9fe11c5814857ecb43a4695f09ae8514a"},a("div",{key:"9cdab3a85fef9552d8169f21f23a515b873b6de2",class:"fk-palette"},a("input",{key:"c257151b6d7458cc93bf4a4533c25692ff5820cf",class:"fk-palette__search",type:"search",placeholder:l("palette.search"),value:this.query,onInput:t=>this.query=t.target.value}),r.map((({category:t,molds:r})=>{const c=!e&&this.collapsed[t];return a("section",{class:"fk-palette__group",key:t},a("button",{type:"button",class:"fk-palette__category",onClick:()=>this.toggle(t)},a("span",{class:{"fk-palette__chevron":!0,"fk-palette__chevron--collapsed":c}},"▾"),o(`category.${t}`,t),a("span",{class:"fk-palette__count"},r.length)),c?null:a("div",{class:"fk-palette__items"},r.map((t=>a("fk-brick-mold-item",{brickMold:t,key:`${t.type}:${t.id}`})))))})),0===r.length?a("p",{class:"fk-palette__empty"},l("palette.empty",{query:this.query})):null))}static get style(){return".fk-palette.sc-fk-brick-list{display:flex;flex-direction:column;gap:var(--fk-spacing);font-family:var(--fk-font)}.fk-palette__search.sc-fk-brick-list{font:inherit;font-size:0.85rem;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 1.5);background:var(--fk-color-surface);color:var(--fk-color-text)}.fk-palette__search.sc-fk-brick-list:focus{outline:none;border-color:var(--fk-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--fk-color-primary) 20%, transparent)}.fk-palette__category.sc-fk-brick-list{display:flex;align-items:center;gap:calc(var(--fk-spacing) / 2);width:100%;margin:0 0 calc(var(--fk-spacing) / 2);padding:calc(var(--fk-spacing) / 2) 0;border:none;background:transparent;font:inherit;font-size:0.7rem;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;color:var(--fk-color-muted);cursor:pointer}.fk-palette__category.sc-fk-brick-list:hover{color:var(--fk-color-text)}.fk-palette__chevron.sc-fk-brick-list{display:inline-block;transition:transform 120ms ease}.fk-palette__chevron--collapsed.sc-fk-brick-list{transform:rotate(-90deg)}.fk-palette__count.sc-fk-brick-list{margin-left:auto;font-weight:600;color:var(--fk-color-muted)}.fk-palette__items.sc-fk-brick-list{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:calc(var(--fk-spacing) / 2)}.fk-palette__empty.sc-fk-brick-list{margin:0;font-size:0.8rem;color:var(--fk-color-muted)}"}},[2,"fk-brick-list",{locale:[1],query:[32],collapsed:[32]}]);function n(){"undefined"!=typeof customElements&&["fk-brick-list","fk-brick-mold-item"].forEach((e=>{switch(e){case"fk-brick-list":customElements.get(t(e))||customElements.define(t(e),f);break;case"fk-brick-mold-item":customElements.get(t(e))||i()}}))}n();export{f as F,n as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as o,H as i,c as r,h as a}from"./p-BB4Llg42.js";import{d as s,a as c}from"./p-92BozD8S.js";import{t as e}from"./p-D-Ecxaih.js";import{b as n}from"./p-
|
|
1
|
+
import{t,p as o,H as i,c as r,h as a}from"./p-BB4Llg42.js";import{d as s,a as c}from"./p-92BozD8S.js";import{t as e}from"./p-D-Ecxaih.js";import{b as n}from"./p-DBDKSYBE.js";const k=o(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.brickRemove=r(this,"brickRemove"),this.brickDuplicate=r(this,"brickDuplicate"),this.brickDrop=r(this,"brickDrop"),this.brickSelect=r(this,"brickSelect"),this.selected=!1,this.isDragging=!1,this.isDropTarget=!1,this.cleanups=[]}componentDidLoad(){this.handleEl&&this.cleanups.push(s({element:this.handleEl,getInitialData:()=>({kind:"move-brick",path:this.path}),onDragStart:()=>this.isDragging=!0,onDrop:()=>this.isDragging=!1})),this.cleanups.push(c({element:this.host,onDrag:({location:t})=>{var o;return this.isDropTarget=(null===(o=t.current.dropTargets[0])||void 0===o?void 0:o.element)===this.host},onDragLeave:()=>this.isDropTarget=!1,onDrop:({source:t,location:o})=>{var i;if(this.isDropTarget=!1,(null===(i=o.current.dropTargets[0])||void 0===i?void 0:i.element)!==this.host)return;const r=this.path.split("."),a=e(t.data,r.slice(0,-1).join("."),Number(r[r.length-1]));a&&this.brickDrop.emit(a)}}))}disconnectedCallback(){this.cleanups.forEach((t=>t())),this.cleanups=[]}render(){return a("div",{key:"ea1cc1c7af646f403330c98b251714f3968c1aae",class:{"fk-actions":!0,"fk-actions--dragging":this.isDragging,"fk-actions--drop-before":this.isDropTarget,"fk-actions--selected":this.selected},onClick:t=>{t.stopPropagation(),this.brickSelect.emit({path:this.path})}},a("div",{key:"99c08de8c78ff6362103f9e355ff6aa3da1367ee",class:"fk-actions__toolbar"},a("button",{key:"8702b1f565ea639585614d4c6e88b2dc44c7ed7c",type:"button",class:"fk-actions__button fk-actions__handle",ref:t=>this.handleEl=t,title:n("actions.move")},"⠿"),a("button",{key:"7394adc36780dbd61195b69cd21fce3c8a852f2a",type:"button",class:"fk-actions__button",title:n("actions.duplicate"),onClick:t=>{t.stopPropagation(),this.brickDuplicate.emit({path:this.path})}},"⧉"),a("button",{key:"ddea0decbc02a4b0627170c973ed19180aa6f651",type:"button",class:"fk-actions__button fk-actions__button--danger",title:n("actions.delete"),onClick:t=>{t.stopPropagation(),this.brickRemove.emit({path:this.path})}},"✕")),a("slot",{key:"44fa7c12a7581ff6b62f29fb1249d427594b5e1f"}))}get host(){return this}static get style(){return".fk-actions.sc-fk-brick-actions{position:relative;padding:calc(var(--fk-spacing) / 2);border:1px solid transparent;border-radius:var(--fk-radius)}.fk-actions.sc-fk-brick-actions:hover{border-color:var(--fk-color-border)}.fk-actions--selected.sc-fk-brick-actions,.fk-actions--selected.sc-fk-brick-actions:hover{border-color:var(--fk-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--fk-color-primary) 20%, transparent)}.fk-actions--dragging.sc-fk-brick-actions{opacity:0.5}.fk-actions--drop-before.sc-fk-brick-actions::before{content:'';position:absolute;top:-2px;left:0;right:0;height:3px;border-radius:2px;background:var(--fk-color-primary)}.fk-actions__toolbar.sc-fk-brick-actions{position:absolute;top:calc(var(--fk-spacing) / -2);right:var(--fk-spacing);z-index:1;display:none;gap:2px;padding:2px;border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 2);background:var(--fk-color-surface);box-shadow:0 2px 6px var(--fk-color-shadow)}.fk-actions.sc-fk-brick-actions:hover>.fk-actions__toolbar.sc-fk-brick-actions{display:flex}.fk-actions__button.sc-fk-brick-actions{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:calc(var(--fk-radius) / 2);background:transparent;color:var(--fk-color-muted);font-size:0.8rem;cursor:pointer}.fk-actions__button.sc-fk-brick-actions:hover{background:color-mix(in srgb, var(--fk-color-primary) 12%, transparent);color:var(--fk-color-primary)}.fk-actions__button--danger.sc-fk-brick-actions:hover{background:color-mix(in srgb, var(--fk-color-danger) 12%, transparent);color:var(--fk-color-danger)}.fk-actions__handle.sc-fk-brick-actions{cursor:grab}"}},[262,"fk-brick-actions",{path:[1],selected:[4],isDragging:[32],isDropTarget:[32]}]);function f(){"undefined"!=typeof customElements&&["fk-brick-actions"].forEach((o=>{"fk-brick-actions"===o&&(customElements.get(t(o))||customElements.define(t(o),k))}))}f();export{k as F,f as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-qLZlXROB.js";export{s as setNonce}from"./p-qLZlXROB.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-qLZlXROB.js";export{s as setNonce}from"./p-qLZlXROB.js";import{g as l}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["p-f360c57a",[[2,"fk-empty-form"]]],["p-1e48d41c",[[2,"fk-form-builder",{spec:[16],data:[16],locales:[16],locale:[1],currentSpec:[32],currentData:[32],selectedUid:[32],copied:[32],importError:[32],editLocale:[32]},[[0,"brickDrop","handleBrickDrop"],[0,"brickRemove","handleBrickRemove"],[0,"brickDuplicate","handleBrickDuplicate"],[0,"brickConfigsChange","handleConfigsChange"],[0,"brickStylesChange","handleStylesChange"],[0,"brickValidationsChange","handleValidationsChange"],[0,"brickRulesChange","handleRulesChange"],[0,"formDataChange","handleDataChange"],[4,"paste","handlePaste"],[0,"brickSelect","handleBrickSelect"]],{spec:[{syncSpec:0}]}],[2,"fk-form-render",{spec:[16],data:[16],editable:[4],selectedUid:[1,"selected-uid"],locale:[1],currentData:[32],touched:[32],expandedSpec:[32],expanding:[32],expandError:[32],validate:[64]},[[0,"brickDataChange","handleBrickDataChange"],[0,"stepTouch","handleStepTouch"],[0,"stepperSubmit","handleStepperSubmit"]],{data:[{syncData:0}],spec:[{onSpecChange:0}]}],[2,"fk-property-panel",{brick:[16],fields:[16],locales:[16],locale:[1],editLocale:[1,"edit-locale"],activeTab:[32],newStyleKey:[32]},null,{brick:[{onBrickChange:0}]}],[2,"fk-brick-list",{locale:[1],query:[32],collapsed:[32]}],[2,"fk-data-grid",{spec:[16],value:[16],disabled:[4],locale:[1],utils:[16],touched:[32],validateRows:[64]},[[0,"brickDataChange","handleRowChange"]]],[2,"fk-rules-editor",{brick:[16],fields:[16],forcedModes:[32],jsonErrors:[32],codeErrors:[32]}],[2,"fk-brick-mold-item",{brickMold:[16],isDragging:[32]}],[2,"fk-file-input",{value:[16],disabled:[4],accept:[1],uploadUrl:[1,"upload-url"],multiple:[4],uploading:[32],removingUrl:[32],uploadError:[32]}],[2,"fk-select-input",{configs:[16],value:[1],disabled:[4],multiple:[4],invalid:[4],dataMap:[16],accessibleLabel:[1,"accessible-label"],open:[32],query:[32],activeIndex:[32],remoteOptions:[32],remoteError:[32],catalogOptions:[32],catalogError:[32]},null,{configs:[{onConfigsChange:0}],dataMap:[{onDataMapChange:0}]}],[2,"fk-signature-input",{value:[1],disabled:[4]},null,{value:[{onValueChange:0}]}],[262,"fk-stepper",{stepLabels:[16],editable:[4],spec:[16],dataMap:[16],locale:[1],active:[32]},null,{stepLabels:[{clampActive:0}]}],[262,"fk-tabs",{tabLabels:[16],editable:[4],spec:[16],dataMap:[16],locale:[1],active:[32]},null,{tabLabels:[{clampActive:0}]}],[0,"fk-brick-render",{brickSpec:[16],rootSpec:[16],data:[16],dataMap:[16],path:[1],editable:[4],selectedUid:[1,"selected-uid"],errors:[16],locale:[1],utils:[16]}],[262,"fk-brick-actions",{path:[1],selected:[4],isDragging:[32],isDropTarget:[32]}],[262,"fk-brick-not-found"],[2,"fk-code-editor",{value:[1],placeholder:[1],completions:[16]},null,{value:[{syncValue:0}]}],[2,"fk-drop-area",{path:[1],empty:[4],isOver:[32]}]]]],e))));
|