@qxs-bns/components-wc 0.0.27 → 0.0.29

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.
@@ -1,7 +1,7 @@
1
- "use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./sorting-card.cjs"),o=require("./types.cjs"),a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?n(e,s):e,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&a(e,s,o),o};const p=[{bg:"#ecf5ff",color:"#3D61E3",border:"#d9ecff"},{bg:"#f0f9eb",color:"#67c23a",border:"#c2e7b0"},{bg:"#fdf6ec",color:"#e6a23c",border:"#faecd8"},{bg:"#fef0f0",color:"#f56c6c",border:"#fde2e2"},{bg:"#f4f4f5",color:"#909399",border:"#e9e9eb"}];exports.QxsTextFill=class extends t.LitElement{constructor(){super(...arguments),this._iconPlus=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>`,this._iconRemove=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>`,this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,this.sorting=!1,this["show-answer-setting"]=!1,this["show-analysis"]=!0,this["rich-text-content"]="",this.analysis="",this["exam-answer-relation-type"]=0,this["exam-expand"]="",this["exam-id"]=0,this["category-id"]="",this["exam-answer-setting"]={isInOrder:!1,isIgnoreCase:!0},this["upload-image"]=async t=>new Promise((e,s)=>{const i=new FileReader;i.onload=t=>e(t.target?.result),i.onerror=s,i.readAsDataURL(t)}),this["answer-list"]=[],this["tag-list"]=[],this["category-list"]=[],this["resource-list"]=[],this["show-tag"]=!1,this["show-category"]=!1,this["show-resource"]=!1,this["model-value"]="",this["use-model"]=!1,this._answers=[{title:"",tag:"",showInput:!1}],this._title="",this._analysis="",this._isInOrder=!1,this._isIgnoreCase=!0,this._keywordCount=null,this._correct="",this._showRichText=!1,this._richText="",this._selectedTagList=[],this._categoryId="",this.TITLE_MAX=200}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("exam-answer-setting")||t.has("rich-text-content")||t.has("exam-expand")||t.has("tag-list")||t.has("category-id"))&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"]),t.has("tag-list")&&(this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(t=>({...t})):[]),t.has("category-id")&&(this._categoryId=this["category-id"]?String(this["category-id"]):"")}_normalizeAnswerTitle(t){return i.trimCommaSeparatedText(t?.title??t?.answer??"")}_normalizedAnswerList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(Array.isArray(t)?t:[]).map(t=>({...t,answerId:t?.answerId??t?.examAnswerId,title:this._normalizeAnswerTitle(t)}))}_filledAnswers(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter(t=>this._normalizeAnswerTitle(t))}_readKeywordCount(t){return t&&void 0!==t.keywordCount&&null!==t.keywordCount&&""!==t.keywordCount?Number(t.keywordCount):null}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this["answer-list"]?.length?this._answers=this._normalizedAnswerList(this["answer-list"]).map(t=>({title:t.title||"",tag:"",showInput:!1,answerId:t.answerId,customAnswerId:t.customAnswerId})):this._answers=[{title:"",tag:"",showInput:!1}],this._isInOrder=!!this["exam-answer-setting"]?.isInOrder,this._isIgnoreCase=this["exam-answer-setting"]?.isIgnoreCase??!0,this._keywordCount=this._readKeywordCount(this["exam-answer-setting"]),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],this._correct=this["exam-expand"]||"",this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(t=>({...t})):[],this._categoryId=this["category-id"]?String(this["category-id"]):""}_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}))}_addTag(t){const e={...this._answers[t]};e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag=""),e.showInput=!1,this._answers=this._answers.map((s,i)=>i===t?e:s)}_closeTag(t,e){const s={...this._answers[e]};s.title=s.title.split(",").filter(e=>e!==t).join(","),this._answers=this._answers.map((t,i)=>i===e?s:t)}_addAnswer(){this._answers=[...this._answers,{title:"",tag:"",showInput:!1}]}_deleteAnswer(t){this._answers.length<2||(this._answers=this._answers.filter((e,s)=>s!==t))}_onCategoryChange(t){this._categoryId=t,this._emit("category-change",{value:t,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_imageResources(){return(this["resource-list"]||[]).filter(t=>1===t.resourceType).map(t=>t.resource.middle||t.resource.url).filter(Boolean)}_videoResource(){return(this["resource-list"]||[]).find(t=>2===t.resourceType)?.resource||null}_categoryLabel(){const t=this["category-list"].find(t=>String(t.categoryId)===String(this._categoryId));return t?.title||t?.categoryName||this._categoryId||"未选择分类"}_validateState(t){const{row:e,title:s,answers:r,correct:o,keywordCount:a}=t;if(!s)return new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e);const n=this._filledAnswers(r);return!!o||null!==a||n.length>0?o?!a||a<1?new i.SubjectError("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",e):n.length?a>n.length?new i.SubjectError("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",e):null:new i.SubjectError("请设置关键词","NO_KEYWORDS","answers",e):new i.SubjectError("请输入问题正确答案!","NO_CORRECT_ANSWER","correct",e):null}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},r=i.trimText(this["is-edit"]?this._title:this.title||""),a=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),n=i.trimText(this["is-edit"]?this._analysis:this.analysis||""),l=i.trimText(this["is-edit"]?this._correct:this["exam-expand"]||""),p=this["is-edit"]?this._keywordCount:this._readKeywordCount(this["exam-answer-setting"]),d=this["is-edit"]?this._isInOrder:this["exam-answer-setting"]?.isInOrder??!1,h=this["is-edit"]?this._isIgnoreCase:this["exam-answer-setting"]?.isIgnoreCase??!0,c=this["is-edit"]?this._showRichText:!!this["rich-text-content"],x=this["is-edit"]?this._richText:this["rich-text-content"]||"",y=this._validateState({row:s,title:r,answers:a,correct:l,keywordCount:p});if(y)return void e(y);const u={answerType:o.SubjectType.TEXT_FILL,examTypeEnum:o.SubjectType.TEXT_FILL,title:r,answers:this._filledAnswers(a).map((t,e)=>{const s=this._normalizeAnswerTitle(t),i={title:s,answer:s,orderIndex:e+1};return t.answerId&&(i.answerId=t.answerId,i.examAnswerId=t.answerId),t.customAnswerId&&(i.customAnswerId=t.customAnswerId),i}),analysis:n,isSetCorrectAnswer:!!l,isKey:this["is-key"],examExpand:l,examAnswerSettingBO:{isIgnoreCase:h,isInOrder:d,...null!==p?{keywordCount:p}:{}},examAnswerSettingVO:{isIgnoreCase:h,isInOrder:d,...null!==p?{keywordCount:p}:{}},examRichTextContent:c?x:""};this["custom-id"]&&(u.customId=this["custom-id"]),t(u)})}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={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},e=i.trimText(this["is-edit"]?this._title:this.title||""),s=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),r=i.trimText(this["is-edit"]?this._correct:this["exam-expand"]||""),o=this["is-edit"]?this._keywordCount:this._readKeywordCount(this["exam-answer-setting"]),a=this._validateState({row:t,title:e,answers:s,correct:r,keywordCount:o});return a?[a]:[]}_renderPreview(){const e=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),s=this["is-edit"]?this._correct:this["exam-expand"]||"";return t.html`
1
+ "use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./sorting-card.cjs"),o=require("./types.cjs"),a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?n(e,s):e,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&a(e,s,o),o};const p=[{bg:"#ecf5ff",color:"#3D61E3",border:"#d9ecff"},{bg:"#f0f9eb",color:"#67c23a",border:"#c2e7b0"},{bg:"#fdf6ec",color:"#e6a23c",border:"#faecd8"},{bg:"#fef0f0",color:"#f56c6c",border:"#fde2e2"},{bg:"#f4f4f5",color:"#909399",border:"#e9e9eb"}];exports.QxsTextFill=class extends t.LitElement{constructor(){super(...arguments),this._iconPlus=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>`,this._iconRemove=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>`,this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["hide-add-rich-text"]=!1,this["show-rich-text"]=!1,this["show-delete-action"]=!0,this["show-save-action"]=!0,this.sorting=!1,this["show-answer-setting"]=!1,this["show-analysis"]=!1,this["rich-text-content"]="",this.analysis="",this["exam-answer-relation-type"]=0,this["exam-expand"]="",this["exam-id"]=0,this["category-id"]="",this["exam-answer-setting"]={isInOrder:!1,isIgnoreCase:!0},this["upload-image"]=async t=>new Promise((e,s)=>{const i=new FileReader;i.onload=t=>e(t.target?.result),i.onerror=s,i.readAsDataURL(t)}),this["answer-list"]=[],this["tag-list"]=[],this["category-list"]=[],this["resource-list"]=[],this["show-tag"]=!1,this["show-category"]=!1,this["show-resource"]=!1,this["model-value"]="",this["use-model"]=!1,this._answers=[{title:"",tag:"",showInput:!1}],this._title="",this._analysis="",this._isInOrder=!1,this._isIgnoreCase=!0,this._keywordCount=null,this._correct="",this._showRichText=!1,this._richText="",this._selectedTagList=[],this._categoryId="",this.TITLE_MAX=200}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("exam-answer-setting")||t.has("rich-text-content")||t.has("exam-expand")||t.has("tag-list")||t.has("category-id"))&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"]),t.has("tag-list")&&(this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(t=>({...t})):[]),t.has("category-id")&&(this._categoryId=this["category-id"]?String(this["category-id"]):"")}_normalizeAnswerTitle(t){return i.trimCommaSeparatedText(t?.title??t?.answer??"")}_normalizedAnswerList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(Array.isArray(t)?t:[]).map(t=>({...t,answerId:t?.answerId??t?.examAnswerId,title:this._normalizeAnswerTitle(t)}))}_filledAnswers(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter(t=>this._normalizeAnswerTitle(t))}_readKeywordCount(t){return t&&void 0!==t.keywordCount&&null!==t.keywordCount&&""!==t.keywordCount?Number(t.keywordCount):null}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this["answer-list"]?.length?this._answers=this._normalizedAnswerList(this["answer-list"]).map(t=>({title:t.title||"",tag:"",showInput:!1,answerId:t.answerId,customAnswerId:t.customAnswerId})):this._answers=[{title:"",tag:"",showInput:!1}],this._isInOrder=!!this["exam-answer-setting"]?.isInOrder,this._isIgnoreCase=this["exam-answer-setting"]?.isIgnoreCase??!0,this._keywordCount=this._readKeywordCount(this["exam-answer-setting"]),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],this._correct=this["exam-expand"]||"",this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(t=>({...t})):[],this._categoryId=this["category-id"]?String(this["category-id"]):""}_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}))}_addTag(t){const e={...this._answers[t]};e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag=""),e.showInput=!1,this._answers=this._answers.map((s,i)=>i===t?e:s)}_closeTag(t,e){const s={...this._answers[e]};s.title=s.title.split(",").filter(e=>e!==t).join(","),this._answers=this._answers.map((t,i)=>i===e?s:t)}_addAnswer(){this._answers=[...this._answers,{title:"",tag:"",showInput:!1}]}_deleteAnswer(t){this._answers.length<2||(this._answers=this._answers.filter((e,s)=>s!==t))}_onCategoryChange(t){this._categoryId=t,this._emit("category-change",{value:t,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_imageResources(){return(this["resource-list"]||[]).filter(t=>1===t.resourceType).map(t=>t.resource.middle||t.resource.url).filter(Boolean)}_videoResource(){return(this["resource-list"]||[]).find(t=>2===t.resourceType)?.resource||null}_categoryLabel(){const t=this["category-list"].find(t=>String(t.categoryId)===String(this._categoryId));return t?.title||t?.categoryName||this._categoryId||"未选择分类"}_validateState(t){const{row:e,title:s,answers:r,correct:o,keywordCount:a}=t;if(!s)return new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e);const n=this._filledAnswers(r);return!!o||null!==a||n.length>0?o?!a||a<1?new i.SubjectError("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",e):n.length?a>n.length?new i.SubjectError("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",e):null:new i.SubjectError("请设置关键词","NO_KEYWORDS","answers",e):new i.SubjectError("请输入问题正确答案!","NO_CORRECT_ANSWER","correct",e):null}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},r=i.trimText(this["is-edit"]?this._title:this.title||""),a=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),n=i.trimText(this["is-edit"]?this._analysis:this.analysis||""),l=i.trimText(this["is-edit"]?this._correct:this["exam-expand"]||""),p=this["is-edit"]?this._keywordCount:this._readKeywordCount(this["exam-answer-setting"]),h=this["is-edit"]?this._isInOrder:this["exam-answer-setting"]?.isInOrder??!1,d=this["is-edit"]?this._isIgnoreCase:this["exam-answer-setting"]?.isIgnoreCase??!0,c=this["is-edit"]?this._showRichText:!!this["rich-text-content"],x=this["is-edit"]?this._richText:this["rich-text-content"]||"",y=this._validateState({row:s,title:r,answers:a,correct:l,keywordCount:p});if(y)return void e(y);const u={answerType:o.SubjectType.TEXT_FILL,examTypeEnum:o.SubjectType.TEXT_FILL,title:r,answers:this._filledAnswers(a).map((t,e)=>{const s=this._normalizeAnswerTitle(t),i={title:s,answer:s,orderIndex:e+1};return t.answerId&&(i.answerId=t.answerId,i.examAnswerId=t.answerId),t.customAnswerId&&(i.customAnswerId=t.customAnswerId),i}),analysis:n,isSetCorrectAnswer:!!l,isKey:this["is-key"],examExpand:l,examAnswerSettingBO:{isIgnoreCase:d,isInOrder:h,...null!==p?{keywordCount:p}:{}},examAnswerSettingVO:{isIgnoreCase:d,isInOrder:h,...null!==p?{keywordCount:p}:{}},examRichTextContent:c?x:""};this["custom-id"]&&(u.customId=this["custom-id"]),t(u)})}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={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},e=i.trimText(this["is-edit"]?this._title:this.title||""),s=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),r=i.trimText(this["is-edit"]?this._correct:this["exam-expand"]||""),o=this["is-edit"]?this._keywordCount:this._readKeywordCount(this["exam-answer-setting"]),a=this._validateState({row:t,title:e,answers:s,correct:r,keywordCount:o});return a?[a]:[]}_renderPreview(){const e=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),s=this["is-edit"]?this._correct:this["exam-expand"]||"";return t.html`
2
2
  <div class="preview">
3
3
  <span class="title">${this["order-index"]+1}.${this.title}(问答题)</span>
4
- ${this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
4
+ ${this["show-rich-text"]&&this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
5
5
  ${this._filledAnswers(e).length?t.html`
6
6
  <div style="margin-top:8px;color:#a8abb2">
7
7
  ${this._filledAnswers(e).map((e,s)=>t.html`<span style="margin-right:10px">关键词${s+1}: ${this._normalizeAnswerTitle(e)}</span>`)}
@@ -130,7 +130,7 @@
130
130
  `)}
131
131
  </div>
132
132
 
133
- ${this._showRichText?t.html`
133
+ ${this["show-rich-text"]&&this._showRichText?t.html`
134
134
  <div class="flex-items-start" style="margin-top:12px">
135
135
  <div class="label"><span>副文本:</span></div>
136
136
  <div style="flex:1">
@@ -167,7 +167,10 @@
167
167
  .is-edit=${this["is-edit"]}
168
168
  .is-set=${this["is-set"]}
169
169
  .show-add=${this["show-add"]}
170
- .show-rich-text=${this._showRichText}
170
+ .show-rich-text=${this["show-rich-text"]&&this._showRichText}
171
+ .hide-add-rich-text=${!this["show-rich-text"]||this["hide-add-rich-text"]}
172
+ .show-delete-action=${this["show-delete-action"]}
173
+ .show-save-action=${this["show-save-action"]}
171
174
  exam-answer-relation-type=${this["exam-answer-relation-type"]}
172
175
  @delete=${()=>this._emit("delete")}
173
176
  @save=${this._save}
@@ -177,6 +180,7 @@
177
180
  @on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
178
181
  ></qxs-subject-action>
179
182
  `:""}
183
+ <slot name="action"></slot>
180
184
  </qxs-subject-layout>
181
185
  `}},exports.QxsTextFill.styles=[r.sortingCardStyles,t.css`
182
186
  :host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
@@ -186,6 +190,9 @@
186
190
  .preview .title { font-size: 14px; color: #303133; }
187
191
  .preview .rich-text { margin-top: 8px; }
188
192
  .preview .rich-text img { max-width: 100%; }
193
+ .preview .rich-text img[data-align="left"] { display: block !important; margin: 0 auto 0 0 !important; }
194
+ .preview .rich-text img[data-align="center"] { display: block !important; margin: 0 auto !important; }
195
+ .preview .rich-text img[data-align="right"] { display: block !important; margin: 0 0 0 auto !important; }
189
196
 
190
197
  .flex { display: flex; }
191
198
  .flex-items-center { display: flex; align-items: center; }
@@ -249,5 +256,5 @@
249
256
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
250
257
  border: 1px solid #e4e7ed; background: #f5f7fa;
251
258
  }
252
- `],l([e.property({type:Number,attribute:"order-index"})],exports.QxsTextFill.prototype,"order-index",2),l([e.property({type:String})],exports.QxsTextFill.prototype,"title",2),l([e.property({type:String,attribute:"custom-id"})],exports.QxsTextFill.prototype,"custom-id",2),l([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsTextFill.prototype,"is-edit",2),l([e.property({type:Boolean,attribute:"is-save"})],exports.QxsTextFill.prototype,"is-save",2),l([e.property({type:Boolean,attribute:"is-set"})],exports.QxsTextFill.prototype,"is-set",2),l([e.property({type:Boolean,attribute:"is-key"})],exports.QxsTextFill.prototype,"is-key",2),l([e.property({type:Boolean,attribute:"show-action"})],exports.QxsTextFill.prototype,"show-action",2),l([e.property({type:Boolean,attribute:"show-add"})],exports.QxsTextFill.prototype,"show-add",2),l([e.property({type:Boolean,reflect:!0})],exports.QxsTextFill.prototype,"sorting",2),l([e.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsTextFill.prototype,"show-answer-setting",2),l([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsTextFill.prototype,"show-analysis",2),l([e.property({type:String,attribute:"rich-text-content"})],exports.QxsTextFill.prototype,"rich-text-content",2),l([e.property({type:String})],exports.QxsTextFill.prototype,"analysis",2),l([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsTextFill.prototype,"exam-answer-relation-type",2),l([e.property({type:String,attribute:"exam-expand"})],exports.QxsTextFill.prototype,"exam-expand",2),l([e.property({type:Number,attribute:"exam-id"})],exports.QxsTextFill.prototype,"exam-id",2),l([e.property({type:String,attribute:"category-id"})],exports.QxsTextFill.prototype,"category-id",2),l([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsTextFill.prototype,"exam-answer-setting",2),l([e.property({type:Object,attribute:"upload-image"})],exports.QxsTextFill.prototype,"upload-image",2),l([e.property({type:Array,attribute:"answer-list"})],exports.QxsTextFill.prototype,"answer-list",2),l([e.property({type:Array,attribute:"tag-list"})],exports.QxsTextFill.prototype,"tag-list",2),l([e.property({type:Array,attribute:"category-list"})],exports.QxsTextFill.prototype,"category-list",2),l([e.property({type:Array,attribute:"resource-list"})],exports.QxsTextFill.prototype,"resource-list",2),l([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsTextFill.prototype,"show-tag",2),l([e.property({type:Boolean,attribute:"show-category"})],exports.QxsTextFill.prototype,"show-category",2),l([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsTextFill.prototype,"show-resource",2),l([e.property({type:Object,attribute:"search-handler"})],exports.QxsTextFill.prototype,"search-handler",2),l([e.property({type:String,attribute:"model-value"})],exports.QxsTextFill.prototype,"model-value",2),l([e.property({type:Boolean,attribute:"use-model"})],exports.QxsTextFill.prototype,"use-model",2),l([e.state()],exports.QxsTextFill.prototype,"_answers",2),l([e.state()],exports.QxsTextFill.prototype,"_title",2),l([e.state()],exports.QxsTextFill.prototype,"_analysis",2),l([e.state()],exports.QxsTextFill.prototype,"_isInOrder",2),l([e.state()],exports.QxsTextFill.prototype,"_isIgnoreCase",2),l([e.state()],exports.QxsTextFill.prototype,"_keywordCount",2),l([e.state()],exports.QxsTextFill.prototype,"_correct",2),l([e.state()],exports.QxsTextFill.prototype,"_showRichText",2),l([e.state()],exports.QxsTextFill.prototype,"_richText",2),l([e.state()],exports.QxsTextFill.prototype,"_selectedTagList",2),l([e.state()],exports.QxsTextFill.prototype,"_categoryId",2),exports.QxsTextFill=l([s.safeCustomElement("qxs-text-fill")],exports.QxsTextFill);
259
+ `],l([e.property({type:Number,attribute:"order-index"})],exports.QxsTextFill.prototype,"order-index",2),l([e.property({type:String})],exports.QxsTextFill.prototype,"title",2),l([e.property({type:String,attribute:"custom-id"})],exports.QxsTextFill.prototype,"custom-id",2),l([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsTextFill.prototype,"is-edit",2),l([e.property({type:Boolean,attribute:"is-save"})],exports.QxsTextFill.prototype,"is-save",2),l([e.property({type:Boolean,attribute:"is-set"})],exports.QxsTextFill.prototype,"is-set",2),l([e.property({type:Boolean,attribute:"is-key"})],exports.QxsTextFill.prototype,"is-key",2),l([e.property({type:Boolean,attribute:"show-action"})],exports.QxsTextFill.prototype,"show-action",2),l([e.property({type:Boolean,attribute:"show-add"})],exports.QxsTextFill.prototype,"show-add",2),l([e.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsTextFill.prototype,"hide-add-rich-text",2),l([e.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsTextFill.prototype,"show-rich-text",2),l([e.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsTextFill.prototype,"show-delete-action",2),l([e.property({type:Boolean,attribute:"show-save-action"})],exports.QxsTextFill.prototype,"show-save-action",2),l([e.property({type:Boolean,reflect:!0})],exports.QxsTextFill.prototype,"sorting",2),l([e.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsTextFill.prototype,"show-answer-setting",2),l([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsTextFill.prototype,"show-analysis",2),l([e.property({type:String,attribute:"rich-text-content"})],exports.QxsTextFill.prototype,"rich-text-content",2),l([e.property({type:String})],exports.QxsTextFill.prototype,"analysis",2),l([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsTextFill.prototype,"exam-answer-relation-type",2),l([e.property({type:String,attribute:"exam-expand"})],exports.QxsTextFill.prototype,"exam-expand",2),l([e.property({type:Number,attribute:"exam-id"})],exports.QxsTextFill.prototype,"exam-id",2),l([e.property({type:String,attribute:"category-id"})],exports.QxsTextFill.prototype,"category-id",2),l([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsTextFill.prototype,"exam-answer-setting",2),l([e.property({type:Object,attribute:"upload-image"})],exports.QxsTextFill.prototype,"upload-image",2),l([e.property({type:Array,attribute:"answer-list"})],exports.QxsTextFill.prototype,"answer-list",2),l([e.property({type:Array,attribute:"tag-list"})],exports.QxsTextFill.prototype,"tag-list",2),l([e.property({type:Array,attribute:"category-list"})],exports.QxsTextFill.prototype,"category-list",2),l([e.property({type:Array,attribute:"resource-list"})],exports.QxsTextFill.prototype,"resource-list",2),l([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsTextFill.prototype,"show-tag",2),l([e.property({type:Boolean,attribute:"show-category"})],exports.QxsTextFill.prototype,"show-category",2),l([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsTextFill.prototype,"show-resource",2),l([e.property({type:Object,attribute:"search-handler"})],exports.QxsTextFill.prototype,"search-handler",2),l([e.property({type:String,attribute:"model-value"})],exports.QxsTextFill.prototype,"model-value",2),l([e.property({type:Boolean,attribute:"use-model"})],exports.QxsTextFill.prototype,"use-model",2),l([e.state()],exports.QxsTextFill.prototype,"_answers",2),l([e.state()],exports.QxsTextFill.prototype,"_title",2),l([e.state()],exports.QxsTextFill.prototype,"_analysis",2),l([e.state()],exports.QxsTextFill.prototype,"_isInOrder",2),l([e.state()],exports.QxsTextFill.prototype,"_isIgnoreCase",2),l([e.state()],exports.QxsTextFill.prototype,"_keywordCount",2),l([e.state()],exports.QxsTextFill.prototype,"_correct",2),l([e.state()],exports.QxsTextFill.prototype,"_showRichText",2),l([e.state()],exports.QxsTextFill.prototype,"_richText",2),l([e.state()],exports.QxsTextFill.prototype,"_selectedTagList",2),l([e.state()],exports.QxsTextFill.prototype,"_categoryId",2),exports.QxsTextFill=l([s.safeCustomElement("qxs-text-fill")],exports.QxsTextFill);
253
260
  //# sourceMappingURL=text-fill.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-fill.cjs","sources":["../../../../packages/components-wc/src/subject/text-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem, trimCommaSeparatedText, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface TextAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n customAnswerId?: string | number\n}\n\ninterface TextAnswerSetting {\n isInOrder?: boolean\n isIgnoreCase?: boolean\n keywordCount?: number\n}\n\nconst TAG_COLORS = [\n { bg: '#ecf5ff', color: '#3D61E3', border: '#d9ecff' },\n { bg: '#f0f9eb', color: '#67c23a', border: '#c2e7b0' },\n { bg: '#fdf6ec', color: '#e6a23c', border: '#faecd8' },\n { bg: '#fef0f0', color: '#f56c6c', border: '#fde2e2' },\n { bg: '#f4f4f5', color: '#909399', border: '#e9e9eb' },\n]\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-text-fill')\nexport class QxsTextFill extends LitElement {\n private readonly _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>`\n private readonly _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\n static styles = [sortingCardStyles, 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 .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\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 {\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;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\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 .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\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 .answer-item .link { color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; line-height: 1; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\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: 'is-key' }) 'is-key' = 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, reflect: true }) sorting = false\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = true\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': TextAnswerSetting = { isInOrder: false, isIgnoreCase: true }\n\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' }) 'answer-list': any[] = []\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n @property({ type: Object, attribute: 'search-handler' }) 'search-handler'?: (query: string, answerType: number) => Promise<any[]>\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _answers: TextAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _keywordCount: number | null = null\n @state() private _correct = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\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('exam-answer-setting') || changed.has('rich-text-content') || changed.has('exam-expand') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value']\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return trimCommaSeparatedText(answer?.title ?? answer?.answer ?? '')\n }\n\n private _normalizedAnswerList(source: any[] = []) {\n return (Array.isArray(source) ? source : []).map((answer: any) => ({\n ...answer,\n answerId: answer?.answerId ?? answer?.examAnswerId,\n title: this._normalizeAnswerTitle(answer),\n }))\n }\n\n private _filledAnswers(source: any[] = []) {\n return source.filter(answer => this._normalizeAnswerTitle(answer))\n }\n\n private _readKeywordCount(setting?: TextAnswerSetting | null) {\n if (!setting || setting.keywordCount === undefined || setting.keywordCount === null || setting.keywordCount === '') {\n return null\n }\n return Number(setting.keywordCount)\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this._normalizedAnswerList(this['answer-list']).map((answer: any) => ({\n title: answer.title || '',\n tag: '',\n showInput: false,\n answerId: answer.answerId,\n customAnswerId: answer.customAnswerId,\n }))\n }\n else {\n this._answers = [{ title: '', tag: '', showInput: false }]\n }\n this._isInOrder = !!this['exam-answer-setting']?.isInOrder\n this._isIgnoreCase = this['exam-answer-setting']?.isIgnoreCase ?? true\n this._keywordCount = this._readKeywordCount(this['exam-answer-setting'])\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._correct = this['exam-expand'] || ''\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\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 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 _addTag(index: number) {\n const answer = { ...this._answers[index] }\n if (answer.tag) {\n answer.title = answer.title ? [answer.title, answer.tag].join(',') : answer.tag\n answer.tag = ''\n }\n answer.showInput = false\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? answer : item)\n }\n\n private _closeTag(tag: string, index: number) {\n const answer = { ...this._answers[index] }\n answer.title = answer.title.split(',').filter(item => item !== tag).join(',')\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? answer : item)\n }\n\n private _addAnswer() {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 2) { return }\n this._answers = this._answers.filter((_, currentIndex) => currentIndex !== index)\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n private _validateState(options: {\n row: any\n title: string\n answers: TextAnswer[]\n correct: string\n keywordCount: number | null\n }) {\n const { row, title, answers, correct, keywordCount } = options\n if (!title) {\n return new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row)\n }\n\n const filledAnswers = this._filledAnswers(answers)\n const shouldValidateAnswers = !!correct || keywordCount !== null || filledAnswers.length > 0\n\n if (!shouldValidateAnswers) { return null }\n if (!correct) {\n return new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row)\n }\n if (!keywordCount || keywordCount < 1) {\n return new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row)\n }\n if (!filledAnswers.length) {\n return new SubjectError('请设置关键词', 'NO_KEYWORDS', 'answers', row)\n }\n if (keywordCount > filledAnswers.length) {\n return new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row)\n }\n return null\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'text_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const analysis = trimText(this['is-edit'] ? this._analysis : this.analysis || '')\n const correct = trimText(this['is-edit'] ? this._correct : this['exam-expand'] || '')\n const keywordCount = this['is-edit'] ? this._keywordCount : this._readKeywordCount(this['exam-answer-setting'])\n const isInOrder = this['is-edit'] ? this._isInOrder : (this['exam-answer-setting']?.isInOrder ?? false)\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : (this['exam-answer-setting']?.isIgnoreCase ?? true)\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 const validationError = this._validateState({ row, title, answers, correct, keywordCount })\n if (validationError) {\n reject(validationError)\n return\n }\n\n const result: any = {\n answerType: SubjectType.TEXT_FILL,\n examTypeEnum: SubjectType.TEXT_FILL,\n title,\n answers: this._filledAnswers(answers).map((answer: any, index: number) => {\n const title = this._normalizeAnswerTitle(answer)\n const next: any = {\n title,\n answer: title,\n orderIndex: index + 1,\n }\n if (answer.answerId) {\n next.answerId = answer.answerId\n next.examAnswerId = answer.answerId\n }\n if (answer.customAnswerId) {\n next.customAnswerId = answer.customAnswerId\n }\n return next\n }),\n analysis,\n isSetCorrectAnswer: !!correct,\n isKey: this['is-key'],\n examExpand: correct,\n examAnswerSettingBO: {\n isIgnoreCase,\n isInOrder,\n ...(keywordCount !== null ? { keywordCount } : {}),\n },\n examAnswerSettingVO: {\n isIgnoreCase,\n isInOrder,\n ...(keywordCount !== null ? { keywordCount } : {}),\n },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\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 row = { customId: this['custom-id'] || undefined, answerType: 'text_fill', orderIndex: this['order-index'] }\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const correct = trimText(this['is-edit'] ? this._correct : this['exam-expand'] || '')\n const keywordCount = this['is-edit'] ? this._keywordCount : this._readKeywordCount(this['exam-answer-setting'])\n const validationError = this._validateState({ row, title, answers, correct, keywordCount })\n return validationError ? [validationError] : []\n }\n\n private _renderPreview() {\n const previewAnswers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const previewCorrect = this['is-edit'] ? this._correct : (this['exam-expand'] || '')\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 class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${this._filledAnswers(previewAnswers).length\n ? html`\n <div style=\"margin-top:8px;color:#a8abb2\">\n ${this._filledAnswers(previewAnswers).map((answer, index) => html`<span style=\"margin-right:10px\">关键词${index + 1}: ${this._normalizeAnswerTitle(answer)}</span>`)}\n </div>\n `\n : ''}\n ${previewCorrect ? html`<div style=\"margin-top:8px;color:#a8abb2\">正确答案:${previewCorrect}</div>` : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = `${this['order-index'] + 1}. ${title}`\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.TEXT_FILL] || SubjectType.TEXT_FILL)\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </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}\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 style=\"flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px\">\n <span style=\"font-size:13px;color:#606266\">共答对</span>\n <input\n type=\"number\"\n style=\"width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px\"\n .value=${this._keywordCount === null ? '' : String(this._keywordCount)}\n min=\"1\"\n @change=${(e: Event) => {\n const value = (e.target as HTMLInputElement).value\n this._keywordCount = value === '' ? null : Number(value)\n }} />\n <span style=\"font-size:13px;color:#606266\">个关键词,算是正确的</span>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\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._correct}\n maxlength=\"200\"\n @input=${(e: Event) => { this._correct = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入正确答案\"></textarea>\n <span class=\"char-counter\">${this._correct.length}/200</span>\n </div>\n </div>\n </div>\n\n <div class=\"answer-list\" style=\"margin-top:12px\">\n <span style=\"padding-left:60px;font-size:12px;color:#909399\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n ${this._answers.map((answer, index) => html`\n <div class=\"answer-item\">\n <span class=\"label\">关键词${index + 1}:</span>\n <div class=\"answer-tags\" style=\"display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px\">\n ${answer.title.split(',').filter(Boolean).map((tag) => {\n const color = TAG_COLORS[index % TAG_COLORS.length]\n return html`\n <span style=\"display:inline-flex;align-items:center;background:${color.bg};color:${color.color};border:1px solid ${color.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px\">\n ${tag}\n <span style=\"cursor:pointer;margin-left:4px;color:#909399\" @click=${() => this._closeTag(tag, index)}>×</span>\n </span>\n `\n })}\n ${html`\n ${answer.showInput\n ? html`\n <input type=\"text\" style=\"width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._addTag(index) }\n }}\n @input=${(e: Event) => { answer.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._addTag(index)} />\n <button class=\"el-link\" @click=${() => this._addTag(index)}>确认</button>\n `\n : html`\n <button class=\"link\" @click=${() => { this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? { ...item, showInput: true } : item); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('input[style*=\\\"width:80px\\\"]') as HTMLInputElement)?.focus() }) }}>\n ${answer.title ? '添加同义词' : '添加关键词'}\n </button>\n `}\n `}\n </div>\n <span class=\"icon\" @click=${() => this._addAnswer()}>${this._iconPlus}</span>\n <span class=\"icon ${this._answers.length < 2 ? 'disabled' : ''}\" @click=${() => this._deleteAnswer(index)}>${this._iconRemove}</span>\n </div>\n `)}\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 <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\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 ${this['show-analysis']\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 <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\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 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 @set-key=${(e: CustomEvent) => { this._emit('set-key', 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":["TAG_COLORS","bg","color","border","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","title","sorting","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","trimCommaSeparatedText","_normalizedAnswerList","source","length","undefined","answerId","examAnswerId","_filledAnswers","filter","_readKeywordCount","setting","keywordCount","Number","customAnswerId","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","slice","_addTag","index","join","currentIndex","_closeTag","split","_addAnswer","_deleteAnswer","_","_onCategoryChange","customId","examId","_imageResources","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","_validateState","options","row","answers","correct","SubjectError","filledAnswers","toJSON","answerType","orderIndex","trimText","showRichText","richText","validationError","SubjectType","TEXT_FILL","examTypeEnum","next","isSetCorrectAnswer","isKey","examExpand","examAnswerSettingBO","examAnswerSettingVO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","_renderPreview","previewAnswers","previewCorrect","_renderResourceSection","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","_renderCategorySection","images","video","src","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","getContent","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gXAqBA,MAAMA,EAAa,CACjB,CAAEC,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,YAiBhCC,QAAAA,YAAN,cAA0BC,EAAAA,WAA1BC,WAAAA,GAAAC,SAAAC,WACLC,KAAiBC,UAAYC,EAAAA,IAAA,2NAC7BF,KAAiBG,YAAcD,EAAAA,IAAA,qLA2EuBF,KAAA,eAAgB,EAC1CA,KAAAI,MAAQ,GACgBJ,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACrBA,KAAAK,SAAU,EACSL,KAAA,wBAAwB,EAC9BA,KAAA,kBAAkB,EACfA,KAAA,qBAAsB,GACtDA,KAAAM,SAAW,GAC6BN,KAAA,6BAA8B,EAC5CA,KAAA,eAAgB,GACpBA,KAAA,WAAY,EACRA,KAAA,eAAgB,GAEtEA,KAAA,uBAA2C,CAAEO,WAAW,EAAOC,cAAc,GAG7ER,KAAA,gBAAkDS,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAA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AkIMyL,UAAA,cAAA,GAlINzL,QAAAA,YAANqL,EAAA,CADNO,EAAAA,kBAAkB,kBACN5L,QAAAA"}
1
+ {"version":3,"file":"text-fill.cjs","sources":["../../../../packages/components-wc/src/subject/text-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem, trimCommaSeparatedText, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface TextAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n customAnswerId?: string | number\n}\n\ninterface TextAnswerSetting {\n isInOrder?: boolean\n isIgnoreCase?: boolean\n keywordCount?: number\n}\n\nconst TAG_COLORS = [\n { bg: '#ecf5ff', color: '#3D61E3', border: '#d9ecff' },\n { bg: '#f0f9eb', color: '#67c23a', border: '#c2e7b0' },\n { bg: '#fdf6ec', color: '#e6a23c', border: '#faecd8' },\n { bg: '#fef0f0', color: '#f56c6c', border: '#fde2e2' },\n { bg: '#f4f4f5', color: '#909399', border: '#e9e9eb' },\n]\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-text-fill')\nexport class QxsTextFill extends LitElement {\n private readonly _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>`\n private readonly _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\n static styles = [sortingCardStyles, 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 .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview .rich-text img[data-align=\"left\"] { display: block !important; margin: 0 auto 0 0 !important; }\n .preview .rich-text img[data-align=\"center\"] { display: block !important; margin: 0 auto !important; }\n .preview .rich-text img[data-align=\"right\"] { display: block !important; margin: 0 0 0 auto !important; }\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 {\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;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\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 .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\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 .answer-item .link { color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; line-height: 1; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\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: 'is-key' }) 'is-key' = 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: 'hide-add-rich-text' }) 'hide-add-rich-text' = false\n @property({ type: Boolean, attribute: 'show-rich-text' }) 'show-rich-text' = false\n @property({ type: Boolean, attribute: 'show-delete-action' }) 'show-delete-action' = true\n @property({ type: Boolean, attribute: 'show-save-action' }) 'show-save-action' = true\n @property({ type: Boolean, reflect: true }) sorting = false\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = false\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': TextAnswerSetting = { isInOrder: false, isIgnoreCase: true }\n\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' }) 'answer-list': any[] = []\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n @property({ type: Object, attribute: 'search-handler' }) 'search-handler'?: (query: string, answerType: number) => Promise<any[]>\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _answers: TextAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _keywordCount: number | null = null\n @state() private _correct = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\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('exam-answer-setting') || changed.has('rich-text-content') || changed.has('exam-expand') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value']\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return trimCommaSeparatedText(answer?.title ?? answer?.answer ?? '')\n }\n\n private _normalizedAnswerList(source: any[] = []) {\n return (Array.isArray(source) ? source : []).map((answer: any) => ({\n ...answer,\n answerId: answer?.answerId ?? answer?.examAnswerId,\n title: this._normalizeAnswerTitle(answer),\n }))\n }\n\n private _filledAnswers(source: any[] = []) {\n return source.filter(answer => this._normalizeAnswerTitle(answer))\n }\n\n private _readKeywordCount(setting?: TextAnswerSetting | null) {\n if (!setting || setting.keywordCount === undefined || setting.keywordCount === null || setting.keywordCount === '') {\n return null\n }\n return Number(setting.keywordCount)\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this._normalizedAnswerList(this['answer-list']).map((answer: any) => ({\n title: answer.title || '',\n tag: '',\n showInput: false,\n answerId: answer.answerId,\n customAnswerId: answer.customAnswerId,\n }))\n }\n else {\n this._answers = [{ title: '', tag: '', showInput: false }]\n }\n this._isInOrder = !!this['exam-answer-setting']?.isInOrder\n this._isIgnoreCase = this['exam-answer-setting']?.isIgnoreCase ?? true\n this._keywordCount = this._readKeywordCount(this['exam-answer-setting'])\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._correct = this['exam-expand'] || ''\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\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 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 _addTag(index: number) {\n const answer = { ...this._answers[index] }\n if (answer.tag) {\n answer.title = answer.title ? [answer.title, answer.tag].join(',') : answer.tag\n answer.tag = ''\n }\n answer.showInput = false\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? answer : item)\n }\n\n private _closeTag(tag: string, index: number) {\n const answer = { ...this._answers[index] }\n answer.title = answer.title.split(',').filter(item => item !== tag).join(',')\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? answer : item)\n }\n\n private _addAnswer() {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 2) { return }\n this._answers = this._answers.filter((_, currentIndex) => currentIndex !== index)\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n private _validateState(options: {\n row: any\n title: string\n answers: TextAnswer[]\n correct: string\n keywordCount: number | null\n }) {\n const { row, title, answers, correct, keywordCount } = options\n if (!title) {\n return new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row)\n }\n\n const filledAnswers = this._filledAnswers(answers)\n const shouldValidateAnswers = !!correct || keywordCount !== null || filledAnswers.length > 0\n\n if (!shouldValidateAnswers) { return null }\n if (!correct) {\n return new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row)\n }\n if (!keywordCount || keywordCount < 1) {\n return new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row)\n }\n if (!filledAnswers.length) {\n return new SubjectError('请设置关键词', 'NO_KEYWORDS', 'answers', row)\n }\n if (keywordCount > filledAnswers.length) {\n return new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row)\n }\n return null\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'text_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const analysis = trimText(this['is-edit'] ? this._analysis : this.analysis || '')\n const correct = trimText(this['is-edit'] ? this._correct : this['exam-expand'] || '')\n const keywordCount = this['is-edit'] ? this._keywordCount : this._readKeywordCount(this['exam-answer-setting'])\n const isInOrder = this['is-edit'] ? this._isInOrder : (this['exam-answer-setting']?.isInOrder ?? false)\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : (this['exam-answer-setting']?.isIgnoreCase ?? true)\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 const validationError = this._validateState({ row, title, answers, correct, keywordCount })\n if (validationError) {\n reject(validationError)\n return\n }\n\n const result: any = {\n answerType: SubjectType.TEXT_FILL,\n examTypeEnum: SubjectType.TEXT_FILL,\n title,\n answers: this._filledAnswers(answers).map((answer: any, index: number) => {\n const title = this._normalizeAnswerTitle(answer)\n const next: any = {\n title,\n answer: title,\n orderIndex: index + 1,\n }\n if (answer.answerId) {\n next.answerId = answer.answerId\n next.examAnswerId = answer.answerId\n }\n if (answer.customAnswerId) {\n next.customAnswerId = answer.customAnswerId\n }\n return next\n }),\n analysis,\n isSetCorrectAnswer: !!correct,\n isKey: this['is-key'],\n examExpand: correct,\n examAnswerSettingBO: {\n isIgnoreCase,\n isInOrder,\n ...(keywordCount !== null ? { keywordCount } : {}),\n },\n examAnswerSettingVO: {\n isIgnoreCase,\n isInOrder,\n ...(keywordCount !== null ? { keywordCount } : {}),\n },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\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 row = { customId: this['custom-id'] || undefined, answerType: 'text_fill', orderIndex: this['order-index'] }\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const correct = trimText(this['is-edit'] ? this._correct : this['exam-expand'] || '')\n const keywordCount = this['is-edit'] ? this._keywordCount : this._readKeywordCount(this['exam-answer-setting'])\n const validationError = this._validateState({ row, title, answers, correct, keywordCount })\n return validationError ? [validationError] : []\n }\n\n private _renderPreview() {\n const previewAnswers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const previewCorrect = this['is-edit'] ? this._correct : (this['exam-expand'] || '')\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${this.title}(问答题)</span>\n ${this['show-rich-text'] && this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${this._filledAnswers(previewAnswers).length\n ? html`\n <div style=\"margin-top:8px;color:#a8abb2\">\n ${this._filledAnswers(previewAnswers).map((answer, index) => html`<span style=\"margin-right:10px\">关键词${index + 1}: ${this._normalizeAnswerTitle(answer)}</span>`)}\n </div>\n `\n : ''}\n ${previewCorrect ? html`<div style=\"margin-top:8px;color:#a8abb2\">正确答案:${previewCorrect}</div>` : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = `${this['order-index'] + 1}. ${title}`\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.TEXT_FILL] || SubjectType.TEXT_FILL)\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </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}\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 style=\"flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px\">\n <span style=\"font-size:13px;color:#606266\">共答对</span>\n <input\n type=\"number\"\n style=\"width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px\"\n .value=${this._keywordCount === null ? '' : String(this._keywordCount)}\n min=\"1\"\n @change=${(e: Event) => {\n const value = (e.target as HTMLInputElement).value\n this._keywordCount = value === '' ? null : Number(value)\n }} />\n <span style=\"font-size:13px;color:#606266\">个关键词,算是正确的</span>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\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._correct}\n maxlength=\"200\"\n @input=${(e: Event) => { this._correct = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入正确答案\"></textarea>\n <span class=\"char-counter\">${this._correct.length}/200</span>\n </div>\n </div>\n </div>\n\n <div class=\"answer-list\" style=\"margin-top:12px\">\n <span style=\"padding-left:60px;font-size:12px;color:#909399\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n ${this._answers.map((answer, index) => html`\n <div class=\"answer-item\">\n <span class=\"label\">关键词${index + 1}:</span>\n <div class=\"answer-tags\" style=\"display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px\">\n ${answer.title.split(',').filter(Boolean).map((tag) => {\n const color = TAG_COLORS[index % TAG_COLORS.length]\n return html`\n <span style=\"display:inline-flex;align-items:center;background:${color.bg};color:${color.color};border:1px solid ${color.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px\">\n ${tag}\n <span style=\"cursor:pointer;margin-left:4px;color:#909399\" @click=${() => this._closeTag(tag, index)}>×</span>\n </span>\n `\n })}\n ${html`\n ${answer.showInput\n ? html`\n <input type=\"text\" style=\"width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._addTag(index) }\n }}\n @input=${(e: Event) => { answer.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._addTag(index)} />\n <button class=\"el-link\" @click=${() => this._addTag(index)}>确认</button>\n `\n : html`\n <button class=\"link\" @click=${() => { this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? { ...item, showInput: true } : item); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('input[style*=\\\"width:80px\\\"]') as HTMLInputElement)?.focus() }) }}>\n ${answer.title ? '添加同义词' : '添加关键词'}\n </button>\n `}\n `}\n </div>\n <span class=\"icon\" @click=${() => this._addAnswer()}>${this._iconPlus}</span>\n <span class=\"icon ${this._answers.length < 2 ? 'disabled' : ''}\" @click=${() => this._deleteAnswer(index)}>${this._iconRemove}</span>\n </div>\n `)}\n </div>\n\n ${this['show-rich-text'] && 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 <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\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 ${this['show-analysis']\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 <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\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['show-rich-text'] && this._showRichText}\n .hide-add-rich-text=${!this['show-rich-text'] || this['hide-add-rich-text']}\n .show-delete-action=${this['show-delete-action']}\n .show-save-action=${this['show-save-action']}\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 @set-key=${(e: CustomEvent) => { this._emit('set-key', 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 <slot name=\"action\"></slot>\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["TAG_COLORS","bg","color","border","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","title","sorting","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","trimCommaSeparatedText","_normalizedAnswerList","source","length","undefined","answerId","examAnswerId","_filledAnswers","filter","_readKeywordCount","setting","keywordCount","Number","customAnswerId","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","slice","_addTag","index","join","currentIndex","_closeTag","split","_addAnswer","_deleteAnswer","_","_onCategoryChange","customId","examId","_imageResources","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","_validateState","options","row","answers","correct","SubjectError","filledAnswers","toJSON","answerType","orderIndex","trimText","showRichText","richText","validationError","SubjectType","TEXT_FILL","examTypeEnum","next","isSetCorrectAnswer","isKey","examExpand","examAnswerSettingBO","examAnswerSettingVO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","_renderPreview","previewAnswers","previewCorrect","_renderResourceSection","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","_renderCategorySection","images","video","src","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","getContent","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gXAqBA,MAAMA,EAAa,CACjB,CAAEC,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,YAiBhCC,QAAA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A,SAxIU3L,QAAAA,YAwIMyL,UAAA,mBAAA,GACAJ,EAAA,CAAhBM,EAAAA,SAzIU3L,QAAAA,YAyIMyL,UAAA,cAAA,GAzINzL,QAAAA,YAANqL,EAAA,CADNO,EAAAA,kBAAkB,kBACN5L,QAAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qxs-bns/components-wc",
3
3
  "type": "module",
4
- "version": "0.0.27",
4
+ "version": "0.0.29",
5
5
  "description": "QXS Business Components - Web Components (framework agnostic)",
6
6
  "license": "MIT",
7
7
  "homepage": "https://qxs-bns.pages.dev/guide/components-wc/",