@qxs-bns/components-wc 0.0.30 → 0.0.32

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 +5 -5
  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 +3 -3
  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
- import{css as t,LitElement as e,html as i}from"lit";import{property as s,state as r}from"lit/decorators.js";import{safeCustomElement as o}from"../base/define.mjs";import{trimCommaSeparatedText as a,SubjectError as n,trimText as l}from"./single.mjs";import{sortingCardStyles as d,renderSortingCard as h}from"./sorting-card.mjs";import{joinSubjectTitle as c,resolveSubjectPrefix as p}from"./title-prefix.mjs";import{SubjectType as x,SubjectTypeLabel as g}from"./types.mjs";var u=Object.defineProperty,y=Object.getOwnPropertyDescriptor,w=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?y(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&u(e,i,o),o};const m=[{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"}];let _=class extends e{constructor(){super(...arguments),this._iconPlus=i`<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=i`<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,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.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(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((i,s)=>s===t?e:i)}_closeTag(t,e){const i={...this._answers[e]};i.title=i.title.split(",").filter(e=>e!==t).join(","),this._answers=this._answers.map((t,s)=>s===e?i:t)}_addAnswer(){this._answers=[...this._answers,{title:"",tag:"",showInput:!1}]}_deleteAnswer(t){this._answers.length<2||(this._answers=this._answers.filter((e,i)=>i!==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:i,answers:s,correct:r,keywordCount:o}=t;if(!i)return new n("题目标题不能为空!","EMPTY_TITLE","title",e);const a=this._filledAnswers(s);return!!r||null!==o||a.length>0?r?!o||o<1?new n("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",e):a.length?o>a.length?new n("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",e):null:new n("请设置关键词","NO_KEYWORDS","answers",e):new n("请输入问题正确答案!","NO_CORRECT_ANSWER","correct",e):null}async toJSON(){return new Promise((t,e)=>{const i={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},s=l(this["is-edit"]?this._title:this.title||""),r=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),o=l(this["is-edit"]?this._analysis:this.analysis||""),a=l(this["is-edit"]?this._correct:this["exam-expand"]||""),n=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"],p=this["is-edit"]?this._richText:this["rich-text-content"]||"",g=this._validateState({row:i,title:s,answers:r,correct:a,keywordCount:n});if(g)return void e(g);const u={answerType:x.TEXT_FILL,examTypeEnum:x.TEXT_FILL,title:s,answers:this._filledAnswers(r).map((t,e)=>{const i=this._normalizeAnswerTitle(t),s={title:i,answer:i,orderIndex:e+1};return t.answerId&&(s.answerId=t.answerId,s.examAnswerId=t.answerId),t.customAnswerId&&(s.customAnswerId=t.customAnswerId),s}),analysis:o,isSetCorrectAnswer:!!a,isKey:this["is-key"],examExpand:a,examAnswerSettingBO:{isIgnoreCase:h,isInOrder:d,...null!==n?{keywordCount:n}:{}},examAnswerSettingVO:{isIgnoreCase:h,isInOrder:d,...null!==n?{keywordCount:n}:{}},examRichTextContent:c?p:""};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=l(this["is-edit"]?this._title:this.title||""),i=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),s=l(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:i,correct:s,keywordCount:r});return o?[o]:[]}_renderPreview(){const t=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),e=this["is-edit"]?this._correct:this["exam-expand"]||"",s=c(p(this["subject-prefix"],`${this["order-index"]+1}.`),this.title);return i`
1
+ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state as r}from"lit/decorators.js";import{safeCustomElement as o}from"../base/define.mjs";import{SUB_TEXT_EDITOR_TOOLBAR as a}from"../editor/toolbar.mjs";import{emitSubjectEvent as n,emitSubjectModelValue as l,getSubjectImageResources as d,getSubjectVideoResource as h,resolveSubjectCategoryLabel as c,showSubjectToast as p,buildSubjectPreviewTitle as w,buildSubjectSortingTitle as g}from"./shared-methods.mjs";import{subjectHostStyles as u,subjectControlResetStyles as y,subjectPreviewBaseStyles as x,subjectFormBaseStyles as m,subjectTextareaStyles as _}from"./shared-styles.mjs";import{trimCommaSeparatedText as v,SubjectError as f,trimText as b}from"./single.mjs";import{sortingCardStyles as $,renderSortingCard as k}from"./sorting-card.mjs";import{SubjectType as I,SubjectTypeLabel as T}from"./types.mjs";var C=Object.defineProperty,A=Object.getOwnPropertyDescriptor,S=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?A(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&C(e,i,o),o};const E=[{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"}];let O=class extends e{constructor(){super(...arguments),this._iconPlus=i`<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=i`<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,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.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 v(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){n(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"]&&l(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((i,s)=>s===t?e:i)}_closeTag(t,e){const i={...this._answers[e]};i.title=i.title.split(",").filter(e=>e!==t).join(","),this._answers=this._answers.map((t,s)=>s===e?i:t)}_addAnswer(){this._answers=[...this._answers,{title:"",tag:"",showInput:!1}]}_deleteAnswer(t){this._answers.length<2||(this._answers=this._answers.filter((e,i)=>i!==t))}_onCategoryChange(t){this._categoryId=t,this._emit("category-change",{value:t,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_imageResources(){return d(this["resource-list"]||[])}_videoResource(){return h(this["resource-list"]||[])}_categoryLabel(){return c(this["category-list"],this._categoryId)}_validateState(t){const{row:e,title:i,answers:s,correct:r,keywordCount:o}=t;if(!i)return new f("题目标题不能为空!","EMPTY_TITLE","title",e);const a=this._filledAnswers(s);return!!r||null!==o||a.length>0?r?!o||o<1?new f("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",e):a.length?o>a.length?new f("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",e):null:new f("请设置关键词","NO_KEYWORDS","answers",e):new f("请输入问题正确答案!","NO_CORRECT_ANSWER","correct",e):null}async toJSON(){return new Promise((t,e)=>{const i={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},s=b(this["is-edit"]?this._title:this.title||""),r=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),o=b(this["is-edit"]?this._analysis:this.analysis||""),a=b(this["is-edit"]?this._correct:this["exam-expand"]||""),n=this["is-edit"]?this._keywordCount:this._readKeywordCount(this["exam-answer-setting"]),l=this["is-edit"]?this._isInOrder:this["exam-answer-setting"]?.isInOrder??!1,d=this["is-edit"]?this._isIgnoreCase:this["exam-answer-setting"]?.isIgnoreCase??!0,h=this["is-edit"]?this._showRichText:!!this["rich-text-content"],c=this["is-edit"]?this._richText:this["rich-text-content"]||"",p=this._validateState({row:i,title:s,answers:r,correct:a,keywordCount:n});if(p)return void e(p);const w={answerType:I.TEXT_FILL,examTypeEnum:I.TEXT_FILL,title:s,answers:this._filledAnswers(r).map((t,e)=>{const i=this._normalizeAnswerTitle(t),s={title:i,answer:i,orderIndex:e+1};return t.answerId&&(s.answerId=t.answerId,s.examAnswerId=t.answerId),t.customAnswerId&&(s.customAnswerId=t.customAnswerId),s}),analysis:o,isSetCorrectAnswer:!!a,isKey:this["is-key"],examExpand:a,examAnswerSettingBO:{isIgnoreCase:d,isInOrder:l,...null!==n?{keywordCount:n}:{}},examAnswerSettingVO:{isIgnoreCase:d,isInOrder:l,...null!==n?{keywordCount:n}:{}},examRichTextContent:h?c:""};this["custom-id"]&&(w.customId=this["custom-id"]),t(w)})}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){p(t.message)}}validate(){const t={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},e=b(this["is-edit"]?this._title:this.title||""),i=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),s=b(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:i,correct:s,keywordCount:r});return o?[o]:[]}_renderPreview(){const t=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),e=this["is-edit"]?this._correct:this["exam-expand"]||"",s=w(this["subject-prefix"],this["order-index"],this.title),r=this._previewKeywordItems(t);return i`
2
2
  <div class="preview">
3
- <span class="title">${s}(问答题)</span>
4
- ${this["show-rich-text"]&&this["rich-text-content"]?i`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
5
- ${this._filledAnswers(t).length?i`
6
- <div style="margin-top:8px;color:#a8abb2">
7
- ${this._filledAnswers(t).map((t,e)=>i`<span style="margin-right:10px">关键词${e+1}: ${this._normalizeAnswerTitle(t)}</span>`)}
3
+ <div class="preview-header">
4
+ <div class="preview-title-row">
5
+ <span class="title">${s}</span>
6
+ <span class="preview-type">问答题</span>
7
+ </div>
8
+ ${this["show-rich-text"]&&this["rich-text-content"]?i`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
9
+ </div>
10
+ ${r.length?i`
11
+ <div class="preview-keyword-list">
12
+ ${r.map(t=>i`
13
+ <span class="preview-answer-key">${t}</span>
14
+ `)}
8
15
  </div>
9
16
  `:""}
10
- ${e?i`<div style="margin-top:8px;color:#a8abb2">正确答案:${e}</div>`:""}
11
- ${this.analysis?i`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
17
+ ${e?i`<div class="preview-answer-body">${e}</div>`:""}
18
+ ${this.analysis?i`<div class="preview-analysis">${this.analysis}</div>`:""}
12
19
  ${this["show-category"]&&this._categoryId?i`<div class="section-row"><span class="value-text">分类:${this._categoryLabel()}</span></div>`:""}
13
20
  ${this._renderResourceSection()}
14
21
  </div>
15
- `}_renderSorting(){const t=l(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=c(p(this["subject-prefix"],`${this["order-index"]+1}. `),t);return h(e,g[x.TEXT_FILL]||x.TEXT_FILL)}_renderCategorySection(){return this["show-category"]?i`
22
+ `}_renderSorting(){const t=b(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=g(this["subject-prefix"],this["order-index"],t);return k(e,T[I.TEXT_FILL]||I.TEXT_FILL)}_renderCategorySection(){return this["show-category"]?i`
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 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
42
49
  </div>
43
50
  </div>
44
51
  `}_renderEdit(){return i`
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((t,e)=>i`
104
- <div class="answer-item">
105
- <span class="label">关键词${e+1}:</span>
106
- <div class="answer-tags" style="display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px">
107
- ${t.title.split(",").filter(Boolean).map(t=>{const s=m[e%m.length];return i`
108
- <span style="display:inline-flex;align-items:center;background:${s.bg};color:${s.color};border:1px solid ${s.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px">
109
- ${t}
110
- <span style="cursor:pointer;margin-left:4px;color:#909399" @click=${()=>this._closeTag(t,e)}>×</span>
111
- </span>
112
- `})}
113
- ${i`
114
- ${t.showInput?i`
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(e)}}
117
- @input=${e=>{t.tag=e.target.value}}
118
- @blur=${()=>this._addTag(e)} />
119
- <button class="el-link" @click=${()=>this._addTag(e)}>确认</button>
120
- `:i`
121
- <button class="link" @click=${()=>{this._answers=this._answers.map((t,i)=>i===e?{...t,showInput:!0}:t),this.updateComplete.then(()=>{this.shadowRoot?.querySelector('input[style*="width:80px"]')?.focus()})}}>
122
- ${t.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((t,e)=>i`
116
+ <div class="answer-item">
117
+ <span class="answer-item-label">关键词${e+1}:</span>
118
+ <div class="answer-tags">
119
+ ${t.title.split(",").filter(Boolean).map(t=>{const s=E[e%E.length];return i`
120
+ <span style="display:inline-flex;align-items:center;background:${s.bg};color:${s.color};border:1px solid ${s.border};border-radius:6px;padding:2px 8px;font-size:12px;line-height:16px">
121
+ ${t}
122
+ <span style="cursor:pointer;margin-left:4px;color:#909399" @click=${()=>this._closeTag(t,e)}>×</span>
123
+ </span>
124
+ `})}
125
+ ${i`
126
+ ${t.showInput?i`
127
+ <input type="text" class="keyword-input"
128
+ @keydown=${t=>{"Enter"===t.key&&this._addTag(e)}}
129
+ @input=${e=>{t.tag=e.target.value}}
130
+ @blur=${()=>this._addTag(e)} />
131
+ <button class="el-link" @click=${()=>this._addTag(e)}>确认</button>
132
+ `:i`
133
+ <button class="link" @click=${()=>{this._answers=this._answers.map((t,i)=>i===e?{...t,showInput:!0}:t),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".keyword-input")?.focus()})}}>
134
+ ${t.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(e)}>${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(e)}>${this._iconRemove}</span>
129
145
  </div>
130
- `)}
131
- </div>
146
+ </div>
132
147
 
133
- ${this["show-rich-text"]&&this._showRichText?i`
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"]?"":i`<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?i`
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=${a}
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"]?"":i`<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"]?i`
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"]?i`
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 t=this["is-edit"]?i`<div slot="edit">${this._renderEdit()}</div>`:i`<div slot="preview">${this._renderPreview()}</div>`;return i`
163
180
  <qxs-subject-layout .show-edit=${this["is-edit"]}>
164
181
  ${t}
@@ -182,41 +199,114 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
182
199
  `:""}
183
200
  <slot name="action"></slot>
184
201
  </qxs-subject-layout>
185
- `}};_.styles=[d,t`
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
+ `}};O.styles=[$,u,y,x,m,_,t`
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 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
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 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
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 @@ import{css as t,LitElement as e,html as i}from"lit";import{property as s,state a
256
345
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
257
346
  border: 1px solid #e4e7ed; background: #f5f7fa;
258
347
  }
259
- `],w([s({type:Number,attribute:"order-index"})],_.prototype,"order-index",2),w([s({type:String,attribute:"subject-prefix"})],_.prototype,"subject-prefix",2),w([s({type:String})],_.prototype,"title",2),w([s({type:String,attribute:"custom-id"})],_.prototype,"custom-id",2),w([s({type:Boolean,attribute:"is-edit"})],_.prototype,"is-edit",2),w([s({type:Boolean,attribute:"is-save"})],_.prototype,"is-save",2),w([s({type:Boolean,attribute:"is-set"})],_.prototype,"is-set",2),w([s({type:Boolean,attribute:"is-key"})],_.prototype,"is-key",2),w([s({type:Boolean,attribute:"show-action"})],_.prototype,"show-action",2),w([s({type:Boolean,attribute:"show-add"})],_.prototype,"show-add",2),w([s({type:Boolean,attribute:"hide-add-rich-text"})],_.prototype,"hide-add-rich-text",2),w([s({type:Boolean,attribute:"show-rich-text"})],_.prototype,"show-rich-text",2),w([s({type:Boolean,attribute:"show-delete-action"})],_.prototype,"show-delete-action",2),w([s({type:Boolean,attribute:"show-save-action"})],_.prototype,"show-save-action",2),w([s({type:Boolean,reflect:!0})],_.prototype,"sorting",2),w([s({type:Boolean,attribute:"show-answer-setting"})],_.prototype,"show-answer-setting",2),w([s({type:Boolean,attribute:"show-analysis"})],_.prototype,"show-analysis",2),w([s({type:String,attribute:"rich-text-content"})],_.prototype,"rich-text-content",2),w([s({type:String})],_.prototype,"analysis",2),w([s({type:Number,attribute:"exam-answer-relation-type"})],_.prototype,"exam-answer-relation-type",2),w([s({type:String,attribute:"exam-expand"})],_.prototype,"exam-expand",2),w([s({type:Number,attribute:"exam-id"})],_.prototype,"exam-id",2),w([s({type:String,attribute:"category-id"})],_.prototype,"category-id",2),w([s({type:Object,attribute:"exam-answer-setting"})],_.prototype,"exam-answer-setting",2),w([s({type:Object,attribute:"upload-image"})],_.prototype,"upload-image",2),w([s({type:Array,attribute:"answer-list"})],_.prototype,"answer-list",2),w([s({type:Array,attribute:"tag-list"})],_.prototype,"tag-list",2),w([s({type:Array,attribute:"category-list"})],_.prototype,"category-list",2),w([s({type:Array,attribute:"resource-list"})],_.prototype,"resource-list",2),w([s({type:Boolean,attribute:"show-tag"})],_.prototype,"show-tag",2),w([s({type:Boolean,attribute:"show-category"})],_.prototype,"show-category",2),w([s({type:Boolean,attribute:"show-resource"})],_.prototype,"show-resource",2),w([s({type:Object,attribute:"search-handler"})],_.prototype,"search-handler",2),w([s({type:String,attribute:"model-value"})],_.prototype,"model-value",2),w([s({type:Boolean,attribute:"use-model"})],_.prototype,"use-model",2),w([r()],_.prototype,"_answers",2),w([r()],_.prototype,"_title",2),w([r()],_.prototype,"_analysis",2),w([r()],_.prototype,"_isInOrder",2),w([r()],_.prototype,"_isIgnoreCase",2),w([r()],_.prototype,"_keywordCount",2),w([r()],_.prototype,"_correct",2),w([r()],_.prototype,"_showRichText",2),w([r()],_.prototype,"_richText",2),w([r()],_.prototype,"_selectedTagList",2),w([r()],_.prototype,"_categoryId",2),_=w([o("qxs-text-fill")],_);export{_ as 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
+ `],S([s({type:Number,attribute:"order-index"})],O.prototype,"order-index",2),S([s({type:String,attribute:"subject-prefix"})],O.prototype,"subject-prefix",2),S([s({type:String})],O.prototype,"title",2),S([s({type:String,attribute:"custom-id"})],O.prototype,"custom-id",2),S([s({type:Boolean,attribute:"is-edit"})],O.prototype,"is-edit",2),S([s({type:Boolean,attribute:"is-save"})],O.prototype,"is-save",2),S([s({type:Boolean,attribute:"is-set"})],O.prototype,"is-set",2),S([s({type:Boolean,attribute:"is-key"})],O.prototype,"is-key",2),S([s({type:Boolean,attribute:"show-action"})],O.prototype,"show-action",2),S([s({type:Boolean,attribute:"show-add"})],O.prototype,"show-add",2),S([s({type:Boolean,attribute:"hide-add-rich-text"})],O.prototype,"hide-add-rich-text",2),S([s({type:Boolean,attribute:"show-rich-text"})],O.prototype,"show-rich-text",2),S([s({type:Boolean,attribute:"show-delete-action"})],O.prototype,"show-delete-action",2),S([s({type:Boolean,attribute:"show-save-action"})],O.prototype,"show-save-action",2),S([s({type:Boolean,reflect:!0})],O.prototype,"sorting",2),S([s({type:Boolean,attribute:"show-answer-setting"})],O.prototype,"show-answer-setting",2),S([s({type:Boolean,attribute:"show-analysis"})],O.prototype,"show-analysis",2),S([s({type:String,attribute:"rich-text-content"})],O.prototype,"rich-text-content",2),S([s({type:String})],O.prototype,"analysis",2),S([s({type:Number,attribute:"exam-answer-relation-type"})],O.prototype,"exam-answer-relation-type",2),S([s({type:String,attribute:"exam-expand"})],O.prototype,"exam-expand",2),S([s({type:Number,attribute:"exam-id"})],O.prototype,"exam-id",2),S([s({type:String,attribute:"category-id"})],O.prototype,"category-id",2),S([s({type:Object,attribute:"exam-answer-setting"})],O.prototype,"exam-answer-setting",2),S([s({type:Object,attribute:"upload-image"})],O.prototype,"upload-image",2),S([s({type:Array,attribute:"answer-list"})],O.prototype,"answer-list",2),S([s({type:Array,attribute:"tag-list"})],O.prototype,"tag-list",2),S([s({type:Array,attribute:"category-list"})],O.prototype,"category-list",2),S([s({type:Array,attribute:"resource-list"})],O.prototype,"resource-list",2),S([s({type:Boolean,attribute:"show-tag"})],O.prototype,"show-tag",2),S([s({type:Boolean,attribute:"show-category"})],O.prototype,"show-category",2),S([s({type:Boolean,attribute:"show-resource"})],O.prototype,"show-resource",2),S([s({type:Object,attribute:"search-handler"})],O.prototype,"search-handler",2),S([s({type:String,attribute:"model-value"})],O.prototype,"model-value",2),S([s({type:Boolean,attribute:"use-model"})],O.prototype,"use-model",2),S([r()],O.prototype,"_answers",2),S([r()],O.prototype,"_title",2),S([r()],O.prototype,"_analysis",2),S([r()],O.prototype,"_isInOrder",2),S([r()],O.prototype,"_isIgnoreCase",2),S([r()],O.prototype,"_keywordCount",2),S([r()],O.prototype,"_correct",2),S([r()],O.prototype,"_showRichText",2),S([r()],O.prototype,"_richText",2),S([r()],O.prototype,"_selectedTagList",2),S([r()],O.prototype,"_categoryId",2),O=S([o("qxs-text-fill")],O);export{O as QxsTextFill};
260
395
  //# sourceMappingURL=text-fill.mjs.map