@qxs-bns/components-wc 0.0.22 → 0.0.24

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 (153) hide show
  1. package/es/editor/blocksuite-editor.mjs +14 -14
  2. package/es/editor/blocksuite-editor.mjs.map +1 -1
  3. package/es/entry-subject.mjs +1 -1
  4. package/es/index.mjs +1 -1
  5. package/es/subject/action.mjs +18 -18
  6. package/es/subject/action.mjs.map +1 -1
  7. package/es/subject/blank-fill.mjs +21 -21
  8. package/es/subject/blank-fill.mjs.map +1 -1
  9. package/es/subject/layout.mjs +3 -3
  10. package/es/subject/layout.mjs.map +1 -1
  11. package/es/subject/list.mjs +43 -43
  12. package/es/subject/list.mjs.map +1 -1
  13. package/es/subject/page-end.mjs +8 -8
  14. package/es/subject/page-end.mjs.map +1 -1
  15. package/es/subject/scale.mjs +19 -19
  16. package/es/subject/scale.mjs.map +1 -1
  17. package/es/subject/single.mjs +48 -48
  18. package/es/subject/single.mjs.map +1 -1
  19. package/es/subject/text-fill.mjs +21 -21
  20. package/es/subject/text-fill.mjs.map +1 -1
  21. package/lib/editor/blocksuite-editor.cjs +4 -4
  22. package/lib/editor/blocksuite-editor.cjs.map +1 -1
  23. package/lib/entry-subject.cjs +1 -1
  24. package/lib/index.cjs +1 -1
  25. package/lib/subject/action.cjs +20 -20
  26. package/lib/subject/action.cjs.map +1 -1
  27. package/lib/subject/blank-fill.cjs +22 -22
  28. package/lib/subject/blank-fill.cjs.map +1 -1
  29. package/lib/subject/layout.cjs +4 -4
  30. package/lib/subject/layout.cjs.map +1 -1
  31. package/lib/subject/list.cjs +51 -51
  32. package/lib/subject/list.cjs.map +1 -1
  33. package/lib/subject/page-end.cjs +8 -8
  34. package/lib/subject/page-end.cjs.map +1 -1
  35. package/lib/subject/scale.cjs +21 -21
  36. package/lib/subject/scale.cjs.map +1 -1
  37. package/lib/subject/single.cjs +50 -50
  38. package/lib/subject/single.cjs.map +1 -1
  39. package/lib/subject/text-fill.cjs +22 -22
  40. package/lib/subject/text-fill.cjs.map +1 -1
  41. package/package.json +3 -3
  42. package/es/entry-all.mjs +0 -2
  43. package/es/entry-all.mjs.map +0 -1
  44. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs +0 -7
  45. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs.map +0 -1
  46. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs +0 -7
  47. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs.map +0 -1
  48. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs +0 -7
  49. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs.map +0 -1
  50. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs +0 -7
  51. package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs.map +0 -1
  52. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs +0 -2
  53. package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs.map +0 -1
  54. 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 +0 -2
  55. 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 +0 -1
  56. package/es/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs +0 -2
  57. package/es/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs.map +0 -1
  58. 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 +0 -2
  59. 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 +0 -1
  60. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs +0 -7
  61. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs.map +0 -1
  62. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs +0 -7
  63. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs.map +0 -1
  64. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs +0 -7
  65. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs.map +0 -1
  66. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs +0 -7
  67. package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs.map +0 -1
  68. package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs +0 -2
  69. package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs.map +0 -1
  70. package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs +0 -2
  71. package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs.map +0 -1
  72. package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs +0 -2
  73. package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs.map +0 -1
  74. package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs +0 -2
  75. package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs.map +0 -1
  76. package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs +0 -2
  77. package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs.map +0 -1
  78. package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs +0 -2
  79. package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs.map +0 -1
  80. package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs +0 -2
  81. package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs.map +0 -1
  82. package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs +0 -2
  83. package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs.map +0 -1
  84. package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs +0 -2
  85. package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs.map +0 -1
  86. package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs +0 -2
  87. package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs.map +0 -1
  88. package/es/subject/rich-text.mjs +0 -27
  89. package/es/subject/rich-text.mjs.map +0 -1
  90. package/lib/entry-all.cjs +0 -2
  91. package/lib/entry-all.cjs.map +0 -1
  92. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs +0 -7
  93. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs.map +0 -1
  94. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs +0 -7
  95. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs.map +0 -1
  96. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs +0 -7
  97. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs.map +0 -1
  98. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs +0 -7
  99. package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs.map +0 -1
  100. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs +0 -2
  101. package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs.map +0 -1
  102. 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 +0 -2
  103. 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 +0 -1
  104. package/lib/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs +0 -2
  105. package/lib/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs.map +0 -1
  106. 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 +0 -2
  107. 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 +0 -1
  108. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs +0 -7
  109. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs.map +0 -1
  110. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs +0 -7
  111. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs.map +0 -1
  112. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs +0 -8
  113. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs.map +0 -1
  114. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs +0 -7
  115. package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs.map +0 -1
  116. package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs +0 -2
  117. package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs.map +0 -1
  118. package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs +0 -2
  119. package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs.map +0 -1
  120. package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs +0 -2
  121. package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs.map +0 -1
  122. package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs +0 -2
  123. package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs.map +0 -1
  124. package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs +0 -2
  125. package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs.map +0 -1
  126. package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs +0 -2
  127. package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs.map +0 -1
  128. package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs +0 -2
  129. package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs.map +0 -1
  130. package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs +0 -2
  131. package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs.map +0 -1
  132. package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs +0 -2
  133. package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs.map +0 -1
  134. package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs +0 -2
  135. package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs.map +0 -1
  136. package/lib/subject/rich-text.cjs +0 -27
  137. package/lib/subject/rich-text.cjs.map +0 -1
  138. package/types/base/define.d.ts +0 -1
  139. package/types/base/uid.d.ts +0 -1
  140. package/types/editor/blocksuite-editor.d.ts +0 -84
  141. package/types/editor/index.d.ts +0 -3
  142. package/types/index.d.ts +0 -4
  143. package/types/subject/action.d.ts +0 -23
  144. package/types/subject/blank-fill.d.ts +0 -49
  145. package/types/subject/index.d.ts +0 -20
  146. package/types/subject/layout.d.ts +0 -7
  147. package/types/subject/list.d.ts +0 -43
  148. package/types/subject/page-end.d.ts +0 -10
  149. package/types/subject/rich-text.d.ts +0 -30
  150. package/types/subject/scale.d.ts +0 -42
  151. package/types/subject/single.d.ts +0 -79
  152. package/types/subject/text-fill.d.ts +0 -54
  153. package/types/subject/type.d.ts +0 -7
@@ -1,7 +1,7 @@
1
- import{html as t,css as e,LitElement as i}from"lit";import{property as s}from"../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs";import{state as o}from"../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs";import{safeCustomElement as a}from"../base/define.mjs";import{SubjectError as r}from"./single.mjs";import{SubjectType as n}from"./types.mjs";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(t,e,i,s)=>{for(var o,a=s>1?void 0:s?d(e,i):e,r=t.length-1;r>=0;r--)(o=t[r])&&(a=(s?o(e,i,a):o(a))||a);return s&&a&&l(e,i,a),a};const p=t`<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>`,c=t`<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>`;let x=class extends i{constructor(){super(...arguments),this.orderIndex=0,this.title="",this.customId="",this.isEdit=!1,this.isSave=!1,this.isSet=!1,this.showAction=!0,this.showAdd=!0,this.showAnalysis=!0,this.analysis="",this.richTextContent="",this.examAnswerRelationType=0,this.uploadImage=async t=>new Promise((e,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.readAsDataURL(t)}),this._answers=[{title:""},{title:""},{title:""},{title:""},{title:""}],this._scaleQuestions=["问题1"],this._rowTitle="",this._title="",this._analysis="",this._showRichText=!1,this._richText="",this.modelValue="",this.useModel=!1,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")}willUpdate(t){t.has("isEdit")&&this.isEdit&&this._syncProps(),!this.isEdit&&(t.has("title")||t.has("answerList")||t.has("analysis")||t.has("richTextContent")||t.has("scaleQuestions"))&&this._syncProps(),t.has("modelValue")&&this.useModel&&(this._title=this.modelValue)}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._rowTitle=this._scaleQuestions.join("\n"),this._richText=this.richTextContent||"",this._showRichText=!!this.richTextContent}async toJSON(){return new Promise((t,e)=>{const i={customId:this.customId||void 0,answerType:"scale",orderIndex:this.orderIndex},s=this.isEdit?this._title:this.title||"",o=this.isEdit?this._answers:this.answerList||[],a=this.isEdit?this._analysis:this.analysis||"",l=this.isEdit?this._rowTitle:this.scaleQuestions?.join("\n")||"",d=this.isEdit?this._showRichText:!!this.richTextContent,h=this.isEdit?this._richText:this.richTextContent||"";if(!s)return void e(new r("题目标题不能为空!","EMPTY_TITLE","title",i));for(let t=0;t<o.length;t++)if(!o[t].title)return void e(new r(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",i));if(!l)return void e(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",i));const p=l.split("\n").filter(t=>t.trim());if(0===p.length)return void e(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",i));const c={answerType:n.SCALE,title:s,analysis:a,answers:o,scaleQuestionList:p,examRichTextContent:d?h:"",examAnswerRelationType:this.examAnswerRelationType};this.customId&&(c.customId=this.customId),t(c)})}_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,this.useModel&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){!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)}(t.message)}}validate(){const t=[],e={customId:this.customId||void 0,answerType:"scale",orderIndex:this.orderIndex},i=this.isEdit?this._title:this.title||"",s=this.isEdit?this._answers:this.answerList||[],o=this.isEdit?this._rowTitle:this.scaleQuestions?.join("\n")||"";if(i||t.push(new r("题目标题不能为空!","EMPTY_TITLE","title",e)),s.forEach((i,s)=>{i.title||t.push(new r(`选项${String.fromCharCode(65+s)}未填写`,"ANSWER_EMPTY","answers",e))}),o){0===o.split("\n").filter(t=>t.trim()).length&&t.push(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e))}else t.push(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e));return t}_renderPreview(){const e=Math.floor(100/(this._answers.length+1));return t`
1
+ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state as o}from"lit/decorators.js";import{safeCustomElement as a}from"../base/define.mjs";import{SubjectError as r}from"./single.mjs";import{SubjectType as n}from"./types.mjs";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(t,e,i,s)=>{for(var o,a=s>1?void 0:s?d(e,i):e,r=t.length-1;r>=0;r--)(o=t[r])&&(a=(s?o(e,i,a):o(a))||a);return s&&a&&l(e,i,a),a};const p=t`<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>`,c=t`<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>`;let x=class extends i{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["show-analysis"]=!0,this.analysis="",this["rich-text-content"]="",this["exam-answer-relation-type"]=0,this["upload-image"]=async t=>new Promise((e,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.readAsDataURL(t)}),this._answers=[{title:""},{title:""},{title:""},{title:""},{title:""}],this._scaleQuestions=["问题1"],this._rowTitle="",this._title="",this._analysis="",this._showRichText=!1,this._richText="",this["model-value"]="",this["use-model"]=!1,this.TITLE_MAX=200}get"answer-list"(){return this._answers}set"answer-list"(t){const e=Array.isArray(t)?t:[];this._answers=e.length?e.slice(0,5):[{title:""},{title:""},{title:""},{title:""},{title:""}],this.requestUpdate("answer-list")}get"scale-questions"(){return this._scaleQuestions}set"scale-questions"(t){this._scaleQuestions=Array.isArray(t)&&t.length?t:["问题1"],this.requestUpdate("scale-questions")}willUpdate(t){t.has("is-edit")&&this["is-edit"]&&this._syncProps(),!this["is-edit"]&&(t.has("title")||t.has("answer-list")||t.has("analysis")||t.has("rich-text-content")||t.has("scale-questions"))&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._rowTitle=this._scaleQuestions.join("\n"),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"]}async toJSON(){return new Promise((t,e)=>{const i={customId:this["custom-id"]||void 0,answerType:"scale",orderIndex:this["order-index"]},s=this["is-edit"]?this._title:this.title||"",o=this["is-edit"]?this._answers:this["answer-list"]||[],a=this["is-edit"]?this._analysis:this.analysis||"",l=this["is-edit"]?this._rowTitle:this["scale-questions"]?.join("\n")||"",d=this["is-edit"]?this._showRichText:!!this["rich-text-content"],h=this["is-edit"]?this._richText:this["rich-text-content"]||"";if(!s)return void e(new r("题目标题不能为空!","EMPTY_TITLE","title",i));for(let t=0;t<o.length;t++)if(!o[t].title)return void e(new r(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",i));if(!l)return void e(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",i));const p=l.split("\n").filter(t=>t.trim());if(0===p.length)return void e(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",i));const c={answerType:n.SCALE,title:s,analysis:a,answers:o,scaleQuestionList:p,examRichTextContent:d?h:"",examAnswerRelationType:this["exam-answer-relation-type"]};this["custom-id"]&&(c.customId=this["custom-id"]),t(c)})}_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,this["use-model"]&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){!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)}(t.message)}}validate(){const t=[],e={customId:this["custom-id"]||void 0,answerType:"scale",orderIndex:this["order-index"]},i=this["is-edit"]?this._title:this.title||"",s=this["is-edit"]?this._answers:this["answer-list"]||[],o=this["is-edit"]?this._rowTitle:this["scale-questions"]?.join("\n")||"";if(i||t.push(new r("题目标题不能为空!","EMPTY_TITLE","title",e)),s.forEach((i,s)=>{i.title||t.push(new r(`选项${String.fromCharCode(65+s)}未填写`,"ANSWER_EMPTY","answers",e))}),o){0===o.split("\n").filter(t=>t.trim()).length&&t.push(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e))}else t.push(new r("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e));return t}_renderPreview(){const e=Math.floor(100/(this._answers.length+1));return t`
2
2
  <div class="preview">
3
- <span class="title">${this.orderIndex+1}.${this.title}(量表题)</span>
4
- ${this.richTextContent?t`<div style="margin-top:8px" .innerHTML=${this.richTextContent}></div>`:""}
3
+ <span class="title">${this["order-index"]+1}.${this.title}(量表题)</span>
4
+ ${this["rich-text-content"]?t`<div style="margin-top:8px" .innerHTML=${this["rich-text-content"]}></div>`:""}
5
5
  <table class="scale-table">
6
6
  <thead><tr>
7
7
  <th style="width:${e}%">问题 \ 选项</th>
@@ -20,7 +20,7 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s}from"..
20
20
  <div class="label"><span>题目:</span></div>
21
21
  <div style="flex:1">
22
22
  <div class="el-input">
23
- <textarea rows="2" .value=${this._title} ?disabled=${this.isSave}
23
+ <textarea rows="2" .value=${this._title} ?disabled=${this["is-save"]}
24
24
  maxlength=${this.TITLE_MAX}
25
25
  @input=${t=>this._onTitleInput(t)}
26
26
  placeholder="【量表题】请输入问题"></textarea>
@@ -33,7 +33,7 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s}from"..
33
33
  <div class="label"><span>行标题:</span></div>
34
34
  <div class="flex" style="flex:1">
35
35
  <div class="el-input" style="width:160px">
36
- <textarea class="row-title-textarea" .value=${this._rowTitle} ?disabled=${this.isSave}
36
+ <textarea class="row-title-textarea" .value=${this._rowTitle} ?disabled=${this["is-save"]}
37
37
  @input=${t=>{this._rowTitle=t.target.value}}
38
38
  @keydown=${t=>{t.stopPropagation()}}
39
39
  placeholder="请输入行标题"></textarea>
@@ -43,12 +43,12 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s}from"..
43
43
  <div class="answer-item">
44
44
  <span class="label">${String.fromCharCode(65+i)}.</span>
45
45
  <div class="input">
46
- <input type="text" .value=${e.title} ?disabled=${this.isSave}
46
+ <input type="text" .value=${e.title} ?disabled=${this["is-save"]}
47
47
  maxlength="10"
48
48
  @input=${t=>{this._answers=this._answers.map((e,s)=>s===i?{title:t.target.value}:e)}}
49
49
  placeholder="选项${i+1}" />
50
50
  </div>
51
- ${this.isSave?"":t`
51
+ ${this["is-save"]?"":t`
52
52
  <span class="icon" @click=${()=>{this._answers.length<5&&(this._answers=[...this._answers,{title:""}])}}>${p}</span>
53
53
  <span class="icon ${this._answers.length<3?"disabled":""}" @click=${()=>{this._answers.length>3&&(this._answers=this._answers.filter((t,e)=>e!==i))}}>${c}</span>
54
54
  `}
@@ -62,7 +62,7 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s}from"..
62
62
  <div class="label"><span>解析:</span></div>
63
63
  <div style="flex:1">
64
64
  <div class="el-input">
65
- <textarea rows="2" .value=${this._analysis} ?disabled=${this.isSave}
65
+ <textarea rows="2" .value=${this._analysis} ?disabled=${this["is-save"]}
66
66
  @input=${t=>{this._analysis=t.target.value}}
67
67
  placeholder="请输入题目解析"></textarea>
68
68
  </div>
@@ -75,25 +75,25 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s}from"..
75
75
  <div style="flex:1">
76
76
  <qxs-blocksuite-editor
77
77
  .content=${this._richText}
78
- .uploadImage=${this.uploadImage}
78
+ .upload-image=${this["upload-image"]}
79
79
  ?is-edit=${!0}
80
80
  ></qxs-blocksuite-editor>
81
- ${this.showAction?"":t`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
81
+ ${this["show-action"]?"":t`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
82
82
  </div>
83
83
  </div>
84
84
  `:""}
85
85
  `}render(){return t`
86
- <qxs-subject-layout .showEdit=${this.isEdit}>
86
+ <qxs-subject-layout .show-edit=${this["is-edit"]}>
87
87
  <div slot="preview">${this._renderPreview()}</div>
88
88
  <div slot="edit">${this._renderEdit()}</div>
89
- ${this.showAction?t`
89
+ ${this["show-action"]?t`
90
90
  <qxs-subject-action
91
- .isEdit=${this.isEdit}
92
- .isSet=${this.isSet}
93
- .showAdd=${this.showAdd}
94
- .showRichText=${this._showRichText}
95
- .showOtherOption=${!1}
96
- exam-answer-relation-type=${this.examAnswerRelationType}
91
+ .is-edit=${this["is-edit"]}
92
+ .is-set=${this["is-set"]}
93
+ .show-add=${this["show-add"]}
94
+ .show-rich-text=${this._showRichText}
95
+ .show-other-option=${!1}
96
+ exam-answer-relation-type=${this["exam-answer-relation-type"]}
97
97
  @delete=${()=>this._emit("delete")}
98
98
  @save=${this._save}
99
99
  @edit=${()=>this._emit("edit")}
@@ -161,5 +161,5 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s}from"..
161
161
  .row-title-textarea {
162
162
  height: 200px;
163
163
  }
164
- `,h([s({type:Number,attribute:"order-index"})],x.prototype,"orderIndex",2),h([s({type:String})],x.prototype,"title",2),h([s({type:String,attribute:"custom-id"})],x.prototype,"customId",2),h([s({type:Boolean,attribute:"is-edit"})],x.prototype,"isEdit",2),h([s({type:Boolean,attribute:"is-save"})],x.prototype,"isSave",2),h([s({type:Boolean,attribute:"is-set"})],x.prototype,"isSet",2),h([s({type:Boolean,attribute:"show-action"})],x.prototype,"showAction",2),h([s({type:Boolean,attribute:"show-add"})],x.prototype,"showAdd",2),h([s({type:Boolean,attribute:"show-analysis"})],x.prototype,"showAnalysis",2),h([s({type:String})],x.prototype,"analysis",2),h([s({type:String,attribute:"rich-text-content"})],x.prototype,"richTextContent",2),h([s({type:Number,attribute:"exam-answer-relation-type"})],x.prototype,"examAnswerRelationType",2),h([s({type:Object})],x.prototype,"uploadImage",2),h([s({type:Array,attribute:"answer-list"})],x.prototype,"answerList",1),h([s({type:Array,attribute:"scale-questions"})],x.prototype,"scaleQuestions",1),h([o()],x.prototype,"_answers",2),h([o()],x.prototype,"_scaleQuestions",2),h([o()],x.prototype,"_rowTitle",2),h([o()],x.prototype,"_title",2),h([o()],x.prototype,"_analysis",2),h([o()],x.prototype,"_showRichText",2),h([o()],x.prototype,"_richText",2),h([s({type:String,attribute:"model-value"})],x.prototype,"modelValue",2),h([s({type:Boolean,attribute:"use-model"})],x.prototype,"useModel",2),x=h([a("qxs-scale")],x);export{x as QxsScale};
164
+ `,h([s({type:Number,attribute:"order-index"})],x.prototype,"order-index",2),h([s({type:String})],x.prototype,"title",2),h([s({type:String,attribute:"custom-id"})],x.prototype,"custom-id",2),h([s({type:Boolean,attribute:"is-edit"})],x.prototype,"is-edit",2),h([s({type:Boolean,attribute:"is-save"})],x.prototype,"is-save",2),h([s({type:Boolean,attribute:"is-set"})],x.prototype,"is-set",2),h([s({type:Boolean,attribute:"show-action"})],x.prototype,"show-action",2),h([s({type:Boolean,attribute:"show-add"})],x.prototype,"show-add",2),h([s({type:Boolean,attribute:"show-analysis"})],x.prototype,"show-analysis",2),h([s({type:String})],x.prototype,"analysis",2),h([s({type:String,attribute:"rich-text-content"})],x.prototype,"rich-text-content",2),h([s({type:Number,attribute:"exam-answer-relation-type"})],x.prototype,"exam-answer-relation-type",2),h([s({type:Object,attribute:"upload-image"})],x.prototype,"upload-image",2),h([s({type:Array,attribute:"answer-list"})],x.prototype,"answer-list",1),h([s({type:Array,attribute:"scale-questions"})],x.prototype,"scale-questions",1),h([o()],x.prototype,"_answers",2),h([o()],x.prototype,"_scaleQuestions",2),h([o()],x.prototype,"_rowTitle",2),h([o()],x.prototype,"_title",2),h([o()],x.prototype,"_analysis",2),h([o()],x.prototype,"_showRichText",2),h([o()],x.prototype,"_richText",2),h([s({type:String,attribute:"model-value"})],x.prototype,"model-value",2),h([s({type:Boolean,attribute:"use-model"})],x.prototype,"use-model",2),x=h([a("qxs-scale")],x);export{x as QxsScale};
165
165
  //# sourceMappingURL=scale.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"scale.mjs","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'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\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: String, attribute: 'custom-id' }) customId = ''\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-add' }) showAdd = true\n @property({ type: Boolean, attribute: 'show-analysis' }) showAnalysis = true\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: Object })\n uploadImage: (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = (e) => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\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 // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) modelValue = ''\n @property({ type: Boolean, attribute: 'use-model' }) useModel = false\n\n private readonly TITLE_MAX = 200\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n if (!this.isEdit && (changed.has('title') || changed.has('answerList') || changed.has('analysis') || changed.has('richTextContent') || changed.has('scaleQuestions'))) {\n this._syncProps()\n }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('modelValue') && this.useModel) {\n this._title = this.modelValue\n }\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n this._rowTitle = this._scaleQuestions.join('\\n')\n this._richText = this.richTextContent || ''\n this._showRichText = !!this.richTextContent\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this.customId || undefined, answerType: 'scale', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : (this.answerList || [])\n const analysis = this.isEdit ? this._analysis : this.analysis || ''\n const rowTitle = this.isEdit ? this._rowTitle : (this.scaleQuestions?.join('\\n') || '')\n const showRichText = this.isEdit ? this._showRichText : !!this.richTextContent\n const richText = this.isEdit ? this._richText : this.richTextContent || ''\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n\n for (let i = 0; i < answers.length; i++) {\n if (!answers[i].title) {\n reject(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写。`, 'ANSWER_EMPTY', 'answers', row))\n return\n }\n }\n\n if (!rowTitle) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const questions = rowTitle.split('\\n').filter((i: string) => i.trim())\n if (questions.length === 0) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.SCALE,\n title,\n analysis,\n answers,\n scaleQuestionList: questions,\n examRichTextContent: showRichText ? richText : '',\n examAnswerRelationType: this.examAnswerRelationType,\n }\n if (this.customId) { result.customId = this.customId }\n resolve(result)\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 if (this.useModel) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this.customId || undefined, answerType: 'scale', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : (this.answerList || [])\n const rowTitle = this.isEdit ? this._rowTitle : (this.scaleQuestions?.join('\\n') || '')\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n\n answers.forEach((a: any, i: number) => {\n if (!a.title) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写`, 'ANSWER_EMPTY', 'answers', row))\n }\n })\n\n if (!rowTitle) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n else {\n const questions = rowTitle.split('\\n').filter((i: string) => i.trim())\n if (questions.length === 0) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n }\n\n return errors\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 .uploadImage=${this.uploadImage}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n ${!this.showAction\n ? html`<div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>`\n : ''}\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout .showEdit=${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 .isEdit=${this.isEdit}\n .isSet=${this.isSet}\n .showAdd=${this.showAdd}\n .showRichText=${this._showRichText}\n .showOtherOption=${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=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","iconRemove","QxsScale","LitElement","constructor","super","arguments","this","orderIndex","title","customId","isEdit","isSave","isSet","showAction","showAdd","showAnalysis","analysis","richTextContent","examAnswerRelationType","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","_scaleQuestions","_rowTitle","_title","_analysis","_showRichText","_richText","modelValue","useModel","TITLE_MAX","answerList","v","arr","Array","isArray","length","slice","requestUpdate","scaleQuestions","willUpdate","changed","has","_syncProps","join","toJSON","row","answerType","answers","rowTitle","showRichText","richText","SubjectError","i","String","fromCharCode","questions","split","filter","trim","SubjectType","SCALE","scaleQuestionList","examRichTextContent","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","forEach","a","_renderPreview","colWidth","Math","floor","map","q","_renderEdit","stopPropagation","x","j","_","render","styles","css","__decorateClass","property","type","Number","attribute","prototype","Boolean","state","safeCustomElement"],"mappings":"2oBAMA,MAAMA,EAAWC,CAAA,2NACXC,EAAaD,CAAA,qLAgBZ,IAAME,EAAN,cAAuBC,EAAvBC,WAAAA,GAAAC,SAAAC,WA8DiDC,KAAAC,WAAa,EACvCD,KAAAE,MAAQ,GACgBF,KAAAG,SAAW,GACZH,KAAAI,QAAS,EACTJ,KAAAK,QAAS,EACVL,KAAAM,OAAQ,EACHN,KAAAO,YAAa,EAChBP,KAAAQ,SAAU,EACLR,KAAAS,cAAe,EAC5CT,KAAAU,SAAW,GACqBV,KAAAW,gBAAkB,GACVX,KAAAY,uBAAyB,EAE7FZ,KAAAa,YAA+CC,SACtC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAAUC,GAAML,EAAQK,EAAEC,QAAQC,QACzCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAoBhB1B,KAAQ2B,SAAgC,CAAC,CAAEzB,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,KAC9GF,KAAQ4B,gBAA4B,CAAC,OACrC5B,KAAQ6B,UAAY,GACpB7B,KAAQ8B,OAAS,GACjB9B,KAAQ+B,UAAY,GACpB/B,KAAQgC,eAAgB,EACxBhC,KAAQi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A6FP2I,UAAA,iBAAA,GAOaL,EAAA,CAAhBO,KApGU7I,EAoGM2I,UAAA,WAAA,GACAL,EAAA,CAAhBO,KArGU7I,EAqGM2I,UAAA,kBAAA,GACAL,EAAA,CAAhBO,KAtGU7I,EAsGM2I,UAAA,YAAA,GACAL,EAAA,CAAhBO,KAvGU7I,EAuGM2I,UAAA,SAAA,GACAL,EAAA,CAAhBO,KAxGU7I,EAwGM2I,UAAA,YAAA,GACAL,EAAA,CAAhBO,KAzGU7I,EAyGM2I,UAAA,gBAAA,GACAL,EAAA,CAAhBO,KA1GU7I,EA0GM2I,UAAA,YAAA,GAGqCL,EAAA,CAArDC,EAAS,CAAEC,KAAMvE,OAAQyE,UAAW,iBA7G1B1I,EA6G2C2I,UAAA,aAAA,GACDL,EAAA,CAApDC,EAAS,CAAEC,KAAMI,QAASF,UAAW,eA9G3B1I,EA8G0C2I,UAAA,WAAA,GA9G1C3I,EAANsI,EAAA,CADNQ,EAAkB,cACN9I"}
1
+ {"version":3,"file":"scale.mjs","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'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\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' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = true\n @property({ type: String }) analysis = ''\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' })\n get 'answer-list'() { return this._answers }\n\n set 'answer-list'(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('answer-list')\n }\n\n @property({ type: Array, attribute: 'scale-questions' })\n get 'scale-questions'() { return this._scaleQuestions }\n\n set 'scale-questions'(v: any) {\n this._scaleQuestions = Array.isArray(v) && v.length ? v : ['问题1']\n this.requestUpdate('scale-questions')\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 // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n private readonly TITLE_MAX = 200\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('rich-text-content') || changed.has('scale-questions'))) {\n this._syncProps()\n }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value']\n }\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n this._rowTitle = this._scaleQuestions.join('\\n')\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'scale', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title || ''\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || [])\n const analysis = this['is-edit'] ? this._analysis : this.analysis || ''\n const rowTitle = this['is-edit'] ? this._rowTitle : (this['scale-questions']?.join('\\n') || '')\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n\n for (let i = 0; i < answers.length; i++) {\n if (!answers[i].title) {\n reject(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写。`, 'ANSWER_EMPTY', 'answers', row))\n return\n }\n }\n\n if (!rowTitle) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const questions = rowTitle.split('\\n').filter((i: string) => i.trim())\n if (questions.length === 0) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.SCALE,\n title,\n analysis,\n answers,\n scaleQuestionList: questions,\n examRichTextContent: showRichText ? richText : '',\n examAnswerRelationType: this['exam-answer-relation-type'],\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\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 if (this['use-model']) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'scale', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title || ''\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || [])\n const rowTitle = this['is-edit'] ? this._rowTitle : (this['scale-questions']?.join('\\n') || '')\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n\n answers.forEach((a: any, i: number) => {\n if (!a.title) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写`, 'ANSWER_EMPTY', 'answers', row))\n }\n })\n\n if (!rowTitle) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n else {\n const questions = rowTitle.split('\\n').filter((i: string) => i.trim())\n if (questions.length === 0) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n }\n\n return errors\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['order-index'] + 1}.${this.title}(量表题)</span>\n ${this['rich-text-content'] ? html`<div style=\"margin-top:8px\" .innerHTML=${this['rich-text-content']}></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['is-save']}\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['is-save']}\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['is-save']}\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['is-save']\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['is-save']}\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 .upload-image=${this['upload-image']}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n ${!this['show-action']\n ? html`<div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>`\n : ''}\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this._showRichText}\n .show-other-option=${false}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\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=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","iconRemove","QxsScale","LitElement","constructor","super","arguments","this","title","analysis","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","_scaleQuestions","_rowTitle","_title","_analysis","_showRichText","_richText","TITLE_MAX","v","arr","Array","isArray","length","slice","requestUpdate","willUpdate","changed","has","_syncProps","join","toJSON","row","customId","answerType","orderIndex","answers","rowTitle","showRichText","richText","SubjectError","i","String","fromCharCode","questions","split","filter","trim","SubjectType","SCALE","scaleQuestionList","examRichTextContent","examAnswerRelationType","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","forEach","a","_renderPreview","colWidth","Math","floor","map","q","_renderEdit","stopPropagation","x","j","_","render","styles","css","__decorateClass","property","type","Number","attribute","prototype","Boolean","state","safeCustomElement"],"mappings":"ybAMA,MAAMA,EAAWC,CAAA,2NACXC,EAAaD,CAAA,qLAgBZ,IAAME,EAAN,cAAuBC,EAAvBC,WAAAA,GAAAC,SAAAC,WA8DiDC,KAAA,eAAgB,EAC1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACRA,KAAA,kBAAkB,EAC/CA,KAAAE,SAAW,GACqBF,KAAA,qBAAsB,GACdA,KAAA,6BAA8B,EAElGA,KAAA,gBAAkDG,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAqBhBf,KAAQgB,SAAgC,CAAC,CAAEf,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAEA,MAAO,KAC9GD,KAAQiB,gBAA4B,CAAC,OACrCjB,KAAQkB,UAAY,GACpBlB,KAAQmB,OAAS,GACjBnB,KAAQoB,UAAY,GACpBpB,KAAQqB,eAAgB,EACxBrB,KAAQsB,UAAY,GAGyBtB,KAAA,eAAgB,GACjBA,KAAA,cAAc,EAEnEA,KAAiBuB,UAAY,GAAA,CA5B7B,gBAAI,GAAkB,OAAOvB,KAAKgB,QAAS,CAE3C,gBAAI,CAAcQ,GAChB,MAAMC,EAAMC,MAAMC,QAAQH,GAAKA,EAAI,GACnCxB,KAAKgB,SAAWS,EAAIG,OAASH,EAAII,MAAM,EAAG,GAAK,CAAC,CAAE5B,MAAO,IAAM,CAAEA,MAAO,IAAM,CAAE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