@qxs-bns/components-wc 0.0.2

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 (141) hide show
  1. package/es/base/define.mjs +2 -0
  2. package/es/base/define.mjs.map +1 -0
  3. package/es/base/uid.mjs +2 -0
  4. package/es/base/uid.mjs.map +1 -0
  5. package/es/editor/blocksuite-editor.mjs +931 -0
  6. package/es/editor/blocksuite-editor.mjs.map +1 -0
  7. package/es/editor/index.mjs +2 -0
  8. package/es/editor/index.mjs.map +1 -0
  9. package/es/index.mjs +2 -0
  10. package/es/index.mjs.map +1 -0
  11. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs +7 -0
  12. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs.map +1 -0
  13. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs +7 -0
  14. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs.map +1 -0
  15. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs +7 -0
  16. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs.map +1 -0
  17. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs +7 -0
  18. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs.map +1 -0
  19. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs +2 -0
  20. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs.map +1 -0
  21. package/es/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs +2 -0
  22. package/es/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs.map +1 -0
  23. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs +7 -0
  24. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs.map +1 -0
  25. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs +7 -0
  26. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs.map +1 -0
  27. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs +7 -0
  28. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs.map +1 -0
  29. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs +7 -0
  30. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs.map +1 -0
  31. package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs +2 -0
  32. package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs.map +1 -0
  33. package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs +2 -0
  34. package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs.map +1 -0
  35. package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs +2 -0
  36. package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs.map +1 -0
  37. package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs +2 -0
  38. package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs.map +1 -0
  39. package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs +2 -0
  40. package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs.map +1 -0
  41. package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs +2 -0
  42. package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs.map +1 -0
  43. package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs +2 -0
  44. package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs.map +1 -0
  45. package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs +2 -0
  46. package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs.map +1 -0
  47. package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs +2 -0
  48. package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs.map +1 -0
  49. package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs +2 -0
  50. package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs.map +1 -0
  51. package/es/subject/action.mjs +118 -0
  52. package/es/subject/action.mjs.map +1 -0
  53. package/es/subject/blank-fill.mjs +204 -0
  54. package/es/subject/blank-fill.mjs.map +1 -0
  55. package/es/subject/layout.mjs +18 -0
  56. package/es/subject/layout.mjs.map +1 -0
  57. package/es/subject/list.mjs +128 -0
  58. package/es/subject/list.mjs.map +1 -0
  59. package/es/subject/page-end.mjs +25 -0
  60. package/es/subject/page-end.mjs.map +1 -0
  61. package/es/subject/rich-text.mjs +27 -0
  62. package/es/subject/rich-text.mjs.map +1 -0
  63. package/es/subject/scale.mjs +162 -0
  64. package/es/subject/scale.mjs.map +1 -0
  65. package/es/subject/single.mjs +318 -0
  66. package/es/subject/single.mjs.map +1 -0
  67. package/es/subject/text-fill.mjs +229 -0
  68. package/es/subject/text-fill.mjs.map +1 -0
  69. package/es/subject/type.mjs +42 -0
  70. package/es/subject/type.mjs.map +1 -0
  71. package/lib/base/define.cjs +2 -0
  72. package/lib/base/define.cjs.map +1 -0
  73. package/lib/base/uid.cjs +2 -0
  74. package/lib/base/uid.cjs.map +1 -0
  75. package/lib/editor/blocksuite-editor.cjs +931 -0
  76. package/lib/editor/blocksuite-editor.cjs.map +1 -0
  77. package/lib/editor/index.cjs +2 -0
  78. package/lib/editor/index.cjs.map +1 -0
  79. package/lib/index.cjs +2 -0
  80. package/lib/index.cjs.map +1 -0
  81. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs +7 -0
  82. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs.map +1 -0
  83. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs +7 -0
  84. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs.map +1 -0
  85. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs +7 -0
  86. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs.map +1 -0
  87. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs +7 -0
  88. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs.map +1 -0
  89. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs +2 -0
  90. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs.map +1 -0
  91. package/lib/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs +2 -0
  92. package/lib/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs.map +1 -0
  93. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs +7 -0
  94. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs.map +1 -0
  95. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs +7 -0
  96. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs.map +1 -0
  97. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs +8 -0
  98. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs.map +1 -0
  99. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs +7 -0
  100. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs.map +1 -0
  101. package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs +2 -0
  102. package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs.map +1 -0
  103. package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs +2 -0
  104. package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs.map +1 -0
  105. package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs +2 -0
  106. package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs.map +1 -0
  107. package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs +2 -0
  108. package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs.map +1 -0
  109. package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs +2 -0
  110. package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs.map +1 -0
  111. package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs +2 -0
  112. package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs.map +1 -0
  113. package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs +2 -0
  114. package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs.map +1 -0
  115. package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs +2 -0
  116. package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs.map +1 -0
  117. package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs +2 -0
  118. package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs.map +1 -0
  119. package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs +2 -0
  120. package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs.map +1 -0
  121. package/lib/subject/action.cjs +118 -0
  122. package/lib/subject/action.cjs.map +1 -0
  123. package/lib/subject/blank-fill.cjs +204 -0
  124. package/lib/subject/blank-fill.cjs.map +1 -0
  125. package/lib/subject/layout.cjs +18 -0
  126. package/lib/subject/layout.cjs.map +1 -0
  127. package/lib/subject/list.cjs +128 -0
  128. package/lib/subject/list.cjs.map +1 -0
  129. package/lib/subject/page-end.cjs +25 -0
  130. package/lib/subject/page-end.cjs.map +1 -0
  131. package/lib/subject/rich-text.cjs +27 -0
  132. package/lib/subject/rich-text.cjs.map +1 -0
  133. package/lib/subject/scale.cjs +162 -0
  134. package/lib/subject/scale.cjs.map +1 -0
  135. package/lib/subject/single.cjs +318 -0
  136. package/lib/subject/single.cjs.map +1 -0
  137. package/lib/subject/text-fill.cjs +229 -0
  138. package/lib/subject/text-fill.cjs.map +1 -0
  139. package/lib/subject/type.cjs +42 -0
  140. package/lib/subject/type.cjs.map +1 -0
  141. package/package.json +77 -0
@@ -0,0 +1,128 @@
1
+ "use strict";var e=require("lit"),t=require("../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs"),s=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),i=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),a=require("sortablejs"),r=require("../base/define.cjs"),o=require("../base/uid.cjs"),n=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=(e,t,s,i)=>{for(var a,r=i>1?void 0:i?l(t,s):t,o=e.length-1;o>=0;o--)(a=e[o])&&(r=(i?a(t,s,r):a(r))||r);return i&&r&&n(t,s,r),r};const c={single:"单选题",multiple:"多选题",sort:"排序题",blank_fill:"填空题",text_fill:"问答题",scale:"量表题",rich_text:"富文本",page_end:"分页符"};exports.QxsSubjectList=class extends e.LitElement{constructor(){super(...arguments),this.isPreview=!1,this._list=[],this._sortMode=!1,this._sortable=null,this._initialDataProcessed=!1}get subjectList(){return this._list}set subjectList(e){if(e){if("string"==typeof e)try{e=JSON.parse(e)}catch{return this._list=[],void this.requestUpdate()}if(!Array.isArray(e))return this._list=[],void this.requestUpdate();this._list=e.map(e=>({...e,customId:e.customId||o.uid()})),this.requestUpdate()}else this._list=[]}attributeChangedCallback(e,t,s){if(super.attributeChangedCallback(e,t,s),"subject-list"===e&&s&&!this._list.length){if(s.includes("[object Object]"))return;try{const e=JSON.parse(s);Array.isArray(e)&&(this._list=e.map(e=>({...e,customId:e.customId||o.uid()})),this.requestUpdate())}catch{}}}get _isPreviewValue(){const e=this.isPreview;return"string"==typeof e?"false"!==e:!!e}connectedCallback(){super.connectedCallback(),this._initialDataProcessed||(this._initialDataProcessed=!0,Promise.resolve().then(()=>{0===this._list.length&&this._processAttributeList()}))}_processAttributeList(){const e=this.getAttribute("subject-list");if(e&&"[]"!==e&&!e.includes("[object Object]"))try{const t=JSON.parse(e);Array.isArray(t)&&t.length>0&&(this._list=t.map(e=>({...e,customId:e.customId||o.uid()})),this.requestUpdate())}catch{}}firstUpdated(){this.updateComplete.then(()=>this._initSortable())}updated(e){e.has("_sortMode")&&(this._sortable?.destroy(),this._sortable=null,this.updateComplete.then(()=>this._initSortable())),e.has("_list")&&this._sortMode&&setTimeout(()=>{this._sortable&&(this._sortable.destroy(),this._sortable=null),this._initSortable()},50)}disconnectedCallback(){super.disconnectedCallback(),this._sortable?.destroy(),this._sortable=null}_initSortable(){if(!this._sortMode)return;const e=this.shadowRoot?.querySelector(".sort-list");e&&(this._sortable&&(this._sortable.destroy(),this._sortable=null),requestAnimationFrame(()=>{const e=this.shadowRoot?.querySelector(".sort-list");e&&!this._sortable&&(this._sortable=a.create(e,{handle:".sort-handle",animation:200,ghostClass:"sort-ghost",chosenClass:"sort-chosen",onEnd:e=>{const{oldIndex:t,newIndex:s}=e;if(void 0===t||void 0===s||t===s)return;const i=[...this._list],[a]=i.splice(t,1);i.splice(s,0,a),this._list=i,this._emit("change",this._list)}}))}))}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}get currentList(){return this._list}addSubject(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const i={customId:o.uid(),answerType:e,title:"",answers:[],analysis:"",scaleQuestionList:[],isEdit:!0,isSave:!1,isRealCanDel:!0,hasSet:!1,isKey:!1,answerCheckType:1,examAnswerRelationType:s??0},a=[...this._list];"number"==typeof t&&t>=0?a.splice(t+1,0,i):a.push(i),this._list=a,this._emit("change",this._list)}addExam(e){let t=1;const s=[];e.forEach(e=>{const i={...e,customId:e.customId||o.uid(),answers:e.answers?.map(e=>({...e,title:e.answer,answerId:e.examAnswerId,isCorrect:e.isCorrect}))||[],isEdit:!0,isSave:!1,isRealCanDel:!0,hasSet:!1};e.richTextContent||(i.answerType=e.examTypeEnum),i.pageIndex>t&&(s.push({customId:o.uid(),answerType:"page_end",analysis:"",scaleQuestionList:[],isEdit:!0,isSave:!1,isRealCanDel:!0,hasSet:!1,examAnswerRelationType:0}),t=i.pageIndex),s.push(i)}),this._list=[...this._list,...s],this._emit("change",this._list)}uploadExcel(e){this._list=[...this._list,...e.map(e=>({...e,customId:e.customId||o.uid(),isRealCanDel:!0}))],this._emit("change",this._list)}setAnswerRelation(e,t,s){const i=this._list.find(e=>e.customId===t);if(i){const t=i.answers?.find(e=>e.customAnswerId===s);t&&(t.answerRelations=e)}this.requestUpdate(),this._emit("change",this._list)}_orderIndex(e){let t=0,s=0;return this._list.forEach(i=>{"page_end"!==i.answerType&&(t++,i.customId===e&&(s=t))}),s-1}_pageIndex(e){return this._list.filter(e=>"page_end"===e.answerType).findIndex(t=>t.customId===e)+1}_totalPages(){return this._list.filter(e=>"page_end"===e.answerType).length}_move(e,t){const s=[...this._list];"up"===t&&e>0?[s[e-1],s[e]]=[s[e],s[e-1]]:"down"===t&&e<s.length-1&&([s[e],s[e+1]]=[s[e+1],s[e]]),this._list=s,this._emit("change",this._list)}_save(e,t){this._list=this._list.map((s,i)=>i===e?{...s,...t.detail,isEdit:!1,isSave:!0}:s),this._emit("change",this._list)}_deleteByCustomId(e){this._list=this._list.filter(t=>t.customId!==e),this._emit("change",this._list)}_delete(e){const t=[...this._list];t.splice(e,1),this._list=t,this._emit("change",this._list)}_setEdit(e,t){this._list=this._list.map((s,i)=>i===e?{...s,isEdit:t}:s)}_renderItem(t,s){const i=this._orderIndex(t.customId),a=(t.isEdit,t.hasSet,t.isRealCanDel,this._isPreviewValue,t.examAnswerRelationType,e=>this._move(s,e.detail)),r=()=>this._deleteByCustomId(t.customId),o=e=>this._save(s,e),n=()=>this._setEdit(s,!0),l=e=>this.addSubject(e.detail?.type??e.detail,s);return["single","multiple","sort"].includes(t.answerType)?e.html`<qxs-subject-single
2
+ .title=${t.title||""}
3
+ .answerList=${t.answers||[]}
4
+ order-index=${i}
5
+ ?is-edit=${t.isEdit}
6
+ ?is-set=${t.hasSet}
7
+ ?is-save=${!t.isRealCanDel}
8
+ ?show-action=${!this._isPreviewValue}
9
+ ?is-key=${t.isKey}
10
+ type=${t.answerType}
11
+ answer-check-type=${t.answerCheckType??1}
12
+ exam-answer-relation-type=${t.examAnswerRelationType??0}
13
+ rich-text-content=${t.examRichTextContent||""}
14
+ analysis=${t.analysis||""}
15
+ least-answer-count=${t.leastAnswerCount??2}
16
+ exam-expand=${t.examExpand||""}
17
+ custom-id=${t.customId||""}
18
+ exam-id=${t.examId??0}
19
+ @move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
20
+ @set-relation=${e=>this._emit("set-relation",e.detail)}
21
+ ></qxs-subject-single>`:"blank_fill"===t.answerType?e.html`<qxs-blank-fill
22
+ .title=${t.title||""}
23
+ .answerList=${t.answers||[]}
24
+ .examAnswerSetting=${t.examAnswerSettingVO||{}}
25
+ order-index=${i}
26
+ ?is-edit=${t.isEdit} ?is-set=${t.hasSet} ?is-save=${!t.isRealCanDel} ?show-action=${!this._isPreviewValue}
27
+ exam-answer-relation-type=${t.examAnswerRelationType??0}
28
+ exam-expand=${t.examExpand||""}
29
+ rich-text-content=${t.examRichTextContent||""}
30
+ analysis=${t.analysis||""}
31
+ @move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
32
+ ></qxs-blank-fill>`:"text_fill"===t.answerType?e.html`<qxs-text-fill
33
+ .title=${t.title||""}
34
+ .answerList=${t.answers||[]}
35
+ .examAnswerSetting=${t.examAnswerSettingVO||{}}
36
+ order-index=${i}
37
+ ?is-edit=${t.isEdit} ?is-set=${t.hasSet} ?is-save=${!t.isRealCanDel} ?show-action=${!this._isPreviewValue}
38
+ exam-answer-relation-type=${t.examAnswerRelationType??0}
39
+ exam-expand=${t.examExpand||""}
40
+ rich-text-content=${t.examRichTextContent||""}
41
+ analysis=${t.analysis||""}
42
+ @move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
43
+ ></qxs-text-fill>`:"scale"===t.answerType?e.html`<qxs-scale
44
+ .title=${t.title||""}
45
+ .answerList=${t.answers||[]}
46
+ .scaleQuestions=${t.scaleQuestionList||[]}
47
+ order-index=${i}
48
+ ?is-edit=${t.isEdit} ?is-set=${t.hasSet} ?is-save=${!t.isRealCanDel} ?show-action=${!this._isPreviewValue}
49
+ exam-answer-relation-type=${t.examAnswerRelationType??0}
50
+ rich-text-content=${t.examRichTextContent||""}
51
+ analysis=${t.analysis||""}
52
+ @move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
53
+ ></qxs-scale>`:"rich_text"===t.answerType?e.html`<qxs-subject-rich-text
54
+ order-index=${i}
55
+ ?is-edit=${t.isEdit} ?is-set=${t.hasSet} ?is-save=${!t.isRealCanDel} ?show-action=${!this._isPreviewValue}
56
+ exam-answer-relation-type=${t.examAnswerRelationType??0}
57
+ rich-text-content=${t.richTextContent||t.examRichTextContent||""}
58
+ @move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
59
+ ></qxs-subject-rich-text>`:"page_end"===t.answerType?e.html`<qxs-page-end
60
+ current-page-index=${this._pageIndex(t.customId)}
61
+ total-page=${this._totalPages()}
62
+ ?show-action=${!this._isPreviewValue}
63
+ @move=${a} @delete=${r} @add=${l}
64
+ ></qxs-page-end>`:e.html`<div style="color:#909399;padding:8px">未知题型: ${t.answerType}</div>`}render(){return e.html`
65
+ <div class="wrapper">
66
+ ${!this._isPreviewValue&&this._list.length>1?e.html`
67
+ <div class="sort-mode-toggle">
68
+ <button class="btn ${this._sortMode?"primary":""}" @click=${()=>{this._sortMode=!this._sortMode}}>
69
+ ${this._sortMode?"":e.html`
70
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
71
+ <path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/>
72
+ </svg>
73
+ `}
74
+ ${this._sortMode?"完成排序":"排序"}
75
+ </button>
76
+ </div>
77
+ `:""}
78
+ ${this._sortMode?e.html`
79
+ <div class="sort-list">
80
+ ${t.repeat(this._list,e=>e.customId,(t,s)=>e.html`
81
+ <div class="sort-item" data-id=${t.customId}>
82
+ <span class="sort-handle">
83
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
84
+ <path d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
85
+ </svg>
86
+ </span>
87
+ <span class="sort-index">${s+1}.</span>
88
+ <span class="sort-title">${t.title||"未命名题目"}</span>
89
+ <span class="sort-type">${c[t.answerType]||t.answerType}</span>
90
+ </div>
91
+ `)}
92
+ </div>
93
+ `:e.html`
94
+ <div class="subject-list">
95
+ ${this._list.map((t,s)=>e.html`
96
+ <div class="subject-item ${this._isPreviewValue?"is-preview":""}" key=${t.customId}>
97
+ <div class="subject-content">${this._renderItem(t,s)}</div>
98
+ </div>
99
+ `)}
100
+ </div>
101
+ `}
102
+ </div>
103
+ `}},exports.QxsSubjectList.styles=e.css`
104
+ :host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; }
105
+ *, ::before, ::after { box-sizing: border-box; }
106
+ .wrapper { width: 100%; padding: 16px; margin-bottom: 16px; background: #fff; border: 1px solid #ebeef5; border-radius: 4px; }
107
+ .sort-mode-toggle { display: flex; justify-content: flex-end; margin-bottom: 12px; }
108
+ .btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; font-size: 12px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266; cursor: pointer; transition: all 0.2s; }
109
+ .btn:hover { color: #409eff; border-color: #c6e2ff; background: #ecf5ff; }
110
+ .btn.primary { background: #409eff; border-color: #409eff; color: #fff; }
111
+ .btn.primary:hover { background: #337ecc; border-color: #337ecc; }
112
+ .subject-list { display: flex; flex-direction: column; }
113
+ .subject-item { position: relative; display: flex; align-items: flex-start; transition: background-color 0.3s ease; }
114
+ .subject-content { flex: 1; min-width: 0; }
115
+ .ghost { opacity: 0.5; background: #ecf5ff; }
116
+ .chosen { box-shadow: 0 4px 16px rgba(64,158,255,.3); }
117
+ .sort-list { display: flex; flex-direction: column; gap: 8px; }
118
+ .sort-item { display: flex; align-items: center; padding: 12px 16px; background: #f8f9fa; border: 1px solid #e4e7ed; border-radius: 6px; cursor: grab; transition: all 0.3s ease; }
119
+ .sort-item:hover { background: #ecf5ff; border-color: #c6e2ff; }
120
+ .sort-item:active { cursor: grabbing; }
121
+ .sort-item.sort-ghost { opacity: 0.5; background: #ecf5ff; border: 2px dashed #409eff; }
122
+ .sort-item.sort-chosen { background: #ecf5ff; border-color: #409eff; box-shadow: 0 4px 16px rgba(64,158,255,.3); transform: scale(1.02); }
123
+ .sort-handle { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 12px; color: #909399; flex-shrink: 0; }
124
+ .sort-index { font-size: 13px; color: #606266; font-weight: 500; margin-right: 8px; min-width: 24px; flex-shrink: 0; }
125
+ .sort-title { flex: 1; font-size: 14px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
126
+ .sort-type { font-size: 12px; color: #909399; margin-left: 12px; padding: 2px 8px; background: #f0f0f0; border-radius: 4px; flex-shrink: 0; }
127
+ `,d([s.property({attribute:"is-preview"})],exports.QxsSubjectList.prototype,"isPreview",2),d([s.property({type:Array})],exports.QxsSubjectList.prototype,"subjectList",1),d([i.state()],exports.QxsSubjectList.prototype,"_list",2),d([i.state()],exports.QxsSubjectList.prototype,"_sortMode",2),exports.QxsSubjectList=d([r.safeCustomElement("qxs-subject-list")],exports.QxsSubjectList);
128
+ //# sourceMappingURL=list.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.cjs","sources":["../../../../packages/components-wc/src/subject/list.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { property, state } from 'lit/decorators.js'\nimport Sortable from 'sortablejs'\nimport { safeCustomElement } from '../base/define'\nimport { uid } from '../base/uid'\n\nconst TYPE_LABEL: Record<string, string> = {\n single: '单选题', multiple: '多选题', sort: '排序题',\n blank_fill: '填空题', text_fill: '问答题', scale: '量表题',\n rich_text: '富文本', page_end: '分页符',\n}\n\n@safeCustomElement('qxs-subject-list')\nexport class QxsSubjectList extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 13px; }\n *, ::before, ::after { box-sizing: border-box; }\n .wrapper { width: 100%; padding: 16px; margin-bottom: 16px; background: #fff; border: 1px solid #ebeef5; border-radius: 4px; }\n .sort-mode-toggle { display: flex; justify-content: flex-end; margin-bottom: 12px; }\n .btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; font-size: 12px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266; cursor: pointer; transition: all 0.2s; }\n .btn:hover { color: #409eff; border-color: #c6e2ff; background: #ecf5ff; }\n .btn.primary { background: #409eff; border-color: #409eff; color: #fff; }\n .btn.primary:hover { background: #337ecc; border-color: #337ecc; }\n .subject-list { display: flex; flex-direction: column; }\n .subject-item { position: relative; display: flex; align-items: flex-start; transition: background-color 0.3s ease; }\n .subject-content { flex: 1; min-width: 0; }\n .ghost { opacity: 0.5; background: #ecf5ff; }\n .chosen { box-shadow: 0 4px 16px rgba(64,158,255,.3); }\n .sort-list { display: flex; flex-direction: column; gap: 8px; }\n .sort-item { display: flex; align-items: center; padding: 12px 16px; background: #f8f9fa; border: 1px solid #e4e7ed; border-radius: 6px; cursor: grab; transition: all 0.3s ease; }\n .sort-item:hover { background: #ecf5ff; border-color: #c6e2ff; }\n .sort-item:active { cursor: grabbing; }\n .sort-item.sort-ghost { opacity: 0.5; background: #ecf5ff; border: 2px dashed #409eff; }\n .sort-item.sort-chosen { background: #ecf5ff; border-color: #409eff; box-shadow: 0 4px 16px rgba(64,158,255,.3); transform: scale(1.02); }\n .sort-handle { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 12px; color: #909399; flex-shrink: 0; }\n .sort-index { font-size: 13px; color: #606266; font-weight: 500; margin-right: 8px; min-width: 24px; flex-shrink: 0; }\n .sort-title { flex: 1; font-size: 14px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .sort-type { font-size: 12px; color: #909399; margin-left: 12px; padding: 2px 8px; background: #f0f0f0; border-radius: 4px; flex-shrink: 0; }\n `\n\n @property({ attribute: 'is-preview' }) isPreview = false\n\n @property({ type: Array })\n get subjectList() { return this._list }\n\n set subjectList(v: any) {\n if (!v) {\n this._list = []\n return\n }\n if (typeof v === 'string') {\n try {\n v = JSON.parse(v)\n }\n catch {\n this._list = []\n this.requestUpdate()\n return\n }\n }\n if (!Array.isArray(v)) {\n this._list = []\n this.requestUpdate()\n return\n }\n this._list = v.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n\n attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null) {\n super.attributeChangedCallback(name, oldVal, newVal)\n if (name === 'subject-list' && newVal && !this._list.length) {\n if (newVal.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(newVal)\n if (Array.isArray(parsed)) {\n this._list = parsed.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n }\n\n @state() private _list: any[] = []\n @state() private _sortMode = false\n private _sortable: Sortable | null = null\n\n private get _isPreviewValue(): boolean {\n const val = (this as any).isPreview\n return typeof val === 'string' ? val !== 'false' : !!val\n }\n\n private _initialDataProcessed = false\n\n connectedCallback() {\n super.connectedCallback()\n if (!this._initialDataProcessed) {\n this._initialDataProcessed = true\n Promise.resolve().then(() => {\n if (this._list.length === 0) {\n this._processAttributeList()\n }\n })\n }\n }\n\n private _processAttributeList() {\n const attr = this.getAttribute('subject-list')\n if (!attr || attr === '[]') { return }\n if (attr.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(attr)\n if (Array.isArray(parsed) && parsed.length > 0) {\n this._list = parsed.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n\n firstUpdated() {\n this.updateComplete.then(() => this._initSortable())\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('_sortMode')) {\n this._sortable?.destroy()\n this._sortable = null\n this.updateComplete.then(() => this._initSortable())\n }\n // Reinitialize Sortable when list changes in sort mode\n if (changed.has('_list') && this._sortMode) {\n // Small delay to let Lit finish DOM updates\n setTimeout(() => {\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n this._initSortable()\n }, 50)\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._sortable?.destroy()\n this._sortable = null\n }\n\n private _initSortable() {\n if (!this._sortMode)\n return\n const el = this.shadowRoot?.querySelector<HTMLElement>('.sort-list')\n if (!el)\n return\n \n // Destroy existing instance first\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n \n // Small delay to ensure DOM is ready after previous destroy\n requestAnimationFrame(() => {\n const currentEl = this.shadowRoot?.querySelector<HTMLElement>('.sort-list')\n if (!currentEl || this._sortable) return\n \n this._sortable = Sortable.create(currentEl, {\n handle: '.sort-handle',\n animation: 200,\n ghostClass: 'sort-ghost',\n chosenClass: 'sort-chosen',\n onEnd: (evt) => {\n const { oldIndex, newIndex } = evt\n if (oldIndex === undefined || newIndex === undefined || oldIndex === newIndex) { return }\n const arr = [...this._list]\n const [item] = arr.splice(oldIndex, 1)\n arr.splice(newIndex, 0, item)\n this._list = arr\n this._emit('change', this._list)\n },\n })\n })\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n // ── public API ────────────────────────────────────────────────\n get currentList() { return this._list }\n\n addSubject(type: string, index?: number, examAnswerRelationType: number | null = null) {\n const item = {\n customId: uid(), answerType: type, title: '',\n answers: [], analysis: '', scaleQuestionList: [],\n isEdit: true, isSave: false, isRealCanDel: true, hasSet: false,\n isKey: false, answerCheckType: 1,\n examAnswerRelationType: examAnswerRelationType ?? 0,\n }\n const arr = [...this._list]\n if (typeof index === 'number' && index >= 0) {\n arr.splice(index + 1, 0, item)\n }\n else { arr.push(item) }\n this._list = arr\n this._emit('change', this._list)\n }\n\n addExam(items: any[]) {\n let pageIdx = 1\n const newItems: any[] = []\n items.forEach((v: any) => {\n const item: any = {\n ...v,\n customId: v.customId || uid(),\n answers: v.answers?.map((c: any) => ({ ...c, title: c.answer, answerId: c.examAnswerId, isCorrect: c.isCorrect })) || [],\n isEdit: true, isSave: false, isRealCanDel: true, hasSet: false,\n }\n if (!v.richTextContent) {\n item.answerType = v.examTypeEnum\n }\n if (item.pageIndex > pageIdx) {\n newItems.push({ customId: uid(), answerType: 'page_end', analysis: '', scaleQuestionList: [], isEdit: true, isSave: false, isRealCanDel: true, hasSet: false, examAnswerRelationType: 0 })\n pageIdx = item.pageIndex\n }\n newItems.push(item)\n })\n this._list = [...this._list, ...newItems]\n this._emit('change', this._list)\n }\n\n uploadExcel(list: any[]) {\n this._list = [...this._list, ...list.map((i: any) => ({ ...i, customId: i.customId || uid(), isRealCanDel: true }))]\n this._emit('change', this._list)\n }\n\n setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const item = this._list.find((v: any) => v.customId === customId)\n if (item) {\n const ans = item.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (ans) { ans.answerRelations = answerRelations }\n }\n this.requestUpdate()\n this._emit('change', this._list)\n }\n\n // ── private helpers ───────────────────────────────────────────\n private _orderIndex(customId: string) {\n let n = 0; let out = 0\n this._list.forEach((v: any) => {\n if (v.answerType !== 'page_end') {\n n++; if (v.customId === customId) { out = n }\n }\n })\n return out - 1\n }\n\n private _pageIndex(customId: string) {\n const pages = this._list.filter((v: any) => v.answerType === 'page_end')\n const idx = pages.findIndex((v: any) => v.customId === customId)\n return idx + 1\n }\n\n private _totalPages() {\n return this._list.filter((v: any) => v.answerType === 'page_end').length\n }\n\n private _move(index: number, dir: 'up' | 'down') {\n const arr = [...this._list]\n if (dir === 'up' && index > 0) { [arr[index - 1], arr[index]] = [arr[index], arr[index - 1]] }\n else if (dir === 'down' && index < arr.length - 1) { [arr[index], arr[index + 1]] = [arr[index + 1], arr[index]] }\n this._list = arr\n this._emit('change', this._list)\n }\n\n private _save(index: number, e: CustomEvent) {\n this._list = this._list.map((item, i) =>\n i === index ? { ...item, ...e.detail, isEdit: false, isSave: true } : item,\n )\n this._emit('change', this._list)\n }\n\n private _deleteByCustomId(customId: string) {\n this._list = this._list.filter(item => item.customId !== customId)\n this._emit('change', this._list)\n }\n\n private _delete(index: number) {\n const arr = [...this._list]\n arr.splice(index, 1)\n this._list = arr\n this._emit('change', this._list)\n }\n\n private _setEdit(index: number, val: boolean) {\n this._list = this._list.map((item, i) => i === index ? { ...item, isEdit: val } : item)\n }\n\n private _renderItem(item: any, index: number) {\n const common = {\n 'order-index': this._orderIndex(item.customId),\n '?is-edit': item.isEdit || false,\n '?is-set': item.hasSet || false,\n '?is-save': !item.isRealCanDel,\n '?show-action': !this._isPreviewValue,\n 'exam-answer-relation-type': item.examAnswerRelationType ?? 0,\n }\n const onMove = (e: CustomEvent) => this._move(index, e.detail as 'up' | 'down')\n const onDelete = () => this._deleteByCustomId(item.customId)\n const onSave = (e: CustomEvent) => this._save(index, e)\n const onEdit = () => this._setEdit(index, true)\n const onAdd = (e: CustomEvent) => this.addSubject(e.detail?.type ?? e.detail, index)\n\n if (['single', 'multiple', 'sort'].includes(item.answerType)) {\n return html`<qxs-subject-single\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit}\n ?is-set=${item.hasSet}\n ?is-save=${!item.isRealCanDel}\n ?show-action=${!this._isPreviewValue}\n ?is-key=${item.isKey}\n type=${item.answerType}\n answer-check-type=${item.answerCheckType ?? 1}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n least-answer-count=${item.leastAnswerCount ?? 2}\n exam-expand=${item.examExpand || ''}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n @set-relation=${(e: CustomEvent) => this._emit('set-relation', e.detail)}\n ></qxs-subject-single>`\n }\n if (item.answerType === 'blank_fill') {\n return html`<qxs-blank-fill\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .examAnswerSetting=${item.examAnswerSettingVO || {}}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-blank-fill>`\n }\n if (item.answerType === 'text_fill') {\n return html`<qxs-text-fill\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .examAnswerSetting=${item.examAnswerSettingVO || {}}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-text-fill>`\n }\n if (item.answerType === 'scale') {\n return html`<qxs-scale\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .scaleQuestions=${item.scaleQuestionList || []}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-scale>`\n }\n if (item.answerType === 'rich_text') {\n return html`<qxs-subject-rich-text\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.richTextContent || item.examRichTextContent || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-subject-rich-text>`\n }\n if (item.answerType === 'page_end') {\n return html`<qxs-page-end\n current-page-index=${this._pageIndex(item.customId)}\n total-page=${this._totalPages()}\n ?show-action=${!this._isPreviewValue}\n @move=${onMove} @delete=${onDelete} @add=${onAdd}\n ></qxs-page-end>`\n }\n return html`<div style=\"color:#909399;padding:8px\">未知题型: ${item.answerType}</div>`\n }\n\n render() {\n return html`\n <div class=\"wrapper\">\n ${!this._isPreviewValue && this._list.length > 1\n ? html`\n <div class=\"sort-mode-toggle\">\n <button class=\"btn ${this._sortMode ? 'primary' : ''}\" @click=${() => { this._sortMode = !this._sortMode }}>\n ${!this._sortMode\n ? html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z\"/>\n </svg>\n `\n : ''}\n ${this._sortMode ? '完成排序' : '排序'}\n </button>\n </div>\n `\n : ''}\n ${this._sortMode\n ? html`\n <div class=\"sort-list\">\n ${repeat(this._list, (item) => item.customId, (item, i) => html`\n <div class=\"sort-item\" data-id=${item.customId}>\n <span class=\"sort-handle\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z\"/>\n </svg>\n </span>\n <span class=\"sort-index\">${i + 1}.</span>\n <span class=\"sort-title\">${item.title || '未命名题目'}</span>\n <span class=\"sort-type\">${TYPE_LABEL[item.answerType] || item.answerType}</span>\n </div>\n `)}\n </div>\n `\n : html`\n <div class=\"subject-list\">\n ${this._list.map((item, i) => html`\n <div class=\"subject-item ${this._isPreviewValue ? 'is-preview' : ''}\" key=${item.customId}>\n <div class=\"subject-content\">${this._renderItem(item, i)}</div>\n </div>\n `)}\n </div>\n `}\n </div>\n `\n }\n}\n\nexport function register() {}\n"],"names":["TYPE_LABEL","single","multiple","sort","blank_fill","text_fill","scale","rich_text","page_end","QxsSubjectList","LitElement","constructor","super","arguments","this","isPreview","_list","_sortMode","_sortable","_initialDataProcessed","subjectList","v","JSON","parse","requestUpdate","Array","isArray","map","i","customId","uid","attributeChangedCallback","name","oldVal","newVal","length","includes","parsed","_isPreviewValue","val","connectedCallback","Promise","resolve","then","_processAttributeList","attr","getAttribute","firstUpdated","updateComplete","_initSortable","updated","changed","has","destroy","setTimeout","disconnectedCallback","el","shadowRoot","querySelector","requestAnimationFrame","currentEl","Sortable","create","handle","animation","ghostClass","chosenClass","onEnd","evt","oldIndex","newIndex","arr","item","splice","_emit","detail","dispatchEvent","CustomEvent","bubbles","composed","currentList","addSubject","type","index","examAnswerRelationType","undefined","answerType","title","answers","analysis","scaleQuestionList","isEdit","isSave","isRealCanDel","hasSet","isKey","answerCheckType","push","addExam","items","pageIdx","newItems","forEach","c","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","pageIndex","uploadExcel","list","setAnswerRelation","answerRelations","customAnswerId","find","ans","_orderIndex","n","out","_pageIndex","filter","findIndex","_totalPages","_move","dir","_save","e","_deleteByCustomId","_delete","_setEdit","_renderItem","common","onMove","onDelete","onSave","onEdit","onAdd","html","examRichTextContent","leastAnswerCount","examExpand","examId","examAnswerSettingVO","render","repeat","styles","css","__decorateClass","property","attribute","prototype","state","safeCustomElement"],"mappings":"koBAOA,MAAMA,EAAqC,CACzCC,OAAQ,MAAOC,SAAU,MAAOC,KAAM,MACtCC,WAAY,MAAOC,UAAW,MAAOC,MAAO,MAC5CC,UAAW,MAAOC,SAAU,OAIjBC,QAAAA,eAAN,cAA6BC,EAAAA,WAA7BC,WAAAA,GAAAC,SAAAC,WA2BkCC,KAAAC,WAAY,EAgD1CD,KAAQE,MAAe,GACvBF,KAAQG,WAAY,EAC7BH,KAAQI,UAA6B,KAOrCJ,KAAQK,uBAAwB,CAAA,CAtDhC,eAAIC,GAAgB,OAAON,KAAKE,KAAM,CAEtC,eAAII,CAAYC,GACd,GAAKA,EAAL,CAIA,GAAiB,iBAANA,EACT,IACEA,EAAIC,KAAKC,MAAMF,EACjB,CAAA,MAIE,OAFAP,KAAKE,MAAQ,QACbF,KAAKU,eAEP,CAEF,IAAKC,MAAMC,QAAQL,GAGjB,OAFAP,KAAKE,MAAQ,QACbF,KAAKU,gBAGPV,KAAKE,MAAQK,EAAEM,IAAKC,IAAA,IAAiBA,EAAGC,SAAUD,EAAEC,UAAYC,EAAAA,SAChEhB,KAAKU,eAjBL,MAFEV,KAAKE,MAAQ,EAoBjB,CAEAe,wBAAAA,CAAyBC,EAAcC,EAAuBC,GAE5D,GADAtB,MAAMmB,yBAAyBC,EAAMC,EAAQC,GAChC,iBAATF,GAA2BE,IAAWpB,KAAKE,MAAMmB,OAAQ,CAC3D,GAAID,EAAOE,SA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eAAN4I,EAAA,CADNK,EAAAA,kBAAkB,qBACNjJ,QAAAA"}
@@ -0,0 +1,25 @@
1
+ "use strict";var e=require("lit"),t=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),s=require("../base/define.cjs"),i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=(e,t,s,o)=>{for(var n,a=o>1?void 0:o?r(t,s):t,d=e.length-1;d>=0;d--)(n=e[d])&&(a=(o?n(t,s,a):n(a))||a);return o&&a&&i(t,s,a),a};exports.QxsPageEnd=class extends e.LitElement{constructor(){super(...arguments),this.currentPageIndex=1,this.totalPage=1,this.showAction=!0}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}render(){return e.html`
2
+ <div class="container">
3
+ <div class="divider">
4
+ <div class="line"></div>
5
+ <span class="label">第${this.currentPageIndex} / ${this.totalPage}页</span>
6
+ <div class="line"></div>
7
+ </div>
8
+ ${this.showAction?e.html`
9
+ <qxs-subject-action
10
+ page-end
11
+ ?show-other-option=${!1}
12
+ ?show-rich-text=${!1}
13
+ @delete=${()=>this._emit("delete")}
14
+ @add=${e=>this._emit("add",e.detail)}
15
+ ></qxs-subject-action>
16
+ `:""}
17
+ </div>
18
+ `}},exports.QxsPageEnd.styles=e.css`
19
+ :host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; }
20
+ .container { width: 100%; }
21
+ .divider { display: flex; align-items: center; padding: 12px 0; }
22
+ .line { flex: 1; height: 1px; background-color: #e4e7ed; }
23
+ .label { padding: 0 12px; font-size: 12px; color: #8c8c8c; }
24
+ `,o([t.property({type:Number,attribute:"current-page-index"})],exports.QxsPageEnd.prototype,"currentPageIndex",2),o([t.property({type:Number,attribute:"total-page"})],exports.QxsPageEnd.prototype,"totalPage",2),o([t.property({type:Boolean,attribute:"show-action"})],exports.QxsPageEnd.prototype,"showAction",2),exports.QxsPageEnd=o([s.safeCustomElement("qxs-page-end")],exports.QxsPageEnd);
25
+ //# sourceMappingURL=page-end.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-end.cjs","sources":["../../../../packages/components-wc/src/subject/page-end.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\n@safeCustomElement('qxs-page-end')\nexport class QxsPageEnd extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; }\n .container { width: 100%; }\n .divider { display: flex; align-items: center; padding: 12px 0; }\n .line { flex: 1; height: 1px; background-color: #e4e7ed; }\n .label { padding: 0 12px; font-size: 12px; color: #8c8c8c; }\n `\n\n @property({ type: Number, attribute: 'current-page-index' }) currentPageIndex = 1\n @property({ type: Number, attribute: 'total-page' }) totalPage = 1\n @property({ type: Boolean, attribute: 'show-action' }) showAction = true\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n render() {\n return html`\n <div class=\"container\">\n <div class=\"divider\">\n <div class=\"line\"></div>\n <span class=\"label\">第${this.currentPageIndex} / ${this.totalPage}页</span>\n <div class=\"line\"></div>\n </div>\n ${this.showAction\n ? html`\n <qxs-subject-action\n page-end\n ?show-other-option=${false}\n ?show-rich-text=${false}\n @delete=${() => this._emit('delete')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n ></qxs-subject-action>\n `\n : ''}\n </div>\n `\n }\n}\n\nexport function register() {\n // auto-registered via @safeCustomElement\n}\n"],"names":["QxsPageEnd","LitElement","constructor","super","arguments","this","currentPageIndex","totalPage","showAction","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","render","html","e","styles","css","__decorateClass","property","type","Number","attribute","prototype","Boolean","safeCustomElement"],"mappings":"wXAKaA,QAAAA,WAAN,cAAyBC,EAAAA,WAAzBC,WAAAA,GAAAC,SAAAC,WASwDC,KAAAC,iBAAmB,EAC3BD,KAAAE,UAAY,EACVF,KAAAG,YAAa,CAAA,CAE5DC,KAAAA,CAAMC,EAAcC,GAC1BN,KAAKO,cAAc,IAAIC,YAAYH,EAAM,CAAEI,SAAS,EAAMC,UAAU,EAAMJ,OAAQA,GAAU,OAC9F,CAEAK,MAAAA,GACE,OAAOC,EAAAA,IAAA;;;;iCAIsBZ,KAAKC,sBAAsBD,KAAKE;;;UAGvDF,KAAKG,WACHS,EAAAA,IAAA;;;gCAGmB;6BACH;sBACN,IAAMZ,KAAKI,MAAM;mBACnBS,GAAmBb,KAAKI,MAAM,MAAOS,EAAEP;;UAG/C;;KAGV,GAtCWX,QAAAA,WACJmB,OAASC,EAAAA,GAAA;;;;;;IAQ6CC,EAAA,CAA5DC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,UAAW,wBAT1BzB,QAAAA,WASkD0B,UAAA,mBAAA,GACRL,EAAA,CAApDC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,UAAW,gBAV1BzB,QAAAA,WAU0C0B,UAAA,YAAA,GACEL,EAAA,CAAtDC,EAAAA,SAAS,CAAEC,KAAMI,QAASF,UAAW,iBAX3BzB,QAAAA,WAW4C0B,UAAA,aAAA,GAX5C1B,QAAAA,WAANqB,EAAA,CADNO,EAAAA,kBAAkB,iBACN5B,QAAAA"}
@@ -0,0 +1,27 @@
1
+ "use strict";var t=require("lit"),e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),i=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),o=require("../base/define.cjs");require("../editor/blocksuite-editor.cjs");var s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=(t,e,i,o)=>{for(var n,c=o>1?void 0:o?r(e,i):e,p=t.length-1;p>=0;p--)(n=t[p])&&(c=(o?n(e,i,c):n(c))||c);return o&&c&&s(e,i,c),c};exports.SubjectRichText=class extends t.LitElement{constructor(){super(...arguments),this.orderIndex=0,this.isEdit=!1,this.isSave=!1,this.showAction=!0,this.isSet=!1,this.richTextContent="",this.examAnswerRelationType=0,this._content="",this._editor=null}createRenderRoot(){return this}_emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??null}))}updated(t){t.has("richTextContent")&&(this._content=this.richTextContent)}disconnectedCallback(){super.disconnectedCallback(),this._editor=null}_save(t){t?.stopImmediatePropagation();const e=this.querySelector("qxs-blocksuite-editor"),i=e?.getContent?.()||this._content;i&&"<p></p>"!==i?(this._content=i,this._emit("save",{richTextContent:i})):function(t){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(e),setTimeout(()=>{e.style.opacity="0",setTimeout(()=>e.remove(),300)},2500)}("富文本内容不能为空!")}render(){const e=this._content||this.richTextContent;return t.html`
2
+ ${this.isEdit?t.html`<qxs-blocksuite-editor .content=${e}></qxs-blocksuite-editor>`:t.html`<qxs-blocksuite-editor .content=${e} readonly preview></qxs-blocksuite-editor>`}
3
+ ${this.showAction?t.html`
4
+ <qxs-subject-action
5
+ ?is-edit=${this.isEdit}
6
+ ?is-set=${this.isSet}
7
+ ?show-other-option=${!1}
8
+ ?hide-add-rich-text=${!0}
9
+ exam-answer-relation-type=${this.examAnswerRelationType}
10
+ @delete=${()=>this._emit("delete")}
11
+ @save=${this._save}
12
+ @edit=${()=>this._emit("edit")}
13
+ @add=${t=>this._emit("add",t.detail)}
14
+ ></qxs-subject-action>
15
+ `:""}
16
+ `}},exports.SubjectRichText.styles=t.css`
17
+ :host {
18
+ display: block;
19
+ font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
20
+ font-size: 12px;
21
+ color: #5a5a5a;
22
+ }
23
+ qxs-blocksuite-editor {
24
+ display: block;
25
+ }
26
+ `,n([e.property({type:Number,attribute:"order-index"})],exports.SubjectRichText.prototype,"orderIndex",2),n([e.property({type:Boolean,attribute:"is-edit"})],exports.SubjectRichText.prototype,"isEdit",2),n([e.property({type:Boolean,attribute:"is-save"})],exports.SubjectRichText.prototype,"isSave",2),n([e.property({type:Boolean,attribute:"show-action"})],exports.SubjectRichText.prototype,"showAction",2),n([e.property({type:Boolean,attribute:"is-set"})],exports.SubjectRichText.prototype,"isSet",2),n([e.property({type:String,attribute:"rich-text-content"})],exports.SubjectRichText.prototype,"richTextContent",2),n([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.SubjectRichText.prototype,"examAnswerRelationType",2),n([i.state()],exports.SubjectRichText.prototype,"_content",2),exports.SubjectRichText=n([o.safeCustomElement("qxs-subject-rich-text")],exports.SubjectRichText);
27
+ //# sourceMappingURL=rich-text.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rich-text.cjs","sources":["../../../../packages/components-wc/src/subject/rich-text.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport '../editor/blocksuite-editor'\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-subject-rich-text')\nexport class SubjectRichText extends LitElement {\n createRenderRoot() { return this }\n\n static styles = css`\n :host {\n display: block;\n font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif;\n font-size: 12px;\n color: #5a5a5a;\n }\n qxs-blocksuite-editor {\n display: block;\n }\n `\n\n @property({ type: Number, attribute: 'order-index' }) orderIndex = 0\n @property({ type: Boolean, attribute: 'is-edit' }) isEdit = false\n @property({ type: Boolean, attribute: 'is-save' }) isSave = false\n @property({ type: Boolean, attribute: 'show-action' }) showAction = true\n @property({ type: Boolean, attribute: 'is-set' }) isSet = false\n @property({ type: String, attribute: 'rich-text-content' }) richTextContent = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n\n @state() private _content = ''\n\n private _editor: HTMLElement | null = null\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('richTextContent')) {\n this._content = this.richTextContent\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._editor = null\n }\n\n private _save(e?: Event) {\n e?.stopImmediatePropagation()\n const editorEl = this.querySelector('qxs-blocksuite-editor') as any\n const content = editorEl?.getContent?.() || this._content\n if (!content || content === '<p></p>') {\n showToast('富文本内容不能为空!')\n return\n }\n this._content = content\n this._emit('save', { richTextContent: content })\n }\n\n render() {\n const content = this._content || this.richTextContent\n return html`\n ${this.isEdit\n ? html`<qxs-blocksuite-editor .content=${content}></qxs-blocksuite-editor>`\n : html`<qxs-blocksuite-editor .content=${content} readonly preview></qxs-blocksuite-editor>`\n }\n ${this.showAction\n ? html`\n <qxs-subject-action\n ?is-edit=${this.isEdit}\n ?is-set=${this.isSet}\n ?show-other-option=${false}\n ?hide-add-rich-text=${true}\n exam-answer-relation-type=${this.examAnswerRelationType}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n ></qxs-subject-action>\n `\n : ''}\n `\n }\n}\n\nexport function register() {}\n"],"names":["SubjectRichText","LitElement","constructor","super","arguments","this","orderIndex","isEdit","isSave","showAction","isSet","richTextContent","examAnswerRelationType","_content","_editor","createRenderRoot","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","updated","changed","has","disconnectedCallback","_save","e","stopImmediatePropagation","editorEl","querySelector","content","getContent","msg","el","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","render","html","styles","css","__decorateClass","property","type","Number","attribute","prototype","Boolean","String","state","safeCustomElement"],"mappings":"8hBAmBaA,QAAAA,gBAAN,cAA8BC,EAAAA,WAA9BC,WAAAA,GAAAC,SAAAC,WAeiDC,KAAAC,WAAa,EAChBD,KAAAE,QAAS,EACTF,KAAAG,QAAS,EACLH,KAAAI,YAAa,EAClBJ,KAAAK,OAAQ,EACEL,KAAAM,gBAAkB,GACVN,KAAAO,uBAAyB,EAEpFP,KAAQQ,SAAW,GAE5BR,KAAQS,QAA8B,IAAA,CAxBtCC,gBAAAA,GAAqB,OAAOV,IAAK,CA0BzBW,KAAAA,CAAMC,EAAcC,GAC1Bb,KAAKc,cAAc,IAAIC,YAAYH,EAAM,CAAEI,SAAS,EAAMC,UAAU,EAAMJ,OAAQA,GAAU,OAC9F,CAEAK,OAAAA,CAAQC,GACFA,EAAQC,IAAI,qBACdpB,KAAKQ,SAAWR,KAAKM,gBAEzB,CAEAe,oBAAAA,GACEvB,MAAMuB,uBACNrB,KAAKS,QAAU,IACjB,CAEQa,KAAAA,CAAMC,GACZA,GAAGC,2BACH,MAAMC,EAAWzB,KAAK0B,cAAc,yBAC9BC,EAAUF,GAAUG,gBAAkB5B,KAAKQ,SAC5CmB,GAAuB,YAAZA,GAIhB3B,KAAKQ,SAAWmB,EAChB3B,KAAKW,MAAM,OAAQ,CAAEL,gBAAiBqB,KAjE1C,SAAmBE,GACjB,MAAMC,EAAKC,SAASC,cAAc,OAClCF,EAAGG,YAAcJ,EAC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C,EAAAA,SAAS,CAAEC,KAAMI,QAASF,UAAW,YAnB3BpE,QAAAA,gBAmBuCqE,UAAA,QAAA,GACUL,EAAA,CAA3DC,EAAAA,SAAS,CAAEC,KAAMK,OAAQH,UAAW,uBApB1BpE,QAAAA,gBAoBiDqE,UAAA,kBAAA,GACQL,EAAA,CAAnEC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,UAAW,+BArB1BpE,QAAAA,gBAqByDqE,UAAA,yBAAA,GAEnDL,EAAA,CAAhBQ,EAAAA,SAvBUxE,QAAAA,gBAuBMqE,UAAA,WAAA,GAvBNrE,QAAAA,gBAANgE,EAAA,CADNS,EAAAA,kBAAkB,0BACNzE,QAAAA"}
@@ -0,0 +1,162 @@
1
+ "use strict";var t=require("lit"),e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),s=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),i=require("../base/define.cjs"),r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?a(e,s):e,n=t.length-1;n>=0;n--)(o=t[n])&&(l=(i?o(e,s,l):o(l))||l);return i&&l&&r(e,s,l),l};const l=t.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`,n=t.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>`;function p(t){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(e),setTimeout(()=>{e.style.opacity="0",setTimeout(()=>e.remove(),300)},2500)}exports.QxsScale=class extends t.LitElement{constructor(){super(...arguments),this.orderIndex=0,this.title="",this.isEdit=!1,this.isSave=!1,this.isSet=!1,this.showAction=!0,this.showAnalysis=!1,this.analysis="",this.richTextContent="",this.examAnswerRelationType=0,this._answers=[{title:""},{title:""},{title:""},{title:""},{title:""}],this._scaleQuestions=["问题1"],this._rowTitle="",this._title="",this._analysis="",this._showRichText=!1,this._richText="",this.TITLE_MAX=200}get answerList(){return this._answers}set answerList(t){const e=Array.isArray(t)?t:[];this._answers=e.length?e.slice(0,5):[{title:""},{title:""},{title:""},{title:""},{title:""}],this.requestUpdate("answerList")}get scaleQuestions(){return this._scaleQuestions}set scaleQuestions(t){this._scaleQuestions=Array.isArray(t)&&t.length?t:["问题1"],this.requestUpdate("scaleQuestions")}updated(t){t.has("isEdit")&&this.isEdit&&this._syncProps()}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._rowTitle=this._scaleQuestions.join("\n"),this.richTextContent&&(this._richText=this.richTextContent,this._showRichText=!0)}_emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??null}))}_onTitleInput(t){const e=t.target;e.value.length>this.TITLE_MAX&&(e.value=e.value.slice(0,this.TITLE_MAX)),this._title=e.value}_save(t){if(t?.stopImmediatePropagation(),!this._title)return void p("题目标题不能为空!");for(let t=0;t<this._answers.length;t++)if(!this._answers[t].title)return void p(`选项${String.fromCharCode(65+t)}未填写。`);if(!this._rowTitle)return void p("行标题不能为空!");const e=this._rowTitle.split("\n").filter(t=>t.trim());0!==e.length?this._emit("save",{title:this._title,analysis:this._analysis,answers:this._answers,scaleQuestionList:e,examRichTextContent:this._showRichText?this._richText:"",examAnswerRelationType:this.examAnswerRelationType}):p("行标题不能为空!")}_renderPreview(){const e=Math.floor(100/(this._answers.length+1));return t.html`
2
+ <div class="preview">
3
+ <span class="title">${this.orderIndex+1}.${this.title}(量表题)</span>
4
+ ${this.richTextContent?t.html`<div style="margin-top:8px" .innerHTML=${this.richTextContent}></div>`:""}
5
+ <table class="scale-table">
6
+ <thead><tr>
7
+ <th style="width:${e}%">问题 \ 选项</th>
8
+ ${this._answers.map(s=>t.html`<th style="width:${e}%">${s.title}</th>`)}
9
+ </tr></thead>
10
+ <tbody>
11
+ ${this._scaleQuestions.map(e=>t.html`
12
+ <tr><td>${e}</td>${this._answers.map(()=>t.html`<td><input type="radio" disabled /></td>`)}</tr>
13
+ `)}
14
+ </tbody>
15
+ </table>
16
+ ${this.analysis?t.html`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
17
+ </div>
18
+ `}_renderEdit(){return t.html`
19
+ <div class="flex-items-start">
20
+ <div class="label"><span>题目:</span></div>
21
+ <div style="flex:1">
22
+ <div class="el-input">
23
+ <textarea rows="2" .value=${this._title} ?disabled=${this.isSave}
24
+ maxlength=${this.TITLE_MAX}
25
+ @input=${t=>this._onTitleInput(t)}
26
+ placeholder="【量表题】请输入问题"></textarea>
27
+ <span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
28
+ </div>
29
+ </div>
30
+ </div>
31
+
32
+ <div class="flex-items-start" style="margin-top:12px">
33
+ <div class="label"><span>行标题:</span></div>
34
+ <div class="flex" style="flex:1">
35
+ <div class="el-input" style="width:160px">
36
+ <textarea class="row-title-textarea" .value=${this._rowTitle} ?disabled=${this.isSave}
37
+ @input=${t=>{this._rowTitle=t.target.value}}
38
+ @keydown=${t=>{t.stopPropagation()}}
39
+ placeholder="请输入行标题"></textarea>
40
+ </div>
41
+ <div style="flex:1;margin-left:12px">
42
+ ${this._answers.map((e,s)=>t.html`
43
+ <div class="answer-item">
44
+ <span class="label">${String.fromCharCode(65+s)}.</span>
45
+ <div class="input">
46
+ <input type="text" .value=${e.title} ?disabled=${this.isSave}
47
+ maxlength="10"
48
+ @input=${t=>{this._answers=this._answers.map((e,i)=>i===s?{title:t.target.value}:e)}}
49
+ placeholder="选项${s+1}" />
50
+ </div>
51
+ ${this.isSave?"":t.html`
52
+ <span class="icon" @click=${()=>{this._answers.length<5&&(this._answers=[...this._answers,{title:""}])}}>${l}</span>
53
+ <span class="icon ${this._answers.length<3?"disabled":""}" @click=${()=>{this._answers.length>3&&(this._answers=this._answers.filter((t,e)=>e!==s))}}>${n}</span>
54
+ `}
55
+ </div>
56
+ `)}
57
+ </div>
58
+ </div>
59
+ </div>
60
+
61
+ <div class="flex-items-start" style="margin-top:12px">
62
+ <div class="label"><span>解析:</span></div>
63
+ <div style="flex:1">
64
+ <div class="el-input">
65
+ <textarea rows="2" .value=${this._analysis} ?disabled=${this.isSave}
66
+ @input=${t=>{this._analysis=t.target.value}}
67
+ placeholder="请输入题目解析"></textarea>
68
+ </div>
69
+ </div>
70
+ </div>
71
+
72
+ ${this._showRichText?t.html`
73
+ <div class="flex-items-start" style="margin-top:12px">
74
+ <div class="label"><span>富文本:</span></div>
75
+ <div style="flex:1">
76
+ <qxs-blocksuite-editor
77
+ content=${this._richText}
78
+ ?is-edit=${!0}
79
+ ></qxs-blocksuite-editor>
80
+ <div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>
81
+ </div>
82
+ </div>
83
+ `:""}
84
+ `}render(){return t.html`
85
+ <qxs-subject-layout ?show-edit=${this.isEdit}>
86
+ <div slot="preview">${this._renderPreview()}</div>
87
+ <div slot="edit">${this._renderEdit()}</div>
88
+ ${this.showAction?t.html`
89
+ <qxs-subject-action
90
+ ?is-edit=${this.isEdit}
91
+ ?is-set=${this.isSet}
92
+ ?show-other-option=${!1}
93
+ exam-answer-relation-type=${this.examAnswerRelationType}
94
+ @delete=${()=>this._emit("delete")}
95
+ @save=${this._save}
96
+ @edit=${()=>this._emit("edit")}
97
+ @add=${t=>this._emit("add",t.detail)}
98
+ @on-show-rich-text=${()=>{this._showRichText=!0}}
99
+ ></qxs-subject-action>
100
+ `:""}
101
+ </qxs-subject-layout>
102
+ `}},exports.QxsScale.styles=t.css`
103
+ :host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
104
+ *, ::before, ::after { box-sizing: border-box; }
105
+
106
+ .preview { padding: 12px 0; }
107
+ .preview .title { font-size: 14px; color: #303133; }
108
+ .scale-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }
109
+ .scale-table th, .scale-table td { border: 1px solid #e4e7ed; padding: 6px 4px; text-align: center; }
110
+ .scale-table th { background: #f5f7fa; color: #909399; }
111
+
112
+ .flex { display: flex; }
113
+ .flex-items-center { display: flex; align-items: center; }
114
+ .flex-items-start { display: flex; align-items: flex-start; }
115
+ .flex-justify-end { display: flex; justify-content: flex-end; }
116
+ .label { min-width: 60px; font-size: 13px; color: #606266; }
117
+
118
+ textarea, input[type="text"] {
119
+ border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;
120
+ font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;
121
+ line-height: 1.5; display: block; box-sizing: border-box; white-space: pre-wrap;
122
+ }
123
+ textarea:focus, input[type="text"]:focus { border-color: #3D61E3; outline: none; }
124
+ textarea:disabled, input[type="text"]:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
125
+
126
+ .el-input { position: relative; display: block; }
127
+ .el-input textarea { padding-bottom: 24px; }
128
+ .el-input .char-counter {
129
+ position: absolute; right: 12px; bottom: 8px;
130
+ font-size: 12px; color: #909399; line-height: 1; pointer-events: none;
131
+ }
132
+
133
+ .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }
134
+ .el-link:hover { color: #2D4CB8; }
135
+ .el-link.danger { color: #f56c6c; }
136
+
137
+ .answer-item { display: flex; align-items: center; margin-top: 6px; }
138
+ .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }
139
+ .answer-item .input { flex: 1; max-width: 200px; }
140
+ .answer-item .input input {
141
+ height: 32px; padding: 0 8px;
142
+ font-size: 13px; line-height: 32px;
143
+ border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;
144
+ transition: border-color .2s; box-sizing: border-box;
145
+ }
146
+ .answer-item .input input:focus { border-color: #3D61E3; outline: none; }
147
+
148
+ .answer-item .icon {
149
+ margin-left: 6px; cursor: pointer; display: inline-flex;
150
+ align-items: center; justify-content: center;
151
+ width: 24px; height: 24px; border-radius: 4px;
152
+ border: 1px solid #dcdfe6; background: #fff; color: #909399;
153
+ transition: all 0.2s;
154
+ }
155
+ .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }
156
+ .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
157
+
158
+ .row-title-textarea {
159
+ height: 200px;
160
+ }
161
+ `,o([e.property({type:Number,attribute:"order-index"})],exports.QxsScale.prototype,"orderIndex",2),o([e.property({type:String})],exports.QxsScale.prototype,"title",2),o([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsScale.prototype,"isEdit",2),o([e.property({type:Boolean,attribute:"is-save"})],exports.QxsScale.prototype,"isSave",2),o([e.property({type:Boolean,attribute:"is-set"})],exports.QxsScale.prototype,"isSet",2),o([e.property({type:Boolean,attribute:"show-action"})],exports.QxsScale.prototype,"showAction",2),o([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsScale.prototype,"showAnalysis",2),o([e.property({type:String})],exports.QxsScale.prototype,"analysis",2),o([e.property({type:String,attribute:"rich-text-content"})],exports.QxsScale.prototype,"richTextContent",2),o([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsScale.prototype,"examAnswerRelationType",2),o([e.property({type:Array,attribute:"answer-list"})],exports.QxsScale.prototype,"answerList",1),o([e.property({type:Array,attribute:"scale-questions"})],exports.QxsScale.prototype,"scaleQuestions",1),o([s.state()],exports.QxsScale.prototype,"_answers",2),o([s.state()],exports.QxsScale.prototype,"_scaleQuestions",2),o([s.state()],exports.QxsScale.prototype,"_rowTitle",2),o([s.state()],exports.QxsScale.prototype,"_title",2),o([s.state()],exports.QxsScale.prototype,"_analysis",2),o([s.state()],exports.QxsScale.prototype,"_showRichText",2),o([s.state()],exports.QxsScale.prototype,"_richText",2),exports.QxsScale=o([i.safeCustomElement("qxs-scale")],exports.QxsScale);
162
+ //# sourceMappingURL=scale.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale.cjs","sources":["../../../../packages/components-wc/src/subject/scale.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\nconst iconPlus = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\nconst iconRemove = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-scale')\nexport class QxsScale extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .scale-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }\n .scale-table th, .scale-table td { border: 1px solid #e4e7ed; padding: 6px 4px; text-align: center; }\n .scale-table th { background: #f5f7fa; color: #909399; }\n\n .flex { display: flex; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 60px; font-size: 13px; color: #606266; }\n\n textarea, input[type=\"text\"] {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box; white-space: pre-wrap;\n }\n textarea:focus, input[type=\"text\"]:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled, input[type=\"text\"]:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n .answer-item { display: flex; align-items: center; margin-top: 6px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 200px; }\n .answer-item .input input {\n height: 32px; padding: 0 8px;\n font-size: 13px; line-height: 32px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n transition: border-color .2s; box-sizing: border-box;\n }\n .answer-item .input input:focus { border-color: #3D61E3; outline: none; }\n\n .answer-item .icon {\n margin-left: 6px; cursor: pointer; display: inline-flex;\n align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 4px;\n border: 1px solid #dcdfe6; background: #fff; color: #909399;\n transition: all 0.2s;\n }\n .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }\n\n .row-title-textarea {\n height: 200px;\n }\n `\n\n @property({ type: Number, attribute: 'order-index' }) orderIndex = 0\n @property({ type: String }) title = ''\n @property({ type: Boolean, attribute: 'is-edit' }) isEdit = false\n @property({ type: Boolean, attribute: 'is-save' }) isSave = false\n @property({ type: Boolean, attribute: 'is-set' }) isSet = false\n @property({ type: Boolean, attribute: 'show-action' }) showAction = true\n @property({ type: Boolean, attribute: 'show-analysis' }) showAnalysis = false\n @property({ type: String }) analysis = ''\n @property({ type: String, attribute: 'rich-text-content' }) richTextContent = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n @property({ type: Array, attribute: 'answer-list' })\n get answerList() { return this._answers }\n\n set answerList(v: any) {\n const arr = Array.isArray(v) ? v : []\n this._answers = arr.length ? arr.slice(0, 5) : [{ title: '' }, { title: '' }, { title: '' }, { title: '' }, { title: '' }]\n this.requestUpdate('answerList')\n }\n\n @property({ type: Array, attribute: 'scale-questions' })\n get scaleQuestions() { return this._scaleQuestions }\n\n set scaleQuestions(v: any) {\n this._scaleQuestions = Array.isArray(v) && v.length ? v : ['问题1']\n this.requestUpdate('scaleQuestions')\n }\n\n @state() private _answers: { title: string }[] = [{ title: '' }, { title: '' }, { title: '' }, { title: '' }, { title: '' }]\n @state() private _scaleQuestions: string[] = ['问题1']\n @state() private _rowTitle = ''\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n\n private readonly TITLE_MAX = 200\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n this._rowTitle = this._scaleQuestions.join('\\n')\n if (this.richTextContent) {\n this._richText = this.richTextContent\n this._showRichText = true\n }\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n }\n\n private _save(e?: Event) {\n e?.stopImmediatePropagation()\n if (!this._title) { showToast('题目标题不能为空!'); return }\n\n for (let i = 0; i < this._answers.length; i++) {\n if (!this._answers[i].title) {\n showToast(`选项${String.fromCharCode(65 + i)}未填写。`)\n return\n }\n }\n\n if (!this._rowTitle) { showToast('行标题不能为空!'); return }\n\n const questions = this._rowTitle.split('\\n').filter(i => i.trim())\n if (questions.length === 0) { showToast('行标题不能为空!'); return }\n\n this._emit('save', {\n title: this._title,\n analysis: this._analysis,\n answers: this._answers,\n scaleQuestionList: questions,\n examRichTextContent: this._showRichText ? this._richText : '',\n examAnswerRelationType: this.examAnswerRelationType,\n })\n }\n\n private _renderPreview() {\n const colWidth = Math.floor(100 / (this._answers.length + 1))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this.orderIndex + 1}.${this.title}(量表题)</span>\n ${this.richTextContent ? html`<div style=\"margin-top:8px\" .innerHTML=${this.richTextContent}></div>` : ''}\n <table class=\"scale-table\">\n <thead><tr>\n <th style=\"width:${colWidth}%\">问题 \\ 选项</th>\n ${this._answers.map(a => html`<th style=\"width:${colWidth}%\">${a.title}</th>`)}\n </tr></thead>\n <tbody>\n ${this._scaleQuestions.map(q => html`\n <tr><td>${q}</td>${this._answers.map(() => html`<td><input type=\"radio\" disabled /></td>`)}</tr>\n `)}\n </tbody>\n </table>\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title} ?disabled=${this.isSave}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【量表题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>行标题:</span></div>\n <div class=\"flex\" style=\"flex:1\">\n <div class=\"el-input\" style=\"width:160px\">\n <textarea class=\"row-title-textarea\" .value=${this._rowTitle} ?disabled=${this.isSave}\n @input=${(e: Event) => { this._rowTitle = (e.target as HTMLTextAreaElement).value }}\n @keydown=${(e: KeyboardEvent) => { e.stopPropagation() }}\n placeholder=\"请输入行标题\"></textarea>\n </div>\n <div style=\"flex:1;margin-left:12px\">\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\">\n <span class=\"label\">${String.fromCharCode(65 + i)}.</span>\n <div class=\"input\">\n <input type=\"text\" .value=${a.title} ?disabled=${this.isSave}\n maxlength=\"10\"\n @input=${(e: Event) => { this._answers = this._answers.map((x, j) => j === i ? { title: (e.target as HTMLInputElement).value } : x) }}\n placeholder=\"选项${i + 1}\" />\n </div>\n ${!this.isSave\n ? html`\n <span class=\"icon\" @click=${() => {\n if (this._answers.length < 5) { this._answers = [...this._answers, { title: '' }] }\n }}>${iconPlus}</span>\n <span class=\"icon ${this._answers.length < 3 ? 'disabled' : ''}\" @click=${() => {\n if (this._answers.length > 3) { this._answers = this._answers.filter((_, j) => j !== i) }\n }}>${iconRemove}</span>\n `\n : ''}\n </div>\n `)}\n </div>\n </div>\n </div>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis} ?disabled=${this.isSave}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n\n ${this._showRichText\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <qxs-blocksuite-editor\n content=${this._richText}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n <div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout ?show-edit=${this.isEdit}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this.showAction\n ? html`\n <qxs-subject-action\n ?is-edit=${this.isEdit}\n ?is-set=${this.isSet}\n ?show-other-option=${false}\n exam-answer-relation-type=${this.examAnswerRelationType}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @on-show-rich-text=${() => { this._showRichText = true }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","iconRemove","showToast","msg","el","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","QxsScale","LitElement","constructor","super","arguments","this","orderIndex","title","isEdit","isSave","isSet","showAction","showAnalysis","analysis","richTextContent","examAnswerRelationType","_answers","_scaleQuestions","_rowTitle","_title","_analysis","_showRichText","_richText","TITLE_MAX","answerList","v","arr","Array","isArray","length","slice","requestUpdate","scaleQuestions","updated","changed","has","_syncProps","join","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","e","target","value","_save","stopImmediatePropagation","i","String","fromCharCode","questions","split","filter","trim","answers","scaleQuestionList","examRichTextContent","_renderPreview","colWidth","Math","floor","map","a","q","_renderEdit","stopPropagation","x","j","_","render","styles","css","__decorateClass","property","type","Number","attribute","prototype","Boolean","state","safeCustomElement"],"mappings":"+eAIA,MAAMA,EAAWC,EAAAA,IAAA,2NACXC,EAAaD,EAAAA,IAAA,qLAEnB,SAASE,EAAUC,GACjB,MAAMC,EAAKC,SAASC,cAAc,OAClCF,EAAGG,YAAcJ,EACjBK,OAAOC,OAAOL,EAAGM,MAAO,CACtBC,SAAU,QAASC,IAAK,OAAQC,KAAM,MAAOC,UAAW,mBACxDC,QAAS,YAAaC,aAAc,MAAOC,SAAU,OAAQC,MAAO,OACpEC,WAAY,UAAWC,OAAQ,QAASC,UAAW,6BACnDC,WAAY,cAAeC,QAAS,MAEtClB,SAASmB,KAAKC,YAAYrB,GAC1BsB,WAAW,KAAQtB,EAAGM,MAAMa,QAAU,IAAKG,WAAW,IAAMtB,EAAGuB,SAAU,MAAQ,KACnF,CAGaC,QAAAA,SAAN,cAAuBC,EAAAA,WAAvBC,WAAAA,GAAAC,SAAAC,WA8DiDC,KAAAC,WAAa,EACvCD,KAAAE,MAAQ,GACeF,KAAAG,QAAS,EACTH,KAAAI,QAAS,EACVJ,KAAAK,OAAQ,EACHL,KAAAM,YAAa,EACXN,KAAAO,cAAe,EAC5CP,KAAAQ,SAAW,GACqBR,KAAAS,gBAAkB,GACVT,KAAAU,uBAAyB,EAkBpFV,KAAQW,SAAgC,CAAC,CAAET,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,KAC9GF,KAAQY,gBAA4B,CAAC,OACrCZ,KAAQa,UAAY,GACpBb,KAAQc,OAAS,GACjBd,KAAQe,UAAY,GACpBf,KAAQgB,eAAgB,EACxBhB,KAAQiB,UAAY,GAE7BjB,KAAiBkB,UAAY,GAAA,CAxB7B,cAAIC,GAAe,OAAOnB,KAAKW,QAAS,CAExC,cAAIQ,CAAWC,GACb,MAAMC,EAAMC,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