@qxs-bns/components-wc 0.0.29 → 0.0.30
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/blank-fill.mjs +7 -7
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/scale.mjs +7 -7
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/single.mjs +10 -10
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/text-fill.mjs +6 -6
- package/es/subject/text-fill.mjs.map +1 -1
- package/es/subject/title-prefix.mjs +2 -0
- package/es/subject/title-prefix.mjs.map +1 -0
- package/lib/subject/blank-fill.cjs +6 -6
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/scale.cjs +6 -6
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/single.cjs +9 -9
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/text-fill.cjs +5 -5
- package/lib/subject/text-fill.cjs.map +1 -1
- package/lib/subject/title-prefix.cjs +2 -0
- package/lib/subject/title-prefix.cjs.map +1 -0
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{html as t,css as e,LitElement as i}from"lit";import{property as s,state as r}from"lit/decorators.js";import{safeCustomElement as a}from"../base/define.mjs";import{trimCommaSeparatedText as o,trimText as n,SubjectError as l}from"./single.mjs";import{sortingCardStyles as h,renderSortingCard as p}from"./sorting-card.mjs";import{
|
|
1
|
+
import{html as t,css as e,LitElement as i}from"lit";import{property as s,state as r}from"lit/decorators.js";import{safeCustomElement as a}from"../base/define.mjs";import{trimCommaSeparatedText as o,trimText as n,SubjectError as l}from"./single.mjs";import{sortingCardStyles as h,renderSortingCard as p}from"./sorting-card.mjs";import{joinSubjectTitle as c,resolveSubjectPrefix as d}from"./title-prefix.mjs";import{SubjectType as g,SubjectTypeLabel as x}from"./types.mjs";var u=Object.defineProperty,y=Object.getOwnPropertyDescriptor,m=(t,e,i,s)=>{for(var r,a=s>1?void 0:s?y(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s?r(e,i,a):r(a))||a);return s&&a&&u(e,i,a),a};const w=t`
|
|
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>`;let
|
|
5
|
+
</svg>`;let _=class extends i{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["hide-add-rich-text"]=!1,this["show-rich-text"]=!1,this["show-delete-action"]=!0,this["show-save-action"]=!0,this.sorting=!1,this["show-answer-setting"]=!1,this["show-analysis"]=!1,this["rich-text-content"]="",this.analysis="",this["exam-answer-relation-type"]=0,this["exam-expand"]="",this["exam-id"]=0,this["category-id"]="",this["exam-answer-setting"]={isInOrder:!1,isIgnoreCase:!0},this["upload-image"]=async t=>new Promise((e,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.readAsDataURL(t)}),this["answer-list"]=[],this["tag-list"]=[],this["category-list"]=[],this["resource-list"]=[],this["show-tag"]=!1,this["show-category"]=!1,this["show-resource"]=!1,this["model-value"]="",this["use-model"]=!1,this._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 o(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 i=(this._title.match(/ ______/g)||[]).length;if(i!==this._answers.length)if(i>this._answers.length)for(let t=this._answers.length;t<i;t++)this._answers=[...this._answers,{title:"",tag:"",showInput:!1}];else this._answers=this._answers.slice(0,i);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 i=e.title.split(","),s=i.findIndex(e=>e===t);s>-1&&(i.splice(s,1),e.title=i.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 i={customId:this["custom-id"]||void 0,answerType:"blank_fill",orderIndex:this["order-index"]},s=n(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),answerId:t?.answerId??t?.examAnswerId})),a=n(this["is-edit"]?this._analysis:this.analysis||""),o=this["is-edit"]?this._isInOrder:this["exam-answer-setting"]?.isInOrder??!1,h=this["is-edit"]?this._isIgnoreCase:this["exam-answer-setting"]?.isIgnoreCase??!0,p=this["is-edit"]?this._showRichText:!!this["rich-text-content"],c=this["is-edit"]?this._richText:this["rich-text-content"]||"",d=r.filter(t=>this._normalizeAnswerTitle(t));if(!s)return void e(new l("题目标题不能为空!","EMPTY_TITLE","title",i));if(r.length<1)return void e(new l("至少添加一个填空符!","NO_BLANK","answers",i));const x={answerType:g.BLANK_FILL,examTypeEnum:g.BLANK_FILL,title:s.replaceAll(/ ______/g,"<filter></filter>"),answers:d.map((t,e)=>{const i=this._normalizeAnswerTitle(t),s={title:i,answer:i,isCorrect:!0,orderIndex:e+1};return t.answerId&&(s.answerId=t.answerId,s.examAnswerId=t.answerId),s}),analysis:a,isSetCorrectAnswer:d.length>0,isKey:this["is-key"],examAnswerSettingBO:{isIgnoreCase:h,isInOrder:o},examAnswerSettingVO:{isIgnoreCase:h,isInOrder:o},examRichTextContent:p?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"]},i=n(this["is-edit"]?this._title:this.title?.replaceAll(/<filter><\/filter>/g," ______")||""),s=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)}));return i||t.push(new l("题目标题不能为空!","EMPTY_TITLE","title",e)),s.length<1&&t.push(new l("至少添加一个填空符!","NO_BLANK","answers",e)),t}_renderPreview(){const e=this.title.replaceAll(/<filter><\/filter>/g," ______"),i=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)})),s=c(d(this["subject-prefix"],`${this["order-index"]+1}.`),e);return t`
|
|
6
6
|
<div class="preview">
|
|
7
|
-
<span class="title">${
|
|
7
|
+
<span class="title">${s}(填空题)</span>
|
|
8
8
|
${this["show-rich-text"]&&this["rich-text-content"]?t`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
9
9
|
${i.some(t=>t.title)?t`
|
|
10
10
|
<div class="content flex flex-wrap">
|
|
@@ -45,7 +45,7 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
|
|
|
45
45
|
${e.length||i?.url?"":t`<div class="tag-hint">暂无资源</div>`}
|
|
46
46
|
</div>
|
|
47
47
|
</div>
|
|
48
|
-
`}_renderSorting(){const t=n(this["is-edit"]?this._title:this.title||"")||"未命名题目",e
|
|
48
|
+
`}_renderSorting(){const t=n(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=c(d(this["subject-prefix"],`${this["order-index"]+1}. `),t);return p(e,x[g.BLANK_FILL]||g.BLANK_FILL)}_renderEdit(){return t`
|
|
49
49
|
<div class="flex flex-items-start">
|
|
50
50
|
<div class="label"><span>题目:</span></div>
|
|
51
51
|
<div style="flex:1">
|
|
@@ -101,7 +101,7 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
|
|
|
101
101
|
@blur=${()=>this._handleAddTag(e)} />
|
|
102
102
|
`:t`
|
|
103
103
|
<span class="el-button--small" @click=${()=>{e.showInput=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".el-input--small")?.focus()})}}>
|
|
104
|
-
${
|
|
104
|
+
${w}
|
|
105
105
|
<span>${e.title?"添加同义词":"添加答案"}</span>
|
|
106
106
|
</span>
|
|
107
107
|
`}
|
|
@@ -166,7 +166,7 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
|
|
|
166
166
|
`:""}
|
|
167
167
|
<slot name="action"></slot>
|
|
168
168
|
</qxs-subject-layout>
|
|
169
|
-
`}};
|
|
169
|
+
`}};_.styles=[h,e`
|
|
170
170
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
171
171
|
*, ::before, ::after { box-sizing: border-box; }
|
|
172
172
|
|
|
@@ -270,5 +270,5 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
|
|
|
270
270
|
width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
|
|
271
271
|
border: 1px solid #e4e7ed; background: #f5f7fa;
|
|
272
272
|
}
|
|
273
|
-
`],
|
|
273
|
+
`],m([s({type:Number,attribute:"order-index"})],_.prototype,"order-index",2),m([s({type:String,attribute:"subject-prefix"})],_.prototype,"subject-prefix",2),m([s({type:String})],_.prototype,"title",2),m([s({type:String,attribute:"custom-id"})],_.prototype,"custom-id",2),m([s({type:Boolean,attribute:"is-edit"})],_.prototype,"is-edit",2),m([s({type:Boolean,attribute:"is-save"})],_.prototype,"is-save",2),m([s({type:Boolean,attribute:"is-set"})],_.prototype,"is-set",2),m([s({type:Boolean,attribute:"is-key"})],_.prototype,"is-key",2),m([s({type:Boolean,attribute:"show-action"})],_.prototype,"show-action",2),m([s({type:Boolean,attribute:"show-add"})],_.prototype,"show-add",2),m([s({type:Boolean,attribute:"hide-add-rich-text"})],_.prototype,"hide-add-rich-text",2),m([s({type:Boolean,attribute:"show-rich-text"})],_.prototype,"show-rich-text",2),m([s({type:Boolean,attribute:"show-delete-action"})],_.prototype,"show-delete-action",2),m([s({type:Boolean,attribute:"show-save-action"})],_.prototype,"show-save-action",2),m([s({type:Boolean,reflect:!0})],_.prototype,"sorting",2),m([s({type:Boolean,attribute:"show-answer-setting"})],_.prototype,"show-answer-setting",2),m([s({type:Boolean,attribute:"show-analysis"})],_.prototype,"show-analysis",2),m([s({type:String,attribute:"rich-text-content"})],_.prototype,"rich-text-content",2),m([s({type:String})],_.prototype,"analysis",2),m([s({type:Number,attribute:"exam-answer-relation-type"})],_.prototype,"exam-answer-relation-type",2),m([s({type:String,attribute:"exam-expand"})],_.prototype,"exam-expand",2),m([s({type:Number,attribute:"exam-id"})],_.prototype,"exam-id",2),m([s({type:String,attribute:"category-id"})],_.prototype,"category-id",2),m([s({type:Object,attribute:"exam-answer-setting"})],_.prototype,"exam-answer-setting",2),m([s({type:Object,attribute:"upload-image"})],_.prototype,"upload-image",2),m([s({type:Array,attribute:"answer-list"})],_.prototype,"answer-list",2),m([s({type:Array,attribute:"tag-list"})],_.prototype,"tag-list",2),m([s({type:Array,attribute:"category-list"})],_.prototype,"category-list",2),m([s({type:Array,attribute:"resource-list"})],_.prototype,"resource-list",2),m([s({type:Boolean,attribute:"show-tag"})],_.prototype,"show-tag",2),m([s({type:Boolean,attribute:"show-category"})],_.prototype,"show-category",2),m([s({type:Boolean,attribute:"show-resource"})],_.prototype,"show-resource",2),m([s({type:String,attribute:"model-value"})],_.prototype,"model-value",2),m([s({type:Boolean,attribute:"use-model"})],_.prototype,"use-model",2),m([r()],_.prototype,"_title",2),m([r()],_.prototype,"_analysis",2),m([r()],_.prototype,"_answers",2),m([r()],_.prototype,"_isInOrder",2),m([r()],_.prototype,"_isIgnoreCase",2),m([r()],_.prototype,"_showRichText",2),m([r()],_.prototype,"_richText",2),m([r()],_.prototype,"_selectedTagList",2),m([r()],_.prototype,"_categoryId",2),_=m([a("qxs-blank-fill")],_);export{_ as QxsBlankFill};
|
|
274
274
|
//# sourceMappingURL=blank-fill.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blank-fill.mjs","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":"ukBAcA,MAAMA,EAAWC,CAAA;;;;UAoBV,IAAMC,EAAN,cAA2BC,EAA3BC,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,EAC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EAAA,CAAxDC,EAAS,CAAEC,KAAM1F,QAAS4F,UAAW,mBApJ3BtL,EAoJ8CuL,UAAA,gBAAA,GAEHL,EAAA,CAArDC,EAAS,CAAEC,KAAMvI,OAAQyI,UAAW,iBAtJ1BtL,EAsJ2CuL,UAAA,cAAA,GACDL,EAAA,CAApDC,EAAS,CAAEC,KAAM1F,QAAS4F,UAAW,eAvJ3BtL,EAuJ0CuL,UAAA,YAAA,GAEpCL,EAAA,CAAhBO,KAzJUzL,EAyJMuL,UAAA,SAAA,GACAL,EAAA,CAAhBO,KA1JUzL,EA0JMuL,UAAA,YAAA,GACAL,EAAA,CAAhBO,KA3JUzL,EA2JMuL,UAAA,WAAA,GACAL,EAAA,CAAhBO,KA5JUzL,EA4JMuL,UAAA,aAAA,GACAL,EAAA,CAAhBO,KA7JUzL,EA6JMuL,UAAA,gBAAA,GACAL,EAAA,CAAhBO,KA9JUzL,EA8JMuL,UAAA,gBAAA,GACAL,EAAA,CAAhBO,KA/JUzL,EA+JMuL,UAAA,YAAA,GACAL,EAAA,CAAhBO,KAhKUzL,EAgKMuL,UAAA,mBAAA,GACAL,EAAA,CAAhBO,KAjKUzL,EAiKMuL,UAAA,cAAA,GAjKNvL,EAANkL,EAAA,CADNQ,EAAkB,mBACN1L"}
|
|
1
|
+
{"version":3,"file":"blank-fill.mjs","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 { joinSubjectTitle, resolveSubjectPrefix } from './title-prefix'\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, attribute: 'subject-prefix' }) 'subject-prefix'?: string\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 const previewTitle = joinSubjectTitle(\n resolveSubjectPrefix(this['subject-prefix'], `${this['order-index'] + 1}.`),\n displayTitle,\n )\n return html`\n <div class=\"preview\">\n <span class=\"title\">${previewTitle}(填空题)</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 = joinSubjectTitle(\n resolveSubjectPrefix(this['subject-prefix'], `${this['order-index'] + 1}. `),\n title,\n )\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","previewTitle","joinSubjectTitle","resolveSubjectPrefix","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":"upBAeA,MAAMA,EAAWC,CAAA;;;;UAoBV,IAAMC,EAAN,cAA2BC,EAA3BC,WAAAA,GAAAC,SAAAC,WA2GiDC,KAAA,eAAgB,EAE1CA,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,UAA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L,UAAA,gBAAA,GACAL,EAAA,CAAhBO,KA/JU5L,EA+JM0L,UAAA,gBAAA,GACAL,EAAA,CAAhBO,KAhKU5L,EAgKM0L,UAAA,YAAA,GACAL,EAAA,CAAhBO,KAjKU5L,EAiKM0L,UAAA,mBAAA,GACAL,EAAA,CAAhBO,KAlKU5L,EAkKM0L,UAAA,cAAA,GAlKN1L,EAANqL,EAAA,CADNQ,EAAkB,mBACN7L"}
|
package/es/subject/scale.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{html as t,css as e,LitElement as i}from"lit";import{property as s,state as o}from"lit/decorators.js";import{safeCustomElement as r}from"../base/define.mjs";import{SubjectError as a,trimText as n}from"./single.mjs";import{sortingCardStyles as l,renderSortingCard as h}from"./sorting-card.mjs";import{
|
|
1
|
+
import{html as t,css as e,LitElement as i}from"lit";import{property as s,state as o}from"lit/decorators.js";import{safeCustomElement as r}from"../base/define.mjs";import{SubjectError as a,trimText as n}from"./single.mjs";import{sortingCardStyles as l,renderSortingCard as h}from"./sorting-card.mjs";import{joinSubjectTitle as d,resolveSubjectPrefix as p}from"./title-prefix.mjs";import{SubjectType as c,SubjectTypeLabel as u}from"./types.mjs";var x=Object.defineProperty,w=Object.getOwnPropertyDescriptor,y=(t,e,i,s)=>{for(var o,r=s>1?void 0:s?w(e,i):e,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s?o(e,i,r):o(r))||r);return s&&r&&x(e,i,r),r};function m(){return{title:""}}function v(){return Array.from({length:5},m)}function f(t){const e={...t,title:n(t?.title??t?.answer??"")},i=t?.answerId??t?.examAnswerId;return void 0!==i&&(e.answerId=i),delete e.answer,delete e.examAnswerId,delete e.isCorrect,e}function g(t,e){const i={...f(t),orderIndex:e+1,answer:n(t?.title??t?.answer??"")};return i.title=n(i.title??""),void 0!==i.answerId&&(i.examAnswerId=i.answerId),void 0===i.answerId&&delete i.answerId,delete i.isCorrect,i}const b=t`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`,_=t`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>`;let T=class extends i{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["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,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.readAsDataURL(t)}),this._answers=v(),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(f):[]}(t);this._answers=e.length?e:v(),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(f):[]}_createAnswerCountError(t){return new a("量表题选项数量必须在 3-5 个之间!","ANSWER_COUNT_INVALID","answers",t)}async toJSON(){return new Promise((t,e)=>{const i={customId:this["custom-id"]||void 0,answerType:c.SCALE,orderIndex:this["order-index"]},s=n(this["is-edit"]?this._title:this.title||""),o=this._resolvedAnswers(),r=this._resolvedQuestions(),l=this["is-edit"]?this._richText:this["rich-text-content"]||"",h=this["show-rich-text"]&&(this["is-edit"]?this._showRichText:!!this["rich-text-content"]);if(!s)return void e(new a("题目标题不能为空!","EMPTY_TITLE","title",i));if(o.length<3||o.length>5)return void e(this._createAnswerCountError(i));for(let t=0;t<o.length;t++)if(!o[t].title)return void e(new a(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",i));if(0===r.length)return void e(new a("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",i));const d={answerType:c.SCALE,examTypeEnum:c.SCALE,title:s,answers:o.map(g),scaleQuestionList:r,analysis:n(this["is-edit"]?this._analysis:this.analysis||""),examRichTextContent:h?l:"",isSetCorrectAnswer:!1};this["custom-id"]&&(d.customId=this["custom-id"]),this["exam-answer-relation-type"]&&(d.examAnswerRelationType=this["exam-answer-relation-type"]),t(d)})}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:c.SCALE,orderIndex:this["order-index"]},i=n(this["is-edit"]?this._title:this.title||""),s=this._resolvedAnswers(),o=this._resolvedQuestions();return i||t.push(new a("题目标题不能为空!","EMPTY_TITLE","title",e)),s.length<3||s.length>5?(t.push(this._createAnswerCountError(e)),t):(s.forEach((i,s)=>{i.title||t.push(new a(`选项${String.fromCharCode(65+s)}未填写`,"ANSWER_EMPTY","answers",e))}),0===o.length&&t.push(new a("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e)),t)}_renderPreview(){const e=this._resolvedAnswers(),i=this._resolvedQuestions(),s=Math.floor(100/((e.length||1)+1)),o=d(p(this["subject-prefix"],`${this["order-index"]+1}.`),this.title);return t`
|
|
2
2
|
<div class="preview">
|
|
3
|
-
<span class="title">${
|
|
3
|
+
<span class="title">${o}(量表题)</span>
|
|
4
4
|
${this["show-rich-text"]&&this["rich-text-content"]?t`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
5
5
|
<div class="scale-table-wrap">
|
|
6
6
|
<table class="scale-table">
|
|
@@ -68,11 +68,11 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
|
|
|
68
68
|
<span
|
|
69
69
|
class="icon"
|
|
70
70
|
@click=${()=>{this._answers.length<5&&(this._answers=[...this._answers,{title:""}])}}
|
|
71
|
-
>${
|
|
71
|
+
>${b}</span>
|
|
72
72
|
<span
|
|
73
73
|
class="icon ${this._answers.length<3?"disabled":""}"
|
|
74
74
|
@click=${()=>{this._answers.length>3&&(this._answers=this._answers.filter((t,e)=>e!==i))}}
|
|
75
|
-
>${
|
|
75
|
+
>${_}</span>
|
|
76
76
|
</div>
|
|
77
77
|
`)}
|
|
78
78
|
</div>
|
|
@@ -118,7 +118,7 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
|
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
120
120
|
`:""}
|
|
121
|
-
`}_renderSorting(){const t=n(this["is-edit"]?this._title:this.title||"")||"未命名题目",e
|
|
121
|
+
`}_renderSorting(){const t=n(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=d(p(this["subject-prefix"],`${this["order-index"]+1}. `),t);return h(e,u[c.SCALE]||c.SCALE)}render(){if(this.sorting)return this._renderSorting();const e=this["is-edit"]?t`<div slot="edit">${this._renderEdit()}</div>`:t`<div slot="preview">${this._renderPreview()}</div>`;return t`
|
|
122
122
|
<qxs-subject-layout .show-edit=${this["is-edit"]}>
|
|
123
123
|
${e}
|
|
124
124
|
${this["show-action"]?t`
|
|
@@ -141,7 +141,7 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
|
|
|
141
141
|
`:""}
|
|
142
142
|
<slot name="action"></slot>
|
|
143
143
|
</qxs-subject-layout>
|
|
144
|
-
`}};
|
|
144
|
+
`}};T.styles=[l,e`
|
|
145
145
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
146
146
|
*, ::before, ::after { box-sizing: border-box; }
|
|
147
147
|
|
|
@@ -215,5 +215,5 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
|
|
|
215
215
|
.answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
|
|
216
216
|
|
|
217
217
|
.row-title-textarea { height: 200px; }
|
|
218
|
-
`],
|
|
218
|
+
`],y([s({type:Number,attribute:"order-index"})],T.prototype,"order-index",2),y([s({type:String,attribute:"subject-prefix"})],T.prototype,"subject-prefix",2),y([s({type:String})],T.prototype,"title",2),y([s({type:String,attribute:"custom-id"})],T.prototype,"custom-id",2),y([s({type:Boolean,attribute:"is-edit"})],T.prototype,"is-edit",2),y([s({type:Boolean,attribute:"is-save"})],T.prototype,"is-save",2),y([s({type:Boolean,attribute:"is-set"})],T.prototype,"is-set",2),y([s({type:Boolean,attribute:"show-action"})],T.prototype,"show-action",2),y([s({type:Boolean,attribute:"show-add"})],T.prototype,"show-add",2),y([s({type:Boolean,attribute:"hide-add-rich-text"})],T.prototype,"hide-add-rich-text",2),y([s({type:Boolean,attribute:"show-rich-text"})],T.prototype,"show-rich-text",2),y([s({type:Boolean,attribute:"show-delete-action"})],T.prototype,"show-delete-action",2),y([s({type:Boolean,attribute:"show-save-action"})],T.prototype,"show-save-action",2),y([s({type:Boolean,reflect:!0})],T.prototype,"sorting",2),y([s({type:Boolean,attribute:"show-analysis"})],T.prototype,"show-analysis",2),y([s({type:String})],T.prototype,"analysis",2),y([s({type:String,attribute:"rich-text-content"})],T.prototype,"rich-text-content",2),y([s({type:Number,attribute:"exam-answer-relation-type"})],T.prototype,"exam-answer-relation-type",2),y([s({type:Object,attribute:"upload-image"})],T.prototype,"upload-image",2),y([s({type:Array,attribute:"answer-list"})],T.prototype,"answer-list",1),y([s({type:Array,attribute:"scale-question-list"})],T.prototype,"scale-question-list",1),y([s({type:Array,attribute:"scale-questions"})],T.prototype,"scale-questions",1),y([o()],T.prototype,"_answers",2),y([o()],T.prototype,"_scaleQuestions",2),y([o()],T.prototype,"_rowTitle",2),y([o()],T.prototype,"_title",2),y([o()],T.prototype,"_analysis",2),y([o()],T.prototype,"_showRichText",2),y([o()],T.prototype,"_richText",2),y([s({type:String,attribute:"model-value"})],T.prototype,"model-value",2),y([s({type:Boolean,attribute:"use-model"})],T.prototype,"use-model",2),T=y([r("qxs-scale")],T);export{T as QxsScale};
|
|
219
219
|
//# sourceMappingURL=scale.mjs.map
|