@agile-team/mach-report 2.23.0 → 2.24.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.
Files changed (162) hide show
  1. package/README.md +9 -2
  2. package/dist/ExcelBindingWizard-BV12hGiK.cjs +1 -0
  3. package/dist/ExcelBindingWizard-Cy_lPjWV.js +1486 -0
  4. package/dist/ParamEditor-DenKjvKu.cjs +1 -0
  5. package/dist/ParamEditor-PyOqHzzw.js +750 -0
  6. package/dist/ReportBatchPanel-8EFtMrKk.js +351 -0
  7. package/dist/ReportBatchPanel-pQ6d0yqJ.cjs +1 -0
  8. package/dist/ReportLabelStudio-B_KF3Zc_.cjs +1 -0
  9. package/dist/ReportLabelStudio-HUeo2TsU.js +784 -0
  10. package/dist/ReportParamPanel-8xR85nz-.cjs +1 -0
  11. package/dist/{ReportParamPanel-Dgmqro1Y.js → ReportParamPanel-DA-YpkvC.js} +342 -307
  12. package/dist/ReportPreview-CyUXJSVX.cjs +6 -0
  13. package/dist/ReportPreview-_wTJnsG1.js +7120 -0
  14. package/dist/ReportTemplateLibrary-CjArKxRG.cjs +1 -0
  15. package/dist/ReportTemplateLibrary-DH8jl9IF.js +312 -0
  16. package/dist/RuleEditor-Bmj98oC4.cjs +1 -0
  17. package/dist/RuleEditor-GDydlEHz.js +2354 -0
  18. package/dist/TemplateOutlinePanel-B554_qk1.cjs +1 -0
  19. package/dist/TemplateOutlinePanel-DjPqzU9h.js +97 -0
  20. package/dist/TemplateReusePanel-D0628OYc.cjs +1 -0
  21. package/dist/TemplateReusePanel-DtYbCN7U.js +389 -0
  22. package/dist/TemplateReviewPanel-CSwvCz3f.cjs +1 -0
  23. package/dist/TemplateReviewPanel-D_FR4ISq.js +602 -0
  24. package/dist/artifact-integrity.json +94 -94
  25. package/dist/assets-B4AJIOTB.cjs +1 -0
  26. package/dist/assets-D0FbszhB.js +137 -0
  27. package/dist/{auto-CTIJ6PnR.js → auto-BksreoKc.js} +5 -5
  28. package/dist/auto-C3mGqzJ8.cjs +1 -0
  29. package/dist/capabilities-CTwlcl8q.cjs +1 -0
  30. package/dist/capabilities-lqDEZSq5.js +121 -0
  31. package/dist/data-bar-2NLRzOCQ.cjs +1 -0
  32. package/dist/{data-bar-IkI6VvMQ.js → data-bar-BnGtnJ82.js} +1 -1
  33. package/dist/designer-BNf7NWd6.js +7589 -0
  34. package/dist/designer-DWnZZ_ej.cjs +2 -0
  35. package/dist/designer.cjs +1 -1
  36. package/dist/designer.d.cts +144 -4
  37. package/dist/designer.d.ts +144 -4
  38. package/dist/designer.js +6 -6
  39. package/dist/diagnostic-collector-1sqd7DQP.js +355 -0
  40. package/dist/diagnostic-collector-D3rlvxm3.cjs +1 -0
  41. package/dist/{dom-JWrchIre.js → dom-C90cTM6Y.js} +4 -4
  42. package/dist/dom-CxOkm_Sy.cjs +1 -0
  43. package/dist/{encoding-BefcaHdp.cjs → encoding-CkziAnZI.cjs} +1 -1
  44. package/dist/{encoding-CL6rXEkR.js → encoding-DSc9zv2F.js} +2 -2
  45. package/dist/{font-loader-Ga51c2VC.cjs → font-loader-D-znWNWS.cjs} +1 -1
  46. package/dist/{font-loader-BT5baV-o.js → font-loader-i7lZbqH_.js} +1 -1
  47. package/dist/{grid-strokes-EoY66L2f.js → grid-strokes-BPiV1WHe.js} +1 -1
  48. package/dist/grid-strokes-DYf-6DMl.cjs +1 -0
  49. package/dist/index.cjs +5 -5
  50. package/dist/index.d.cts +46 -7
  51. package/dist/index.d.ts +46 -7
  52. package/dist/index.js +69 -68
  53. package/dist/{json-snapshot-OqkPyUk5.js → json-snapshot-BJWZNryO.js} +919 -791
  54. package/dist/json-snapshot-C7QZrRBf.cjs +2 -0
  55. package/dist/{pdf-aobetCsy.js → pdf-0_5XiTCx.js} +2499 -2492
  56. package/dist/{pdf-HiEeXe9H.cjs → pdf-DWuq6uxx.cjs} +31 -31
  57. package/dist/pdf.cjs +1 -1
  58. package/dist/pdf.d.cts +18 -0
  59. package/dist/pdf.d.ts +18 -0
  60. package/dist/pdf.js +2 -2
  61. package/dist/{plugin-DeYYAL6F.js → plugin-B1ydqEmS.js} +1 -1
  62. package/dist/{plugin-BFANt-i8.cjs → plugin-BQBz2vLG.cjs} +1 -1
  63. package/dist/prefill-2p9wrpn9.cjs +1 -0
  64. package/dist/{prefill-Dk4C6S5R.js → prefill-Cuzh1wxf.js} +13 -13
  65. package/dist/prepared-CVbgO9KR.js +128 -0
  66. package/dist/prepared-DAwe8Il2.cjs +1 -0
  67. package/dist/protocol-BOri9qJL.js +105 -0
  68. package/dist/protocol-DD5dHSz-.cjs +1 -0
  69. package/dist/record-bindings-CAyM5tGg.cjs +1 -0
  70. package/dist/{record-bindings-DatJZv_e.js → record-bindings-fhav-NLG.js} +1 -1
  71. package/dist/{region-binding-workflow-DjrXuR1q.js → region-binding-workflow-Cm4mqhih.js} +2 -2
  72. package/dist/{region-binding-workflow-l7NGfagJ.cjs → region-binding-workflow-DWCUgjZl.cjs} +1 -1
  73. package/dist/report-encoding-worker.cjs +1 -1
  74. package/dist/report-encoding-worker.js +1 -1
  75. package/dist/rich-text-layout-X9YOz1JD.cjs +3 -0
  76. package/dist/{rich-text-layout-Ciwa6D2o.js → rich-text-layout-YJHtCWQI.js} +1 -1
  77. package/dist/runtime-BpSAgOw1.js +201 -0
  78. package/dist/runtime-Cd2UTnwe.cjs +1 -0
  79. package/dist/sbom.cdx.json +1 -1
  80. package/dist/server/node.d.cts +55 -7
  81. package/dist/server/node.d.ts +55 -7
  82. package/dist/server-node.cjs +5 -5
  83. package/dist/server-node.js +2710 -2418
  84. package/dist/server.cjs +1 -1
  85. package/dist/server.d.cts +47 -12
  86. package/dist/server.d.ts +47 -12
  87. package/dist/server.js +8 -8
  88. package/dist/style.css +1 -1
  89. package/dist/{template-catalog-CoT7jm_6.cjs → template-catalog--yBX169M.cjs} +1 -1
  90. package/dist/{template-catalog--cjxzgH7.js → template-catalog-Bu7s7ReF.js} +3 -3
  91. package/dist/template-fragments-5EzVn7bm.cjs +1 -0
  92. package/dist/{template-fragments-CPpGpQoz.js → template-fragments-Di2vDFnx.js} +2 -2
  93. package/dist/{template-registry-O0hNIOfB.js → template-registry-BCBF2b8j.js} +10 -10
  94. package/dist/template-registry-Bnh5aEYf.cjs +1 -0
  95. package/dist/textwrap-BPFxhpOw.cjs +4 -0
  96. package/dist/textwrap-CmVkhMhx.js +111 -0
  97. package/dist/vue/async.d.cts +104 -18
  98. package/dist/vue/async.d.ts +104 -18
  99. package/dist/vue/index.d.cts +134 -28
  100. package/dist/vue/index.d.ts +134 -28
  101. package/dist/vue-async.cjs +1 -1
  102. package/dist/vue-async.js +3 -3
  103. package/dist/vue.cjs +1 -1
  104. package/dist/vue.js +192 -162
  105. package/dist/{workbook-session-C9ZmCBwY.js → workbook-session-B6P_-5a4.js} +2 -2
  106. package/dist/{workbook-session-C6-SrnCT.cjs → workbook-session-BnPK3T58.cjs} +1 -1
  107. package/dist/worker.cjs +1 -1
  108. package/dist/worker.d.cts +55 -7
  109. package/dist/worker.d.ts +55 -7
  110. package/dist/worker.js +4 -4
  111. package/dist/xlsx.cjs +4 -4
  112. package/dist/xlsx.d.cts +18 -1
  113. package/dist/xlsx.d.ts +18 -1
  114. package/dist/xlsx.js +279 -272
  115. package/package.json +1 -1
  116. package/dist/ExcelBindingWizard-D4FLind-.js +0 -1485
  117. package/dist/ExcelBindingWizard-D4RS5Bpg.cjs +0 -1
  118. package/dist/ParamEditor-C-6C9rd2.cjs +0 -1
  119. package/dist/ParamEditor-CASZt-Ma.js +0 -732
  120. package/dist/ReportBatchPanel-Bq7t8a5r.js +0 -350
  121. package/dist/ReportBatchPanel-YVj5IO5y.cjs +0 -1
  122. package/dist/ReportLabelStudio-Cqhita1b.cjs +0 -1
  123. package/dist/ReportLabelStudio-Dj7GXhuv.js +0 -783
  124. package/dist/ReportParamPanel-DZbFVmDL.cjs +0 -1
  125. package/dist/ReportPreview-DeWzG8jQ.js +0 -6257
  126. package/dist/ReportPreview-FFIryrIr.cjs +0 -6
  127. package/dist/ReportTemplateLibrary-BaWodmpm.cjs +0 -1
  128. package/dist/ReportTemplateLibrary-DdAAAD2I.js +0 -311
  129. package/dist/RuleEditor-D2UwQGF6.js +0 -2341
  130. package/dist/RuleEditor-DcT9xI1v.cjs +0 -1
  131. package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +0 -1
  132. package/dist/TemplateOutlinePanel-DrT7XN0m.js +0 -96
  133. package/dist/TemplateReusePanel-4eejkNqi.js +0 -388
  134. package/dist/TemplateReusePanel-DZMyiX5I.cjs +0 -1
  135. package/dist/TemplateReviewPanel-BIhNLeNw.js +0 -592
  136. package/dist/TemplateReviewPanel-DnYImiXu.cjs +0 -1
  137. package/dist/assets-D2gHc4Mz.cjs +0 -1
  138. package/dist/assets-T_gDeFaz.js +0 -132
  139. package/dist/auto-4pK9HePf.cjs +0 -1
  140. package/dist/capabilities-DiBj4Qgl.cjs +0 -1
  141. package/dist/capabilities-pg7j7VLT.js +0 -106
  142. package/dist/data-bar-CeZuFmYl.cjs +0 -1
  143. package/dist/designer-DhrE7jzw.js +0 -7169
  144. package/dist/designer-IAZu6kBX.cjs +0 -2
  145. package/dist/dom-ChE5D-L-.cjs +0 -1
  146. package/dist/grid-strokes-Be24LGuV.cjs +0 -1
  147. package/dist/json-snapshot-1tvQNzQE.cjs +0 -2
  148. package/dist/prefill-DsUD5OoK.cjs +0 -1
  149. package/dist/prepared-DCIxhKFo.js +0 -94
  150. package/dist/prepared-Dv-XM3i1.cjs +0 -1
  151. package/dist/progress-ByiOxUD3.js +0 -250
  152. package/dist/progress-WomPRP3B.cjs +0 -1
  153. package/dist/protocol-B9YgfQ_d.cjs +0 -1
  154. package/dist/protocol-DxeUKGYG.js +0 -90
  155. package/dist/record-bindings-MBxbeBsi.cjs +0 -1
  156. package/dist/rich-text-layout-DK7A_a5r.cjs +0 -3
  157. package/dist/runtime-75Y5Oq5B.js +0 -171
  158. package/dist/runtime-DKlGd_D4.cjs +0 -1
  159. package/dist/template-fragments-GVjpew_q.cjs +0 -1
  160. package/dist/template-registry-DI59PXVK.cjs +0 -1
  161. package/dist/textwrap-BIjtEWmq.js +0 -110
  162. package/dist/textwrap-Cy7o1hIR.cjs +0 -4
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("@agile-team/mach-report"),F=require("./designer-IAZu6kBX.cjs"),K=require("./_plugin-vue_export-helper-BLmdZLlg.cjs");function H(o){return!o||typeof o.id!="string"||!o.id.trim()||typeof o.name!="string"||!o.name.trim()||[o.draftRevision,o.publishedRevision].some(m=>m!==void 0&&(typeof m!="string"||!m.trim()))?!1:o.tags===void 0||Array.isArray(o.tags)&&o.tags.length<=20&&o.tags.every(m=>typeof m=="string")}function O(o){if(!o||!Array.isArray(o.items)||o.items.length>100||o.next!==void 0&&(typeof o.next!="string"||!o.next||o.next.length>4096))throw new Error("invalid");const m=new Set;for(const i of o.items){if(!H(i)||m.has(i.id))throw new Error("invalid");m.add(i.id)}if(o.categories!==void 0&&(!Array.isArray(o.categories)||o.categories.length>1e3||o.categories.some(i=>!i||typeof i.id!="string"||!i.id||typeof i.label!="string")))throw new Error("invalid")}function j(o,m){const i=e.computed(()=>({...F.TEMPLATE_LIBRARY_MESSAGES,...o.messages})),T=e.ref(""),n=e.ref(""),D=e.shallowRef([]),S=e.shallowRef([]),d=e.ref([void 0]),p=e.ref(),N=e.ref(!1),h=e.ref(!1),f=e.ref(""),s=e.shallowRef(),w=e.ref(""),V=e.ref(""),y=e.ref("search"),k=e.ref(""),E=e.shallowRef();let v=0,g=0,C,x,R;const A=e.computed(()=>({search:i.value.retrySearch,open:i.value.retryOpen,copy:i.value.retryCopy})[y.value]);function _(){f.value="",E.value=void 0}function l(t,a){if(O(t),t.next!==void 0&&(t.next===a.cursor||!a.previous&&d.value.includes(t.next)))throw new Error(i.value.stale);D.value=t.items.map(u=>({...u,...u.tags?{tags:[...u.tags]}:{}})),p.value=t.next,a.previous?d.value=d.value.slice(0,-1):a.more&&(d.value=[...d.value,a.cursor]),t.categories&&(S.value=t.categories)}function r(t){return t instanceof Error?t.message==="invalid"?i.value.invalid:t.message:String(t)}async function b(t){clearTimeout(R),C?.abort();const a=++v,u=new AbortController;C=u,N.value=!0,_(),!t.more&&!t.previous&&(D.value=[],p.value=void 0,d.value=[void 0]);try{const c=await o.provider.search({query:t.query,category:t.category,cursor:t.cursor,limit:30,signal:u.signal});if(a!==v)return;l(c,t)}catch(c){a===v&&!u.signal.aborted&&(f.value=r(c),y.value="search",E.value=()=>b(t))}finally{a===v&&(N.value=!1)}}async function q(t=!1,a=!1){t&&!p.value||a&&d.value.length<2||await b({query:T.value.trim(),category:n.value||void 0,cursor:a?d.value.at(-2):t?p.value:void 0,more:t,previous:a})}async function M(t,a,u){if(t.savedDocument)return B.parseReportTemplate(t.savedDocument);if(t.candidate)return B.parseReportTemplate(t.candidate);const c=await o.provider.get(t.entry.id,{signal:a,mode:t.mode});if(u!==g)return;if(!c||c.id!==t.entry.id)throw new Error(i.value.missing);const $=B.parseReportTemplate(c);if(t.mode==="published"&&t.entry.publishedRevision!==$.revision)throw new Error(i.value.publicationChanged);return t.copy?(t.candidate=B.cloneReportTemplate($,t.identity),B.parseReportTemplate(t.candidate)):$}async function L(t){if(h.value)return;const a=++g,u=new AbortController;x=u,h.value=!0,_(),k.value=(t.copy&&!t.savedDocument?i.value.creatingTarget:i.value.openingTarget).replace("{name}",t.savedDocument?.name??t.entry.name);try{let c=await M(t,u.signal,a);if(!c||a!==g)return;if(t.copy&&!t.savedDocument){if(!t.create||(c=B.parseReportTemplate(await t.create(c,{signal:u.signal})),a!==g))return;if(c.id!==t.identity.id)throw new Error(i.value.invalid);t.savedDocument=B.parseReportTemplate(c),s.value=void 0}m(c,{mode:t.mode}),t.copy&&q()}catch(c){a===g&&!u.signal.aborted&&(f.value=r(c),y.value=t.copy&&!t.savedDocument?"copy":"open",E.value=()=>L(t))}finally{a===g&&(h.value=!1,k.value="")}}async function P(t,a=!1,u="edit"){await L({entry:{...t},copy:a,mode:a?"edit":u,identity:{id:w.value.trim(),name:V.value.trim()},create:o.create})}function I(){v++,C?.abort(),D.value=[],p.value=void 0,d.value=[void 0],N.value=!0,_(),clearTimeout(R),R=setTimeout(()=>{q()},180)}function U(){g++,x?.abort(),h.value=!1,k.value="",s.value=void 0,q()}return e.watch([T,n],I),e.watch([()=>o.provider,()=>o.create],U),e.watch([w,V],()=>{y.value==="copy"&&_()}),e.onBeforeUnmount(()=>{v++,g++,clearTimeout(R),C?.abort(),x?.abort()}),q(),{m:i,cursors:d,query:T,category:n,entries:D,categories:S,next:p,loading:N,busy:h,error:f,errorKind:y,retryLabel:A,loadingTarget:k,copying:s,newId:w,newName:V,search:q,load:P,retry:async()=>{!h.value&&!N.value&&await E.value?.()},beginCopy:t=>{_(),s.value=t,w.value="",V.value=t.name},cancelCopy:()=>{h.value||(s.value=void 0,_())}}}const z=["aria-label","aria-busy"],G=["disabled"],Y={class:"mr-library-search"},J=["placeholder","aria-label"],Q=["aria-label"],W={value:""},X=["value"],Z={key:0,class:"mr-library-progress",role:"status"},ee={key:1,role:"alert",class:"mr-library-error"},te=["disabled"],re=["disabled"],oe=["disabled"],ne=["disabled"],le=["disabled"],ae={key:3},ie={class:"mr-library-info"},se=["title","disabled","onClick"],ue=["title"],ce={key:0},de={key:1},fe={key:2,class:"mr-library-tags"},me=["title"],ve={class:"mr-library-actions"},pe=["disabled","onClick"],ye=["disabled","onClick"],ge=["disabled","onClick"],be={key:4,class:"mr-library-empty",role:"status"},he={key:0},ke=["disabled"],Ee=["disabled"],_e=e.defineComponent({__name:"ReportTemplateLibrary",props:{provider:{},messages:{},create:{type:Function}},emits:["open"],setup(o,{emit:m}){const i=o,T=m,{m:n,cursors:D,query:S,category:d,entries:p,categories:N,next:h,loading:f,busy:s,error:w,copying:V,newId:y,newName:k,search:E,load:v,beginCopy:g,cancelCopy:C,retry:x,retryLabel:R,loadingTarget:A}=j(i,(_,l)=>T("open",_,l));return(_,l)=>(e.openBlock(),e.createElementBlock("section",{class:"mr-library","aria-label":e.unref(n).title,"aria-busy":e.unref(f)||e.unref(s)},[e.createElementVNode("header",null,[e.createElementVNode("div",null,[e.createElementVNode("h2",null,e.toDisplayString(e.unref(n).title),1),e.createElementVNode("p",null,e.toDisplayString(e.unref(n).subtitle),1)]),e.createElementVNode("button",{type:"button",disabled:e.unref(f)||e.unref(s),onClick:l[0]||(l[0]=r=>e.unref(E)())},e.toDisplayString(e.unref(n).refresh),9,G)]),e.createElementVNode("div",Y,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[1]||(l[1]=r=>e.isRef(S)?S.value=r:null),type:"search",placeholder:e.unref(n).search,"aria-label":e.unref(n).search,onKeydown:l[2]||(l[2]=e.withKeys(r=>e.unref(E)(),["enter"]))},null,40,J),[[e.vModelText,e.unref(S)]]),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":l[3]||(l[3]=r=>e.isRef(d)?d.value=r:null),"aria-label":e.unref(n).all},[e.createElementVNode("option",W,e.toDisplayString(e.unref(n).all),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),r=>(e.openBlock(),e.createElementBlock("option",{key:r.id,value:r.id},e.toDisplayString(r.label)+e.toDisplayString(r.count===void 0?"":` (${r.count})`),9,X))),128))],8,Q),[[e.vModelSelect,e.unref(d)]])]),e.unref(A)?(e.openBlock(),e.createElementBlock("div",Z,e.toDisplayString(e.unref(A)),1)):e.createCommentVNode("",!0),e.unref(w)?(e.openBlock(),e.createElementBlock("div",ee,[e.createTextVNode(e.toDisplayString(e.unref(w))+" ",1),e.createElementVNode("button",{type:"button",disabled:e.unref(f)||e.unref(s),onClick:l[4]||(l[4]=r=>e.unref(x)())},e.toDisplayString(e.unref(R)),9,te)])):e.createCommentVNode("",!0),e.unref(V)?(e.openBlock(),e.createElementBlock("form",{key:2,class:"mr-library-copy",onSubmit:l[8]||(l[8]=e.withModifiers(r=>e.unref(v)(e.unref(V),!0),["prevent"]))},[e.createElementVNode("strong",null,e.toDisplayString(e.unref(n).copyTitle)+" · "+e.toDisplayString(e.unref(V).name),1),e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(e.unref(n).newId),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[5]||(l[5]=r=>e.isRef(y)?y.value=r:null),required:"",maxlength:"256",disabled:e.unref(s)},null,8,re),[[e.vModelText,e.unref(y)]])]),e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(e.unref(n).newName),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[6]||(l[6]=r=>e.isRef(k)?k.value=r:null),required:"",maxlength:"256",disabled:e.unref(s)},null,8,oe),[[e.vModelText,e.unref(k)]])]),e.createElementVNode("div",null,[e.createElementVNode("button",{type:"button",disabled:e.unref(s),onClick:l[7]||(l[7]=r=>e.unref(C)())},e.toDisplayString(e.unref(n).cancel),9,ne),e.createElementVNode("button",{type:"submit",disabled:e.unref(s)||!e.unref(y).trim()||!e.unref(k).trim()},e.toDisplayString(e.unref(s)?e.unref(n).loading:e.unref(n).create),9,le)])],32)):e.createCommentVNode("",!0),e.unref(p).length?(e.openBlock(),e.createElementBlock("ul",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),r=>(e.openBlock(),e.createElementBlock("li",{key:r.id},[e.createElementVNode("div",ie,[e.createElementVNode("button",{class:"mr-library-name",title:r.name,type:"button",disabled:e.unref(s),onClick:b=>e.unref(v)(r)},e.toDisplayString(r.name),9,se),e.createElementVNode("small",{title:r.id},[e.createTextVNode(e.toDisplayString(r.id),1),r.revision?(e.openBlock(),e.createElementBlock("span",ce," · "+e.toDisplayString(e.unref(n).revision)+" "+e.toDisplayString(r.revision),1)):e.createCommentVNode("",!0)],8,ue),r.draftRevision||r.publishedRevision?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["mr-library-state",{"mr-library-state--draft":r.draftRevision}])},e.toDisplayString(r.draftRevision?r.publishedRevision?e.unref(n).draftPending:e.unref(n).draft:e.unref(n).published),3)):e.createCommentVNode("",!0),r.description?(e.openBlock(),e.createElementBlock("p",de,e.toDisplayString(r.description),1)):e.createCommentVNode("",!0),r.tags?.length?(e.openBlock(),e.createElementBlock("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.tags,b=>(e.openBlock(),e.createElementBlock("span",{key:b,title:b},e.toDisplayString(b),9,me))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ve,[o.create?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:e.unref(s),onClick:b=>e.unref(g)(r)},e.toDisplayString(e.unref(n).copy),9,pe)):e.createCommentVNode("",!0),r.publishedRevision?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:e.unref(s),onClick:b=>e.unref(v)(r,!1,"published")},e.toDisplayString(e.unref(n).viewPublished),9,ye)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",disabled:e.unref(s),onClick:b=>e.unref(v)(r)},e.toDisplayString(r.draftRevision?e.unref(n).continueDraft:e.unref(n).open),9,ge)])]))),128))])):(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("strong",null,e.toDisplayString(e.unref(f)?e.unref(n).loading:e.unref(n).empty),1),e.unref(f)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",he,e.toDisplayString(e.unref(n).emptyHint),1))])),e.createElementVNode("footer",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(D).length)+" "+e.toDisplayString(e.unref(n).page)+" · "+e.toDisplayString(e.unref(p).length)+" "+e.toDisplayString(e.unref(n).count),1),e.createElementVNode("div",null,[e.unref(D).length>1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:e.unref(f)||e.unref(s),onClick:l[9]||(l[9]=r=>e.unref(E)(!1,!0))},e.toDisplayString(e.unref(n).previous),9,ke)):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:e.unref(f)||e.unref(s),onClick:l[10]||(l[10]=r=>e.unref(E)(!0))},e.toDisplayString(e.unref(f)?e.unref(n).loading:e.unref(n).loadMore),9,Ee)):e.createCommentVNode("",!0)])])],8,z))}}),Ve=K._export_sfc(_e,[["__scopeId","data-v-9513aca4"]]);exports.default=Ve;
@@ -1,311 +0,0 @@
1
- import { computed as W, ref as _, shallowRef as K, watch as O, onBeforeUnmount as oe, defineComponent as re, openBlock as u, createElementBlock as c, unref as e, createElementVNode as i, toDisplayString as l, withDirectives as F, withKeys as ae, isRef as z, vModelText as Y, Fragment as j, renderList as J, vModelSelect as le, createCommentVNode as g, createTextVNode as G, withModifiers as ie, normalizeClass as se } from "vue";
2
- import { parseReportTemplate as M, cloneReportTemplate as ne } from "@agile-team/mach-report";
3
- import { a as de } from "./designer-DhrE7jzw.js";
4
- import { _ as ue } from "./_plugin-vue_export-helper-8SL1F89S.js";
5
- function ce(r) {
6
- return !r || typeof r.id != "string" || !r.id.trim() || typeof r.name != "string" || !r.name.trim() || [r.draftRevision, r.publishedRevision].some((p) => p !== void 0 && (typeof p != "string" || !p.trim())) ? !1 : r.tags === void 0 || Array.isArray(r.tags) && r.tags.length <= 20 && r.tags.every((p) => typeof p == "string");
7
- }
8
- function ve(r) {
9
- if (!r || !Array.isArray(r.items) || r.items.length > 100 || r.next !== void 0 && (typeof r.next != "string" || !r.next || r.next.length > 4096)) throw new Error("invalid");
10
- const p = /* @__PURE__ */ new Set();
11
- for (const d of r.items) {
12
- if (!ce(d) || p.has(d.id)) throw new Error("invalid");
13
- p.add(d.id);
14
- }
15
- if (r.categories !== void 0 && (!Array.isArray(r.categories) || r.categories.length > 1e3 || r.categories.some((d) => !d || typeof d.id != "string" || !d.id || typeof d.label != "string"))) throw new Error("invalid");
16
- }
17
- function ye(r, p) {
18
- const d = W(() => ({ ...de, ...r.messages })), N = _(""), a = _(""), D = K([]), L = K([]), f = _([void 0]), w = _(), S = _(!1), T = _(!1), m = _(""), v = K(), q = _(""), $ = _(""), k = _("search"), x = _(""), E = K();
19
- let h = 0, C = 0, P, I, V;
20
- const B = W(() => ({ search: d.value.retrySearch, open: d.value.retryOpen, copy: d.value.retryCopy })[k.value]);
21
- function A() {
22
- m.value = "", E.value = void 0;
23
- }
24
- function s(t, n) {
25
- if (ve(t), t.next !== void 0 && (t.next === n.cursor || !n.previous && f.value.includes(t.next))) throw new Error(d.value.stale);
26
- D.value = t.items.map((y) => ({ ...y, ...y.tags ? { tags: [...y.tags] } : {} })), w.value = t.next, n.previous ? f.value = f.value.slice(0, -1) : n.more && (f.value = [...f.value, n.cursor]), t.categories && (L.value = t.categories);
27
- }
28
- function o(t) {
29
- return t instanceof Error ? t.message === "invalid" ? d.value.invalid : t.message : String(t);
30
- }
31
- async function R(t) {
32
- clearTimeout(V), P?.abort();
33
- const n = ++h, y = new AbortController();
34
- P = y, S.value = !0, A(), !t.more && !t.previous && (D.value = [], w.value = void 0, f.value = [void 0]);
35
- try {
36
- const b = await r.provider.search({ query: t.query, category: t.category, cursor: t.cursor, limit: 30, signal: y.signal });
37
- if (n !== h) return;
38
- s(b, t);
39
- } catch (b) {
40
- n === h && !y.signal.aborted && (m.value = o(b), k.value = "search", E.value = () => R(t));
41
- } finally {
42
- n === h && (S.value = !1);
43
- }
44
- }
45
- async function U(t = !1, n = !1) {
46
- t && !w.value || n && f.value.length < 2 || await R({ query: N.value.trim(), category: a.value || void 0, cursor: n ? f.value.at(-2) : t ? w.value : void 0, more: t, previous: n });
47
- }
48
- async function X(t, n, y) {
49
- if (t.savedDocument) return M(t.savedDocument);
50
- if (t.candidate) return M(t.candidate);
51
- const b = await r.provider.get(t.entry.id, { signal: n, mode: t.mode });
52
- if (y !== C) return;
53
- if (!b || b.id !== t.entry.id) throw new Error(d.value.missing);
54
- const H = M(b);
55
- if (t.mode === "published" && t.entry.publishedRevision !== H.revision) throw new Error(d.value.publicationChanged);
56
- return t.copy ? (t.candidate = ne(H, t.identity), M(t.candidate)) : H;
57
- }
58
- async function Q(t) {
59
- if (T.value) return;
60
- const n = ++C, y = new AbortController();
61
- I = y, T.value = !0, A(), x.value = (t.copy && !t.savedDocument ? d.value.creatingTarget : d.value.openingTarget).replace("{name}", t.savedDocument?.name ?? t.entry.name);
62
- try {
63
- let b = await X(t, y.signal, n);
64
- if (!b || n !== C) return;
65
- if (t.copy && !t.savedDocument) {
66
- if (!t.create || (b = M(await t.create(b, { signal: y.signal })), n !== C)) return;
67
- if (b.id !== t.identity.id) throw new Error(d.value.invalid);
68
- t.savedDocument = M(b), v.value = void 0;
69
- }
70
- p(b, { mode: t.mode }), t.copy && U();
71
- } catch (b) {
72
- n === C && !y.signal.aborted && (m.value = o(b), k.value = t.copy && !t.savedDocument ? "copy" : "open", E.value = () => Q(t));
73
- } finally {
74
- n === C && (T.value = !1, x.value = "");
75
- }
76
- }
77
- async function Z(t, n = !1, y = "edit") {
78
- await Q({ entry: { ...t }, copy: n, mode: n ? "edit" : y, identity: { id: q.value.trim(), name: $.value.trim() }, create: r.create });
79
- }
80
- function ee() {
81
- h++, P?.abort(), D.value = [], w.value = void 0, f.value = [void 0], S.value = !0, A(), clearTimeout(V), V = setTimeout(() => {
82
- U();
83
- }, 180);
84
- }
85
- function te() {
86
- C++, I?.abort(), T.value = !1, x.value = "", v.value = void 0, U();
87
- }
88
- return O([N, a], ee), O([() => r.provider, () => r.create], te), O([q, $], () => {
89
- k.value === "copy" && A();
90
- }), oe(() => {
91
- h++, C++, clearTimeout(V), P?.abort(), I?.abort();
92
- }), U(), {
93
- m: d,
94
- cursors: f,
95
- query: N,
96
- category: a,
97
- entries: D,
98
- categories: L,
99
- next: w,
100
- loading: S,
101
- busy: T,
102
- error: m,
103
- errorKind: k,
104
- retryLabel: B,
105
- loadingTarget: x,
106
- copying: v,
107
- newId: q,
108
- newName: $,
109
- search: U,
110
- load: Z,
111
- retry: async () => {
112
- !T.value && !S.value && await E.value?.();
113
- },
114
- beginCopy: (t) => {
115
- A(), v.value = t, q.value = "", $.value = t.name;
116
- },
117
- cancelCopy: () => {
118
- T.value || (v.value = void 0, A());
119
- }
120
- };
121
- }
122
- const be = ["aria-label", "aria-busy"], fe = ["disabled"], me = { class: "mr-library-search" }, pe = ["placeholder", "aria-label"], ge = ["aria-label"], he = { value: "" }, _e = ["value"], we = {
123
- key: 0,
124
- class: "mr-library-progress",
125
- role: "status"
126
- }, ke = {
127
- key: 1,
128
- role: "alert",
129
- class: "mr-library-error"
130
- }, Ce = ["disabled"], Re = ["disabled"], Te = ["disabled"], xe = ["disabled"], Ee = ["disabled"], Ae = { key: 3 }, $e = { class: "mr-library-info" }, De = ["title", "disabled", "onClick"], Se = ["title"], qe = { key: 0 }, Le = { key: 1 }, Pe = {
131
- key: 2,
132
- class: "mr-library-tags"
133
- }, Ve = ["title"], Me = { class: "mr-library-actions" }, Ne = ["disabled", "onClick"], Ie = ["disabled", "onClick"], Ue = ["disabled", "onClick"], Be = {
134
- key: 4,
135
- class: "mr-library-empty",
136
- role: "status"
137
- }, Ke = { key: 0 }, Fe = ["disabled"], ze = ["disabled"], Ge = /* @__PURE__ */ re({
138
- __name: "ReportTemplateLibrary",
139
- props: {
140
- provider: {},
141
- messages: {},
142
- create: { type: Function }
143
- },
144
- emits: ["open"],
145
- setup(r, { emit: p }) {
146
- const d = r, N = p, { m: a, cursors: D, query: L, category: f, entries: w, categories: S, next: T, loading: m, busy: v, error: q, copying: $, newId: k, newName: x, search: E, load: h, beginCopy: C, cancelCopy: P, retry: I, retryLabel: V, loadingTarget: B } = ye(d, (A, s) => N("open", A, s));
147
- return (A, s) => (u(), c("section", {
148
- class: "mr-library",
149
- "aria-label": e(a).title,
150
- "aria-busy": e(m) || e(v)
151
- }, [
152
- i("header", null, [
153
- i("div", null, [
154
- i("h2", null, l(e(a).title), 1),
155
- i("p", null, l(e(a).subtitle), 1)
156
- ]),
157
- i("button", {
158
- type: "button",
159
- disabled: e(m) || e(v),
160
- onClick: s[0] || (s[0] = (o) => e(E)())
161
- }, l(e(a).refresh), 9, fe)
162
- ]),
163
- i("div", me, [
164
- F(i("input", {
165
- "onUpdate:modelValue": s[1] || (s[1] = (o) => z(L) ? L.value = o : null),
166
- type: "search",
167
- placeholder: e(a).search,
168
- "aria-label": e(a).search,
169
- onKeydown: s[2] || (s[2] = ae((o) => e(E)(), ["enter"]))
170
- }, null, 40, pe), [
171
- [Y, e(L)]
172
- ]),
173
- F(i("select", {
174
- "onUpdate:modelValue": s[3] || (s[3] = (o) => z(f) ? f.value = o : null),
175
- "aria-label": e(a).all
176
- }, [
177
- i("option", he, l(e(a).all), 1),
178
- (u(!0), c(j, null, J(e(S), (o) => (u(), c("option", {
179
- key: o.id,
180
- value: o.id
181
- }, l(o.label) + l(o.count === void 0 ? "" : ` (${o.count})`), 9, _e))), 128))
182
- ], 8, ge), [
183
- [le, e(f)]
184
- ])
185
- ]),
186
- e(B) ? (u(), c("div", we, l(e(B)), 1)) : g("", !0),
187
- e(q) ? (u(), c("div", ke, [
188
- G(l(e(q)) + " ", 1),
189
- i("button", {
190
- type: "button",
191
- disabled: e(m) || e(v),
192
- onClick: s[4] || (s[4] = (o) => e(I)())
193
- }, l(e(V)), 9, Ce)
194
- ])) : g("", !0),
195
- e($) ? (u(), c("form", {
196
- key: 2,
197
- class: "mr-library-copy",
198
- onSubmit: s[8] || (s[8] = ie((o) => e(h)(e($), !0), ["prevent"]))
199
- }, [
200
- i("strong", null, l(e(a).copyTitle) + " · " + l(e($).name), 1),
201
- i("label", null, [
202
- G(l(e(a).newId), 1),
203
- F(i("input", {
204
- "onUpdate:modelValue": s[5] || (s[5] = (o) => z(k) ? k.value = o : null),
205
- required: "",
206
- maxlength: "256",
207
- disabled: e(v)
208
- }, null, 8, Re), [
209
- [Y, e(k)]
210
- ])
211
- ]),
212
- i("label", null, [
213
- G(l(e(a).newName), 1),
214
- F(i("input", {
215
- "onUpdate:modelValue": s[6] || (s[6] = (o) => z(x) ? x.value = o : null),
216
- required: "",
217
- maxlength: "256",
218
- disabled: e(v)
219
- }, null, 8, Te), [
220
- [Y, e(x)]
221
- ])
222
- ]),
223
- i("div", null, [
224
- i("button", {
225
- type: "button",
226
- disabled: e(v),
227
- onClick: s[7] || (s[7] = (o) => e(P)())
228
- }, l(e(a).cancel), 9, xe),
229
- i("button", {
230
- type: "submit",
231
- disabled: e(v) || !e(k).trim() || !e(x).trim()
232
- }, l(e(v) ? e(a).loading : e(a).create), 9, Ee)
233
- ])
234
- ], 32)) : g("", !0),
235
- e(w).length ? (u(), c("ul", Ae, [
236
- (u(!0), c(j, null, J(e(w), (o) => (u(), c("li", {
237
- key: o.id
238
- }, [
239
- i("div", $e, [
240
- i("button", {
241
- class: "mr-library-name",
242
- title: o.name,
243
- type: "button",
244
- disabled: e(v),
245
- onClick: (R) => e(h)(o)
246
- }, l(o.name), 9, De),
247
- i("small", {
248
- title: o.id
249
- }, [
250
- G(l(o.id), 1),
251
- o.revision ? (u(), c("span", qe, " · " + l(e(a).revision) + " " + l(o.revision), 1)) : g("", !0)
252
- ], 8, Se),
253
- o.draftRevision || o.publishedRevision ? (u(), c("span", {
254
- key: 0,
255
- class: se(["mr-library-state", { "mr-library-state--draft": o.draftRevision }])
256
- }, l(o.draftRevision ? o.publishedRevision ? e(a).draftPending : e(a).draft : e(a).published), 3)) : g("", !0),
257
- o.description ? (u(), c("p", Le, l(o.description), 1)) : g("", !0),
258
- o.tags?.length ? (u(), c("div", Pe, [
259
- (u(!0), c(j, null, J(o.tags, (R) => (u(), c("span", {
260
- key: R,
261
- title: R
262
- }, l(R), 9, Ve))), 128))
263
- ])) : g("", !0)
264
- ]),
265
- i("div", Me, [
266
- r.create ? (u(), c("button", {
267
- key: 0,
268
- type: "button",
269
- disabled: e(v),
270
- onClick: (R) => e(C)(o)
271
- }, l(e(a).copy), 9, Ne)) : g("", !0),
272
- o.publishedRevision ? (u(), c("button", {
273
- key: 1,
274
- type: "button",
275
- disabled: e(v),
276
- onClick: (R) => e(h)(o, !1, "published")
277
- }, l(e(a).viewPublished), 9, Ie)) : g("", !0),
278
- i("button", {
279
- type: "button",
280
- disabled: e(v),
281
- onClick: (R) => e(h)(o)
282
- }, l(o.draftRevision ? e(a).continueDraft : e(a).open), 9, Ue)
283
- ])
284
- ]))), 128))
285
- ])) : (u(), c("div", Be, [
286
- i("strong", null, l(e(m) ? e(a).loading : e(a).empty), 1),
287
- e(m) ? g("", !0) : (u(), c("p", Ke, l(e(a).emptyHint), 1))
288
- ])),
289
- i("footer", null, [
290
- i("span", null, l(e(D).length) + " " + l(e(a).page) + " · " + l(e(w).length) + " " + l(e(a).count), 1),
291
- i("div", null, [
292
- e(D).length > 1 ? (u(), c("button", {
293
- key: 0,
294
- type: "button",
295
- disabled: e(m) || e(v),
296
- onClick: s[9] || (s[9] = (o) => e(E)(!1, !0))
297
- }, l(e(a).previous), 9, Fe)) : g("", !0),
298
- e(T) ? (u(), c("button", {
299
- key: 1,
300
- type: "button",
301
- disabled: e(m) || e(v),
302
- onClick: s[10] || (s[10] = (o) => e(E)(!0))
303
- }, l(e(m) ? e(a).loading : e(a).loadMore), 9, ze)) : g("", !0)
304
- ])
305
- ])
306
- ], 8, be));
307
- }
308
- }), Je = /* @__PURE__ */ ue(Ge, [["__scopeId", "data-v-9513aca4"]]);
309
- export {
310
- Je as default
311
- };