@qxs-bns/components-wc 0.0.30 → 0.0.31

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 (49) hide show
  1. package/es/editor/blocksuite-editor.mjs +166 -357
  2. package/es/editor/blocksuite-editor.mjs.map +1 -1
  3. package/es/editor/toolbar.mjs +2 -0
  4. package/es/editor/toolbar.mjs.map +1 -0
  5. package/es/subject/action.mjs +7 -8
  6. package/es/subject/action.mjs.map +1 -1
  7. package/es/subject/blank-fill.mjs +243 -132
  8. package/es/subject/blank-fill.mjs.map +1 -1
  9. package/es/subject/layout.mjs +4 -4
  10. package/es/subject/layout.mjs.map +1 -1
  11. package/es/subject/page-end.mjs +1 -1
  12. package/es/subject/page-end.mjs.map +1 -1
  13. package/es/subject/scale.mjs +165 -126
  14. package/es/subject/scale.mjs.map +1 -1
  15. package/es/subject/shared-methods.mjs +2 -0
  16. package/es/subject/shared-methods.mjs.map +1 -0
  17. package/es/subject/shared-styles.mjs +75 -0
  18. package/es/subject/shared-styles.mjs.map +1 -0
  19. package/es/subject/single.mjs +243 -187
  20. package/es/subject/single.mjs.map +1 -1
  21. package/es/subject/sortable.mjs +7 -7
  22. package/es/subject/sortable.mjs.map +1 -1
  23. package/es/subject/text-fill.mjs +273 -138
  24. package/es/subject/text-fill.mjs.map +1 -1
  25. package/lib/editor/blocksuite-editor.cjs +166 -357
  26. package/lib/editor/blocksuite-editor.cjs.map +1 -1
  27. package/lib/editor/toolbar.cjs +2 -0
  28. package/lib/editor/toolbar.cjs.map +1 -0
  29. package/lib/subject/action.cjs +33 -34
  30. package/lib/subject/action.cjs.map +1 -1
  31. package/lib/subject/blank-fill.cjs +247 -136
  32. package/lib/subject/blank-fill.cjs.map +1 -1
  33. package/lib/subject/layout.cjs +2 -2
  34. package/lib/subject/layout.cjs.map +1 -1
  35. package/lib/subject/page-end.cjs +2 -2
  36. package/lib/subject/page-end.cjs.map +1 -1
  37. package/lib/subject/scale.cjs +165 -126
  38. package/lib/subject/scale.cjs.map +1 -1
  39. package/lib/subject/shared-methods.cjs +2 -0
  40. package/lib/subject/shared-methods.cjs.map +1 -0
  41. package/lib/subject/shared-styles.cjs +75 -0
  42. package/lib/subject/shared-styles.cjs.map +1 -0
  43. package/lib/subject/single.cjs +243 -187
  44. package/lib/subject/single.cjs.map +1 -1
  45. package/lib/subject/sortable.cjs +1 -1
  46. package/lib/subject/sortable.cjs.map +1 -1
  47. package/lib/subject/text-fill.cjs +273 -138
  48. package/lib/subject/text-fill.cjs.map +1 -1
  49. package/package.json +1 -1
@@ -1,18 +1,25 @@
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("./title-prefix.cjs"),a=require("./types.cjs"),n=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?l(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&n(e,s,o),o};const h=[{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||""),o=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:o,correct:l,keywordCount:p});if(y)return void e(y);const u={answerType:a.SubjectType.TEXT_FILL,examTypeEnum:a.SubjectType.TEXT_FILL,title:r,answers:this._filledAnswers(o).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"]||"",i=o.joinSubjectTitle(o.resolveSubjectPrefix(this["subject-prefix"],`${this["order-index"]+1}.`),this.title);return t.html`
1
+ "use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("../editor/toolbar.cjs"),r=require("./shared-methods.cjs"),o=require("./shared-styles.cjs"),a=require("./single.cjs"),n=require("./sorting-card.cjs"),l=require("./types.cjs"),p=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?d(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&p(e,s,o),o};const c=[{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 a.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))}_previewKeywordItems(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this._filledAnswers(t).flatMap(t=>this._normalizeAnswerTitle(t).split(",").map(t=>t.trim()).filter(Boolean))}_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){r.emitSubjectEvent(this,t,e)}_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"]&&r.emitSubjectModelValue(this,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 r.getSubjectImageResources(this["resource-list"]||[])}_videoResource(){return r.getSubjectVideoResource(this["resource-list"]||[])}_categoryLabel(){return r.resolveSubjectCategoryLabel(this["category-list"],this._categoryId)}_validateState(t){const{row:e,title:s,answers:i,correct:r,keywordCount:o}=t;if(!s)return new a.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e);const n=this._filledAnswers(i);return!!r||null!==o||n.length>0?r?!o||o<1?new a.SubjectError("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",e):n.length?o>n.length?new a.SubjectError("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",e):null:new a.SubjectError("请设置关键词","NO_KEYWORDS","answers",e):new a.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"]},i=a.trimText(this["is-edit"]?this._title:this.title||""),r=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),o=a.trimText(this["is-edit"]?this._analysis:this.analysis||""),n=a.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"]||"",w=this._validateState({row:s,title:i,answers:r,correct:n,keywordCount:p});if(w)return void e(w);const u={answerType:l.SubjectType.TEXT_FILL,examTypeEnum:l.SubjectType.TEXT_FILL,title:i,answers:this._filledAnswers(r).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:o,isSetCorrectAnswer:!!n,isKey:this["is-key"],examExpand:n,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){r.showSubjectToast(t.message)}}validate(){const t={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},e=a.trimText(this["is-edit"]?this._title:this.title||""),s=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),i=a.trimText(this["is-edit"]?this._correct:this["exam-expand"]||""),r=this["is-edit"]?this._keywordCount:this._readKeywordCount(this["exam-answer-setting"]),o=this._validateState({row:t,title:e,answers:s,correct:i,keywordCount:r});return o?[o]:[]}_renderPreview(){const e=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),s=this["is-edit"]?this._correct:this["exam-expand"]||"",i=r.buildSubjectPreviewTitle(this["subject-prefix"],this["order-index"],this.title),o=this._previewKeywordItems(e);return t.html`
2
2
  <div class="preview">
3
- <span class="title">${i}(问答题)</span>
4
- ${this["show-rich-text"]&&this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
5
- ${this._filledAnswers(e).length?t.html`
6
- <div style="margin-top:8px;color:#a8abb2">
7
- ${this._filledAnswers(e).map((e,s)=>t.html`<span style="margin-right:10px">关键词${s+1}: ${this._normalizeAnswerTitle(e)}</span>`)}
3
+ <div class="preview-header">
4
+ <div class="preview-title-row">
5
+ <span class="title">${i}</span>
6
+ <span class="preview-type">问答题</span>
7
+ </div>
8
+ ${this["show-rich-text"]&&this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
9
+ </div>
10
+ ${o.length?t.html`
11
+ <div class="preview-keyword-list">
12
+ ${o.map(e=>t.html`
13
+ <span class="preview-answer-key">${e}</span>
14
+ `)}
8
15
  </div>
9
16
  `:""}
10
- ${s?t.html`<div style="margin-top:8px;color:#a8abb2">正确答案:${s}</div>`:""}
11
- ${this.analysis?t.html`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
17
+ ${s?t.html`<div class="preview-answer-body">${s}</div>`:""}
18
+ ${this.analysis?t.html`<div class="preview-analysis">${this.analysis}</div>`:""}
12
19
  ${this["show-category"]&&this._categoryId?t.html`<div class="section-row"><span class="value-text">分类:${this._categoryLabel()}</span></div>`:""}
13
20
  ${this._renderResourceSection()}
14
21
  </div>
15
- `}_renderSorting(){const t=i.trimText(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=o.joinSubjectTitle(o.resolveSubjectPrefix(this["subject-prefix"],`${this["order-index"]+1}. `),t);return r.renderSortingCard(e,a.SubjectTypeLabel[a.SubjectType.TEXT_FILL]||a.SubjectType.TEXT_FILL)}_renderCategorySection(){return this["show-category"]?t.html`
22
+ `}_renderSorting(){const t=a.trimText(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=r.buildSubjectSortingTitle(this["subject-prefix"],this["order-index"],t);return n.renderSortingCard(e,l.SubjectTypeLabel[l.SubjectType.TEXT_FILL]||l.SubjectType.TEXT_FILL)}_renderCategorySection(){return this["show-category"]?t.html`
16
23
  <div class="flex-items-start section-row">
17
24
  <div class="label"><span>分类:</span></div>
18
25
  <div style="flex:1">
@@ -42,123 +49,133 @@
42
49
  </div>
43
50
  </div>
44
51
  `}_renderEdit(){return t.html`
45
- <div class="flex-items-start">
46
- <div class="label"><span>题目:</span></div>
47
- <div style="flex:1">
48
- <div class="el-input">
49
- <textarea rows="2" .value=${this._title}
50
- maxlength=${this.TITLE_MAX}
51
- @input=${t=>this._onTitleInput(t)}
52
- placeholder="【问答题】请输入问题"></textarea>
53
- <span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
52
+ <div class="edit-form">
53
+ <div class="edit-row">
54
+ <div class="label"><span>题目:</span></div>
55
+ <div class="row-body">
56
+ <div class="el-input">
57
+ <textarea rows="2" .value=${this._title}
58
+ maxlength=${this.TITLE_MAX}
59
+ @input=${t=>this._onTitleInput(t)}
60
+ placeholder="【问答题】请输入问题"></textarea>
61
+ <span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
62
+ </div>
54
63
  </div>
55
64
  </div>
56
- </div>
57
65
 
58
- <div class="flex-items-start" style="margin-top:12px">
59
- <div class="label"><span>答题设置:</span></div>
60
- <div style="flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px">
61
- <span style="font-size:13px;color:#606266">共答对</span>
62
- <input
63
- type="number"
64
- style="width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px"
65
- .value=${null===this._keywordCount?"":String(this._keywordCount)}
66
- min="1"
67
- @change=${t=>{const e=t.target.value;this._keywordCount=""===e?null:Number(e)}} />
68
- <span style="font-size:13px;color:#606266">个关键词,算是正确的</span>
69
- <label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266">
70
- <input type="checkbox" .checked=${this._isInOrder}
71
- @change=${t=>{this._isInOrder=t.target.checked}} />
72
- 答案不分顺序
73
- </label>
74
- <label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266">
75
- <input type="checkbox" .checked=${this._isIgnoreCase}
76
- @change=${t=>{this._isIgnoreCase=t.target.checked}} />
77
- 忽略大小写
78
- </label>
66
+ <div class="edit-row section-row">
67
+ <div class="label"><span>答题设置:</span></div>
68
+ <div class="row-body edit-inline">
69
+ <span class="setting-copy">共答对</span>
70
+ <input
71
+ type="number"
72
+ class="setting-number"
73
+ .value=${null===this._keywordCount?"":String(this._keywordCount)}
74
+ min="1"
75
+ @change=${t=>{const e=t.target.value;this._keywordCount=""===e?null:Number(e)}} />
76
+ <span class="setting-copy">个关键词,算是正确的</span>
77
+ <label class="setting-toggle">
78
+ <input type="checkbox" .checked=${this._isInOrder}
79
+ @change=${t=>{this._isInOrder=t.target.checked}} />
80
+ 答案不分顺序
81
+ </label>
82
+ <label class="setting-toggle">
83
+ <input type="checkbox" .checked=${this._isIgnoreCase}
84
+ @change=${t=>{this._isIgnoreCase=t.target.checked}} />
85
+ 忽略大小写
86
+ </label>
87
+ </div>
79
88
  </div>
80
- </div>
81
89
 
82
- <slot name="business-tag"></slot>
90
+ <slot name="business-tag"></slot>
83
91
 
84
- ${this._renderCategorySection()}
92
+ ${this._renderCategorySection()}
85
93
 
86
- ${this._renderResourceSection()}
94
+ ${this._renderResourceSection()}
87
95
 
88
- <div class="flex-items-start" style="margin-top:12px">
89
- <div class="label"><span>答案:</span></div>
90
- <div style="flex:1">
91
- <div class="el-input">
92
- <textarea rows="2" .value=${this._correct}
93
- maxlength="200"
94
- @input=${t=>{this._correct=t.target.value}}
95
- placeholder="请输入正确答案"></textarea>
96
- <span class="char-counter">${this._correct.length}/200</span>
96
+ <div class="edit-row section-row">
97
+ <div class="label"><span>答案:</span></div>
98
+ <div class="row-body">
99
+ <div class="el-input">
100
+ <textarea rows="2" .value=${this._correct}
101
+ maxlength="200"
102
+ @input=${t=>{this._correct=t.target.value}}
103
+ placeholder="请输入正确答案"></textarea>
104
+ <span class="char-counter">${this._correct.length}/200</span>
105
+ </div>
97
106
  </div>
98
107
  </div>
99
- </div>
100
108
 
101
- <div class="answer-list" style="margin-top:12px">
102
- <span style="padding-left:60px;font-size:12px;color:#909399">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>
103
- ${this._answers.map((e,s)=>t.html`
104
- <div class="answer-item">
105
- <span class="label">关键词${s+1}:</span>
106
- <div class="answer-tags" style="display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px">
107
- ${e.title.split(",").filter(Boolean).map(e=>{const i=h[s%h.length];return t.html`
108
- <span style="display:inline-flex;align-items:center;background:${i.bg};color:${i.color};border:1px solid ${i.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px">
109
- ${e}
110
- <span style="cursor:pointer;margin-left:4px;color:#909399" @click=${()=>this._closeTag(e,s)}>×</span>
111
- </span>
112
- `})}
113
- ${t.html`
114
- ${e.showInput?t.html`
115
- <input type="text" style="width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px"
116
- @keydown=${t=>{"Enter"===t.key&&this._addTag(s)}}
117
- @input=${t=>{e.tag=t.target.value}}
118
- @blur=${()=>this._addTag(s)} />
119
- <button class="el-link" @click=${()=>this._addTag(s)}>确认</button>
120
- `:t.html`
121
- <button class="link" @click=${()=>{this._answers=this._answers.map((t,e)=>e===s?{...t,showInput:!0}:t),this.updateComplete.then(()=>{this.shadowRoot?.querySelector('input[style*="width:80px"]')?.focus()})}}>
122
- ${e.title?"添加同义词":"添加关键词"}
123
- </button>
124
- `}
125
- `}
109
+ <div class="edit-row section-row keyword-section-row">
110
+ <div class="label"><span>关键词:</span></div>
111
+ <div class="row-body">
112
+ <div class="keyword-section">
113
+ <div class="edit-note">如遇特殊字符关键词,请补充同义词,例如 “CO₂” 同时补充 “CO2”。</div>
114
+ <div class="answer-list">
115
+ ${this._answers.map((e,s)=>t.html`
116
+ <div class="answer-item">
117
+ <span class="answer-item-label">关键词${s+1}:</span>
118
+ <div class="answer-tags">
119
+ ${e.title.split(",").filter(Boolean).map(e=>{const i=c[s%c.length];return t.html`
120
+ <span style="display:inline-flex;align-items:center;background:${i.bg};color:${i.color};border:1px solid ${i.border};border-radius:6px;padding:2px 8px;font-size:12px;line-height:16px">
121
+ ${e}
122
+ <span style="cursor:pointer;margin-left:4px;color:#909399" @click=${()=>this._closeTag(e,s)}>×</span>
123
+ </span>
124
+ `})}
125
+ ${t.html`
126
+ ${e.showInput?t.html`
127
+ <input type="text" class="keyword-input"
128
+ @keydown=${t=>{"Enter"===t.key&&this._addTag(s)}}
129
+ @input=${t=>{e.tag=t.target.value}}
130
+ @blur=${()=>this._addTag(s)} />
131
+ <button class="el-link" @click=${()=>this._addTag(s)}>确认</button>
132
+ `:t.html`
133
+ <button class="link" @click=${()=>{this._answers=this._answers.map((t,e)=>e===s?{...t,showInput:!0}:t),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".keyword-input")?.focus()})}}>
134
+ ${e.title?"添加同义词":"添加关键词"}
135
+ </button>
136
+ `}
137
+ `}
138
+ </div>
139
+ <span class="icon" @click=${()=>this._addAnswer()}>${this._iconPlus}</span>
140
+ <span class="icon ${this._answers.length<2?"disabled":""}" @click=${()=>this._deleteAnswer(s)}>${this._iconRemove}</span>
141
+ </div>
142
+ `)}
143
+ </div>
126
144
  </div>
127
- <span class="icon" @click=${()=>this._addAnswer()}>${this._iconPlus}</span>
128
- <span class="icon ${this._answers.length<2?"disabled":""}" @click=${()=>this._deleteAnswer(s)}>${this._iconRemove}</span>
129
145
  </div>
130
- `)}
131
- </div>
146
+ </div>
132
147
 
133
- ${this["show-rich-text"]&&this._showRichText?t.html`
134
- <div class="flex-items-start" style="margin-top:12px">
135
- <div class="label"><span>副文本:</span></div>
136
- <div style="flex:1">
137
- <slot name="sub-text">
138
- <qxs-blocksuite-editor
139
- .content=${this._richText}
140
- .upload-image=${this["upload-image"]}
141
- ?is-edit=${!0}
142
- @input=${t=>{this._richText=t.target.getContent()}}
143
- ></qxs-blocksuite-editor>
144
- </slot>
145
- ${this["show-action"]?"":t.html`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
148
+ ${this["show-rich-text"]&&this._showRichText?t.html`
149
+ <div class="edit-row section-row">
150
+ <div class="label"><span>副文本:</span></div>
151
+ <div class="row-body">
152
+ <slot name="sub-text">
153
+ <qxs-blocksuite-editor
154
+ .content=${this._richText}
155
+ .toolbar=${i.SUB_TEXT_EDITOR_TOOLBAR}
156
+ .upload-image=${this["upload-image"]}
157
+ ?is-edit=${!0}
158
+ @input=${t=>{this._richText=t.target.getContent()}}
159
+ ></qxs-blocksuite-editor>
160
+ </slot>
161
+ ${this["show-action"]?"":t.html`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
162
+ </div>
146
163
  </div>
147
- </div>
148
- `:""}
164
+ `:""}
149
165
 
150
- ${this["show-analysis"]?t.html`
151
- <div class="flex-items-start" style="margin-top:12px">
152
- <div class="label"><span>解析:</span></div>
153
- <div style="flex:1">
154
- <div class="el-input">
155
- <textarea rows="2" .value=${this._analysis}
156
- @input=${t=>{this._analysis=t.target.value}}
157
- placeholder="请输入题目解析"></textarea>
166
+ ${this["show-analysis"]?t.html`
167
+ <div class="edit-row section-row">
168
+ <div class="label"><span>解析:</span></div>
169
+ <div class="row-body">
170
+ <div class="el-input">
171
+ <textarea rows="2" .value=${this._analysis}
172
+ @input=${t=>{this._analysis=t.target.value}}
173
+ placeholder="请输入题目解析"></textarea>
174
+ </div>
158
175
  </div>
159
176
  </div>
160
- </div>
161
- `:""}
177
+ `:""}
178
+ </div>
162
179
  `}render(){if(this.sorting)return this._renderSorting();const e=this["is-edit"]?t.html`<div slot="edit">${this._renderEdit()}</div>`:t.html`<div slot="preview">${this._renderPreview()}</div>`;return t.html`
163
180
  <qxs-subject-layout .show-edit=${this["is-edit"]}>
164
181
  ${e}
@@ -182,41 +199,114 @@
182
199
  `:""}
183
200
  <slot name="action"></slot>
184
201
  </qxs-subject-layout>
185
- `}},exports.QxsTextFill.styles=[r.sortingCardStyles,t.css`
186
- :host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
187
- *, ::before, ::after { box-sizing: border-box; }
188
-
189
- .preview { padding: 12px 0; }
190
- .preview .title { font-size: 14px; color: #303133; }
191
- .preview .rich-text { margin-top: 8px; }
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; }
202
+ `}},exports.QxsTextFill.styles=[n.sortingCardStyles,o.subjectHostStyles,o.subjectControlResetStyles,o.subjectPreviewBaseStyles,o.subjectFormBaseStyles,o.subjectTextareaStyles,t.css`
203
+ .preview-keyword-list {
204
+ display: flex;
205
+ flex-wrap: wrap;
206
+ gap: 8px;
207
+ margin-top: 16px;
208
+ }
209
+ .preview-answer-key {
210
+ display: inline-flex;
211
+ align-items: center;
212
+ padding: 2px 10px;
213
+ border-radius: 999px;
214
+ background: #f3f6fb;
215
+ font-size: 12px;
216
+ line-height: 1.6;
217
+ font-weight: 500;
218
+ color: #6b7280;
219
+ }
220
+ .preview-answer-body {
221
+ position: relative;
222
+ margin-top: 16px;
223
+ padding-left: 16px;
224
+ font-size: 14px;
225
+ line-height: 1.85;
226
+ font-weight: 600;
227
+ color: #3c4758;
228
+ white-space: pre-wrap;
229
+ }
230
+ .preview-answer-body::before {
231
+ content: '';
232
+ position: absolute;
233
+ left: 0;
234
+ top: 0.72em;
235
+ width: 6px;
236
+ height: 6px;
237
+ border-radius: 999px;
238
+ background: #c9d5ff;
239
+ }
240
+ .preview-analysis {
241
+ margin-top: 20px;
242
+ padding-left: 10px;
243
+ border-left: 2px solid #e5eaf3;
244
+ font-size: 13px;
245
+ line-height: 1.8;
246
+ color: #6b7280;
247
+ }
196
248
 
197
249
  .flex { display: flex; }
198
250
  .flex-items-center { display: flex; align-items: center; }
199
251
  .flex-items-start { display: flex; align-items: flex-start; }
200
252
  .flex-justify-end { display: flex; justify-content: flex-end; }
201
- .label { min-width: 60px; font-size: 13px; color: #606266; }
202
-
203
- textarea {
204
- border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;
205
- font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;
206
- line-height: 1.5; display: block; box-sizing: border-box;
253
+ .edit-inline {
254
+ display: flex;
255
+ align-items: center;
256
+ flex-wrap: wrap;
257
+ gap: 8px 14px;
258
+ min-height: 32px;
259
+ }
260
+ .setting-copy {
261
+ font-size: 13px;
262
+ color: #606266;
263
+ }
264
+ .setting-number {
265
+ width: 68px;
266
+ height: 32px;
267
+ border: 1px solid #dcdfe6;
268
+ border-radius: 6px;
269
+ padding: 0 10px;
270
+ font-size: 13px;
271
+ line-height: 32px;
272
+ font-family: inherit;
273
+ }
274
+ .setting-number:focus {
275
+ border-color: #3D61E3;
276
+ outline: none;
277
+ }
278
+ .setting-toggle {
279
+ display: inline-flex;
280
+ align-items: center;
281
+ gap: 4px;
282
+ cursor: pointer;
283
+ font-size: 12px;
284
+ color: #606266;
285
+ user-select: none;
207
286
  }
208
- textarea:focus { border-color: #3D61E3; outline: none; }
209
- textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
210
- .el-input { position: relative; display: block; }
211
- .el-input textarea { padding-bottom: 24px; }
212
- .el-input .char-counter {
213
- position: absolute; right: 12px; bottom: 8px;
214
- font-size: 12px; color: #909399; line-height: 1; pointer-events: none;
287
+ .edit-note {
288
+ margin-bottom: 8px;
289
+ font-size: 12px;
290
+ line-height: 1.6;
291
+ color: #909399;
215
292
  }
216
293
 
217
- .answer-list { margin-top: 12px; }
218
- .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }
219
- .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }
294
+ .answer-list { display: flex; flex-direction: column; gap: 10px; }
295
+ .answer-item {
296
+ display: grid;
297
+ grid-template-columns: 76px minmax(0, 1fr) auto auto;
298
+ gap: 8px;
299
+ align-items: center;
300
+ border-radius: 4px;
301
+ }
302
+ .answer-item-label {
303
+ min-width: 0;
304
+ font-size: 13px;
305
+ line-height: 1.5;
306
+ font-weight: 600;
307
+ color: #6b7280;
308
+ letter-spacing: 0;
309
+ }
220
310
  .answer-item .icon {
221
311
  margin-left: 6px; cursor: pointer; display: inline-flex;
222
312
  align-items: center; justify-content: center;
@@ -233,7 +323,6 @@
233
323
  .el-link:hover { color: #2D4CB8; }
234
324
  .el-link.danger { color: #f56c6c; }
235
325
 
236
- .section-row { margin-top: 12px; }
237
326
  .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }
238
327
  .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
239
328
  .tag-item {
@@ -245,7 +334,7 @@
245
334
  .tag-item .close:hover { color: #f56c6c; }
246
335
  .tag-hint { font-size: 12px; color: #909399; }
247
336
  .el-select {
248
- width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;
337
+ width: 150px; height: 34px; border: 1px solid #dcdfe6; border-radius: 6px;
249
338
  padding: 0 8px; font-size: 13px; background: #fff; appearance: none;
250
339
  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");
251
340
  background-repeat: no-repeat; background-position: right 8px center;
@@ -256,5 +345,51 @@
256
345
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
257
346
  border: 1px solid #e4e7ed; background: #f5f7fa;
258
347
  }
259
- `],p([e.property({type:Number,attribute:"order-index"})],exports.QxsTextFill.prototype,"order-index",2),p([e.property({type:String,attribute:"subject-prefix"})],exports.QxsTextFill.prototype,"subject-prefix",2),p([e.property({type:String})],exports.QxsTextFill.prototype,"title",2),p([e.property({type:String,attribute:"custom-id"})],exports.QxsTextFill.prototype,"custom-id",2),p([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsTextFill.prototype,"is-edit",2),p([e.property({type:Boolean,attribute:"is-save"})],exports.QxsTextFill.prototype,"is-save",2),p([e.property({type:Boolean,attribute:"is-set"})],exports.QxsTextFill.prototype,"is-set",2),p([e.property({type:Boolean,attribute:"is-key"})],exports.QxsTextFill.prototype,"is-key",2),p([e.property({type:Boolean,attribute:"show-action"})],exports.QxsTextFill.prototype,"show-action",2),p([e.property({type:Boolean,attribute:"show-add"})],exports.QxsTextFill.prototype,"show-add",2),p([e.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsTextFill.prototype,"hide-add-rich-text",2),p([e.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsTextFill.prototype,"show-rich-text",2),p([e.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsTextFill.prototype,"show-delete-action",2),p([e.property({type:Boolean,attribute:"show-save-action"})],exports.QxsTextFill.prototype,"show-save-action",2),p([e.property({type:Boolean,reflect:!0})],exports.QxsTextFill.prototype,"sorting",2),p([e.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsTextFill.prototype,"show-answer-setting",2),p([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsTextFill.prototype,"show-analysis",2),p([e.property({type:String,attribute:"rich-text-content"})],exports.QxsTextFill.prototype,"rich-text-content",2),p([e.property({type:String})],exports.QxsTextFill.prototype,"analysis",2),p([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsTextFill.prototype,"exam-answer-relation-type",2),p([e.property({type:String,attribute:"exam-expand"})],exports.QxsTextFill.prototype,"exam-expand",2),p([e.property({type:Number,attribute:"exam-id"})],exports.QxsTextFill.prototype,"exam-id",2),p([e.property({type:String,attribute:"category-id"})],exports.QxsTextFill.prototype,"category-id",2),p([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsTextFill.prototype,"exam-answer-setting",2),p([e.property({type:Object,attribute:"upload-image"})],exports.QxsTextFill.prototype,"upload-image",2),p([e.property({type:Array,attribute:"answer-list"})],exports.QxsTextFill.prototype,"answer-list",2),p([e.property({type:Array,attribute:"tag-list"})],exports.QxsTextFill.prototype,"tag-list",2),p([e.property({type:Array,attribute:"category-list"})],exports.QxsTextFill.prototype,"category-list",2),p([e.property({type:Array,attribute:"resource-list"})],exports.QxsTextFill.prototype,"resource-list",2),p([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsTextFill.prototype,"show-tag",2),p([e.property({type:Boolean,attribute:"show-category"})],exports.QxsTextFill.prototype,"show-category",2),p([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsTextFill.prototype,"show-resource",2),p([e.property({type:Object,attribute:"search-handler"})],exports.QxsTextFill.prototype,"search-handler",2),p([e.property({type:String,attribute:"model-value"})],exports.QxsTextFill.prototype,"model-value",2),p([e.property({type:Boolean,attribute:"use-model"})],exports.QxsTextFill.prototype,"use-model",2),p([e.state()],exports.QxsTextFill.prototype,"_answers",2),p([e.state()],exports.QxsTextFill.prototype,"_title",2),p([e.state()],exports.QxsTextFill.prototype,"_analysis",2),p([e.state()],exports.QxsTextFill.prototype,"_isInOrder",2),p([e.state()],exports.QxsTextFill.prototype,"_isIgnoreCase",2),p([e.state()],exports.QxsTextFill.prototype,"_keywordCount",2),p([e.state()],exports.QxsTextFill.prototype,"_correct",2),p([e.state()],exports.QxsTextFill.prototype,"_showRichText",2),p([e.state()],exports.QxsTextFill.prototype,"_richText",2),p([e.state()],exports.QxsTextFill.prototype,"_selectedTagList",2),p([e.state()],exports.QxsTextFill.prototype,"_categoryId",2),exports.QxsTextFill=p([s.safeCustomElement("qxs-text-fill")],exports.QxsTextFill);
348
+ .answer-tags {
349
+ display: flex;
350
+ flex-wrap: wrap;
351
+ gap: 6px;
352
+ align-items: center;
353
+ flex: 1;
354
+ max-width: 420px;
355
+ min-height: 28px;
356
+ }
357
+ .keyword-section { display: flex; flex-direction: column; gap: 10px; }
358
+ .keyword-section-row > .label { padding-top: 0; }
359
+ .keyword-input {
360
+ width: 88px;
361
+ height: 28px;
362
+ border: 1px solid #dcdfe6;
363
+ border-radius: 6px;
364
+ padding: 0 8px;
365
+ font-size: 12px;
366
+ font-family: inherit;
367
+ }
368
+ .keyword-input:focus {
369
+ border-color: #3D61E3;
370
+ outline: none;
371
+ }
372
+
373
+ @media (max-width: 720px) {
374
+ .edit-row,
375
+ .section-row {
376
+ flex-direction: column;
377
+ gap: 8px;
378
+ }
379
+
380
+ .edit-row > .label,
381
+ .section-row > .label {
382
+ min-width: 0;
383
+ padding-top: 0;
384
+ }
385
+
386
+ .answer-item-label {
387
+ min-width: 0;
388
+ }
389
+
390
+ .answer-tags {
391
+ max-width: none;
392
+ }
393
+ }
394
+ `],h([e.property({type:Number,attribute:"order-index"})],exports.QxsTextFill.prototype,"order-index",2),h([e.property({type:String,attribute:"subject-prefix"})],exports.QxsTextFill.prototype,"subject-prefix",2),h([e.property({type:String})],exports.QxsTextFill.prototype,"title",2),h([e.property({type:String,attribute:"custom-id"})],exports.QxsTextFill.prototype,"custom-id",2),h([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsTextFill.prototype,"is-edit",2),h([e.property({type:Boolean,attribute:"is-save"})],exports.QxsTextFill.prototype,"is-save",2),h([e.property({type:Boolean,attribute:"is-set"})],exports.QxsTextFill.prototype,"is-set",2),h([e.property({type:Boolean,attribute:"is-key"})],exports.QxsTextFill.prototype,"is-key",2),h([e.property({type:Boolean,attribute:"show-action"})],exports.QxsTextFill.prototype,"show-action",2),h([e.property({type:Boolean,attribute:"show-add"})],exports.QxsTextFill.prototype,"show-add",2),h([e.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsTextFill.prototype,"hide-add-rich-text",2),h([e.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsTextFill.prototype,"show-rich-text",2),h([e.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsTextFill.prototype,"show-delete-action",2),h([e.property({type:Boolean,attribute:"show-save-action"})],exports.QxsTextFill.prototype,"show-save-action",2),h([e.property({type:Boolean,reflect:!0})],exports.QxsTextFill.prototype,"sorting",2),h([e.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsTextFill.prototype,"show-answer-setting",2),h([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsTextFill.prototype,"show-analysis",2),h([e.property({type:String,attribute:"rich-text-content"})],exports.QxsTextFill.prototype,"rich-text-content",2),h([e.property({type:String})],exports.QxsTextFill.prototype,"analysis",2),h([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsTextFill.prototype,"exam-answer-relation-type",2),h([e.property({type:String,attribute:"exam-expand"})],exports.QxsTextFill.prototype,"exam-expand",2),h([e.property({type:Number,attribute:"exam-id"})],exports.QxsTextFill.prototype,"exam-id",2),h([e.property({type:String,attribute:"category-id"})],exports.QxsTextFill.prototype,"category-id",2),h([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsTextFill.prototype,"exam-answer-setting",2),h([e.property({type:Object,attribute:"upload-image"})],exports.QxsTextFill.prototype,"upload-image",2),h([e.property({type:Array,attribute:"answer-list"})],exports.QxsTextFill.prototype,"answer-list",2),h([e.property({type:Array,attribute:"tag-list"})],exports.QxsTextFill.prototype,"tag-list",2),h([e.property({type:Array,attribute:"category-list"})],exports.QxsTextFill.prototype,"category-list",2),h([e.property({type:Array,attribute:"resource-list"})],exports.QxsTextFill.prototype,"resource-list",2),h([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsTextFill.prototype,"show-tag",2),h([e.property({type:Boolean,attribute:"show-category"})],exports.QxsTextFill.prototype,"show-category",2),h([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsTextFill.prototype,"show-resource",2),h([e.property({type:Object,attribute:"search-handler"})],exports.QxsTextFill.prototype,"search-handler",2),h([e.property({type:String,attribute:"model-value"})],exports.QxsTextFill.prototype,"model-value",2),h([e.property({type:Boolean,attribute:"use-model"})],exports.QxsTextFill.prototype,"use-model",2),h([e.state()],exports.QxsTextFill.prototype,"_answers",2),h([e.state()],exports.QxsTextFill.prototype,"_title",2),h([e.state()],exports.QxsTextFill.prototype,"_analysis",2),h([e.state()],exports.QxsTextFill.prototype,"_isInOrder",2),h([e.state()],exports.QxsTextFill.prototype,"_isIgnoreCase",2),h([e.state()],exports.QxsTextFill.prototype,"_keywordCount",2),h([e.state()],exports.QxsTextFill.prototype,"_correct",2),h([e.state()],exports.QxsTextFill.prototype,"_showRichText",2),h([e.state()],exports.QxsTextFill.prototype,"_richText",2),h([e.state()],exports.QxsTextFill.prototype,"_selectedTagList",2),h([e.state()],exports.QxsTextFill.prototype,"_categoryId",2),exports.QxsTextFill=h([s.safeCustomElement("qxs-text-fill")],exports.QxsTextFill);
260
395
  //# sourceMappingURL=text-fill.cjs.map