@qxs-bns/components-wc 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/subject/action.mjs +5 -5
- package/es/subject/action.mjs.map +1 -1
- package/es/subject/blank-fill.mjs +12 -8
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/page-end.mjs +6 -4
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/scale.mjs +34 -14
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/single.mjs +9 -5
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/text-fill.mjs +10 -6
- package/es/subject/text-fill.mjs.map +1 -1
- package/lib/subject/action.cjs +5 -5
- package/lib/subject/action.cjs.map +1 -1
- package/lib/subject/blank-fill.cjs +10 -6
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/page-end.cjs +5 -3
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/scale.cjs +30 -10
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/single.cjs +9 -5
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/text-fill.cjs +9 -5
- package/lib/subject/text-fill.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
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"),a=require("./types.cjs"),
|
|
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"),a=require("./types.cjs"),o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,n=(t,e,s,i)=>{for(var r,a=i>1?void 0:i?l(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(a=(i?r(e,s,a):r(a))||a);return i&&a&&o(e,s,a),a};const p=t.html`
|
|
2
2
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"
|
|
3
3
|
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
4
4
|
<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>
|
|
5
|
-
</svg>`;exports.QxsBlankFill=class extends t.LitElement{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,this.sorting=!1,this["show-answer-setting"]=!1,this["show-analysis"]=!
|
|
5
|
+
</svg>`;exports.QxsBlankFill=class extends t.LitElement{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["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._title="",this._analysis="",this._answers=[{title:"",tag:"",showInput:!1}],this._isInOrder=!1,this._isIgnoreCase=!0,this._showRichText=!1,this._richText="",this._selectedTagList=[],this._categoryId="",this.TITLE_MAX=400}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("tag-list")||t.has("category-id"))&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"].replaceAll(/<filter><\/filter>/g," ______")),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??"")}_syncProps(){if(this._title=(this.title||"").replaceAll(/<filter><\/filter>/g," ______"),this._analysis=this.analysis||"",this["answer-list"]?.length)this._answers=this["answer-list"].map(t=>({title:this._normalizeAnswerTitle(t),tag:"",showInput:!1,answerId:t?.answerId??t?.examAnswerId}));else{const t=(this._title.match(/ ______/g)||[]).length;this._answers=Array.from({length:t},()=>({title:"",tag:"",showInput:!1}))}this["exam-answer-setting"]&&(this._isInOrder=!!this["exam-answer-setting"].isInOrder,this._isIgnoreCase=!!this["exam-answer-setting"].isIgnoreCase),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],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}))}_addBlank(){this._title+=" ______",this._answers=[...this._answers,{title:"",tag:"",showInput:!1}],this.requestUpdate(),this._emitModelUpdate()}_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;const s=(this._title.match(/ ______/g)||[]).length;if(s!==this._answers.length)if(s>this._answers.length)for(let t=this._answers.length;t<s;t++)this._answers=[...this._answers,{title:"",tag:"",showInput:!1}];else this._answers=this._answers.slice(0,s);this._emitModelUpdate()}_emitModelUpdate(){if(this["use-model"]){const t=this._title.replaceAll(/ ______/g,"<filter></filter>");this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:t}))}}_handleAddTag(t){t.showInput=!1,t.tag&&(t.title=t.title?[t.title,t.tag].join(","):t.tag,t.tag=""),this.requestUpdate()}_closeTag(t,e){if(!t)return;const s=e.title.split(","),i=s.findIndex(e=>e===t);i>-1&&(s.splice(i,1),e.title=s.join(",")),this.requestUpdate()}_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||"未选择分类"}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:"blank_fill",orderIndex:this["order-index"]},r=i.trimText(this["is-edit"]?this._title:this.title?.replaceAll(/<filter><\/filter>/g," ______")||""),o=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t),answerId:t?.answerId??t?.examAnswerId})),l=i.trimText(this["is-edit"]?this._analysis:this.analysis||""),n=this["is-edit"]?this._isInOrder:this["exam-answer-setting"]?.isInOrder??!1,p=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"]||"",d=o.filter(t=>this._normalizeAnswerTitle(t));if(!r)return void e(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",s));if(o.length<1)return void e(new i.SubjectError("至少添加一个填空符!","NO_BLANK","answers",s));const x={answerType:a.SubjectType.BLANK_FILL,examTypeEnum:a.SubjectType.BLANK_FILL,title:r.replaceAll(/ ______/g,"<filter></filter>"),answers:d.map((t,e)=>{const s=this._normalizeAnswerTitle(t),i={title:s,answer:s,isCorrect:!0,orderIndex:e+1};return t.answerId&&(i.answerId=t.answerId,i.examAnswerId=t.answerId),i}),analysis:l,isSetCorrectAnswer:d.length>0,isKey:this["is-key"],examAnswerSettingBO:{isIgnoreCase:p,isInOrder:n},examAnswerSettingVO:{isIgnoreCase:p,isInOrder:n},examRichTextContent:h?c:""};this["custom-id"]&&(x.customId=this["custom-id"]),t(x)})}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){!function(t){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(e),setTimeout(()=>{e.style.opacity="0",setTimeout(()=>e.remove(),300)},2500)}(t.message)}}validate(){const t=[],e={customId:this["custom-id"]||void 0,answerType:"blank_fill",orderIndex:this["order-index"]},s=i.trimText(this["is-edit"]?this._title:this.title?.replaceAll(/<filter><\/filter>/g," ______")||""),r=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)}));return s||t.push(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e)),r.length<1&&t.push(new i.SubjectError("至少添加一个填空符!","NO_BLANK","answers",e)),t}_renderPreview(){const e=this.title.replaceAll(/<filter><\/filter>/g," ______"),s=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)}));return t.html`
|
|
6
6
|
<div class="preview">
|
|
7
7
|
<span class="title">${this["order-index"]+1}.${e}(填空题)</span>
|
|
8
|
-
${this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
8
|
+
${this["show-rich-text"]&&this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
9
9
|
${s.some(t=>t.title)?t.html`
|
|
10
10
|
<div class="content flex flex-wrap">
|
|
11
11
|
<span>正确答案:</span>
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
</div>
|
|
111
111
|
`)}
|
|
112
112
|
|
|
113
|
-
${this._showRichText?t.html`
|
|
113
|
+
${this["show-rich-text"]&&this._showRichText?t.html`
|
|
114
114
|
<div class="flex flex-items-start" style="margin-top:12px">
|
|
115
115
|
<div class="label"><span>副文本:</span></div>
|
|
116
116
|
<div style="flex:1">
|
|
@@ -151,7 +151,10 @@
|
|
|
151
151
|
.is-edit=${this["is-edit"]}
|
|
152
152
|
.is-set=${this["is-set"]}
|
|
153
153
|
.show-add=${this["show-add"]}
|
|
154
|
-
.show-rich-text=${this._showRichText}
|
|
154
|
+
.show-rich-text=${this["show-rich-text"]&&this._showRichText}
|
|
155
|
+
.hide-add-rich-text=${!this["show-rich-text"]||this["hide-add-rich-text"]}
|
|
156
|
+
.show-delete-action=${this["show-delete-action"]}
|
|
157
|
+
.show-save-action=${this["show-save-action"]}
|
|
155
158
|
exam-answer-relation-type=${this["exam-answer-relation-type"]}
|
|
156
159
|
@delete=${()=>this._emit("delete")}
|
|
157
160
|
@save=${this._save}
|
|
@@ -161,6 +164,7 @@
|
|
|
161
164
|
@on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
|
|
162
165
|
></qxs-subject-action>
|
|
163
166
|
`:""}
|
|
167
|
+
<slot name="action"></slot>
|
|
164
168
|
</qxs-subject-layout>
|
|
165
169
|
`}},exports.QxsBlankFill.styles=[r.sortingCardStyles,t.css`
|
|
166
170
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
@@ -266,5 +270,5 @@
|
|
|
266
270
|
width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
|
|
267
271
|
border: 1px solid #e4e7ed; background: #f5f7fa;
|
|
268
272
|
}
|
|
269
|
-
`],n([e.property({type:Number,attribute:"order-index"})],exports.QxsBlankFill.prototype,"order-index",2),n([e.property({type:String})],exports.QxsBlankFill.prototype,"title",2),n([e.property({type:String,attribute:"custom-id"})],exports.QxsBlankFill.prototype,"custom-id",2),n([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsBlankFill.prototype,"is-edit",2),n([e.property({type:Boolean,attribute:"is-save"})],exports.QxsBlankFill.prototype,"is-save",2),n([e.property({type:Boolean,attribute:"is-set"})],exports.QxsBlankFill.prototype,"is-set",2),n([e.property({type:Boolean,attribute:"is-key"})],exports.QxsBlankFill.prototype,"is-key",2),n([e.property({type:Boolean,attribute:"show-action"})],exports.QxsBlankFill.prototype,"show-action",2),n([e.property({type:Boolean,attribute:"show-add"})],exports.QxsBlankFill.prototype,"show-add",2),n([e.property({type:Boolean,reflect:!0})],exports.QxsBlankFill.prototype,"sorting",2),n([e.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsBlankFill.prototype,"show-answer-setting",2),n([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsBlankFill.prototype,"show-analysis",2),n([e.property({type:String,attribute:"rich-text-content"})],exports.QxsBlankFill.prototype,"rich-text-content",2),n([e.property({type:String})],exports.QxsBlankFill.prototype,"analysis",2),n([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsBlankFill.prototype,"exam-answer-relation-type",2),n([e.property({type:String,attribute:"exam-expand"})],exports.QxsBlankFill.prototype,"exam-expand",2),n([e.property({type:Number,attribute:"exam-id"})],exports.QxsBlankFill.prototype,"exam-id",2),n([e.property({type:String,attribute:"category-id"})],exports.QxsBlankFill.prototype,"category-id",2),n([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsBlankFill.prototype,"exam-answer-setting",2),n([e.property({type:Object,attribute:"upload-image"})],exports.QxsBlankFill.prototype,"upload-image",2),n([e.property({type:Array,attribute:"answer-list"})],exports.QxsBlankFill.prototype,"answer-list",2),n([e.property({type:Array,attribute:"tag-list"})],exports.QxsBlankFill.prototype,"tag-list",2),n([e.property({type:Array,attribute:"category-list"})],exports.QxsBlankFill.prototype,"category-list",2),n([e.property({type:Array,attribute:"resource-list"})],exports.QxsBlankFill.prototype,"resource-list",2),n([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsBlankFill.prototype,"show-tag",2),n([e.property({type:Boolean,attribute:"show-category"})],exports.QxsBlankFill.prototype,"show-category",2),n([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsBlankFill.prototype,"show-resource",2),n([e.property({type:String,attribute:"model-value"})],exports.QxsBlankFill.prototype,"model-value",2),n([e.property({type:Boolean,attribute:"use-model"})],exports.QxsBlankFill.prototype,"use-model",2),n([e.state()],exports.QxsBlankFill.prototype,"_title",2),n([e.state()],exports.QxsBlankFill.prototype,"_analysis",2),n([e.state()],exports.QxsBlankFill.prototype,"_answers",2),n([e.state()],exports.QxsBlankFill.prototype,"_isInOrder",2),n([e.state()],exports.QxsBlankFill.prototype,"_isIgnoreCase",2),n([e.state()],exports.QxsBlankFill.prototype,"_showRichText",2),n([e.state()],exports.QxsBlankFill.prototype,"_richText",2),n([e.state()],exports.QxsBlankFill.prototype,"_selectedTagList",2),n([e.state()],exports.QxsBlankFill.prototype,"_categoryId",2),exports.QxsBlankFill=n([s.safeCustomElement("qxs-blank-fill")],exports.QxsBlankFill);
|
|
273
|
+
`],n([e.property({type:Number,attribute:"order-index"})],exports.QxsBlankFill.prototype,"order-index",2),n([e.property({type:String})],exports.QxsBlankFill.prototype,"title",2),n([e.property({type:String,attribute:"custom-id"})],exports.QxsBlankFill.prototype,"custom-id",2),n([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsBlankFill.prototype,"is-edit",2),n([e.property({type:Boolean,attribute:"is-save"})],exports.QxsBlankFill.prototype,"is-save",2),n([e.property({type:Boolean,attribute:"is-set"})],exports.QxsBlankFill.prototype,"is-set",2),n([e.property({type:Boolean,attribute:"is-key"})],exports.QxsBlankFill.prototype,"is-key",2),n([e.property({type:Boolean,attribute:"show-action"})],exports.QxsBlankFill.prototype,"show-action",2),n([e.property({type:Boolean,attribute:"show-add"})],exports.QxsBlankFill.prototype,"show-add",2),n([e.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsBlankFill.prototype,"hide-add-rich-text",2),n([e.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsBlankFill.prototype,"show-rich-text",2),n([e.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsBlankFill.prototype,"show-delete-action",2),n([e.property({type:Boolean,attribute:"show-save-action"})],exports.QxsBlankFill.prototype,"show-save-action",2),n([e.property({type:Boolean,reflect:!0})],exports.QxsBlankFill.prototype,"sorting",2),n([e.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsBlankFill.prototype,"show-answer-setting",2),n([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsBlankFill.prototype,"show-analysis",2),n([e.property({type:String,attribute:"rich-text-content"})],exports.QxsBlankFill.prototype,"rich-text-content",2),n([e.property({type:String})],exports.QxsBlankFill.prototype,"analysis",2),n([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsBlankFill.prototype,"exam-answer-relation-type",2),n([e.property({type:String,attribute:"exam-expand"})],exports.QxsBlankFill.prototype,"exam-expand",2),n([e.property({type:Number,attribute:"exam-id"})],exports.QxsBlankFill.prototype,"exam-id",2),n([e.property({type:String,attribute:"category-id"})],exports.QxsBlankFill.prototype,"category-id",2),n([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsBlankFill.prototype,"exam-answer-setting",2),n([e.property({type:Object,attribute:"upload-image"})],exports.QxsBlankFill.prototype,"upload-image",2),n([e.property({type:Array,attribute:"answer-list"})],exports.QxsBlankFill.prototype,"answer-list",2),n([e.property({type:Array,attribute:"tag-list"})],exports.QxsBlankFill.prototype,"tag-list",2),n([e.property({type:Array,attribute:"category-list"})],exports.QxsBlankFill.prototype,"category-list",2),n([e.property({type:Array,attribute:"resource-list"})],exports.QxsBlankFill.prototype,"resource-list",2),n([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsBlankFill.prototype,"show-tag",2),n([e.property({type:Boolean,attribute:"show-category"})],exports.QxsBlankFill.prototype,"show-category",2),n([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsBlankFill.prototype,"show-resource",2),n([e.property({type:String,attribute:"model-value"})],exports.QxsBlankFill.prototype,"model-value",2),n([e.property({type:Boolean,attribute:"use-model"})],exports.QxsBlankFill.prototype,"use-model",2),n([e.state()],exports.QxsBlankFill.prototype,"_title",2),n([e.state()],exports.QxsBlankFill.prototype,"_analysis",2),n([e.state()],exports.QxsBlankFill.prototype,"_answers",2),n([e.state()],exports.QxsBlankFill.prototype,"_isInOrder",2),n([e.state()],exports.QxsBlankFill.prototype,"_isIgnoreCase",2),n([e.state()],exports.QxsBlankFill.prototype,"_showRichText",2),n([e.state()],exports.QxsBlankFill.prototype,"_richText",2),n([e.state()],exports.QxsBlankFill.prototype,"_selectedTagList",2),n([e.state()],exports.QxsBlankFill.prototype,"_categoryId",2),exports.QxsBlankFill=n([s.safeCustomElement("qxs-blank-fill")],exports.QxsBlankFill);
|
|
270
274
|
//# sourceMappingURL=blank-fill.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blank-fill.cjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem, trimCommaSeparatedText, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface BlankAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n}\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-blank-fill')\nexport class QxsBlankFill extends LitElement {\n static styles = [sortingCardStyles, css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview .rich-text img[data-align=\"left\"] { display: block !important; margin: 0 auto 0 0 !important; }\n .preview .rich-text img[data-align=\"center\"] { display: block !important; margin: 0 auto !important; }\n .preview .rich-text img[data-align=\"right\"] { display: block !important; margin: 0 0 0 auto !important; }\n .preview .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 70px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\n\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .el-select:focus { border-color: #3D61E3; outline: none; }\n .el-select:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\n }\n `]\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'is-key' }) 'is-key' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, reflect: true }) sorting = false\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = true\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': { isInOrder: boolean, isIgnoreCase: boolean } = { isInOrder: false, isIgnoreCase: true }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) 'answer-list': any[] = []\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n private readonly TITLE_MAX = 400\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('exam-answer-setting') || changed.has('rich-text-content') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value'].replaceAll(/<filter><\\/filter>/g, ' ______')\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return trimCommaSeparatedText(answer?.title ?? answer?.answer ?? '')\n }\n\n private _syncProps() {\n this._title = (this.title || '').replaceAll(/<filter><\\/filter>/g, ' ______')\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this['answer-list'].map((a: any) => ({\n title: this._normalizeAnswerTitle(a),\n tag: '',\n showInput: false,\n answerId: a?.answerId ?? a?.examAnswerId,\n }))\n }\n else {\n const blankCount = (this._title.match(/ ______/g) || []).length\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this['exam-answer-setting']) {\n this._isInOrder = !!this['exam-answer-setting'].isInOrder\n this._isIgnoreCase = !!this['exam-answer-setting'].isIgnoreCase\n }\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\n this._emitModelUpdate()\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n this._emitModelUpdate()\n }\n\n private _emitModelUpdate() {\n if (this['use-model']) {\n const modelValue = this._title.replaceAll(/ ______/g, '<filter></filter>')\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: modelValue,\n }))\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (!tag) { return }\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) {\n tags.splice(idx, 1)\n item.title = tags.join(',')\n }\n this.requestUpdate()\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || '')\n const answers = this['is-edit']\n ? this._answers\n : (this['answer-list'] || []).map((answer: any) => ({\n ...answer,\n title: this._normalizeAnswerTitle(answer),\n answerId: answer?.answerId ?? answer?.examAnswerId,\n }))\n const analysis = trimText(this['is-edit'] ? this._analysis : this.analysis || '')\n const isInOrder = this['is-edit'] ? this._isInOrder : this['exam-answer-setting']?.isInOrder ?? false\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : this['exam-answer-setting']?.isIgnoreCase ?? true\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const filledAnswers = answers.filter((answer: any) => this._normalizeAnswerTitle(answer))\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (answers.length < 1) {\n reject(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.BLANK_FILL,\n examTypeEnum: SubjectType.BLANK_FILL,\n title: title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: filledAnswers.map((answer: any, index: number) => {\n const title = this._normalizeAnswerTitle(answer)\n const next: any = {\n title,\n answer: title,\n isCorrect: true,\n orderIndex: index + 1,\n }\n if (answer.answerId) {\n next.answerId = answer.answerId\n next.examAnswerId = answer.answerId\n }\n return next\n }),\n analysis,\n isSetCorrectAnswer: filledAnswers.length > 0,\n isKey: this['is-key'],\n examAnswerSettingBO: { isIgnoreCase, isInOrder },\n examAnswerSettingVO: { isIgnoreCase, isInOrder },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || '')\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (answers.length < 1) {\n errors.push(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n const previewAnswers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${displayTitle}(填空题)</span>\n ${this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\n ${previewAnswers.map((a, i) => a.title\n ? html`<span style=\"margin-right:10px\">填空${i + 1}: ${a.title}</span>`\n : '')}\n </div>\n `\n : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = `${this['order-index'] + 1}. ${title}`\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.BLANK_FILL] || SubjectType.BLANK_FILL)\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .value=${this._title}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【填空题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex flex-justify-end\">\n <span class=\"el-link\" @click=${() => this._addBlank()}>插入填空符</span>\n </div>\n\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n <span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>\n </span>\n `)}\n ${html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `}\n </div>\n </div>\n `)}\n\n ${this._showRichText\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>副文本:</span></div>\n <div style=\"flex:1\">\n <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\n ${!this['show-action']\n ? html`\n <div class=\"flex flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this._showRichText}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","QxsBlankFill","LitElement","constructor","super","arguments","this","title","sorting","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","replaceAll","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","trimCommaSeparatedText","length","a","answerId","examAnswerId","blankCount","match","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_emitModelUpdate","_onTitleInput","el","value","slice","i","modelValue","_handleAddTag","join","_closeTag","tags","split","idx","findIndex","t","splice","_onCategoryChange","customId","examId","_imageResources","filter","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","toJSON","row","answerType","orderIndex","trimText","answers","showRichText","richText","filledAnswers","SubjectError","SubjectType","BLANK_FILL","examTypeEnum","index","next","isCorrect","isSetCorrectAnswer","isKey","examAnswerSettingBO","examAnswerSettingVO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","_renderPreview","displayTitle","previewAnswers","some","_renderResourceSection","_renderCategorySection","images","video","src","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","getContent","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gXAcA,MAAMA,EAAWC,EAAAA,IAAA;;;;UAoBJC,QAAAA,aAAN,cAA2BC,EAAAA,WAA3BC,WAAAA,GAAAC,SAAAC,WA2GiDC,KAAA,eAAgB,EAC1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACrBA,KAAAE,SAAU,EACSF,KAAA,wBAAwB,EAC9BA,KAAA,kBAAkB,EACfA,KAAA,qBAAsB,GACtDA,KAAAG,SAAW,GAC6BH,KAAA,6BAA8B,EAC5CA,KAAA,eAA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EAAAA,SAAS,CAAEC,KAAM1F,QAAS4F,UAAW,mBAhJ3BtL,QAAAA,aAgJ8CuL,UAAA,gBAAA,GAEHL,EAAA,CAArDC,EAAAA,SAAS,CAAEC,KAAMvI,OAAQyI,UAAW,iBAlJ1BtL,QAAAA,aAkJ2CuL,UAAA,cAAA,GACDL,EAAA,CAApDC,EAAAA,SAAS,CAAEC,KAAM1F,QAAS4F,UAAW,eAnJ3BtL,QAAAA,aAmJ0CuL,UAAA,YAAA,GAEpCL,EAAA,CAAhBO,EAAAA,SArJUzL,QAAAA,aAqJMuL,UAAA,SAAA,GACAL,EAAA,CAAhBO,EAAAA,SAtJUzL,QAAAA,aAsJMuL,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SAvJUzL,QAAAA,aAuJMuL,UAAA,WAAA,GACAL,EAAA,CAAhBO,EAAAA,SAxJUzL,QAAAA,aAwJMuL,UAAA,aAAA,GACAL,EAAA,CAAhBO,EAAAA,SAzJUzL,QAAAA,aAyJMuL,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SA1JUzL,QAAAA,aA0JMuL,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SA3JUzL,QAAAA,aA2JMuL,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SA5JUzL,QAAAA,aA4JMuL,UAAA,mBAAA,GACAL,EAAA,CAAhBO,EAAAA,SA7JUzL,QAAAA,aA6JMuL,UAAA,cAAA,GA7JNvL,QAAAA,aAANkL,EAAA,CADNQ,EAAAA,kBAAkB,mBACN1L,QAAAA"}
|
|
1
|
+
{"version":3,"file":"blank-fill.cjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem, trimCommaSeparatedText, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface BlankAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n}\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-blank-fill')\nexport class QxsBlankFill extends LitElement {\n static styles = [sortingCardStyles, css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview .rich-text img[data-align=\"left\"] { display: block !important; margin: 0 auto 0 0 !important; }\n .preview .rich-text img[data-align=\"center\"] { display: block !important; margin: 0 auto !important; }\n .preview .rich-text img[data-align=\"right\"] { display: block !important; margin: 0 0 0 auto !important; }\n .preview .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 70px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\n\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .el-select:focus { border-color: #3D61E3; outline: none; }\n .el-select:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\n }\n `]\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'is-key' }) 'is-key' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'hide-add-rich-text' }) 'hide-add-rich-text' = false\n @property({ type: Boolean, attribute: 'show-rich-text' }) 'show-rich-text' = false\n @property({ type: Boolean, attribute: 'show-delete-action' }) 'show-delete-action' = true\n @property({ type: Boolean, attribute: 'show-save-action' }) 'show-save-action' = true\n @property({ type: Boolean, reflect: true }) sorting = false\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = false\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': { isInOrder: boolean, isIgnoreCase: boolean } = { isInOrder: false, isIgnoreCase: true }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) 'answer-list': any[] = []\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n private readonly TITLE_MAX = 400\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('exam-answer-setting') || changed.has('rich-text-content') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value'].replaceAll(/<filter><\\/filter>/g, ' ______')\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return trimCommaSeparatedText(answer?.title ?? answer?.answer ?? '')\n }\n\n private _syncProps() {\n this._title = (this.title || '').replaceAll(/<filter><\\/filter>/g, ' ______')\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this['answer-list'].map((a: any) => ({\n title: this._normalizeAnswerTitle(a),\n tag: '',\n showInput: false,\n answerId: a?.answerId ?? a?.examAnswerId,\n }))\n }\n else {\n const blankCount = (this._title.match(/ ______/g) || []).length\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this['exam-answer-setting']) {\n this._isInOrder = !!this['exam-answer-setting'].isInOrder\n this._isIgnoreCase = !!this['exam-answer-setting'].isIgnoreCase\n }\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\n this._emitModelUpdate()\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n this._emitModelUpdate()\n }\n\n private _emitModelUpdate() {\n if (this['use-model']) {\n const modelValue = this._title.replaceAll(/ ______/g, '<filter></filter>')\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: modelValue,\n }))\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (!tag) { return }\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) {\n tags.splice(idx, 1)\n item.title = tags.join(',')\n }\n this.requestUpdate()\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || '')\n const answers = this['is-edit']\n ? this._answers\n : (this['answer-list'] || []).map((answer: any) => ({\n ...answer,\n title: this._normalizeAnswerTitle(answer),\n answerId: answer?.answerId ?? answer?.examAnswerId,\n }))\n const analysis = trimText(this['is-edit'] ? this._analysis : this.analysis || '')\n const isInOrder = this['is-edit'] ? this._isInOrder : this['exam-answer-setting']?.isInOrder ?? false\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : this['exam-answer-setting']?.isIgnoreCase ?? true\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const filledAnswers = answers.filter((answer: any) => this._normalizeAnswerTitle(answer))\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (answers.length < 1) {\n reject(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.BLANK_FILL,\n examTypeEnum: SubjectType.BLANK_FILL,\n title: title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: filledAnswers.map((answer: any, index: number) => {\n const title = this._normalizeAnswerTitle(answer)\n const next: any = {\n title,\n answer: title,\n isCorrect: true,\n orderIndex: index + 1,\n }\n if (answer.answerId) {\n next.answerId = answer.answerId\n next.examAnswerId = answer.answerId\n }\n return next\n }),\n analysis,\n isSetCorrectAnswer: filledAnswers.length > 0,\n isKey: this['is-key'],\n examAnswerSettingBO: { isIgnoreCase, isInOrder },\n examAnswerSettingVO: { isIgnoreCase, isInOrder },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || '')\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (answers.length < 1) {\n errors.push(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n const previewAnswers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${displayTitle}(填空题)</span>\n ${this['show-rich-text'] && this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\n ${previewAnswers.map((a, i) => a.title\n ? html`<span style=\"margin-right:10px\">填空${i + 1}: ${a.title}</span>`\n : '')}\n </div>\n `\n : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = `${this['order-index'] + 1}. ${title}`\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.BLANK_FILL] || SubjectType.BLANK_FILL)\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .value=${this._title}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【填空题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex flex-justify-end\">\n <span class=\"el-link\" @click=${() => this._addBlank()}>插入填空符</span>\n </div>\n\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n <span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>\n </span>\n `)}\n ${html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `}\n </div>\n </div>\n `)}\n\n ${this['show-rich-text'] && this._showRichText\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>副文本:</span></div>\n <div style=\"flex:1\">\n <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\n ${!this['show-action']\n ? html`\n <div class=\"flex flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this['show-rich-text'] && this._showRichText}\n .hide-add-rich-text=${!this['show-rich-text'] || this['hide-add-rich-text']}\n .show-delete-action=${this['show-delete-action']}\n .show-save-action=${this['show-save-action']}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n <slot name=\"action\"></slot>\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","QxsBlankFill","LitElement","constructor","super","arguments","this","title","sorting","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","replaceAll","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","trimCommaSeparatedText","length","a","answerId","examAnswerId","blankCount","match","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_emitModelUpdate","_onTitleInput","el","value","slice","i","modelValue","_handleAddTag","join","_closeTag","tags","split","idx","findIndex","t","splice","_onCategoryChange","customId","examId","_imageResources","filter","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","toJSON","row","answerType","orderIndex","trimText","answers","showRichText","richText","filledAnswers","SubjectError","SubjectType","BLANK_FILL","examTypeEnum","index","next","isCorrect","isSetCorrectAnswer","isKey","examAnswerSettingBO","examAnswerSettingVO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","_renderPreview","displayTitle","previewAnswers","some","_renderResourceSection","_renderCategorySection","images","video","src","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","getContent","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gXAcA,MAAMA,EAAWC,EAAAA,IAAA;;;;UAoBJC,QAAAA,aAAN,cAA2BC,EAAAA,WAA3BC,WAAAA,GAAAC,SAAAC,WA2GiDC,KAAA,eAAgB,EAC1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACHA,KAAA,uBAAuB,EAC3BA,KAAA,mBAAmB,EACfA,KAAA,uBAAuB,EACzBA,KAAA,qBAAqB,EACrCA,KAAAE,SAAU,EACSF,KAAA,wBAAwB,EAC9BA,KAAA,kBAAkB,EACfA,KAAA,qBAAsB,GACtDA,KAAAG,SAAW,GAC6BH,KAAA,6BAA8B,EAC5CA,KAAA,eAAgB,GACpBA,KAAA,WAAY,EACRA,KAAA,eAAgB,GAEtEA,KAAA,uBAAuE,CAAEI,WAAW,EAAOC,cAAc,GAGzGL,KAAA,gBAAkDM,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAI4BlB,KAAA,eAAuB,GAC1BA,KAAA,YAAwB,GACnBA,KAAA,iBAA8B,GAC9BA,KAAA,iBAA8B,GACjCA,KAAA,aAAa,EACRA,KAAA,kBAAkB,EAClBA,KAAA,kBAAkB,EAErBA,KAAA,eAAgB,GACjBA,KAAA,cAAc,EAE1DA,KAAQmB,OAAS,GACjBnB,KAAQoB,UAAY,GACpBpB,KAAQqB,SAA0B,CAAC,CAAE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C,EAAAA,SAAS,CAAEC,KAAM1F,QAAS4F,UAAW,mBApJ3BtL,QAAAA,aAoJ8CuL,UAAA,gBAAA,GAEHL,EAAA,CAArDC,EAAAA,SAAS,CAAEC,KAAMvI,OAAQyI,UAAW,iBAtJ1BtL,QAAAA,aAsJ2CuL,UAAA,cAAA,GACDL,EAAA,CAApDC,EAAAA,SAAS,CAAEC,KAAM1F,QAAS4F,UAAW,eAvJ3BtL,QAAAA,aAuJ0CuL,UAAA,YAAA,GAEpCL,EAAA,CAAhBO,EAAAA,SAzJUzL,QAAAA,aAyJMuL,UAAA,SAAA,GACAL,EAAA,CAAhBO,EAAAA,SA1JUzL,QAAAA,aA0JMuL,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SA3JUzL,QAAAA,aA2JMuL,UAAA,WAAA,GACAL,EAAA,CAAhBO,EAAAA,SA5JUzL,QAAAA,aA4JMuL,UAAA,aAAA,GACAL,EAAA,CAAhBO,EAAAA,SA7JUzL,QAAAA,aA6JMuL,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SA9JUzL,QAAAA,aA8JMuL,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SA/JUzL,QAAAA,aA+JMuL,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SAhKUzL,QAAAA,aAgKMuL,UAAA,mBAAA,GACAL,EAAA,CAAhBO,EAAAA,SAjKUzL,QAAAA,aAiKMuL,UAAA,cAAA,GAjKNvL,QAAAA,aAANkL,EAAA,CADNQ,EAAAA,kBAAkB,mBACN1L,QAAAA"}
|
package/lib/subject/page-end.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("lit"),t=require("lit/decorators.js"),s=require("../base/define.cjs"),
|
|
1
|
+
"use strict";var e=require("lit"),t=require("lit/decorators.js"),s=require("../base/define.cjs"),o=require("./sorting-card.cjs"),i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=(e,t,s,o)=>{for(var a,n=o>1?void 0:o?r(t,s):t,d=e.length-1;d>=0;d--)(a=e[d])&&(n=(o?a(t,s,n):a(n))||n);return o&&n&&i(t,s,n),n};exports.QxsPageEnd=class extends e.LitElement{constructor(){super(...arguments),this["current-page-index"]=1,this["total-page"]=1,this["show-action"]=!0,this["show-add"]=!0,this["show-delete-action"]=!0,this["custom-id"]="",this.sorting=!1}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}async toJSON(){const e={answerType:"page_end"};return this["custom-id"]&&(e.customId=this["custom-id"]),e}validate(){return[]}render(){return this.sorting?o.renderSortingCard("分页边界",`第${this["current-page-index"]} / ${this["total-page"]}页`):e.html`
|
|
2
2
|
<div class="container">
|
|
3
3
|
<div class="divider">
|
|
4
4
|
<div class="line"></div>
|
|
@@ -9,18 +9,20 @@
|
|
|
9
9
|
<qxs-subject-action
|
|
10
10
|
.page-end=${!0}
|
|
11
11
|
.show-add=${this["show-add"]}
|
|
12
|
+
.show-delete-action=${this["show-delete-action"]}
|
|
12
13
|
.show-other-option=${!1}
|
|
13
14
|
.show-rich-text=${!1}
|
|
14
15
|
@delete=${()=>this._emit("delete")}
|
|
15
16
|
@add=${e=>this._emit("add",e.detail)}
|
|
16
17
|
></qxs-subject-action>
|
|
17
18
|
`:""}
|
|
19
|
+
<slot name="action"></slot>
|
|
18
20
|
</div>
|
|
19
|
-
`}},exports.QxsPageEnd.styles=[
|
|
21
|
+
`}},exports.QxsPageEnd.styles=[o.sortingCardStyles,e.css`
|
|
20
22
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; }
|
|
21
23
|
.container { width: 100%; }
|
|
22
24
|
.divider { display: flex; align-items: center; padding: 12px 0; }
|
|
23
25
|
.line { flex: 1; height: 1px; background-color: #e4e7ed; }
|
|
24
26
|
.label { padding: 0 12px; font-size: 12px; color: #8c8c8c; }
|
|
25
|
-
`],a([t.property({type:Number,attribute:"current-page-index"})],exports.QxsPageEnd.prototype,"current-page-index",2),a([t.property({type:Number,attribute:"total-page"})],exports.QxsPageEnd.prototype,"total-page",2),a([t.property({type:Boolean,attribute:"show-action"})],exports.QxsPageEnd.prototype,"show-action",2),a([t.property({type:Boolean,attribute:"show-add"})],exports.QxsPageEnd.prototype,"show-add",2),a([t.property({type:String,attribute:"custom-id"})],exports.QxsPageEnd.prototype,"custom-id",2),a([t.property({type:Boolean,reflect:!0})],exports.QxsPageEnd.prototype,"sorting",2),exports.QxsPageEnd=a([s.safeCustomElement("qxs-page-end")],exports.QxsPageEnd);
|
|
27
|
+
`],a([t.property({type:Number,attribute:"current-page-index"})],exports.QxsPageEnd.prototype,"current-page-index",2),a([t.property({type:Number,attribute:"total-page"})],exports.QxsPageEnd.prototype,"total-page",2),a([t.property({type:Boolean,attribute:"show-action"})],exports.QxsPageEnd.prototype,"show-action",2),a([t.property({type:Boolean,attribute:"show-add"})],exports.QxsPageEnd.prototype,"show-add",2),a([t.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsPageEnd.prototype,"show-delete-action",2),a([t.property({type:String,attribute:"custom-id"})],exports.QxsPageEnd.prototype,"custom-id",2),a([t.property({type:Boolean,reflect:!0})],exports.QxsPageEnd.prototype,"sorting",2),exports.QxsPageEnd=a([s.safeCustomElement("qxs-page-end")],exports.QxsPageEnd);
|
|
26
28
|
//# sourceMappingURL=page-end.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-end.cjs","sources":["../../../../packages/components-wc/src/subject/page-end.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\n\n@safeCustomElement('qxs-page-end')\nexport class QxsPageEnd extends LitElement {\n static styles = [sortingCardStyles, css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; }\n .container { width: 100%; }\n .divider { display: flex; align-items: center; padding: 12px 0; }\n .line { flex: 1; height: 1px; background-color: #e4e7ed; }\n .label { padding: 0 12px; font-size: 12px; color: #8c8c8c; }\n `]\n\n @property({ type: Number, attribute: 'current-page-index' }) 'current-page-index' = 1\n @property({ type: Number, attribute: 'total-page' }) 'total-page' = 1\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, reflect: true }) sorting = false\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n async toJSON(): Promise<any> {\n const result: any = {\n answerType: 'page_end',\n }\n if (this['custom-id']) {\n result.customId = this['custom-id']\n }\n return result\n }\n\n validate() {\n return []\n }\n\n render() {\n if (this.sorting) {\n return renderSortingCard('分页边界', `第${this['current-page-index']} / ${this['total-page']}页`)\n }\n\n return html`\n <div class=\"container\">\n <div class=\"divider\">\n <div class=\"line\"></div>\n <span class=\"label\">第${this['current-page-index']} / ${this['total-page']}页</span>\n <div class=\"line\"></div>\n </div>\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .page-end=${true}\n .show-add=${this['show-add']}\n .show-other-option=${false}\n .show-rich-text=${false}\n @delete=${() => this._emit('delete')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n ></qxs-subject-action>\n `\n : ''}\n </div>\n `\n }\n}\n\nexport function register() {\n // auto-registered via @safeCustomElement\n}\n"],"names":["QxsPageEnd","LitElement","constructor","super","arguments","this","sorting","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","toJSON","result","answerType","customId","validate","render","renderSortingCard","html","e","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","Boolean","String","reflect","safeCustomElement"],"mappings":"6TAMaA,QAAAA,WAAN,cAAyBC,EAAAA,WAAzBC,WAAAA,GAAAC,SAAAC,WASwDC,KAAA,sBAAuB,EAC/BA,KAAA,cAAe,EACbA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,
|
|
1
|
+
{"version":3,"file":"page-end.cjs","sources":["../../../../packages/components-wc/src/subject/page-end.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\n\n@safeCustomElement('qxs-page-end')\nexport class QxsPageEnd extends LitElement {\n static styles = [sortingCardStyles, css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; }\n .container { width: 100%; }\n .divider { display: flex; align-items: center; padding: 12px 0; }\n .line { flex: 1; height: 1px; background-color: #e4e7ed; }\n .label { padding: 0 12px; font-size: 12px; color: #8c8c8c; }\n `]\n\n @property({ type: Number, attribute: 'current-page-index' }) 'current-page-index' = 1\n @property({ type: Number, attribute: 'total-page' }) 'total-page' = 1\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'show-delete-action' }) 'show-delete-action' = true\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, reflect: true }) sorting = false\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n async toJSON(): Promise<any> {\n const result: any = {\n answerType: 'page_end',\n }\n if (this['custom-id']) {\n result.customId = this['custom-id']\n }\n return result\n }\n\n validate() {\n return []\n }\n\n render() {\n if (this.sorting) {\n return renderSortingCard('分页边界', `第${this['current-page-index']} / ${this['total-page']}页`)\n }\n\n return html`\n <div class=\"container\">\n <div class=\"divider\">\n <div class=\"line\"></div>\n <span class=\"label\">第${this['current-page-index']} / ${this['total-page']}页</span>\n <div class=\"line\"></div>\n </div>\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .page-end=${true}\n .show-add=${this['show-add']}\n .show-delete-action=${this['show-delete-action']}\n .show-other-option=${false}\n .show-rich-text=${false}\n @delete=${() => this._emit('delete')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n ></qxs-subject-action>\n `\n : ''}\n <slot name=\"action\"></slot>\n </div>\n `\n }\n}\n\nexport function register() {\n // auto-registered via @safeCustomElement\n}\n"],"names":["QxsPageEnd","LitElement","constructor","super","arguments","this","sorting","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","toJSON","result","answerType","customId","validate","render","renderSortingCard","html","e","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","Boolean","String","reflect","safeCustomElement"],"mappings":"6TAMaA,QAAAA,WAAN,cAAyBC,EAAAA,WAAzBC,WAAAA,GAAAC,SAAAC,WASwDC,KAAA,sBAAuB,EAC/BA,KAAA,cAAe,EACbA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACHA,KAAA,uBAAuB,EACjCA,KAAA,aAAc,GACtBA,KAAAC,SAAU,CAAA,CAE9CC,KAAAA,CAAMC,EAAcC,GAC1BJ,KAAKK,cAAc,IAAIC,YAAYH,EAAM,CAAEI,SAAS,EAAMC,UAAU,EAAMJ,OAAQA,GAAU,OAC9F,CAEA,YAAMK,GACJ,MAAMC,EAAc,CAClBC,WAAY,YAKd,OAHIX,KAAK,eACPU,EAAOE,SAAWZ,KAAK,cAElBU,CACT,CAEAG,QAAAA,GACE,MAAO,EACT,CAEAC,MAAAA,GACE,OAAId,KAAKC,QACAc,oBAAkB,OAAQ,IAAIf,KAAK,2BAA2BA,KAAK,kBAGrEgB,EAAAA,IAAA;;;;iCAIsBhB,KAAK,2BAA2BA,KAAK;;;UAG5DA,KAAK,eACHgB,EAAAA,IAAA;;yBAEY;wBACAhB,KAAK;kCACKA,KAAK;kCACN;+BACH;sBACR,IAAMA,KAAKE,MAAM;mBACnBe,GAAmBjB,KAAKE,MAAM,MAAOe,EAAEb;;UAG/C;;;KAIV,GA/DWT,QAAAA,WACJuB,OAAS,CAACC,EAAAA,kBAAmBC,EAAAA,GAAA;;;;;;KAQyBC,EAAA,CAA5DC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,UAAW,wBAT1B9B,QAAAA,WASkD+B,UAAA,qBAAA,GACRL,EAAA,CAApDC,EAAAA,SAAS,CAAEC,KAAMC,OAAQC,UAAW,gBAV1B9B,QAAAA,WAU0C+B,UAAA,aAAA,GACEL,EAAA,CAAtDC,EAAAA,SAAS,CAAEC,KAAMI,QAASF,UAAW,iBAX3B9B,QAAAA,WAW4C+B,UAAA,cAAA,GACHL,EAAA,CAAnDC,EAAAA,SAAS,CAAEC,KAAMI,QAASF,UAAW,cAZ3B9B,QAAAA,WAYyC+B,UAAA,WAAA,GACUL,EAAA,CAA7DC,EAAAA,SAAS,CAAEC,KAAMI,QAASF,UAAW,wBAb3B9B,QAAAA,WAamD+B,UAAA,qBAAA,GACVL,EAAA,CAAnDC,EAAAA,SAAS,CAAEC,KAAMK,OAAQH,UAAW,eAd1B9B,QAAAA,WAcyC+B,UAAA,YAAA,GACRL,EAAA,CAA3CC,EAAAA,SAAS,CAAEC,KAAMI,QAASE,SAAS,KAfzBlC,QAAAA,WAeiC+B,UAAA,UAAA,GAfjC/B,QAAAA,WAAN0B,EAAA,CADNS,EAAAA,kBAAkB,iBACNnC,QAAAA"}
|
package/lib/subject/scale.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./sorting-card.cjs"),o=require("./types.cjs"),a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?n(e,s):e,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&a(e,s,o),o};function p(){return{title:""}}function
|
|
1
|
+
"use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./sorting-card.cjs"),o=require("./types.cjs"),a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?n(e,s):e,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&a(e,s,o),o};function p(){return{title:""}}function h(){return Array.from({length:5},p)}function c(t){const e={...t,title:i.trimText(t?.title??t?.answer??"")},s=t?.answerId??t?.examAnswerId;return void 0!==s&&(e.answerId=s),delete e.answer,delete e.examAnswerId,delete e.isCorrect,e}function d(t,e){const s={...c(t),orderIndex:e+1,answer:i.trimText(t?.title??t?.answer??"")};return s.title=i.trimText(s.title??""),void 0!==s.answerId&&(s.examAnswerId=s.answerId),void 0===s.answerId&&delete s.answerId,delete s.isCorrect,s}const x=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>`,u=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>`;exports.QxsScale=class extends t.LitElement{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["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-analysis"]=!1,this.analysis="",this["rich-text-content"]="",this["exam-answer-relation-type"]=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._answers=h(),this._scaleQuestions=[],this._rowTitle="",this._title="",this._analysis="",this._showRichText=!1,this._richText="",this["model-value"]="",this["use-model"]=!1,this.TITLE_MAX=200}get"answer-list"(){return this._answers}set"answer-list"(t){const e=function(t){return Array.isArray(t)?t.map(c):[]}(t);this._answers=e.length?e:h(),this.requestUpdate("answer-list")}get"scale-question-list"(){return this._scaleQuestions}set"scale-question-list"(t){this._scaleQuestions=function(t){return Array.isArray(t)?t.map(t=>String(t??"").trim()).filter(Boolean):[]}(t),this.requestUpdate("scale-question-list")}get"scale-questions"(){return this._scaleQuestions}set"scale-questions"(t){this["scale-question-list"]=t,this.requestUpdate("scale-questions")}willUpdate(t){const e=t.has("title")||t.has("answer-list")||t.has("rich-text-content")||t.has("scale-question-list")||t.has("scale-questions");(t.has("is-edit")&&this["is-edit"]||!this["is-edit"]&&e)&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._rowTitle=this._scaleQuestions.join("\n"),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"]}_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}))}_resolvedQuestions(){const t=this["is-edit"]?this._rowTitle:this._scaleQuestions.join("\n");return t.split("\n").map(t=>t.trim()).filter(Boolean)}_resolvedAnswers(){const t=this["is-edit"]?this._answers:this["answer-list"];return Array.isArray(t)?t.map(c):[]}_createAnswerCountError(t){return new i.SubjectError("量表题选项数量必须在 3-5 个之间!","ANSWER_COUNT_INVALID","answers",t)}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:o.SubjectType.SCALE,orderIndex:this["order-index"]},r=i.trimText(this["is-edit"]?this._title:this.title||""),a=this._resolvedAnswers(),n=this._resolvedQuestions(),l=this["is-edit"]?this._richText:this["rich-text-content"]||"",p=this["show-rich-text"]&&(this["is-edit"]?this._showRichText:!!this["rich-text-content"]);if(!r)return void e(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",s));if(a.length<3||a.length>5)return void e(this._createAnswerCountError(s));for(let t=0;t<a.length;t++)if(!a[t].title)return void e(new i.SubjectError(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",s));if(0===n.length)return void e(new i.SubjectError("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",s));const h={answerType:o.SubjectType.SCALE,examTypeEnum:o.SubjectType.SCALE,title:r,answers:a.map(d),scaleQuestionList:n,analysis:i.trimText(this["is-edit"]?this._analysis:this.analysis||""),examRichTextContent:p?l:"",isSetCorrectAnswer:!1};this["custom-id"]&&(h.customId=this["custom-id"]),this["exam-answer-relation-type"]&&(h.examAnswerRelationType=this["exam-answer-relation-type"]),t(h)})}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){!function(t){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(e),setTimeout(()=>{e.style.opacity="0",setTimeout(()=>e.remove(),300)},2500)}(t.message)}}validate(){const t=[],e={customId:this["custom-id"]||void 0,answerType:o.SubjectType.SCALE,orderIndex:this["order-index"]},s=i.trimText(this["is-edit"]?this._title:this.title||""),r=this._resolvedAnswers(),a=this._resolvedQuestions();return s||t.push(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e)),r.length<3||r.length>5?(t.push(this._createAnswerCountError(e)),t):(r.forEach((s,r)=>{s.title||t.push(new i.SubjectError(`选项${String.fromCharCode(65+r)}未填写`,"ANSWER_EMPTY","answers",e))}),0===a.length&&t.push(new i.SubjectError("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e)),t)}_renderPreview(){const e=this._resolvedAnswers(),s=this._resolvedQuestions(),i=Math.floor(100/((e.length||1)+1));return t.html`
|
|
2
2
|
<div class="preview">
|
|
3
3
|
<span class="title">${this["order-index"]+1}.${this.title}(量表题)</span>
|
|
4
|
-
${this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
4
|
+
${this["show-rich-text"]&&this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
5
5
|
<div class="scale-table-wrap">
|
|
6
6
|
<table class="scale-table">
|
|
7
7
|
<thead>
|
|
8
8
|
<tr>
|
|
9
|
-
<th style="width:${
|
|
10
|
-
${
|
|
9
|
+
<th style="width:${i}%">问题 \ 选项</th>
|
|
10
|
+
${e.map(e=>t.html`<th style="width:${i}%">${e.title}</th>`)}
|
|
11
11
|
</tr>
|
|
12
12
|
</thead>
|
|
13
13
|
<tbody>
|
|
14
|
-
${
|
|
14
|
+
${s.map(s=>t.html`
|
|
15
15
|
<tr>
|
|
16
|
-
<td>${
|
|
17
|
-
${
|
|
16
|
+
<td>${s}</td>
|
|
17
|
+
${e.map(()=>t.html`<td><input type="radio" disabled /></td>`)}
|
|
18
18
|
</tr>
|
|
19
19
|
`)}
|
|
20
20
|
</tbody>
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
</div>
|
|
80
80
|
</div>
|
|
81
81
|
|
|
82
|
-
${this._showRichText?t.html`
|
|
82
|
+
${this["show-rich-text"]&&this._showRichText?t.html`
|
|
83
83
|
<div class="flex-items-start" style="margin-top:12px">
|
|
84
84
|
<div class="label"><span>副文本:</span></div>
|
|
85
85
|
<div style="flex:1">
|
|
@@ -102,6 +102,22 @@
|
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
104
|
`:""}
|
|
105
|
+
|
|
106
|
+
${this["show-analysis"]?t.html`
|
|
107
|
+
<div class="flex-items-start" style="margin-top:12px">
|
|
108
|
+
<div class="label"><span>解析:</span></div>
|
|
109
|
+
<div style="flex:1">
|
|
110
|
+
<div class="el-input">
|
|
111
|
+
<textarea
|
|
112
|
+
rows="2"
|
|
113
|
+
.value=${this._analysis}
|
|
114
|
+
@input=${t=>{this._analysis=t.target.value}}
|
|
115
|
+
placeholder="请输入题目解析"
|
|
116
|
+
></textarea>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
`:""}
|
|
105
121
|
`}_renderSorting(){const t=i.trimText(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=`${this["order-index"]+1}. ${t}`;return r.renderSortingCard(e,o.SubjectTypeLabel[o.SubjectType.SCALE]||o.SubjectType.SCALE)}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`
|
|
106
122
|
<qxs-subject-layout .show-edit=${this["is-edit"]}>
|
|
107
123
|
${e}
|
|
@@ -110,7 +126,10 @@
|
|
|
110
126
|
.is-edit=${this["is-edit"]}
|
|
111
127
|
.is-set=${this["is-set"]}
|
|
112
128
|
.show-add=${this["show-add"]}
|
|
113
|
-
.show-rich-text=${this._showRichText}
|
|
129
|
+
.show-rich-text=${this["show-rich-text"]&&this._showRichText}
|
|
130
|
+
.hide-add-rich-text=${!this["show-rich-text"]||this["hide-add-rich-text"]}
|
|
131
|
+
.show-delete-action=${this["show-delete-action"]}
|
|
132
|
+
.show-save-action=${this["show-save-action"]}
|
|
114
133
|
.show-other-option=${!1}
|
|
115
134
|
exam-answer-relation-type=${this["exam-answer-relation-type"]}
|
|
116
135
|
@delete=${()=>this._emit("delete")}
|
|
@@ -120,6 +139,7 @@
|
|
|
120
139
|
@on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
|
|
121
140
|
></qxs-subject-action>
|
|
122
141
|
`:""}
|
|
142
|
+
<slot name="action"></slot>
|
|
123
143
|
</qxs-subject-layout>
|
|
124
144
|
`}},exports.QxsScale.styles=[r.sortingCardStyles,t.css`
|
|
125
145
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
@@ -195,5 +215,5 @@
|
|
|
195
215
|
.answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
|
|
196
216
|
|
|
197
217
|
.row-title-textarea { height: 200px; }
|
|
198
|
-
`],l([e.property({type:Number,attribute:"order-index"})],exports.QxsScale.prototype,"order-index",2),l([e.property({type:String})],exports.QxsScale.prototype,"title",2),l([e.property({type:String,attribute:"custom-id"})],exports.QxsScale.prototype,"custom-id",2),l([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsScale.prototype,"is-edit",2),l([e.property({type:Boolean,attribute:"is-save"})],exports.QxsScale.prototype,"is-save",2),l([e.property({type:Boolean,attribute:"is-set"})],exports.QxsScale.prototype,"is-set",2),l([e.property({type:Boolean,attribute:"show-action"})],exports.QxsScale.prototype,"show-action",2),l([e.property({type:Boolean,attribute:"show-add"})],exports.QxsScale.prototype,"show-add",2),l([e.property({type:Boolean,reflect:!0})],exports.QxsScale.prototype,"sorting",2),l([e.property({type:String})],exports.QxsScale.prototype,"analysis",2),l([e.property({type:String,attribute:"rich-text-content"})],exports.QxsScale.prototype,"rich-text-content",2),l([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsScale.prototype,"exam-answer-relation-type",2),l([e.property({type:Object,attribute:"upload-image"})],exports.QxsScale.prototype,"upload-image",2),l([e.property({type:Array,attribute:"answer-list"})],exports.QxsScale.prototype,"answer-list",1),l([e.property({type:Array,attribute:"scale-question-list"})],exports.QxsScale.prototype,"scale-question-list",1),l([e.property({type:Array,attribute:"scale-questions"})],exports.QxsScale.prototype,"scale-questions",1),l([e.state()],exports.QxsScale.prototype,"_answers",2),l([e.state()],exports.QxsScale.prototype,"_scaleQuestions",2),l([e.state()],exports.QxsScale.prototype,"_rowTitle",2),l([e.state()],exports.QxsScale.prototype,"_title",2),l([e.state()],exports.QxsScale.prototype,"_showRichText",2),l([e.state()],exports.QxsScale.prototype,"_richText",2),l([e.property({type:String,attribute:"model-value"})],exports.QxsScale.prototype,"model-value",2),l([e.property({type:Boolean,attribute:"use-model"})],exports.QxsScale.prototype,"use-model",2),exports.QxsScale=l([s.safeCustomElement("qxs-scale")],exports.QxsScale);
|
|
218
|
+
`],l([e.property({type:Number,attribute:"order-index"})],exports.QxsScale.prototype,"order-index",2),l([e.property({type:String})],exports.QxsScale.prototype,"title",2),l([e.property({type:String,attribute:"custom-id"})],exports.QxsScale.prototype,"custom-id",2),l([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsScale.prototype,"is-edit",2),l([e.property({type:Boolean,attribute:"is-save"})],exports.QxsScale.prototype,"is-save",2),l([e.property({type:Boolean,attribute:"is-set"})],exports.QxsScale.prototype,"is-set",2),l([e.property({type:Boolean,attribute:"show-action"})],exports.QxsScale.prototype,"show-action",2),l([e.property({type:Boolean,attribute:"show-add"})],exports.QxsScale.prototype,"show-add",2),l([e.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsScale.prototype,"hide-add-rich-text",2),l([e.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsScale.prototype,"show-rich-text",2),l([e.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsScale.prototype,"show-delete-action",2),l([e.property({type:Boolean,attribute:"show-save-action"})],exports.QxsScale.prototype,"show-save-action",2),l([e.property({type:Boolean,reflect:!0})],exports.QxsScale.prototype,"sorting",2),l([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsScale.prototype,"show-analysis",2),l([e.property({type:String})],exports.QxsScale.prototype,"analysis",2),l([e.property({type:String,attribute:"rich-text-content"})],exports.QxsScale.prototype,"rich-text-content",2),l([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsScale.prototype,"exam-answer-relation-type",2),l([e.property({type:Object,attribute:"upload-image"})],exports.QxsScale.prototype,"upload-image",2),l([e.property({type:Array,attribute:"answer-list"})],exports.QxsScale.prototype,"answer-list",1),l([e.property({type:Array,attribute:"scale-question-list"})],exports.QxsScale.prototype,"scale-question-list",1),l([e.property({type:Array,attribute:"scale-questions"})],exports.QxsScale.prototype,"scale-questions",1),l([e.state()],exports.QxsScale.prototype,"_answers",2),l([e.state()],exports.QxsScale.prototype,"_scaleQuestions",2),l([e.state()],exports.QxsScale.prototype,"_rowTitle",2),l([e.state()],exports.QxsScale.prototype,"_title",2),l([e.state()],exports.QxsScale.prototype,"_analysis",2),l([e.state()],exports.QxsScale.prototype,"_showRichText",2),l([e.state()],exports.QxsScale.prototype,"_richText",2),l([e.property({type:String,attribute:"model-value"})],exports.QxsScale.prototype,"model-value",2),l([e.property({type:Boolean,attribute:"use-model"})],exports.QxsScale.prototype,"use-model",2),exports.QxsScale=l([s.safeCustomElement("qxs-scale")],exports.QxsScale);
|
|
199
219
|
//# sourceMappingURL=scale.cjs.map
|