@qxs-bns/components 0.0.55 → 0.0.57

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 (193) hide show
  1. package/es/index.mjs +1 -1
  2. package/es/index.mjs.map +1 -1
  3. package/es/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.8.3_/node_modules/@iconify/vue/dist/iconify.mjs +2 -0
  4. package/es/node_modules/.pnpm/{@iconify_vue@5.0.0_vue@3.5.13_typescript@5.8.2_ → @iconify_vue@5.0.0_vue@3.5.18_typescript@5.8.3_}/node_modules/@iconify/vue/dist/iconify.mjs.map +1 -1
  5. package/es/package.json.mjs +1 -1
  6. package/es/src/components.mjs +1 -1
  7. package/es/src/data-chart/src/analyze.mjs +1 -1
  8. package/es/src/data-chart/src/analyze.mjs.map +1 -1
  9. package/es/src/data-chart/src/components/area.vue2.mjs +1 -1
  10. package/es/src/data-chart/src/components/area.vue2.mjs.map +1 -1
  11. package/es/src/data-chart/src/components/bar.vue.mjs +1 -1
  12. package/es/src/data-chart/src/components/bar.vue.mjs.map +1 -1
  13. package/es/src/data-chart/src/components/card.vue2.mjs +1 -1
  14. package/es/src/data-chart/src/components/card.vue2.mjs.map +1 -1
  15. package/es/src/data-chart/src/components/data-chart-card-bg-left.svg.mjs.map +1 -1
  16. package/es/src/data-chart/src/components/data-chart-card-bg-right.svg.mjs.map +1 -1
  17. package/es/src/data-chart/src/components/empty.svg.mjs.map +1 -1
  18. package/es/src/data-chart/src/components/empty.vue.mjs.map +1 -1
  19. package/es/src/data-chart/src/components/funnel.vue.mjs +1 -1
  20. package/es/src/data-chart/src/components/funnel.vue.mjs.map +1 -1
  21. package/es/src/data-chart/src/components/line.vue2.mjs +1 -1
  22. package/es/src/data-chart/src/components/line.vue2.mjs.map +1 -1
  23. package/es/src/data-chart/src/components/pie.vue.mjs +1 -1
  24. package/es/src/data-chart/src/components/pie.vue.mjs.map +1 -1
  25. package/es/src/data-chart/src/components/radar.vue.mjs +1 -1
  26. package/es/src/data-chart/src/components/radar.vue.mjs.map +1 -1
  27. package/es/src/data-chart/src/components/scatter-simple.vue.mjs +1 -1
  28. package/es/src/data-chart/src/components/scatter-simple.vue.mjs.map +1 -1
  29. package/es/src/data-chart/src/components/scatter.vue.mjs +1 -1
  30. package/es/src/data-chart/src/components/scatter.vue.mjs.map +1 -1
  31. package/es/src/data-chart/src/components/table.vue.mjs +1 -1
  32. package/es/src/data-chart/src/components/table.vue.mjs.map +1 -1
  33. package/es/src/data-chart/src/data-chart.vue.mjs +1 -1
  34. package/es/src/data-chart/src/data-chart.vue.mjs.map +1 -1
  35. package/es/src/data-chart/src/utils/config.mjs +1 -1
  36. package/es/src/data-chart/src/utils/config.mjs.map +1 -1
  37. package/es/src/data-chart/src/utils/mapData.mjs +2 -0
  38. package/es/src/data-chart/src/utils/mapData.mjs.map +1 -0
  39. package/es/src/data-chart/src/utils/safe-eval.mjs.map +1 -1
  40. package/es/src/data-chart/src/utils/useCharts.mjs +1 -1
  41. package/es/src/data-chart/src/utils/useCharts.mjs.map +1 -1
  42. package/es/src/defaults.mjs.map +1 -1
  43. package/es/src/file-upload/src/file-upload.vue.mjs +1 -1
  44. package/es/src/file-upload/src/file-upload.vue.mjs.map +1 -1
  45. package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs +1 -1
  46. package/es/src/fixed-action-bar/src/fixed-action-bar.vue.mjs.map +1 -1
  47. package/es/src/icon/index.mjs +1 -1
  48. package/es/src/icon/index.mjs.map +1 -1
  49. package/es/src/icon/src/icon.vue.mjs +1 -1
  50. package/es/src/icon/src/icon.vue.mjs.map +1 -1
  51. package/es/src/image-upload/src/image-upload.vue.mjs +1 -1
  52. package/es/src/image-upload/src/image-upload.vue.mjs.map +1 -1
  53. package/es/src/make-installer.mjs.map +1 -1
  54. package/es/src/photo-crop-tool/src/composables.mjs +1 -1
  55. package/es/src/photo-crop-tool/src/composables.mjs.map +1 -1
  56. package/es/src/photo-crop-tool/src/photo-crop-tool.vue.mjs +1 -1
  57. package/es/src/photo-crop-tool/src/photo-crop-tool.vue.mjs.map +1 -1
  58. package/es/src/subject-action/src/subject-action.vue.mjs +1 -1
  59. package/es/src/subject-action/src/subject-action.vue.mjs.map +1 -1
  60. package/es/src/subject-layout/src/subject-layout.vue.mjs.map +1 -1
  61. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs +1 -1
  62. package/es/src/subject-list/src/components/SubjectPageEnd.vue.mjs.map +1 -1
  63. package/es/src/subject-list/src/components/SubjectRichText.vue.mjs +1 -1
  64. package/es/src/subject-list/src/components/SubjectRichText.vue.mjs.map +1 -1
  65. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs +1 -1
  66. package/es/src/subject-list/src/components/subject-blank-fill.vue.mjs.map +1 -1
  67. package/es/src/subject-list/src/components/subject-scale.vue.mjs +1 -1
  68. package/es/src/subject-list/src/components/subject-scale.vue.mjs.map +1 -1
  69. package/es/src/subject-list/src/components/subject-single.vue.mjs +1 -1
  70. package/es/src/subject-list/src/components/subject-single.vue.mjs.map +1 -1
  71. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs +1 -1
  72. package/es/src/subject-list/src/components/subject-text-fill.vue.mjs.map +1 -1
  73. package/es/src/subject-list/src/subject-list.vue.mjs +1 -1
  74. package/es/src/subject-list/src/subject-list.vue.mjs.map +1 -1
  75. package/es/src/subject-type/src/subject-type.vue.mjs +1 -1
  76. package/es/src/subject-type/src/subject-type.vue.mjs.map +1 -1
  77. package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs +1 -1
  78. package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs.map +1 -1
  79. package/es/src/withInstall.mjs.map +1 -1
  80. package/lib/index.cjs +1 -1
  81. package/lib/index.cjs.map +1 -1
  82. package/lib/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.8.3_/node_modules/@iconify/vue/dist/iconify.cjs +2 -0
  83. package/lib/node_modules/.pnpm/{@iconify_vue@5.0.0_vue@3.5.13_typescript@5.8.2_ → @iconify_vue@5.0.0_vue@3.5.18_typescript@5.8.3_}/node_modules/@iconify/vue/dist/iconify.cjs.map +1 -1
  84. package/lib/package.json.cjs +1 -1
  85. package/lib/src/components.cjs +1 -1
  86. package/lib/src/data-chart/index.cjs.map +1 -1
  87. package/lib/src/data-chart/src/analyze.cjs +1 -1
  88. package/lib/src/data-chart/src/analyze.cjs.map +1 -1
  89. package/lib/src/data-chart/src/components/area.vue2.cjs +1 -1
  90. package/lib/src/data-chart/src/components/area.vue2.cjs.map +1 -1
  91. package/lib/src/data-chart/src/components/bar.vue.cjs +1 -1
  92. package/lib/src/data-chart/src/components/bar.vue.cjs.map +1 -1
  93. package/lib/src/data-chart/src/components/card.vue2.cjs +1 -1
  94. package/lib/src/data-chart/src/components/card.vue2.cjs.map +1 -1
  95. package/lib/src/data-chart/src/components/empty.vue.cjs.map +1 -1
  96. package/lib/src/data-chart/src/components/funnel.vue.cjs +1 -1
  97. package/lib/src/data-chart/src/components/funnel.vue.cjs.map +1 -1
  98. package/lib/src/data-chart/src/components/line.vue2.cjs +1 -1
  99. package/lib/src/data-chart/src/components/line.vue2.cjs.map +1 -1
  100. package/lib/src/data-chart/src/components/pie.vue.cjs +1 -1
  101. package/lib/src/data-chart/src/components/pie.vue.cjs.map +1 -1
  102. package/lib/src/data-chart/src/components/radar.vue.cjs +1 -1
  103. package/lib/src/data-chart/src/components/radar.vue.cjs.map +1 -1
  104. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs +1 -1
  105. package/lib/src/data-chart/src/components/scatter-simple.vue.cjs.map +1 -1
  106. package/lib/src/data-chart/src/components/scatter.vue.cjs +1 -1
  107. package/lib/src/data-chart/src/components/scatter.vue.cjs.map +1 -1
  108. package/lib/src/data-chart/src/components/table.vue.cjs +1 -1
  109. package/lib/src/data-chart/src/components/table.vue.cjs.map +1 -1
  110. package/lib/src/data-chart/src/data-chart.vue.cjs +1 -1
  111. package/lib/src/data-chart/src/data-chart.vue.cjs.map +1 -1
  112. package/lib/src/data-chart/src/utils/config.cjs +1 -1
  113. package/lib/src/data-chart/src/utils/config.cjs.map +1 -1
  114. package/lib/src/data-chart/src/utils/mapData.cjs +2 -0
  115. package/lib/src/data-chart/src/utils/mapData.cjs.map +1 -0
  116. package/lib/src/data-chart/src/utils/safe-eval.cjs.map +1 -1
  117. package/lib/src/data-chart/src/utils/useCharts.cjs +1 -1
  118. package/lib/src/data-chart/src/utils/useCharts.cjs.map +1 -1
  119. package/lib/src/defaults.cjs.map +1 -1
  120. package/lib/src/file-upload/index.cjs.map +1 -1
  121. package/lib/src/file-upload/src/file-upload.vue.cjs +1 -1
  122. package/lib/src/file-upload/src/file-upload.vue.cjs.map +1 -1
  123. package/lib/src/fixed-action-bar/index.cjs.map +1 -1
  124. package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs +1 -1
  125. package/lib/src/fixed-action-bar/src/fixed-action-bar.vue.cjs.map +1 -1
  126. package/lib/src/icon/index.cjs +1 -1
  127. package/lib/src/icon/index.cjs.map +1 -1
  128. package/lib/src/icon/src/icon.vue.cjs +1 -1
  129. package/lib/src/icon/src/icon.vue.cjs.map +1 -1
  130. package/lib/src/image-upload/index.cjs.map +1 -1
  131. package/lib/src/image-upload/src/image-upload.vue.cjs +1 -1
  132. package/lib/src/image-upload/src/image-upload.vue.cjs.map +1 -1
  133. package/lib/src/make-installer.cjs.map +1 -1
  134. package/lib/src/photo-crop-tool/index.cjs.map +1 -1
  135. package/lib/src/photo-crop-tool/src/composables.cjs +1 -1
  136. package/lib/src/photo-crop-tool/src/composables.cjs.map +1 -1
  137. package/lib/src/photo-crop-tool/src/photo-crop-tool.vue.cjs +1 -1
  138. package/lib/src/photo-crop-tool/src/photo-crop-tool.vue.cjs.map +1 -1
  139. package/lib/src/subject-action/index.cjs.map +1 -1
  140. package/lib/src/subject-action/src/subject-action.vue.cjs +1 -1
  141. package/lib/src/subject-action/src/subject-action.vue.cjs.map +1 -1
  142. package/lib/src/subject-layout/index.cjs.map +1 -1
  143. package/lib/src/subject-layout/src/subject-layout.vue.cjs.map +1 -1
  144. package/lib/src/subject-list/index.cjs.map +1 -1
  145. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs +1 -1
  146. package/lib/src/subject-list/src/components/SubjectPageEnd.vue.cjs.map +1 -1
  147. package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs +1 -1
  148. package/lib/src/subject-list/src/components/SubjectRichText.vue.cjs.map +1 -1
  149. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs +1 -1
  150. package/lib/src/subject-list/src/components/subject-blank-fill.vue.cjs.map +1 -1
  151. package/lib/src/subject-list/src/components/subject-scale.vue.cjs +1 -1
  152. package/lib/src/subject-list/src/components/subject-scale.vue.cjs.map +1 -1
  153. package/lib/src/subject-list/src/components/subject-single.vue.cjs +1 -1
  154. package/lib/src/subject-list/src/components/subject-single.vue.cjs.map +1 -1
  155. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs +1 -1
  156. package/lib/src/subject-list/src/components/subject-text-fill.vue.cjs.map +1 -1
  157. package/lib/src/subject-list/src/subject-list.vue.cjs +1 -1
  158. package/lib/src/subject-list/src/subject-list.vue.cjs.map +1 -1
  159. package/lib/src/subject-type/index.cjs.map +1 -1
  160. package/lib/src/subject-type/src/subject-type.vue.cjs +1 -1
  161. package/lib/src/subject-type/src/subject-type.vue.cjs.map +1 -1
  162. package/lib/src/tiny-mce-editor/index.cjs.map +1 -1
  163. package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs +1 -1
  164. package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs.map +1 -1
  165. package/lib/src/withInstall.cjs.map +1 -1
  166. package/package.json +3 -2
  167. package/types/src/components.d.ts +1 -1
  168. package/types/src/components.d.ts.map +1 -1
  169. package/types/src/data-chart/src/components/area.vue.d.ts.map +1 -1
  170. package/types/src/data-chart/src/utils/config.d.ts.map +1 -1
  171. package/types/src/data-chart/src/utils/mapData.d.ts +64 -0
  172. package/types/src/data-chart/src/utils/mapData.d.ts.map +1 -0
  173. package/types/src/data-chart/src/utils/types.d.ts +4 -0
  174. package/types/src/data-chart/src/utils/types.d.ts.map +1 -1
  175. package/types/src/data-chart/src/utils/useCharts.d.ts +3 -4
  176. package/types/src/data-chart/src/utils/useCharts.d.ts.map +1 -1
  177. package/types/src/fixed-action-bar/index.d.ts +1 -1
  178. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts +1 -1
  179. package/types/src/fixed-action-bar/src/fixed-action-bar.vue.d.ts.map +1 -1
  180. package/types/src/icon/index.d.ts +3 -3
  181. package/types/src/icon/index.d.ts.map +1 -1
  182. package/types/src/image-upload/index.d.ts +3 -2
  183. package/types/src/image-upload/index.d.ts.map +1 -1
  184. package/types/src/image-upload/src/image-upload.vue.d.ts +2 -80
  185. package/types/src/image-upload/src/image-upload.vue.d.ts.map +1 -1
  186. package/types/src/subject-layout/index.d.ts +5 -3
  187. package/types/src/subject-layout/index.d.ts.map +1 -1
  188. package/types/src/subject-layout/src/subject-layout.vue.d.ts +2 -24
  189. package/types/src/subject-layout/src/subject-layout.vue.d.ts.map +1 -1
  190. package/types/src/tiny-mce-editor/index.d.ts.map +1 -1
  191. package/types/tsconfig.tsbuildinfo +1 -1
  192. package/es/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.13_typescript@5.8.2_/node_modules/@iconify/vue/dist/iconify.mjs +0 -2
  193. package/lib/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.13_typescript@5.8.2_/node_modules/@iconify/vue/dist/iconify.cjs +0 -2
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as t,useAttrs as s,computed as n,watch as i,createElementBlock as a,openBlock as o,normalizeClass as l,unref as r,createElementVNode as d,Fragment as c,renderList as m,createBlock as u,createCommentVNode as p,mergeProps as x}from"vue";import{useNamespace as w}from"@qxs-bns/hooks";import{setGuid as v}from"@qxs-bns/utils";import y from"./components/subject-blank-fill.vue.mjs";import h from"./components/subject-scale.vue.mjs";import f from"./components/subject-single.vue.mjs";import E from"./components/subject-text-fill.vue.mjs";import T from"./components/SubjectPageEnd.vue.mjs";import S from"./components/SubjectRichText.vue.mjs";import{ElMessage as A}from"element-plus/es";import"element-plus/es/components/base/style/index";import"element-plus/es/components/message/style/index";const R={class:"subject-list-wrapper"};var g=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:g,emit:D}){const I=e,j=D,b=t([]),C=s();g({addSubject:M,currentList:b,uploadExcel:function(e){b.value=b.value.concat(e)},addExam:function(e){console.log(e,"items");let t=1;const s=[];e.forEach((e=>{const n={...e,customId:v(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map((e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect})))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};n.pageIndex>t&&(s.push({customId:v(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=n.pageIndex),s.push(n)})),b.value=b.value.concat(s)},setAnswerRelation:function(e,t,s){const n=b.value.find((e=>e.customId===t));if(n){const t=n.answers?.find((e=>e.customAnswerId===s));t&&(t.answerRelations=e)}}});const _=n((()=>{const e=b.value.filter((e=>"page_end"===e.answerType));return t=>{const s=e.findIndex((e=>e.customId===t));return-1!==s?s+1:0}}));function k(){return e=>{let t=0,s=0;return b.value.forEach((n=>{"page_end"!==n.answerType&&(t++,e===n.customId&&(s=t))})),s-1}}function M(e,t=null,s=null){const n={customId:v(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s};null!==t?b.value.splice(t+1,0,n):b.value.push(n)}function L(e,t){if("up"===t&&e>0){const[t]=b.value.splice(e,1);b.value.splice(e-1,0,t)}else if("down"===t&&e<b.value.length-1){const[t]=b.value.splice(e,1);b.value.splice(e+1,0,t)}}function P(e,t){b.value[e]={...b.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType}}function q(e){b.value.splice(e,1),A.success("删除成功")}function Q(e,t){j("setRelation",e,t)}i((()=>I.subjectList),(e=>{e&&(b.value=[...e])}),{immediate:!0});const O=w("subject-list");return(e,t)=>(o(),a("div",{class:l(r(O).e("list-exam"))},[d("div",R,[(o(!0),a(c,null,m(r(b),((t,s)=>(o(),a("div",{key:t.customId,class:"subject-item"},[["single","multiple","sort"].includes(t.answerType)?(o(),u(f,x({key:0,ref_for:!0},r(C),{"order-index":k()(t.customId),title:t.title,type:t.answerType,"exam-id":t.examId,"is-key":t.isKey,"is-save":!t.isRealCanDel,"custom-id":t.customId,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"least-answer-count":t.leastAnswerCount,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,"exam-expand":t.examExpand,"answer-check-type":t.answerCheckType,"exam-rich-text-content":t.examRichTextContent,"exam-answer-relation-type":t.examAnswerRelationType,onSetRelation:Q,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:(e,t)=>M(e,s,t)}),null,16,["order-index","title","type","exam-id","is-key","is-save","custom-id","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answer-check-type","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===t.answerType?(o(),u(h,x({key:1,ref_for:!0},r(C),{"order-index":k()(t.customId),title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"is-edit":t.isEdit||!1,"scale-question-list":t.scaleQuestionList,"show-action":!e.isPreview,"exam-rich-text-content":t.examRichTextContent,"exam-answer-relation-type":t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===t.answerType?(o(),u(y,x({key:2,ref_for:!0},r(C),{"order-index":k()(t.customId),title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},"exam-rich-text-content":t.examRichTextContent,"exam-answer-relation-type":t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===t.answerType?(o(),u(E,x({key:3,ref_for:!0},r(C),{"order-index":k()(t.customId),title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-expand":t.examExpand,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},"exam-answer-relation-type":t.examAnswerRelationType,"exam-rich-text-content":t.examRichTextContent,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","exam-answer-relation-type","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===t.answerType?(o(),u(S,x({key:4,ref_for:!0},r(C),{"order-index":k()(t.customId),"rich-text-content":t.richTextContent,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,"exam-answer-relation-type":t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)}),null,16,["order-index","rich-text-content","is-set","is-save","is-edit","show-action","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"page_end"===t.answerType?(o(),u(T,{key:s,"total-page":b.value.filter((e=>"page_end"===e.answerType)).length,"current-page-index":r(_)(t.customId),item:t,"is-edit":t.isEdit||!1,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,"exam-answer-relation-type":t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)},null,8,["total-page","current-page-index","item","is-edit","is-set","is-save","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):p("v-if",!0)])))),128))])],2))}});export{g as default};
1
+ import{defineComponent as e,ref as t,useAttrs as s,computed as n,watch as i,createElementBlock as a,openBlock as o,normalizeClass as l,unref as r,createElementVNode as d,Fragment as c,renderList as m,createBlock as u,createCommentVNode as p,mergeProps as x}from"vue";import{useNamespace as w}from"@qxs-bns/hooks";import{setGuid as v}from"@qxs-bns/utils";import y from"./components/subject-blank-fill.vue.mjs";import h from"./components/subject-scale.vue.mjs";import f from"./components/subject-single.vue.mjs";import E from"./components/subject-text-fill.vue.mjs";import T from"./components/SubjectPageEnd.vue.mjs";import S from"./components/SubjectRichText.vue.mjs";import{ElMessage as A}from"element-plus/es";import"element-plus/es/components/base/style/index";import"element-plus/es/components/message/style/index";const R={class:"subject-list-wrapper"};var g=e({name:"QxsSubjectList",__name:"subject-list",props:{subjectList:{type:Array,required:!0},isPreview:{type:Boolean,required:!0}},emits:["setRelation"],setup(e,{expose:g,emit:D}){const I=e,j=D,b=t([]),C=s();g({addSubject:M,currentList:b,uploadExcel:function(e){b.value=b.value.concat(e)},addExam:function(e){console.log(e,"items");let t=1;const s=[];e.forEach(e=>{const n={...e,customId:v(),answerType:e.richTextContent?"rich_text":e.examTypeEnum,answers:e.answers?.map(e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect}))||[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1};n.pageIndex>t&&(s.push({customId:v(),answerType:"page_end",analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=n.pageIndex),s.push(n)}),b.value=b.value.concat(s)},setAnswerRelation:function(e,t,s){const n=b.value.find(e=>e.customId===t);if(n){const t=n.answers?.find(e=>e.customAnswerId===s);t&&(t.answerRelations=e)}}});const _=n(()=>{const e=b.value.filter(e=>"page_end"===e.answerType);return t=>{const s=e.findIndex(e=>e.customId===t);return-1!==s?s+1:0}});function k(){return e=>{let t=0,s=0;return b.value.forEach(n=>{"page_end"!==n.answerType&&(t++,e===n.customId&&(s=t))}),s-1}}function M(e,t=null,s=null){const n={customId:v(),answerType:e,analysis:"",scaleQuestionList:[],isSave:!1,isEdit:!0,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:s};null!==t?b.value.splice(t+1,0,n):b.value.push(n)}function L(e,t){if("up"===t&&e>0){const[t]=b.value.splice(e,1);b.value.splice(e-1,0,t)}else if("down"===t&&e<b.value.length-1){const[t]=b.value.splice(e,1);b.value.splice(e+1,0,t)}}function P(e,t){b.value[e]={...b.value[e],...t,isEdit:!1,examAnswerRelationType:t.examAnswerRelationType}}function q(e){b.value.splice(e,1),A.success("删除成功")}function Q(e,t){j("setRelation",e,t)}i(()=>I.subjectList,e=>{e&&(b.value=[...e])},{immediate:!0});const O=w("subject-list");return(e,t)=>(o(),a("div",{class:l(r(O).e("list-exam"))},[d("div",R,[(o(!0),a(c,null,m(r(b),(t,s)=>(o(),a("div",{key:t.customId,class:"subject-item"},[["single","multiple","sort"].includes(t.answerType)?(o(),u(f,x({key:0,ref_for:!0},r(C),{"order-index":k()(t.customId),title:t.title,type:t.answerType,"exam-id":t.examId,"is-key":t.isKey,"is-save":!t.isRealCanDel,"custom-id":t.customId,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"least-answer-count":t.leastAnswerCount,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,"exam-expand":t.examExpand,"answer-check-type":t.answerCheckType,"exam-rich-text-content":t.examRichTextContent,"exam-answer-relation-type":t.examAnswerRelationType,onSetRelation:Q,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:(e,t)=>M(e,s,t)}),null,16,["order-index","title","type","exam-id","is-key","is-save","custom-id","is-set","answer-list","analysis","least-answer-count","is-edit","show-action","exam-expand","answer-check-type","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"scale"===t.answerType?(o(),u(h,x({key:1,ref_for:!0},r(C),{"order-index":k()(t.customId),title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"is-edit":t.isEdit||!1,"scale-question-list":t.scaleQuestionList,"show-action":!e.isPreview,"exam-rich-text-content":t.examRichTextContent,"exam-answer-relation-type":t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","is-edit","scale-question-list","show-action","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"blank_fill"===t.answerType?(o(),u(y,x({key:2,ref_for:!0},r(C),{"order-index":k()(t.customId),title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},"exam-rich-text-content":t.examRichTextContent,"exam-answer-relation-type":t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-answer-setting-v-o","exam-rich-text-content","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"text_fill"===t.answerType?(o(),u(E,x({key:3,ref_for:!0},r(C),{"order-index":k()(t.customId),title:t.title,"is-save":!t.isRealCanDel,"is-set":t.hasSet||!1,"answer-list":t.answers,analysis:t.analysis,"show-action":!e.isPreview,"is-edit":t.isEdit||!1,"exam-expand":t.examExpand,"exam-answer-setting-v-o":t.examAnswerSettingVO||{},"exam-answer-relation-type":t.examAnswerRelationType,"exam-rich-text-content":t.examRichTextContent,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)}),null,16,["order-index","title","is-save","is-set","answer-list","analysis","show-action","is-edit","exam-expand","exam-answer-setting-v-o","exam-answer-relation-type","exam-rich-text-content","onMove","onDelete","onSave","onEdit","onAdd"])):"rich_text"===t.answerType?(o(),u(S,x({key:4,ref_for:!0},r(C),{"order-index":k()(t.customId),"rich-text-content":t.richTextContent,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,"is-edit":t.isEdit||!1,"show-action":!e.isPreview,"exam-answer-relation-type":t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)}),null,16,["order-index","rich-text-content","is-set","is-save","is-edit","show-action","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):"page_end"===t.answerType?(o(),u(T,{key:s,"total-page":b.value.filter(e=>"page_end"===e.answerType).length,"current-page-index":r(_)(t.customId),item:t,"is-edit":t.isEdit||!1,"is-set":t.hasSet||!1,"is-save":!t.isRealCanDel,"exam-answer-relation-type":t.examAnswerRelationType,onMove:e=>L(s,e),onDelete:e=>q(s),onSave:e=>P(s,e),onEdit:e=>t.isEdit=!0,onAdd:e=>M(e,s,null)},null,8,["total-page","current-page-index","item","is-edit","is-set","is-save","exam-answer-relation-type","onMove","onDelete","onSave","onEdit","onAdd"])):p("v-if",!0)]))),128))])],2))}});export{g as default};
2
2
  //# sourceMappingURL=subject-list.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-list.vue.mjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst emits = defineEmits(['setRelation'])\nconst currentList = ref([] as any)\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\nfunction currentIndex() {\n return (currentExamId: string) => {\n let current = 0\n let output = 0\n\n // 遍历 currentList,过滤掉分页器,并计算题目序号\n currentList.value.forEach((v: any) => {\n if (v.answerType !== 'page_end') { // 排除分页器\n current++\n if (currentExamId === v.customId) { // 匹配当前题目 ID\n output = current\n }\n }\n })\n\n return output - 1\n }\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n }\n else {\n currentList.value.push(newSubject)\n }\n}\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n }\n else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div\n v-for=\"(item, index) in currentList\"\n :key=\"item.customId\"\n class=\"subject-item\"\n >\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :is-key=\"item.isKey\"\n :is-save=\"!item.isRealCanDel\"\n :custom-id=\"item.customId\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-expand=\"item.examExpand\"\n :answer-check-type=\"item.answerCheckType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @set-relation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\"\n />\n </template>\n <SubjectScale\n v-else-if=\"item.answerType === 'scale'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-else-if=\"item.answerType === 'blank_fill'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-else-if=\"item.answerType === 'text_fill'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-else-if=\"item.answerType === 'rich_text'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :rich-text-content=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :key=\"index\"\n :total-page=\"totalPageIndex()\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","currentList","ref","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","currentPageIndex","computed","currentPageList","filter","currentId","findIndex","currentExamId","current","output","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace"],"mappings":"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"}
1
+ {"version":3,"file":"subject-list.vue.mjs","sources":["../../../../../../packages/components/src/subject-list/src/subject-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { setGuid } from '@qxs-bns/utils'\nimport SubjectBlankFill from './components/subject-blank-fill.vue'\nimport SubjectScale from './components/subject-scale.vue'\nimport SubjectSingle from './components/subject-single.vue'\nimport SubjectTextFill from './components/subject-text-fill.vue'\nimport SubjectPageEnd from './components/SubjectPageEnd.vue'\nimport SubjectRichText from './components/SubjectRichText.vue'\n\ndefineOptions({\n name: 'QxsSubjectList',\n})\n\nconst props = defineProps<{\n subjectList: any[]\n isPreview: boolean\n}>()\nconst emits = defineEmits(['setRelation'])\nconst currentList = ref([] as any)\nconst attrs = useAttrs()\n\ndefineExpose({\n addSubject,\n currentList,\n uploadExcel,\n addExam,\n setAnswerRelation,\n})\n\nfunction totalPageIndex() {\n return currentList.value.filter((v: any) => v.answerType === 'page_end').length\n}\n\nconst currentPageIndex = computed(() => {\n const currentPageList = currentList.value.filter((v: any) => v.answerType === 'page_end')\n return (currentId: string) => {\n const currentIndex = currentPageList.findIndex((c: any) => c.customId === currentId)\n return currentIndex !== -1 ? currentIndex + 1 : 0\n }\n})\n\nfunction currentIndex() {\n return (currentExamId: string) => {\n let current = 0\n let output = 0\n\n // 遍历 currentList,过滤掉分页器,并计算题目序号\n currentList.value.forEach((v: any) => {\n if (v.answerType !== 'page_end') { // 排除分页器\n current++\n if (currentExamId === v.customId) { // 匹配当前题目 ID\n output = current\n }\n }\n })\n\n return output - 1\n }\n}\n\nfunction addSubject(type: string, index: number | null = null, examAnswerRelationType: number | null = null) {\n const newSubject = {\n customId: setGuid(),\n answerType: type,\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType,\n }\n\n if (index !== null) {\n currentList.value.splice(index + 1, 0, newSubject)\n }\n else {\n currentList.value.push(newSubject)\n }\n}\nfunction addExam(items: any[]) {\n console.log(items, 'items')\n\n let currentIndex = 1\n const newList: any[] = []\n\n items.forEach((v: any) => {\n // 创建新的题目对象\n const newItem = {\n ...v,\n customId: setGuid(),\n answerType: v.richTextContent ? 'rich_text' : v.examTypeEnum,\n answers: v.answers?.map((c: any) => ({\n ...c,\n title: c.answer,\n answerId: c.examAnswerId,\n isCorrect: c.isCorrect,\n })) || [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n }\n\n // 如果当前题目的 pageIndex 和 currentIndex 不一致,则插入分页器\n if (newItem.pageIndex > currentIndex) {\n newList.push({\n customId: setGuid(),\n answerType: 'page_end',\n analysis: '',\n scaleQuestionList: [],\n isSave: false,\n isEdit: true,\n isRealCanDel: true,\n hasSet: false,\n examAnswerRelationType: 0,\n })\n currentIndex = newItem.pageIndex\n }\n\n // 将题目添加到 newList\n newList.push(newItem)\n })\n\n // 更新 currentList\n currentList.value = currentList.value.concat(newList)\n}\nfunction uploadExcel(list: any[]) {\n currentList.value = currentList.value.concat(list)\n}\n\nfunction move(index: number, type: 'up' | 'down') {\n if (type === 'up' && index > 0) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index - 1, 0, item)\n }\n else if (type === 'down' && index < currentList.value.length - 1) {\n const [item] = currentList.value.splice(index, 1)\n currentList.value.splice(index + 1, 0, item)\n }\n}\n\nfunction saveSubject(index: number, item: any) {\n currentList.value[index] = {\n ...currentList.value[index],\n ...item,\n isEdit: false,\n examAnswerRelationType: item.examAnswerRelationType,\n }\n}\n\nfunction deleteSubject(index: number) {\n currentList.value.splice(index, 1)\n ElMessage.success('删除成功')\n}\n\nfunction setRelation(customId: number, examAnswers: any) {\n emits('setRelation', customId, examAnswers)\n}\n\nfunction setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const targetItem = currentList.value.find((v: any) => v.customId === customId)\n if (targetItem) {\n const targetAnswer = targetItem.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (targetAnswer) {\n targetAnswer.answerRelations = answerRelations\n }\n }\n}\n\nwatch(() => props.subjectList, (newList: any) => {\n if (newList) {\n currentList.value = [...newList]\n }\n}, { immediate: true })\n\nconst ns = useNamespace('subject-list')\n</script>\n\n<template>\n <div :class=\"ns.e('list-exam')\">\n <div class=\"subject-list-wrapper\">\n <div\n v-for=\"(item, index) in currentList\"\n :key=\"item.customId\"\n class=\"subject-item\"\n >\n <template v-if=\"['single', 'multiple', 'sort'].includes(item.answerType)\">\n <SubjectSingle\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :type=\"item.answerType\"\n :exam-id=\"item.examId\"\n :is-key=\"item.isKey\"\n :is-save=\"!item.isRealCanDel\"\n :custom-id=\"item.customId\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :least-answer-count=\"item.leastAnswerCount\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-expand=\"item.examExpand\"\n :answer-check-type=\"item.answerCheckType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @set-relation=\"setRelation\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string, examAnswerRelationType: number) => addSubject(type, index, examAnswerRelationType)\"\n />\n </template>\n <SubjectScale\n v-else-if=\"item.answerType === 'scale'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :is-edit=\"item.isEdit || false\"\n :scale-question-list=\"item.scaleQuestionList\"\n :show-action=\"!isPreview\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectBlankFill\n v-else-if=\"item.answerType === 'blank_fill'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectTextFill\n v-else-if=\"item.answerType === 'text_fill'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :title=\"item.title\"\n :is-save=\"!item.isRealCanDel\"\n :is-set=\"item.hasSet || false\"\n :answer-list=\"item.answers\"\n :analysis=\"item.analysis\"\n :show-action=\"!isPreview\"\n :is-edit=\"item.isEdit || false\"\n :exam-expand=\"item.examExpand\"\n :exam-answer-setting-v-o=\"item.examAnswerSettingVO || {}\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n :exam-rich-text-content=\"item.examRichTextContent\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectRichText\n v-else-if=\"item.answerType === 'rich_text'\"\n v-bind=\"attrs\"\n :order-index=\"currentIndex()(item.customId)\"\n :rich-text-content=\"item.richTextContent\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :is-edit=\"item.isEdit || false\"\n :show-action=\"!isPreview\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n <SubjectPageEnd\n v-else-if=\"item.answerType === 'page_end'\"\n :key=\"index\"\n :total-page=\"totalPageIndex()\"\n :current-page-index=\"currentPageIndex(item.customId)\"\n :item=\"item\"\n :is-edit=\"item.isEdit || false\"\n :is-set=\"item.hasSet || false\"\n :is-save=\"!item.isRealCanDel\"\n :exam-answer-relation-type=\"item.examAnswerRelationType\"\n @move=\"(type: 'up' | 'down') => move(index, type)\"\n @delete=\"deleteSubject(index)\"\n @save=\"(item: any) => saveSubject(index, item)\"\n @edit=\"item.isEdit = true\"\n @add=\"(type: string) => addSubject(type, index, null)\"\n />\n </div>\n </div>\n </div>\n</template>\n"],"names":["props","__props","emits","__emit","currentList","ref","attrs","useAttrs","__expose","addSubject","uploadExcel","list","value","concat","addExam","items","console","log","currentIndex","newList","forEach","v","newItem","customId","setGuid","answerType","richTextContent","examTypeEnum","answers","map","c","title","answer","answerId","examAnswerId","isCorrect","isSave","isEdit","isRealCanDel","hasSet","pageIndex","push","analysis","scaleQuestionList","examAnswerRelationType","setAnswerRelation","answerRelations","customAnswerId","targetItem","find","targetAnswer","currentPageIndex","computed","currentPageList","filter","currentId","findIndex","currentExamId","current","output","type","index","newSubject","splice","move","item","length","saveSubject","deleteSubject","ElMessage","success","setRelation","examAnswers","watch","subjectList","immediate","ns","useNamespace","_createElementBlock","class","_normalizeClass","_unref","e","_createElementVNode","_hoisted_1","_openBlock","_Fragment","_renderList","key","includes","_createBlock","SubjectSingle","_mergeProps","examId","isKey","leastAnswerCount","isPreview","examExpand","answerCheckType","examRichTextContent","onSetRelation","onMove","onDelete","$event","onSave","onEdit","onAdd","SubjectScale","SubjectBlankFill","examAnswerSettingVO","SubjectTextFill","SubjectRichText","SubjectPageEnd"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,ref as l,createElementBlock as t,openBlock as s,normalizeClass as a,unref as i,createElementVNode as c,Fragment as p,renderList as n,toDisplayString as y}from"vue";import{useNamespace as b}from"@qxs-bns/hooks";const u={class:"type-item"},m={class:"base-subject"},o=["onClick"],d={class:"type-item"},v={class:"base-subject flex"},r=["onClick"],k={class:"type-item"},f={class:"base-subject flex"},x=["onClick"];var j=e({name:"QxsSubjectType",__name:"subject-type",emits:["select"],setup(e,{emit:j}){const C=j,_=l([{type:"single",label:"单选题"},{type:"multiple",label:"多选题"},{type:"blank_fill",label:"填空题"},{type:"text_fill",label:"问答题"},{type:"scale",label:"量表题"},{type:"sort",label:"排序题"}]),g=l([{type:"rich_text",label:"富文本"},{type:"page_end",label:"分页器"}]),h=l([{type:"single",label:"单选题"},{type:"multiple",label:"多选题"}]),q=b("subject-type");return(e,l)=>(s(),t("div",{class:a(i(q).e("type-list"))},[c("div",u,[l[0]||(l[0]=c("div",null,"普通题目类型",-1)),c("div",m,[(s(!0),t(p,null,n(i(_),(e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type)},[c("span",null,y(e.label),1)],8,o)))),128))])]),c("div",d,[l[1]||(l[1]=c("div",null,"其他",-1)),c("div",v,[(s(!0),t(p,null,n(i(g),(e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type)},[c("span",null,y(e.label),1)],8,r)))),128))])]),c("div",k,[l[2]||(l[2]=c("div",null,"互动问答类型(支持设置结果项)",-1)),c("div",f,[(s(!0),t(p,null,n(i(h),(e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type,!0)},[c("span",null,y(e.label),1)],8,x)))),128))])])],2))}});export{j as default};
1
+ import{defineComponent as e,ref as l,createElementBlock as t,openBlock as s,normalizeClass as a,unref as i,createElementVNode as c,Fragment as p,renderList as n,toDisplayString as y}from"vue";import{useNamespace as b}from"@qxs-bns/hooks";const u={class:"type-item"},m={class:"base-subject"},o=["onClick"],d={class:"type-item"},v={class:"base-subject flex"},r=["onClick"],k={class:"type-item"},f={class:"base-subject flex"},x=["onClick"];var j=e({name:"QxsSubjectType",__name:"subject-type",emits:["select"],setup(e,{emit:j}){const C=j,_=l([{type:"single",label:"单选题"},{type:"multiple",label:"多选题"},{type:"blank_fill",label:"填空题"},{type:"text_fill",label:"问答题"},{type:"scale",label:"量表题"},{type:"sort",label:"排序题"}]),g=l([{type:"rich_text",label:"富文本"},{type:"page_end",label:"分页器"}]),h=l([{type:"single",label:"单选题"},{type:"multiple",label:"多选题"}]),q=b("subject-type");return(e,l)=>(s(),t("div",{class:a(i(q).e("type-list"))},[c("div",u,[l[0]||(l[0]=c("div",null,"普通题目类型",-1)),c("div",m,[(s(!0),t(p,null,n(i(_),e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type)},[c("span",null,y(e.label),1)],8,o))),128))])]),c("div",d,[l[1]||(l[1]=c("div",null,"其他",-1)),c("div",v,[(s(!0),t(p,null,n(i(g),e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type)},[c("span",null,y(e.label),1)],8,r))),128))])]),c("div",k,[l[2]||(l[2]=c("div",null,"互动问答类型(支持设置结果项)",-1)),c("div",f,[(s(!0),t(p,null,n(i(h),e=>(s(),t("div",{key:e.type,class:"item flex-center",onClick:l=>C("select",e.type,!0)},[c("span",null,y(e.label),1)],8,x))),128))])])],2))}});export{j as default};
2
2
  //# sourceMappingURL=subject-type.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"subject-type.vue.mjs","sources":["../../../../../../packages/components/src/subject-type/src/subject-type.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\n\ndefineOptions({\n name: 'QxsSubjectType',\n})\nconst emits = defineEmits(['select'])\nconst subjectOptions = ref([\n {\n type: 'single',\n label: '单选题',\n }, {\n type: 'multiple',\n label: '多选题',\n },\n {\n type: 'blank_fill',\n label: '填空题',\n },\n {\n type: 'text_fill',\n label: '问答题',\n },\n {\n type: 'scale',\n label: '量表题',\n },\n {\n type: 'sort',\n label: '排序题',\n },\n])\nconst otherOptions = ref([\n {\n type: 'rich_text',\n label: '富文本',\n },\n {\n type: 'page_end',\n label: '分页器',\n },\n])\nconst interactionOptions = ref([\n {\n type: 'single',\n label: '单选题',\n }, {\n type: 'multiple',\n label: '多选题',\n },\n])\nconst ns = useNamespace('subject-type')\n</script>\n\n<template>\n <div :class=\"ns.e('type-list')\">\n <div class=\"type-item\">\n <div>普通题目类型</div>\n <div class=\"base-subject\">\n <div\n v-for=\"item in subjectOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n <div class=\"type-item\">\n <div>其他</div>\n <div class=\"base-subject flex\">\n <div\n v-for=\"item in otherOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n <div class=\"type-item\">\n <div>互动问答类型(支持设置结果项)</div>\n <div class=\"base-subject flex\">\n <div\n v-for=\"item in interactionOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type, true)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n"],"names":["emits","__emit","subjectOptions","ref","type","label","otherOptions","interactionOptions","ns","useNamespace"],"mappings":"6gBAMA,MAAMA,EAAQC,EACRC,EAAiBC,EAAI,CACzB,CACEC,KAAM,SACNC,MAAO,OACN,CACDD,KAAM,WACNC,MAAO,OAET,CACED,KAAM,aACNC,MAAO,OAET,CACED,KAAM,YACNC,MAAO,OAET,CACED,KAAM,QACNC,MAAO,OAET,CACED,KAAM,OACNC,MAAO,SAGLC,EAAeH,EAAI,CACvB,CACEC,KAAM,YACNC,MAAO,OAET,CACED,KAAM,WACNC,MAAO,SAGLE,EAAqBJ,EAAI,CAC7B,CACEC,KAAM,SACNC,MAAO,OACN,CACDD,KAAM,WACNC,MAAO,SAGLG,EAAKC,EAAa"}
1
+ {"version":3,"file":"subject-type.vue.mjs","sources":["../../../../../../packages/components/src/subject-type/src/subject-type.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useNamespace } from '@qxs-bns/hooks'\n\ndefineOptions({\n name: 'QxsSubjectType',\n})\nconst emits = defineEmits(['select'])\nconst subjectOptions = ref([\n {\n type: 'single',\n label: '单选题',\n }, {\n type: 'multiple',\n label: '多选题',\n },\n {\n type: 'blank_fill',\n label: '填空题',\n },\n {\n type: 'text_fill',\n label: '问答题',\n },\n {\n type: 'scale',\n label: '量表题',\n },\n {\n type: 'sort',\n label: '排序题',\n },\n])\nconst otherOptions = ref([\n {\n type: 'rich_text',\n label: '富文本',\n },\n {\n type: 'page_end',\n label: '分页器',\n },\n])\nconst interactionOptions = ref([\n {\n type: 'single',\n label: '单选题',\n }, {\n type: 'multiple',\n label: '多选题',\n },\n])\nconst ns = useNamespace('subject-type')\n</script>\n\n<template>\n <div :class=\"ns.e('type-list')\">\n <div class=\"type-item\">\n <div>普通题目类型</div>\n <div class=\"base-subject\">\n <div\n v-for=\"item in subjectOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n <div class=\"type-item\">\n <div>其他</div>\n <div class=\"base-subject flex\">\n <div\n v-for=\"item in otherOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n <div class=\"type-item\">\n <div>互动问答类型(支持设置结果项)</div>\n <div class=\"base-subject flex\">\n <div\n v-for=\"item in interactionOptions\"\n :key=\"item.type\"\n class=\"item flex-center\"\n @click=\"emits('select', item.type, true)\"\n >\n <span>{{ item.label }}</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n"],"names":["emits","__emit","subjectOptions","ref","type","label","otherOptions","interactionOptions","ns","useNamespace","_createElementBlock","class","_normalizeClass","_unref","e","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_Fragment","_renderList","item","key","onClick","$event","_toDisplayString","_hoisted_4","_hoisted_5","_hoisted_7","_hoisted_8"],"mappings":"6gBAMA,MAAMA,EAAQC,EACRC,EAAiBC,EAAI,CACzB,CACEC,KAAM,SACNC,MAAO,OACN,CACDD,KAAM,WACNC,MAAO,OAET,CACED,KAAM,aACNC,MAAO,OAET,CACED,KAAM,YACNC,MAAO,OAET,CACED,KAAM,QACNC,MAAO,OAET,CACED,KAAM,OACNC,MAAO,SAGLC,EAAeH,EAAI,CACvB,CACEC,KAAM,YACNC,MAAO,OAET,CACED,KAAM,WACNC,MAAO,SAGLE,EAAqBJ,EAAI,CAC7B,CACEC,KAAM,SACNC,MAAO,OACN,CACDD,KAAM,WACNC,MAAO,SAGLG,EAAKC,EAAa,kCAItBC,EAwCM,MAAA,CAxCAC,MAAKC,EAAEC,EAAAL,GAAGM,EAAC,gBACfC,EAYM,MAZNC,EAYM,CAXJC,EAAA,KAAAA,EAAA,GAAAF,EAAiB,WAAZ,UAAM,IACXA,EASM,MATNG,EASM,QARJR,EAOMS,EAAA,KAAAC,EANWP,EAAAX,GAARmB,QADTX,EAOM,MAAA,CALHY,IAAKD,EAAKjB,KACXO,MAAM,mBACLY,QAAKC,GAAExB,EAAK,SAAWqB,EAAKjB,QAE7BW,EAA6B,OAAA,KAAAU,EAApBJ,EAAKhB,OAAK,qBAIzBU,EAYM,MAZNW,EAYM,CAXJT,EAAA,KAAAA,EAAA,GAAAF,EAAa,WAAR,MAAE,IACPA,EASM,MATNY,EASM,QARJjB,EAOMS,EAAA,KAAAC,EANWP,EAAAP,GAARe,QADTX,EAOM,MAAA,CALHY,IAAKD,EAAKjB,KACXO,MAAM,mBACLY,QAAKC,GAAExB,EAAK,SAAWqB,EAAKjB,QAE7BW,EAA6B,OAAA,KAAAU,EAApBJ,EAAKhB,OAAK,qBAIzBU,EAYM,MAZNa,EAYM,CAXJX,EAAA,KAAAA,EAAA,GAAAF,EAA0B,WAArB,mBAAe,IACpBA,EASM,MATNc,EASM,QARJnB,EAOMS,EAAA,KAAAC,EANWP,EAAAN,GAARc,QADTX,EAOM,MAAA,CALHY,IAAKD,EAAKjB,KACXO,MAAM,mBACLY,QAAKC,GAAExB,EAAK,SAAWqB,EAAKjB,MAAI,KAEjCW,EAA6B,OAAA,KAAAU,EAApBJ,EAAKhB,OAAK"}
@@ -1,2 +1,2 @@
1
- import{defineComponent as e,shallowRef as t,ref as i,computed as n,watch as o,onMounted as l,onBeforeUnmount as a,createElementBlock as r,openBlock as s,normalizeClass as m,unref as u,createCommentVNode as c,withDirectives as p,createElementVNode as d,isRef as g,vModelText as y}from"vue";import{useNamespace as f}from"@qxs-bns/hooks";import{merge as h}from"lodash-es";import v from"tinymce/tinymce";import"tinymce/themes/silver/theme";import"tinymce/icons/default/icons";import"tinymce/models/dom";import"tinymce/plugins/autolink";import"tinymce/plugins/autoresize";import"tinymce/plugins/fullscreen";import"tinymce/plugins/image";import"tinymce/plugins/insertdatetime";import"tinymce/plugins/link";import"tinymce/plugins/lists";import"tinymce/plugins/media";import"tinymce/plugins/preview";import"tinymce/plugins/table";import"tinymce/plugins/wordcount";import"tinymce/plugins/code";import"tinymce/plugins/searchreplace";import"tinymce/plugins/nonbreaking";const b=["id","name"];var k=e({name:"QxsTinyMceEditor",__name:"tiny-mce-editor",props:{modelValue:{type:String,required:!0,default:""},config:{type:Object,required:!1,default:()=>({})},assetsBasePath:{type:String,required:!1,default:""}},emits:["update:modelValue"],setup(e,{emit:k}){const _=k,x=f("tiny-mce-editor"),w=e.assetsBasePath||"node_modules/",S=t(null),V=i(`tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2,9)}`),$=n({get:()=>e.modelValue,set(e){_("update:modelValue",e)}}),z={selector:`textarea#${V.value}`,promotion:!1,license_key:"gpl",elementpath:!1,language:"zh-Hans",language_url:`${w}tinymce/langs/zh-Hans.js`,skin_url:`${w}tinymce/skins/ui/oxide`,content_css:`${w}tinymce/skins/content/default/content.min.css`,min_height:300,max_height:700,plugins:"autolink autoresize fullscreen image insertdatetime link lists media preview table wordcount code searchreplace nonbreaking",toolbar:"undo redo | bold italic underline strikethrough | blocks | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor removeformat | link image media table insertdatetime searchreplace | preview code",branding:!1,autoresize:!0,menubar:!1,nonbreaking_force_tab:!0,toolbar_mode:"sliding",insertdatetime_formats:["%Y年%m月%d日","%H点%M分%S秒","%Y-%m-%d","%H:%M:%S"],setup:t=>{t.on("init",(()=>{S.value=t,t.setContent($.value)})),t.on("input change undo redo",(()=>{$.value=t.getContent()})),e.config?.expandSetup?.(t)}},q=n((()=>{const t=z;return e.config.images_upload_handler||("string"==typeof t.plugins?t.plugins=t.plugins.replace("image",""):Array.isArray(t.plugins)&&(t.plugins=t.plugins.filter((e=>"image"!==e)))),h(t,e.config)}));return o((()=>e.modelValue),(e=>{try{S.value&&e!==S.value?.getContent()&&S.value.setContent(e)}catch(e){console.error("设置编辑器内容时出错:",e)}})),l((async()=>{"undefined"!=typeof window&&v.init(q.value)})),a((()=>{S.value&&(S.value.destroy(),S.value=null)})),(e,t)=>(s(),r("div",{class:m(u(x).e("tiny-mce"))},[c(" 使用动态生成的 id "),p(d("textarea",{id:u(V),"onUpdate:modelValue":t[0]||(t[0]=e=>g($)?$.value=e:null),name:u(V)},null,8,b),[[y,u($)]])],2))}});export{k as default};
1
+ import{defineComponent as e,shallowRef as t,ref as i,computed as n,watch as o,onMounted as l,onBeforeUnmount as a,createElementBlock as r,openBlock as s,normalizeClass as m,unref as u,createCommentVNode as c,withDirectives as p,createElementVNode as d,isRef as g,vModelText as y}from"vue";import{useNamespace as f}from"@qxs-bns/hooks";import{merge as h}from"lodash-es";import v from"tinymce/tinymce";import"tinymce/themes/silver/theme";import"tinymce/icons/default/icons";import"tinymce/models/dom";import"tinymce/plugins/autolink";import"tinymce/plugins/autoresize";import"tinymce/plugins/fullscreen";import"tinymce/plugins/image";import"tinymce/plugins/insertdatetime";import"tinymce/plugins/link";import"tinymce/plugins/lists";import"tinymce/plugins/media";import"tinymce/plugins/preview";import"tinymce/plugins/table";import"tinymce/plugins/wordcount";import"tinymce/plugins/code";import"tinymce/plugins/searchreplace";import"tinymce/plugins/nonbreaking";const b=["id","name"];var k=e({name:"QxsTinyMceEditor",__name:"tiny-mce-editor",props:{modelValue:{type:String,required:!0,default:""},config:{type:Object,required:!1,default:()=>({})},assetsBasePath:{type:String,required:!1,default:""}},emits:["update:modelValue"],setup(e,{emit:k}){const _=k,x=f("tiny-mce-editor"),w=e.assetsBasePath||"node_modules/",S=t(null),V=i(`tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2,9)}`),$=n({get:()=>e.modelValue,set(e){_("update:modelValue",e)}}),z={selector:`textarea#${V.value}`,promotion:!1,license_key:"gpl",elementpath:!1,language:"zh-Hans",language_url:`${w}tinymce/langs/zh-Hans.js`,skin_url:`${w}tinymce/skins/ui/oxide`,content_css:`${w}tinymce/skins/content/default/content.min.css`,min_height:300,max_height:700,plugins:"autolink autoresize fullscreen image insertdatetime link lists media preview table wordcount code searchreplace nonbreaking",toolbar:"undo redo | bold italic underline strikethrough | blocks | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor removeformat | link image media table insertdatetime searchreplace | preview code",branding:!1,autoresize:!0,menubar:!1,nonbreaking_force_tab:!0,toolbar_mode:"sliding",insertdatetime_formats:["%Y年%m月%d日","%H点%M分%S秒","%Y-%m-%d","%H:%M:%S"],setup:t=>{t.on("init",()=>{S.value=t,t.setContent($.value)}),t.on("input change undo redo",()=>{$.value=t.getContent()}),e.config?.expandSetup?.(t)}},q=n(()=>{const t=z;return e.config.images_upload_handler||("string"==typeof t.plugins?t.plugins=t.plugins.replace("image",""):Array.isArray(t.plugins)&&(t.plugins=t.plugins.filter(e=>"image"!==e))),h(t,e.config)});return o(()=>e.modelValue,e=>{try{S.value&&e!==S.value?.getContent()&&S.value.setContent(e)}catch(e){console.error("设置编辑器内容时出错:",e)}}),l(async()=>{"undefined"!=typeof window&&v.init(q.value)}),a(()=>{S.value&&(S.value.destroy(),S.value=null)}),(e,t)=>(s(),r("div",{class:m(u(x).e("tiny-mce"))},[c(" 使用动态生成的 id "),p(d("textarea",{id:u(V),"onUpdate:modelValue":t[0]||(t[0]=e=>g($)?$.value=e:null),name:u(V)},null,8,b),[[y,u($)]])],2))}});export{k as default};
2
2
  //# sourceMappingURL=tiny-mce-editor.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tiny-mce-editor.vue.mjs","sources":["../../../../../../packages/components/src/tiny-mce-editor/src/tiny-mce-editor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor, RawEditorOptions } from 'tinymce/tinymce'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { merge } from 'lodash-es'\nimport tinymce from 'tinymce/tinymce'\n\n// 导入核心功能\nimport 'tinymce/themes/silver/theme'\nimport 'tinymce/icons/default/icons'\nimport 'tinymce/models/dom'\n\nimport 'tinymce/plugins/autolink'\nimport 'tinymce/plugins/autoresize'\nimport 'tinymce/plugins/fullscreen'\nimport 'tinymce/plugins/image'\nimport 'tinymce/plugins/insertdatetime'\nimport 'tinymce/plugins/link'\nimport 'tinymce/plugins/lists'\nimport 'tinymce/plugins/media'\nimport 'tinymce/plugins/preview'\nimport 'tinymce/plugins/table'\nimport 'tinymce/plugins/wordcount'\nimport 'tinymce/plugins/code'\nimport 'tinymce/plugins/searchreplace'\nimport 'tinymce/plugins/nonbreaking'\n// 导入语言包\n\ndefineOptions({\n name: 'QxsTinyMceEditor',\n})\n\nconst {\n modelValue = '',\n config = {},\n assetsBasePath = '',\n} = defineProps<{\n modelValue: string\n config?: RawEditorOptions & {\n expandSetup?: RawEditorOptions['setup']\n }\n assetsBasePath?: string\n}>()\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst ns = useNamespace('tiny-mce-editor')\n\nconst colorScheme = 'light'\nconst basePath = assetsBasePath || 'node_modules/'\n// 存储编辑器实例的引用\nconst editorInstance = shallowRef<Editor | null>(null)\n// 生成唯一的 id\nconst uniqueId = ref(\n `tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n)\n\nconst content = computed({\n get() {\n return modelValue\n },\n set(val) {\n emit('update:modelValue', val)\n },\n})\n\nconst defaultSetting: RawEditorOptions = {\n // 使用动态生成的 id\n selector: `textarea#${uniqueId.value}`,\n promotion: false, // 禁用推广信息\n license_key: 'gpl',\n elementpath: false,\n language: 'zh-Hans',\n language_url: `${basePath}tinymce/langs/zh-Hans.js`,\n skin_url: `${basePath}${\n colorScheme === 'light' ? 'tinymce/skins/ui/oxide' : 'tinymce/skins/ui/oxide-dark'\n }`,\n content_css: `${basePath}${\n colorScheme === 'light'\n ? 'tinymce/skins/content/default/content.min.css'\n : 'tinymce/skins/content/dark/content.min.css'\n }`,\n min_height: 300,\n max_height: 700,\n plugins:\n 'autolink autoresize fullscreen image insertdatetime link lists media preview table wordcount code searchreplace nonbreaking',\n toolbar:\n 'undo redo | bold italic underline strikethrough | blocks | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor removeformat | link image media table insertdatetime searchreplace | preview code',\n branding: false,\n autoresize: true,\n menubar: false,\n nonbreaking_force_tab: true,\n toolbar_mode: 'sliding',\n insertdatetime_formats: [\n '%Y年%m月%d日',\n '%H点%M分%S秒',\n '%Y-%m-%d',\n '%H:%M:%S',\n ],\n // https://www.tiny.cloud/docs/tinymce/6/file-image-upload/#images_upload_handler\n // images_upload_handler: async (blobInfo: any, progress: any) => {\n // // blobInfo, succFun, failFun, progress\n // const files = blobInfo.blob()\n // const formData = new FormData()\n // formData.append('image', files)\n\n // const { res, error } = await useApi({\n // // ...commonUrls.uploadImage,\n // params: {\n // bucketType: classify,\n // },\n // data: formData,\n // onUploadProgress: (e: any) => {\n // progress((e.loaded / e.total) * 100)\n // },\n // })\n // if (res) {\n // const { normal } = res\n // console.log('normal: ', res)\n // return normal\n // }\n // if (error) {\n // console.log(error.message)\n // return Promise.reject(error.message)\n // }\n // },\n setup: (editor: Editor) => {\n // 编辑器初始化完成后设置内容\n editor.on('init', () => {\n // 保存编辑器实例\n editorInstance.value = editor\n editor.setContent(content.value)\n })\n\n // 监听编辑器内容变化\n editor.on('input change undo redo', () => {\n content.value = editor.getContent()\n })\n\n config?.expandSetup?.(editor)\n },\n}\n\nconst initSetting = computed(() => {\n const dealDefaultSetting = defaultSetting\n if (!config.images_upload_handler) {\n // 删除 image 图片 plugin\n if (typeof dealDefaultSetting.plugins === 'string') {\n dealDefaultSetting.plugins = dealDefaultSetting.plugins.replace(\n 'image',\n '',\n )\n }\n else if (Array.isArray(dealDefaultSetting.plugins)) {\n dealDefaultSetting.plugins = dealDefaultSetting.plugins.filter(\n plugin => plugin !== 'image',\n )\n }\n }\n return merge(dealDefaultSetting, config)\n})\n\n// 监听 modelValue 的变化\nwatch(() => modelValue, (newVal) => {\n try {\n // 确保编辑器已初始化且内容确实发生变化\n if (editorInstance.value && newVal !== editorInstance.value?.getContent()) {\n editorInstance.value.setContent(newVal)\n }\n }\n catch (error) {\n console.error('设置编辑器内容时出错:', error)\n }\n})\n\nonMounted(async () => {\n if (typeof window !== 'undefined') {\n tinymce.init(initSetting.value)\n }\n})\n\n// 组件卸载时清理\nonBeforeUnmount(() => {\n if (editorInstance.value) {\n editorInstance.value.destroy()\n editorInstance.value = null\n }\n})\n</script>\n\n<template>\n <div :class=\"ns.e('tiny-mce')\">\n <!-- 使用动态生成的 id -->\n <textarea\n :id=\"uniqueId\"\n v-model=\"content\"\n :name=\"uniqueId\"\n />\n </div>\n</template>\n"],"names":["emit","__emit","ns","useNamespace","basePath","__props","assetsBasePath","editorInstance","shallowRef","uniqueId","ref","Date","now","Math","random","toString","substr","content","computed","get","modelValue","set","val","defaultSetting","selector","value","promotion","license_key","elementpath","language","language_url","skin_url","content_css","min_height","max_height","plugins","toolbar","branding","autoresize","menubar","nonbreaking_force_tab","toolbar_mode","insertdatetime_formats","setup","editor","on","setContent","getContent","config","expandSetup","initSetting","dealDefaultSetting","images_upload_handler","replace","Array","isArray","filter","plugin","merge","watch","newVal","error","console","onMounted","async","window","tinymce","init","onBeforeUnmount","destroy"],"mappings":"2tCA2CA,MAAMA,EAAOC,EAEPC,EAAKC,EAAa,mBAGlBC,EAAWC,EAAAC,gBAAkB,gBAE7BC,EAAiBC,EAA0B,MAE3CC,EAAWC,EACf,qBAAqBC,KAAKC,SAASC,KAAKC,SAASC,SAAS,IAAIC,OAAO,EAAG,MAGpEC,EAAUC,EAAS,CACvBC,IAAM,IACGd,EAAAe,WAET,GAAAC,CAAIC,GACFtB,EAAK,oBAAqBsB,EAAG,IAI3BC,EAAmC,CAEvCC,SAAU,YAAYf,EAASgB,QAC/BC,WAAW,EACXC,YAAa,MACbC,aAAa,EACbC,SAAU,UACVC,aAAc,GAAG1B,4BACjB2B,SAAU,GAAG3B,0BAGb4B,YAAa,GAAG5B,iDAKhB6B,WAAY,IACZC,WAAY,IACZC,QACE,8HACFC,QACE,oPACFC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,uBAAuB,EACvBC,aAAc,UACdC,uBAAwB,CACtB,YACA,YACA,WACA,YA6BFC,MAAQC,IAECA,EAAAC,GAAG,QAAQ,KAEhBtC,EAAekB,MAAQmB,EAChBA,EAAAE,WAAW7B,EAAQQ,MAAK,IAI1BmB,EAAAC,GAAG,0BAA0B,KAC1B5B,EAAAQ,MAAQmB,EAAOG,YAAW,IAG9B1C,EAAA2C,QAAEC,cAAcL,EAAM,GAI1BM,EAAchC,GAAS,KAC3B,MAAMiC,EAAqB5B,EAepB,OAdFlB,EAAM2C,OAACI,wBAEgC,iBAA/BD,EAAmBhB,QACTgB,EAAAhB,QAAUgB,EAAmBhB,QAAQkB,QACtD,QACA,IAGKC,MAAMC,QAAQJ,EAAmBhB,WACrBgB,EAAAhB,QAAUgB,EAAmBhB,QAAQqB,WACjC,UAAXC,MAITC,EAAMP,EAAoB9C,EAAM2C,OAAA,WAIzCW,GAAM,IAAMtD,EAAAe,aAAawC,IACnB,IAEErD,EAAekB,OAASmC,IAAWrD,EAAekB,OAAOsB,cAC5CxC,EAAAkB,MAAMqB,WAAWc,SAG7BC,GACGC,QAAAD,MAAM,cAAeA,EAAK,KAItCE,GAAUC,UACc,oBAAXC,QACDC,EAAAC,KAAKjB,EAAYzB,MAAK,IAKlC2C,GAAgB,KACV7D,EAAekB,QACjBlB,EAAekB,MAAM4C,UACrB9D,EAAekB,MAAQ,KAAA"}
1
+ {"version":3,"file":"tiny-mce-editor.vue.mjs","sources":["../../../../../../packages/components/src/tiny-mce-editor/src/tiny-mce-editor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor, RawEditorOptions } from 'tinymce/tinymce'\nimport { useNamespace } from '@qxs-bns/hooks'\nimport { merge } from 'lodash-es'\nimport tinymce from 'tinymce/tinymce'\n\n// 导入核心功能\nimport 'tinymce/themes/silver/theme'\nimport 'tinymce/icons/default/icons'\nimport 'tinymce/models/dom'\n\nimport 'tinymce/plugins/autolink'\nimport 'tinymce/plugins/autoresize'\nimport 'tinymce/plugins/fullscreen'\nimport 'tinymce/plugins/image'\nimport 'tinymce/plugins/insertdatetime'\nimport 'tinymce/plugins/link'\nimport 'tinymce/plugins/lists'\nimport 'tinymce/plugins/media'\nimport 'tinymce/plugins/preview'\nimport 'tinymce/plugins/table'\nimport 'tinymce/plugins/wordcount'\nimport 'tinymce/plugins/code'\nimport 'tinymce/plugins/searchreplace'\nimport 'tinymce/plugins/nonbreaking'\n// 导入语言包\n\ndefineOptions({\n name: 'QxsTinyMceEditor',\n})\n\nconst {\n modelValue = '',\n config = {},\n assetsBasePath = '',\n} = defineProps<{\n modelValue: string\n config?: RawEditorOptions & {\n expandSetup?: RawEditorOptions['setup']\n }\n assetsBasePath?: string\n}>()\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst ns = useNamespace('tiny-mce-editor')\n\nconst colorScheme = 'light'\nconst basePath = assetsBasePath || 'node_modules/'\n// 存储编辑器实例的引用\nconst editorInstance = shallowRef<Editor | null>(null)\n// 生成唯一的 id\nconst uniqueId = ref(\n `tiny-mce-textarea-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n)\n\nconst content = computed({\n get() {\n return modelValue\n },\n set(val) {\n emit('update:modelValue', val)\n },\n})\n\nconst defaultSetting: RawEditorOptions = {\n // 使用动态生成的 id\n selector: `textarea#${uniqueId.value}`,\n promotion: false, // 禁用推广信息\n license_key: 'gpl',\n elementpath: false,\n language: 'zh-Hans',\n language_url: `${basePath}tinymce/langs/zh-Hans.js`,\n skin_url: `${basePath}${\n colorScheme === 'light' ? 'tinymce/skins/ui/oxide' : 'tinymce/skins/ui/oxide-dark'\n }`,\n content_css: `${basePath}${\n colorScheme === 'light'\n ? 'tinymce/skins/content/default/content.min.css'\n : 'tinymce/skins/content/dark/content.min.css'\n }`,\n min_height: 300,\n max_height: 700,\n plugins:\n 'autolink autoresize fullscreen image insertdatetime link lists media preview table wordcount code searchreplace nonbreaking',\n toolbar:\n 'undo redo | bold italic underline strikethrough | blocks | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | forecolor backcolor removeformat | link image media table insertdatetime searchreplace | preview code',\n branding: false,\n autoresize: true,\n menubar: false,\n nonbreaking_force_tab: true,\n toolbar_mode: 'sliding',\n insertdatetime_formats: [\n '%Y年%m月%d日',\n '%H点%M分%S秒',\n '%Y-%m-%d',\n '%H:%M:%S',\n ],\n // https://www.tiny.cloud/docs/tinymce/6/file-image-upload/#images_upload_handler\n // images_upload_handler: async (blobInfo: any, progress: any) => {\n // // blobInfo, succFun, failFun, progress\n // const files = blobInfo.blob()\n // const formData = new FormData()\n // formData.append('image', files)\n\n // const { res, error } = await useApi({\n // // ...commonUrls.uploadImage,\n // params: {\n // bucketType: classify,\n // },\n // data: formData,\n // onUploadProgress: (e: any) => {\n // progress((e.loaded / e.total) * 100)\n // },\n // })\n // if (res) {\n // const { normal } = res\n // console.log('normal: ', res)\n // return normal\n // }\n // if (error) {\n // console.log(error.message)\n // return Promise.reject(error.message)\n // }\n // },\n setup: (editor: Editor) => {\n // 编辑器初始化完成后设置内容\n editor.on('init', () => {\n // 保存编辑器实例\n editorInstance.value = editor\n editor.setContent(content.value)\n })\n\n // 监听编辑器内容变化\n editor.on('input change undo redo', () => {\n content.value = editor.getContent()\n })\n\n config?.expandSetup?.(editor)\n },\n}\n\nconst initSetting = computed(() => {\n const dealDefaultSetting = defaultSetting\n if (!config.images_upload_handler) {\n // 删除 image 图片 plugin\n if (typeof dealDefaultSetting.plugins === 'string') {\n dealDefaultSetting.plugins = dealDefaultSetting.plugins.replace(\n 'image',\n '',\n )\n }\n else if (Array.isArray(dealDefaultSetting.plugins)) {\n dealDefaultSetting.plugins = dealDefaultSetting.plugins.filter(\n plugin => plugin !== 'image',\n )\n }\n }\n return merge(dealDefaultSetting, config)\n})\n\n// 监听 modelValue 的变化\nwatch(() => modelValue, (newVal) => {\n try {\n // 确保编辑器已初始化且内容确实发生变化\n if (editorInstance.value && newVal !== editorInstance.value?.getContent()) {\n editorInstance.value.setContent(newVal)\n }\n }\n catch (error) {\n console.error('设置编辑器内容时出错:', error)\n }\n})\n\nonMounted(async () => {\n if (typeof window !== 'undefined') {\n tinymce.init(initSetting.value)\n }\n})\n\n// 组件卸载时清理\nonBeforeUnmount(() => {\n if (editorInstance.value) {\n editorInstance.value.destroy()\n editorInstance.value = null\n }\n})\n</script>\n\n<template>\n <div :class=\"ns.e('tiny-mce')\">\n <!-- 使用动态生成的 id -->\n <textarea\n :id=\"uniqueId\"\n v-model=\"content\"\n :name=\"uniqueId\"\n />\n </div>\n</template>\n"],"names":["emit","__emit","ns","useNamespace","basePath","__props","assetsBasePath","editorInstance","shallowRef","uniqueId","ref","Date","now","Math","random","toString","substr","content","computed","get","modelValue","set","val","defaultSetting","selector","value","promotion","license_key","elementpath","language","language_url","skin_url","content_css","min_height","max_height","plugins","toolbar","branding","autoresize","menubar","nonbreaking_force_tab","toolbar_mode","insertdatetime_formats","setup","editor","on","setContent","getContent","config","expandSetup","initSetting","dealDefaultSetting","images_upload_handler","replace","Array","isArray","filter","plugin","merge","watch","newVal","error","console","onMounted","async","window","tinymce","init","onBeforeUnmount","destroy","_createElementBlock","class","_normalizeClass","_unref","e","_createCommentVNode","_createElementVNode","id","$event","name"],"mappings":"2tCA2CA,MAAMA,EAAOC,EAEPC,EAAKC,EAAa,mBAGlBC,EAAWC,EAAAC,gBAAkB,gBAE7BC,EAAiBC,EAA0B,MAE3CC,EAAWC,EACf,qBAAqBC,KAAKC,SAASC,KAAKC,SAASC,SAAS,IAAIC,OAAO,EAAG,MAGpEC,EAAUC,EAAS,CACvBC,IAAA,IACSd,EAAAe,WAET,GAAAC,CAAIC,GACFtB,EAAK,oBAAqBsB,EAC5B,IAGIC,EAAmC,CAEvCC,SAAU,YAAYf,EAASgB,QAC/BC,WAAW,EACXC,YAAa,MACbC,aAAa,EACbC,SAAU,UACVC,aAAc,GAAG1B,4BACjB2B,SAAU,GAAG3B,0BAGb4B,YAAa,GAAG5B,iDAKhB6B,WAAY,IACZC,WAAY,IACZC,QACE,8HACFC,QACE,oPACFC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,uBAAuB,EACvBC,aAAc,UACdC,uBAAwB,CACtB,YACA,YACA,WACA,YA6BFC,MAAQC,IAENA,EAAOC,GAAG,OAAQ,KAEhBtC,EAAekB,MAAQmB,EACvBA,EAAOE,WAAW7B,EAAQQ,SAI5BmB,EAAOC,GAAG,yBAA0B,KAClC5B,EAAQQ,MAAQmB,EAAOG,eAGzB1C,EAAA2C,QAAQC,cAAcL,KAIpBM,EAAchC,EAAS,KAC3B,MAAMiC,EAAqB5B,EAe3B,OAdKlB,EAAA2C,OAAOI,wBAEgC,iBAA/BD,EAAmBhB,QAC5BgB,EAAmBhB,QAAUgB,EAAmBhB,QAAQkB,QACtD,QACA,IAGKC,MAAMC,QAAQJ,EAAmBhB,WACxCgB,EAAmBhB,QAAUgB,EAAmBhB,QAAQqB,UACjC,UAAXC,KAITC,EAAMP,EAAoB9C,EAAA2C,iBAInCW,EAAM,IAAMtD,EAAAe,WAAawC,IACvB,IAEMrD,EAAekB,OAASmC,IAAWrD,EAAekB,OAAOsB,cAC3DxC,EAAekB,MAAMqB,WAAWc,EAEpC,OACOC,GACLC,QAAQD,MAAM,cAAeA,EAC/B,IAGFE,EAAUC,UACc,oBAAXC,QACTC,EAAQC,KAAKjB,EAAYzB,SAK7B2C,EAAgB,KACV7D,EAAekB,QACjBlB,EAAekB,MAAM4C,UACrB9D,EAAekB,MAAQ,oBAMzB6C,EAOM,MAAA,CAPAC,MAAKC,EAAEC,EAAAvE,GAAGwE,EAAC,eACfC,EAAA,kBACAC,EAIE,WAAA,CAHCC,GAAIJ,EAAAhE,6CACIQ,EAAOQ,MAAAqD,EAAA,MACfC,KAAMN,EAAAhE,kBADEgE,EAAAxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"withInstall.mjs","sources":["../../../../packages/components/src/withInstall.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\n\nexport type SFCWithInstall<T> = T & Plugin\n// type SFCwithInstall<T> = T & Plugin\n\nexport function withInstall<T, E extends Record<string, any>>(main: T,\n extra?: E) {\n ; (main as SFCWithInstall<T>).install = (app: App): void => {\n for (const comp of [main, ...Object.values(extra ?? {})]) {\n app.component(comp.name, comp)\n }\n }\n\n if (extra) {\n for (const [key, comp] of Object.entries(extra)) {\n ; (main as any)[key] = comp\n }\n }\n return main as SFCWithInstall<T> & E\n}\n"],"names":["withInstall","main","extra","install","app","comp","Object","values","component","name"],"mappings":"AAKgB,SAAAA,EAA8CC,EAC5DC,GAYO,OAXJD,EAA2BE,QAAWC,IAC5B,IAAA,MAAAC,IAAQ,CAACJ,KAASK,OAAOC,OAAgB,CAAE,IAChDH,EAAAI,UAAUH,EAAKI,KAAMJ,EAC3B,EAQKJ,CACT"}
1
+ {"version":3,"file":"withInstall.mjs","sources":["../../../../packages/components/src/withInstall.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\n\nexport type SFCWithInstall<T> = T & Plugin\n// type SFCwithInstall<T> = T & Plugin\n\nexport function withInstall<T, E extends Record<string, any>>(main: T,\n extra?: E) {\n ; (main as SFCWithInstall<T>).install = (app: App): void => {\n for (const comp of [main, ...Object.values(extra ?? {})]) {\n app.component(comp.name, comp)\n }\n }\n\n if (extra) {\n for (const [key, comp] of Object.entries(extra)) {\n ; (main as any)[key] = comp\n }\n }\n return main as SFCWithInstall<T> & E\n}\n"],"names":["withInstall","main","extra","install","app","comp","Object","values","component","name"],"mappings":"AAKO,SAASA,EAA8CC,EAC5DC,GAYA,OAXGD,EAA2BE,QAAWC,IACvC,IAAA,MAAWC,IAAQ,CAACJ,KAASK,OAAOC,OAAgB,CAAA,IAClDH,EAAII,UAAUH,EAAKI,KAAMJ,IAStBJ,CACT"}
package/lib/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/defaults.cjs"),s=require("./src/data-chart/index.cjs"),r=require("./src/file-upload/index.cjs"),t=require("./src/fixed-action-bar/index.cjs"),o=require("./src/image-upload/index.cjs"),c=require("./src/photo-crop-tool/index.cjs"),i=require("./src/subject-action/index.cjs"),x=require("./src/subject-layout/index.cjs"),u=require("./src/subject-list/index.cjs"),a=require("./src/subject-type/index.cjs"),d=require("./src/tiny-mce-editor/index.cjs"),n=require("./src/icon/index.cjs");const p=e.default.install,j=e.default.version;exports.default=e.default,exports.QxsDataChart=s.QxsDataChart,exports.QxsFileUpload=r.QxsFileUpload,exports.QxsFixedActionBar=t.QxsFixedActionBar,exports.QxsImageUpload=o.QxsImageUpload,exports.QxsPhotoCropTool=c.QxsPhotoCropTool,exports.QxsSubjectAction=i.QxsSubjectAction,exports.QxsSubjectLayout=x.QxsSubjectLayout,exports.QxsSubjectList=u.QxsSubjectList,exports.QxsSubjectType=a.QxsSubjectType,exports.QxsTinyMceEditor=d.QxsTinyMceEditor,exports.Icon=n.Icon,exports.install=p,exports.version=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/defaults.cjs"),s=require("./src/data-chart/index.cjs"),r=require("./src/file-upload/index.cjs"),t=require("./src/fixed-action-bar/index.cjs"),o=require("./src/icon/index.cjs"),c=require("./src/image-upload/index.cjs"),i=require("./src/photo-crop-tool/index.cjs"),x=require("./src/subject-action/index.cjs"),u=require("./src/subject-layout/index.cjs"),a=require("./src/subject-list/index.cjs"),d=require("./src/subject-type/index.cjs"),n=require("./src/tiny-mce-editor/index.cjs");const p=e.default.install,j=e.default.version;exports.default=e.default,exports.QxsDataChart=s.QxsDataChart,exports.QxsFileUpload=r.QxsFileUpload,exports.QxsFixedActionBar=t.QxsFixedActionBar,exports.QxsIcon=o.QxsIcon,exports.QxsImageUpload=c.QxsImageUpload,exports.QxsPhotoCropTool=i.QxsPhotoCropTool,exports.QxsSubjectAction=x.QxsSubjectAction,exports.QxsSubjectLayout=u.QxsSubjectLayout,exports.QxsSubjectList=a.QxsSubjectList,exports.QxsSubjectType=d.QxsSubjectType,exports.QxsTinyMceEditor=n.QxsTinyMceEditor,exports.install=p,exports.version=j;
2
2
  //# sourceMappingURL=index.cjs.map
package/lib/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../packages/components/index.ts"],"sourcesContent":["import installer from './src/defaults'\n\nexport * from './src/components'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":["install","installer","version"],"mappings":"yjBAIaA,MAAAA,EAAUC,EAAAA,QAAUD,QACpBE,EAAUD,EAAAA,QAAUC"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../packages/components/index.ts"],"sourcesContent":["import installer from './src/defaults'\n\nexport * from './src/components'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":["install","installer","version"],"mappings":"yjBAIO,MAAMA,EAAUC,EAAAA,QAAUD,QACpBE,EAAUD,EAAAA,QAAUC"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("vue");const t=/^[a-z0-9]+(-[a-z0-9]+)*$/,n=(e,t,n,r="")=>{const i=e.split(":");if("@"===e.slice(0,1)){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const e=i.pop(),n=i.pop(),c={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!o(c)?null:c}const c=i[0],s=c.split("-");if(s.length>1){const e={provider:r,prefix:s.shift(),name:s.join("-")};return t&&!o(e)?null:e}if(n&&""===r){const e={provider:r,prefix:"",name:c};return t&&!o(e,n)?null:e}return null},o=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name),r=Object.freeze({left:0,top:0,width:16,height:16}),i=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),c=Object.freeze({...r,...i}),s=Object.freeze({...c,body:"",hidden:!1});function l(e,t){const n=function(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const o=((e.rotate||0)+(t.rotate||0))%4;return o&&(n.rotate=o),n}(e,t);for(const o in s)o in i?o in e&&!(o in n)&&(n[o]=i[o]):o in t?n[o]=t[o]:o in e&&(n[o]=e[o]);return n}function a(e,t,n){const o=e.icons,r=e.aliases||Object.create(null);let i={};function c(e){i=l(o[e]||r[e],i)}return c(t),n.forEach(c),l(e,i)}function u(e,t){const n=[];if("object"!=typeof e||"object"!=typeof e.icons)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});const o=function(e){const t=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);return Object.keys(t).concat(Object.keys(n)).forEach(function e(r){if(t[r])return o[r]=[];if(!(r in o)){o[r]=null;const t=n[r]&&n[r].parent,i=t&&e(t);i&&(o[r]=[t].concat(i))}return o[r]}),o}(e);for(const r in o){const i=o[r];i&&(t(r,a(e,r,i)),n.push(r))}return n}const f={provider:"",aliases:{},not_found:{},...r};function p(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function d(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!p(e,f))return null;const n=t.icons;for(const e in n){const t=n[e];if(!e||"string"!=typeof t.body||!p(t,s))return null}const o=t.aliases||Object.create(null);for(const e in o){const t=o[e],r=t.parent;if(!e||"string"!=typeof r||!n[r]&&!o[r]||!p(t,s))return null}return t}const h=Object.create(null);function g(e,t){const n=h[e]||(h[e]=Object.create(null));return n[t]||(n[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function m(e,t){return d(t)?u(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}let b=!1;function v(e){return"boolean"==typeof e&&(b=e),b}function y(e,t){const o=n(e,!0,b);if(!o)return!1;const r=g(o.provider,o.prefix);return t?function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]={...n},!0}catch(e){}return!1}(r,o.name,t):(r.missing.add(o.name),!0)}function x(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),b&&!t&&!e.prefix){let t=!1;return d(e)&&(e.prefix="",u(e,(e,n)=>{y(e,n)&&(t=!0)})),t}const n=e.prefix;if(!o({prefix:n,name:"a"}))return!1;return!!m(g(t,n),e)}const w=Object.freeze({width:null,height:null}),j=Object.freeze({...w,...i}),k=/(-?[0-9.]*[0-9]+[0-9.]*)/g,F=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function O(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const o=e.split(k);if(null===o||!o.length)return e;const r=[];let i=o.shift(),c=F.test(i);for(;;){if(c){const e=parseFloat(i);isNaN(e)?r.push(i):r.push(Math.ceil(e*t*n)/n)}else r.push(i);if(i=o.shift(),void 0===i)return r.join("");c=!c}}function E(e,t){const n={...c,...e},o={...j,...t},r={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,o].forEach(e=>{const t=[],n=e.hFlip,o=e.vFlip;let c,s=e.rotate;switch(n?o?s+=2:(t.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),t.push("scale(-1 1)"),r.top=r.left=0):o&&(t.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),t.push("scale(1 -1)"),r.top=r.left=0),s<0&&(s-=4*Math.floor(s/4)),s%=4,s){case 1:c=r.height/2+r.top,t.unshift("rotate(90 "+c.toString()+" "+c.toString()+")");break;case 2:t.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:c=r.width/2+r.left,t.unshift("rotate(-90 "+c.toString()+" "+c.toString()+")")}s%2==1&&(r.left!==r.top&&(c=r.left,r.left=r.top,r.top=c),r.width!==r.height&&(c=r.width,r.width=r.height,r.height=c)),t.length&&(i=function(e,t,n){const o=function(e,t="defs"){let n="";const o=e.indexOf("<"+t);for(;o>=0;){const r=e.indexOf(">",o),i=e.indexOf("</"+t);if(-1===r||-1===i)break;const c=e.indexOf(">",i);if(-1===c)break;n+=e.slice(r+1,i).trim(),e=e.slice(0,o).trim()+e.slice(c+1)}return{defs:n,content:e}}(e);return r=o.defs,i=t+o.content+n,r?"<defs>"+r+"</defs>"+i:i;var r,i}(i,'<g transform="'+t.join(" ")+'">',"</g>"))});const s=o.width,l=o.height,a=r.width,u=r.height;let f,p;null===s?(p=null===l?"1em":"auto"===l?u:l,f=O(p,a/u)):(f="auto"===s?a:s,p=null===l?O(f,u/a):"auto"===l?u:l);const d={},h=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(d[e]=t.toString())};h("width",f),h("height",p);const g=[r.left,r.top,a,u];return d.viewBox=g.join(" "),{attributes:d,viewBox:g,body:i}}const I=/\sid="(\S+)"/g,T="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let S=0;function C(e,t=T){const n=[];let o;for(;o=I.exec(e);)n.push(o[1]);if(!n.length)return e;const r="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach(n=>{const o="function"==typeof t?t(n):t+(S++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),"")}const L=Object.create(null);function z(e){return L[e]||L[""]}function M(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const A=Object.create(null),P=["https://api.simplesvg.com","https://api.unisvg.com"],R=[];for(;P.length>0;)1===P.length||Math.random()>.5?R.push(P.shift()):R.push(P.pop());function $(e,t){const n=M(t);return null!==n&&(A[e]=n,!0)}function N(e){return A[e]}A[""]=M({resources:["https://api.iconify.design"].concat(R)});let U=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();const q={prepare:(e,t,n)=>{const o=[],r=function(e,t){const n=N(e);if(!n)return 0;let o;if(n.maxURL){let e=0;n.resources.forEach(t=>{const n=t;e=Math.max(e,n.length)});const r=t+".json?icons=";o=n.maxURL-e-n.path.length-r.length}else o=0;return o}(e,t),i="icons";let c={type:i,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,l)=>{s+=n.length+1,s>=r&&l>0&&(o.push(c),c={type:i,provider:e,prefix:t,icons:[]},s=n.length),c.icons.push(n)}),o.push(c),o},send:(e,t,n)=>{if(!U)return void n("abort",424);let o=function(e){if("string"==typeof e){const t=N(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,n=t.icons.join(",");o+=e+".json?"+new URLSearchParams({icons:n}).toString();break}case"custom":{const e=t.uri;o+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void n("abort",400)}let r=503;U(e+o).then(e=>{const t=e.status;if(200===t)return r=501,e.json();setTimeout(()=>{n(function(e){return 404===e}(t)?"abort":"next",t)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{n("success",e)}):setTimeout(()=>{404===e?n("abort",e):n("next",r)})}).catch(()=>{n("next",r)})}};function D(e,t){e.forEach(e=>{const n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}let _=0;var H={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Q(e,t,n,o){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let c;if(e.random){let t=e.resources.slice(0);for(c=[];t.length>1;){const e=Math.floor(Math.random()*t.length);c.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}c=c.concat(t)}else c=e.resources.slice(i).concat(e.resources.slice(0,i));const s=Date.now();let l,a="pending",u=0,f=null,p=[],d=[];function h(){f&&(clearTimeout(f),f=null)}function g(){"pending"===a&&(a="aborted"),h(),p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function m(e,t){t&&(d=[]),"function"==typeof e&&d.push(e)}function b(){a="failed",d.forEach(e=>{e(void 0,l)})}function v(){p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function y(){if("pending"!==a)return;h();const o=c.shift();if(void 0===o)return p.length?void(f=setTimeout(()=>{h(),"pending"===a&&(v(),b())},e.timeout)):void b();const r={status:"pending",resource:o,callback:(t,n)=>{!function(t,n,o){const r="success"!==n;switch(p=p.filter(e=>e!==t),a){case"pending":break;case"failed":if(r||!e.dataAfterTimeout)return;break;default:return}if("abort"===n)return l=o,void b();if(r)return l=o,void(p.length||(c.length?y():b()));if(h(),v(),!e.random){const n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}a="completed",d.forEach(e=>{e(o)})}(r,t,n)}};p.push(r),u++,f=setTimeout(y,e.rotate),n(o,t,r.callback)}return"function"==typeof o&&d.push(o),setTimeout(y),function(){return{startTime:s,payload:t,status:a,queriesSent:u,queriesPending:p.length,subscribe:m,abort:g}}}function B(e){const t={...H,...e};let n=[];function o(){n=n.filter(e=>"pending"===e().status)}return{query:function(e,r,i){const c=Q(t,e,r,(e,t)=>{o(),i&&i(e,t)});return n.push(c),c},find:function(e){return n.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:o}}function V(){}const G=Object.create(null);function J(e,t,n){let o,r;if("string"==typeof e){const t=z(e);if(!t)return n(void 0,424),V;r=t.send;const i=function(e){if(!G[e]){const t=N(e);if(!t)return;const n={config:t,redundancy:B(t)};G[e]=n}return G[e]}(e);i&&(o=i.redundancy)}else{const t=M(e);if(t){o=B(t);const n=z(e.resources?e.resources[0]:"");n&&(r=n.send)}}return o&&r?o.query(t,r,n)().abort:(n(void 0,424),V)}function K(){}function W(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const o=e.provider,r=e.prefix;t.forEach(t=>{const i=t.icons,c=i.pending.length;i.pending=i.pending.filter(t=>{if(t.prefix!==r)return!0;const c=t.name;if(e.icons[c])i.loaded.push({provider:o,prefix:r,name:c});else{if(!e.missing.has(c))return n=!0,!0;i.missing.push({provider:o,prefix:r,name:c})}return!1}),i.pending.length!==c&&(n||D([e],t.id),t.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),t.abort))})}))}(e)}))}function X(e,t,n){function o(){const n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&"object"==typeof n)try{if(!m(e,n).length)return void o()}catch(e){console.error(e)}o(),W(e)}function Y(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Z(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:o}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;const i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i))return void Y(e.loadIcons(r,o,n),t=>{X(e,r,t)});if(i)return void r.forEach(t=>{Y(i(t,o,n),n=>{X(e,[t],n?{prefix:o,icons:{[t]:n}}:null)})});const{valid:c,invalid:s}=function(e){const n=[],o=[];return e.forEach(e=>{(e.match(t)?n:o).push(e)}),{valid:n,invalid:o}}(r);if(s.length&&X(e,s,null),!c.length)return;const l=o.match(t)?z(n):null;if(!l)return void X(e,c,null);l.prepare(n,o,c).forEach(t=>{J(n,t,n=>{X(e,t.icons,n)})})}))}const ee=(e,t)=>{const o=function(e,t=!0,o=!1){const r=[];return e.forEach(e=>{const i="string"==typeof e?n(e,t,o):e;i&&r.push(i)}),r}(e,!0,v()),r=function(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name));let o={provider:"",prefix:"",name:""};return e.forEach(e=>{if(o.name===e.name&&o.prefix===e.prefix&&o.provider===e.provider)return;o=e;const r=e.provider,i=e.prefix,c=e.name,s=n[r]||(n[r]=Object.create(null)),l=s[i]||(s[i]=g(r,i));let a;a=c in l.icons?t.loaded:""===i||l.missing.has(c)?t.missing:t.pending;const u={provider:r,prefix:i,name:c};a.push(u)}),t}(o);if(!r.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(r.loaded,r.missing,r.pending,K)}),()=>{e=!1}}const i=Object.create(null),c=[];let s,l;return r.pending.forEach(e=>{const{provider:t,prefix:n}=e;if(n===l&&t===s)return;s=t,l=n,c.push(g(t,n));const o=i[t]||(i[t]=Object.create(null));o[n]||(o[n]=[])}),r.pending.forEach(e=>{const{provider:t,prefix:n,name:o}=e,r=g(t,n),c=r.pendingIcons||(r.pendingIcons=new Set);c.has(o)||(c.add(o),i[t][n].push(o))}),c.forEach(e=>{const t=i[e.provider][e.prefix];t.length&&Z(e,t)}),t?function(e,t,n){const o=_++,r=D.bind(null,n,o);if(!t.pending.length)return r;const i={id:o,icons:t,callback:e,abort:r};return n.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(i)}),r}(t,r,c):K};const te=/[\s,]+/;function ne(e,t){t.split(te).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function oe(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(e){for(;e<0;)e+=4;return e%4}if(""===n){const t=parseInt(e);return isNaN(t)?0:o(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let r=parseFloat(e.slice(0,e.length-n.length));return isNaN(r)?0:(r/=t,r%1==0?o(r):0)}}return t}const re={...j,inline:!1},ie={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},ce={display:"inline-block"},se={backgroundColor:"currentColor"},le={backgroundColor:"transparent"},ae={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},ue={webkitMask:se,mask:se,background:le};for(const e in ue){const t=ue[e];for(const n in ae)t[e+n]=ae[n]}const fe={};function pe(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";fe[e+"-flip"]=t,fe[e.slice(0,1)+"-flip"]=t,fe[e+"Flip"]=t});const de=(t,n)=>{const o=function(e,t){const n={...e};for(const e in t){const o=t[e],r=typeof o;e in w?(null===o||o&&("string"===r||"number"===r))&&(n[e]=o):r===typeof n[e]&&(n[e]="rotate"===e?o%4:o)}return n}(re,n),r={...ie},i=n.mode||"svg",c={},s=n.style,l="object"!=typeof s||s instanceof Array?{}:s;for(let e in n){const t=n[e];if(void 0!==t)switch(e){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":o[e]=!0===t||"true"===t||1===t;break;case"flip":"string"==typeof t&&ne(o,t);break;case"color":c.color=t;break;case"rotate":"string"==typeof t?o[e]=oe(t):"number"==typeof t&&(o[e]=t);break;case"ariaHidden":case"aria-hidden":!0!==t&&"true"!==t&&delete r["aria-hidden"];break;default:{const n=fe[e];n?!0!==t&&"true"!==t&&1!==t||(o[n]=!0):void 0===re[e]&&(r[e]=t)}}}const a=E(t,o),u=a.attributes;if(o.inline&&(c.verticalAlign="-0.125em"),"svg"===i){r.style={...c,...l},Object.assign(r,u);let t=0,o=n.id;return"string"==typeof o&&(o=o.replace(/-/g,"_")),r.innerHTML=C(a.body,o?()=>o+"ID"+t++:"iconifyVue"),e.h("svg",r)}const{body:f,width:p,height:d}=t,h="mask"===i||"bg"!==i&&-1!==f.indexOf("currentColor"),g=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in t)n+=" "+e+'="'+t[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}(f,{...u,width:p+"",height:d+""});var m;return r.style={...c,"--svg":(m=g,'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(m)+'")'),width:pe(u.width),height:pe(u.height),...ce,...h?se:le,...l},e.h("span",r)};var he;if(v(!0),he=q,L[""]=he,"undefined"!=typeof document&&"undefined"!=typeof window){const e=window;if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!x(e))&&console.error(n)}catch(e){console.error(n)}})}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){const n="IconifyProviders["+e+"] is invalid.";try{const o=t[e];if("object"!=typeof o||!o||void 0===o.resources)continue;$(e,o)||console.error(n)}catch(e){console.error(n)}}}}const ge={...c,body:""},me=e.defineComponent((t,{emit:o})=>{const r=e.ref(null);function i(){r.value&&(r.value.abort?.(),r.value=null)}const s=e.ref(!!t.ssr),l=e.ref(""),a=e.shallowRef(null);function u(){const c=t.icon;if("object"==typeof c&&null!==c&&"string"==typeof c.body)return l.value="",{data:c};let s;if("string"!=typeof c||null===(s=n(c,!1,!0)))return null;let a=function(e){const t="string"==typeof e?n(e,!0,b):e;if(t){const e=g(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}(s);if(!a){const e=r.value;return e&&e.name===c||(r.value=null===a?{name:c}:{name:c,abort:ee([s],f)}),null}i(),l.value!==c&&(l.value=c,e.nextTick(()=>{o("load",c)}));const u=t.customise;if(u){a=Object.assign({},a);const e=u(a.body,s.name,s.prefix,s.provider);"string"==typeof e&&(a.body=e)}const p=["iconify"];return""!==s.prefix&&p.push("iconify--"+s.prefix),""!==s.provider&&p.push("iconify--"+s.provider),{data:a,classes:p}}function f(){const e=u();e?e.data!==a.value?.data&&(a.value=e):a.value=null}return s.value?f():e.onMounted(()=>{s.value=!0,f()}),e.watch(()=>t.icon,f),e.onUnmounted(i),()=>{const e=a.value;if(!e)return de(ge,t);let n=t;return e.classes&&(n={...t,class:e.classes.join(" ")}),de({...c,...e.data},n)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]});exports.Icon=me,exports.addAPIProvider=$,exports.addCollection=x,exports.addIcon=y,exports.buildIcon=E,exports.calculateSize=O,exports.loadIcons=ee,exports.replaceIDs=C;
2
+ //# sourceMappingURL=iconify.cjs.map