@qxs-bns/components-wc 0.0.21 → 0.0.23
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/base/define.mjs +1 -1
- package/es/base/define.mjs.map +1 -1
- package/es/editor/blocksuite-editor.mjs +3 -3
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/editor/index.mjs +1 -1
- package/es/editor/index.mjs.map +1 -1
- package/es/entry-editor.mjs +2 -0
- package/es/entry-editor.mjs.map +1 -0
- package/es/entry-subject.mjs +2 -0
- package/es/entry-subject.mjs.map +1 -0
- package/es/index.mjs +1 -1
- package/es/subject/action.mjs +5 -5
- package/es/subject/action.mjs.map +1 -1
- package/es/subject/blank-fill.mjs +8 -8
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/layout.mjs +4 -4
- package/es/subject/layout.mjs.map +1 -1
- package/es/subject/list.mjs +77 -77
- package/es/subject/list.mjs.map +1 -1
- package/es/subject/page-end.mjs +7 -7
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/scale.mjs +7 -7
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/single.mjs +11 -11
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/text-fill.mjs +32 -32
- package/es/subject/text-fill.mjs.map +1 -1
- package/lib/base/define.cjs +1 -1
- package/lib/base/define.cjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +2 -2
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/editor/index.cjs +1 -1
- package/lib/editor/index.cjs.map +1 -1
- package/lib/entry-editor.cjs +2 -0
- package/lib/entry-editor.cjs.map +1 -0
- package/lib/entry-subject.cjs +2 -0
- package/lib/entry-subject.cjs.map +1 -0
- package/lib/index.cjs +1 -1
- package/lib/subject/action.cjs +2 -2
- package/lib/subject/action.cjs.map +1 -1
- package/lib/subject/blank-fill.cjs +9 -9
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/layout.cjs +4 -4
- package/lib/subject/layout.cjs.map +1 -1
- package/lib/subject/list.cjs +32 -32
- package/lib/subject/list.cjs.map +1 -1
- package/lib/subject/page-end.cjs +5 -5
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/scale.cjs +10 -10
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/single.cjs +14 -14
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/text-fill.cjs +40 -40
- package/lib/subject/text-fill.cjs.map +1 -1
- package/package.json +16 -1
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs +0 -7
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.mjs.map +0 -1
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs +0 -7
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.mjs.map +0 -1
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs +0 -7
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.mjs.map +0 -1
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs +0 -7
- package/es/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.mjs.map +0 -1
- package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs +0 -7
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.mjs.map +0 -1
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs +0 -7
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.mjs.map +0 -1
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs +0 -7
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.mjs.map +0 -1
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs +0 -7
- package/es/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.mjs.map +0 -1
- package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs +0 -2
- package/es/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs +0 -2
- package/es/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.mjs.map +0 -1
- package/es/subject/rich-text.mjs +0 -27
- package/es/subject/rich-text.mjs.map +0 -1
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs +0 -7
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.cjs.map +0 -1
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs +0 -7
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs.map +0 -1
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs +0 -7
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs.map +0 -1
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs +0 -7
- package/lib/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.cjs.map +0 -1
- package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.19.0_@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/@tiptap_extension-placeholder@3.20.5_@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5_/node_modules/@tiptap/extension-placeholder/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/@tiptap_extensions@3.19.0_@tiptap_core@3.19.0_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/@tiptap_extensions@3.20.5_@tiptap_core@3.20.5_@tiptap_pm@3.20.5__@tiptap_pm@3.20.5/node_modules/@tiptap/extensions/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs +0 -7
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.cjs.map +0 -1
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs +0 -7
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.cjs.map +0 -1
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs +0 -8
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.cjs.map +0 -1
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs +0 -7
- package/lib/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.cjs.map +0 -1
- package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/prosemirror-history@1.5.0/node_modules/prosemirror-history/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs +0 -2
- package/lib/node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.cjs.map +0 -1
- package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs +0 -2
- package/lib/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.cjs.map +0 -1
- package/lib/subject/rich-text.cjs +0 -27
- package/lib/subject/rich-text.cjs.map +0 -1
- package/types/base/define.d.ts +0 -1
- package/types/base/uid.d.ts +0 -1
- package/types/editor/blocksuite-editor.d.ts +0 -84
- package/types/editor/index.d.ts +0 -3
- package/types/index.d.ts +0 -4
- package/types/subject/action.d.ts +0 -23
- package/types/subject/blank-fill.d.ts +0 -49
- package/types/subject/index.d.ts +0 -20
- package/types/subject/layout.d.ts +0 -7
- package/types/subject/list.d.ts +0 -43
- package/types/subject/page-end.d.ts +0 -10
- package/types/subject/rich-text.d.ts +0 -30
- package/types/subject/scale.d.ts +0 -42
- package/types/subject/single.d.ts +0 -79
- package/types/subject/text-fill.d.ts +0 -54
- package/types/subject/type.d.ts +0 -7
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./types.cjs"),o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=(t,e,s,i)=>{for(var r,a=i>1?void 0:i?n(e,s):e,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(i?r(e,s,a):r(a))||a);return i&&a&&o(e,s,a),a};const l=[{bg:"#ecf5ff",color:"#3D61E3",border:"#d9ecff"},{bg:"#f0f9eb",color:"#67c23a",border:"#c2e7b0"},{bg:"#fdf6ec",color:"#e6a23c",border:"#faecd8"},{bg:"#fef0f0",color:"#f56c6c",border:"#fde2e2"},{bg:"#f4f4f5",color:"#909399",border:"#e9e9eb"}];exports.QxsTextFill=class extends t.LitElement{constructor(){super(...arguments),this._iconPlus=t.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`,this._iconRemove=t.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>`,this.orderIndex=0,this.title="",this.customId="",this.isEdit=!1,this.isSave=!1,this.isSet=!1,this.isKey=!1,this.showAction=!0,this.showAdd=!0,this.showAnswerSetting=!1,this.showAnalysis=!0,this.richTextContent="",this.analysis="",this.examAnswerRelationType=0,this.examExpand="",this.examAnswerSetting={isInOrder:!0,isIgnoreCase:!0,keywordCount:1},this.uploadImage=async t=>new Promise((e,s)=>{const i=new FileReader;i.onload=t=>e(t.target?.result),i.onerror=s,i.readAsDataURL(t)}),this.answerList=[],this.modelValue="",this.useModel=!1,this._answers=[{title:"",tag:"",showInput:!1}],this._title="",this._analysis="",this._isInOrder=!0,this._isIgnoreCase=!0,this._keywordCount=1,this._correct="",this._showRichText=!1,this._richText="",this.TITLE_MAX=200}willUpdate(t){t.has("isEdit")&&this.isEdit&&this._syncProps(),!this.isEdit&&(t.has("title")||t.has("answerList")||t.has("analysis")||t.has("examAnswerSetting")||t.has("richTextContent")||t.has("examExpand"))&&this._syncProps(),t.has("modelValue")&&this.useModel&&(this._title=this.modelValue)}_normalizeAnswerTitle(t){return String(t?.title??t?.answer??"")}_normalizedAnswerList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(Array.isArray(t)?t:[]).map(t=>({...t,answerId:t?.answerId??t?.examAnswerId,title:this._normalizeAnswerTitle(t)}))}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this.answerList?.length?this._answers=this._normalizedAnswerList(this.answerList).map(t=>({title:t.title||"",tag:"",showInput:!1,answerId:t.answerId,customAnswerId:t.customAnswerId})):this._answers=[{title:"",tag:"",showInput:!1}],this.examAnswerSetting&&(this._isInOrder=!!this.examAnswerSetting.isInOrder,this._isIgnoreCase=!!this.examAnswerSetting.isIgnoreCase,this._keywordCount=this.examAnswerSetting.keywordCount||1),this._richText=this.richTextContent||"",this._showRichText=!!this.richTextContent,this._correct=this.examExpand||""}_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.useModel&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}_addTag(t){const e={...this._answers[t]};e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag=""),e.showInput=!1,this._answers=this._answers.map((s,i)=>i===t?e:s)}_closeTag(t,e){const s={...this._answers[e]};s.title=s.title.split(",").filter(e=>e!==t).join(","),this._answers=this._answers.map((t,i)=>i===e?s:t)}async toJSON(){return new Promise((t,e)=>{const s={customId:this.customId||void 0,answerType:"text_fill",orderIndex:this.orderIndex},o=this.isEdit?this._title:this.title||"",n=this.isEdit?this._answers:this._normalizedAnswerList(this.answerList||[]),a=this.isEdit?this._analysis:this.analysis||"",l=this.isEdit?this._correct:this.examExpand||"",p=this.isEdit?this._keywordCount:this.examAnswerSetting?.keywordCount||1,d=this.isEdit?this._isInOrder:this.examAnswerSetting?.isInOrder??!0,h=this.isEdit?this._isIgnoreCase:this.examAnswerSetting?.isIgnoreCase??!0,c=this.isEdit?this._showRichText:!!this.richTextContent,x=this.isEdit?this._richText:this.richTextContent||"";if(!o)return void e(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",s));if(p||l){if(!p)return void e(new i.SubjectError("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",s));if(!l)return void e(new i.SubjectError("请输入问题正确答案!","NO_CORRECT_ANSWER","correct",s));if(n.length!==p)return void e(new i.SubjectError("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",s));const t=[];if(n.forEach((e,s)=>{this._normalizeAnswerTitle(e)||t.push(`关键词${s+1}未设置`)}),t.length)return void e(new i.SubjectError(t.join(","),"KEYWORD_EMPTY","answers",s))}const w={answerType:r.SubjectType.TEXT_FILL,title:o,answers:n.filter(t=>this._normalizeAnswerTitle(t)).map(t=>({title:this._normalizeAnswerTitle(t),...t.answerId?{answerId:t.answerId}:{},...t.customAnswerId?{customAnswerId:t.customAnswerId}:{}})),analysis:a,isSetCorrectAnswer:!!l,isKey:this.isKey,examExpand:l,examAnswerSettingBO:{isIgnoreCase:h,isInOrder:d,keywordCount:p},examRichTextContent:c?x:""};this.customId&&(w.customId=this.customId),t(w)})}_addAnswer(){this.isSave||(this._answers=[...this._answers,{title:"",tag:"",showInput:!1}])}_deleteAnswer(t){this._answers.length<2||this.isSave||(this._answers=this._answers.filter((e,s)=>s!==t))}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.customId||void 0,answerType:"text_fill",orderIndex:this.orderIndex},s=this.isEdit?this._title:this.title||"",r=this.isEdit?this._answers:this._normalizedAnswerList(this.answerList||[]),o=this.isEdit?this._correct:this.examExpand||"",n=this.isEdit?this._keywordCount:this.examAnswerSetting?.keywordCount||1;return s||t.push(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e)),(n||o)&&(n||t.push(new i.SubjectError("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",e)),o||t.push(new i.SubjectError("请输入问题正确答案!","NO_CORRECT_ANSWER","correct",e)),r.length!==n&&t.push(new i.SubjectError("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",e)),r.forEach((s,r)=>{this._normalizeAnswerTitle(s)||t.push(new i.SubjectError(`关键词${r+1}未设置`,"KEYWORD_EMPTY","answers",e))})),t}_renderPreview(){const e=this.isEdit?this._answers:this._normalizedAnswerList(this.answerList||[]),s=this.isEdit?this._correct:this.examExpand||"";return t.html`
|
|
2
2
|
<div class="preview">
|
|
3
3
|
<span class="title">${this.orderIndex+1}.${this.title}(问答题)</span>
|
|
4
|
-
${this.richTextContent?
|
|
5
|
-
${
|
|
4
|
+
${this.richTextContent?t.html`<div class="rich-text" .innerHTML=${this.richTextContent}></div>`:""}
|
|
5
|
+
${e.some(t=>t.title)?t.html`
|
|
6
6
|
<div style="margin-top:8px;color:#a8abb2">
|
|
7
|
-
${
|
|
8
|
-
<span style="margin-right:10px">关键词${s+1}: ${
|
|
7
|
+
${e.map((e,s)=>e.title?t.html`
|
|
8
|
+
<span style="margin-right:10px">关键词${s+1}: ${e.title}</span>
|
|
9
9
|
`:"")}
|
|
10
10
|
</div>
|
|
11
11
|
`:""}
|
|
12
|
-
${s?
|
|
13
|
-
${this.analysis?
|
|
12
|
+
${s?t.html`<div style="margin-top:8px;color:#a8abb2">正确答案:${s}</div>`:""}
|
|
13
|
+
${this.analysis?t.html`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
|
|
14
14
|
</div>
|
|
15
|
-
`}_renderEdit(){return
|
|
15
|
+
`}_renderEdit(){return t.html`
|
|
16
16
|
<div class="flex-items-start">
|
|
17
17
|
<div class="label"><span>题目:</span></div>
|
|
18
18
|
<div style="flex:1">
|
|
19
19
|
<div class="el-input">
|
|
20
20
|
<textarea rows="2" .value=${this._title} ?disabled=${this.isSave}
|
|
21
21
|
maxlength=${this.TITLE_MAX}
|
|
22
|
-
@input=${
|
|
22
|
+
@input=${t=>this._onTitleInput(t)}
|
|
23
23
|
placeholder="【问答题】请输入问题"></textarea>
|
|
24
24
|
<span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
|
-
${this.showAnswerSetting?
|
|
29
|
+
${this.showAnswerSetting?t.html`
|
|
30
30
|
<div class="flex-items-start" style="margin-top:12px">
|
|
31
31
|
<div class="label"><span>答题设置:</span></div>
|
|
32
32
|
<div style="flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px">
|
|
33
33
|
<span style="font-size:13px;color:#606266">共答对</span>
|
|
34
34
|
<input type="number" style="width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px"
|
|
35
35
|
.value=${String(this._keywordCount)} min="1"
|
|
36
|
-
@change=${
|
|
36
|
+
@change=${t=>{this._keywordCount=Number(t.target.value)}} />
|
|
37
37
|
<span style="font-size:13px;color:#606266">个关键词,算是正确的</span>
|
|
38
38
|
<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266">
|
|
39
39
|
<input type="checkbox" .checked=${this._isInOrder}
|
|
40
|
-
@change=${
|
|
40
|
+
@change=${t=>{this._isInOrder=t.target.checked}} />
|
|
41
41
|
答案不分顺序
|
|
42
42
|
</label>
|
|
43
43
|
<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266">
|
|
44
44
|
<input type="checkbox" .checked=${this._isIgnoreCase}
|
|
45
|
-
@change=${
|
|
45
|
+
@change=${t=>{this._isIgnoreCase=t.target.checked}} />
|
|
46
46
|
忽略大小写
|
|
47
47
|
</label>
|
|
48
48
|
</div>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<div class="el-input">
|
|
56
56
|
<textarea rows="2" .value=${this._correct} ?disabled=${this.isSave}
|
|
57
57
|
maxlength="200"
|
|
58
|
-
@input=${
|
|
58
|
+
@input=${t=>{this._correct=t.target.value}}
|
|
59
59
|
placeholder="请输入正确答案"></textarea>
|
|
60
60
|
<span class="char-counter">${this._correct.length}/200</span>
|
|
61
61
|
</div>
|
|
@@ -64,26 +64,26 @@
|
|
|
64
64
|
|
|
65
65
|
<div class="answer-list" style="margin-top:12px">
|
|
66
66
|
<span style="padding-left:60px;font-size:12px;color:#909399">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>
|
|
67
|
-
${this._answers.map((
|
|
67
|
+
${this._answers.map((e,s)=>t.html`
|
|
68
68
|
<div class="answer-item">
|
|
69
69
|
<span class="label">关键词${s+1}:</span>
|
|
70
70
|
<div class="answer-tags" style="display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px">
|
|
71
|
-
${
|
|
71
|
+
${e.title.split(",").filter(Boolean).map(e=>{const i=l[s%l.length];return t.html`
|
|
72
72
|
<span style="display:inline-flex;align-items:center;background:${i.bg};color:${i.color};border:1px solid ${i.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px">
|
|
73
|
-
${
|
|
74
|
-
${this.isSave?"":
|
|
73
|
+
${e}
|
|
74
|
+
${this.isSave?"":t.html`<span style="cursor:pointer;margin-left:4px;color:#909399" @click=${()=>this._closeTag(e,s)}>×</span>`}
|
|
75
75
|
</span>
|
|
76
76
|
`})}
|
|
77
|
-
${this.isSave?"":
|
|
78
|
-
${
|
|
77
|
+
${this.isSave?"":t.html`
|
|
78
|
+
${e.showInput?t.html`
|
|
79
79
|
<input type="text" style="width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px"
|
|
80
|
-
@keydown=${
|
|
81
|
-
@input=${
|
|
80
|
+
@keydown=${t=>{"Enter"===t.key&&this._addTag(s)}}
|
|
81
|
+
@input=${t=>{e.tag=t.target.value}}
|
|
82
82
|
@blur=${()=>this._addTag(s)} />
|
|
83
83
|
<button class="el-link" @click=${()=>this._addTag(s)}>确认</button>
|
|
84
|
-
`:
|
|
85
|
-
<button class="link" @click=${()=>{this._answers=this._answers.map((e
|
|
86
|
-
${
|
|
84
|
+
`:t.html`
|
|
85
|
+
<button class="link" @click=${()=>{this._answers=this._answers.map((t,e)=>e===s?{...t,showInput:!0}:t),this.updateComplete.then(()=>{this.shadowRoot?.querySelector('input[style*="width:80px"]')?.focus()})}}>
|
|
86
|
+
${e.title?"添加同义词":"添加关键词"}
|
|
87
87
|
</button>
|
|
88
88
|
`}
|
|
89
89
|
`}
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
`)}
|
|
95
95
|
</div>
|
|
96
96
|
|
|
97
|
-
${this._showRichText?
|
|
97
|
+
${this._showRichText?t.html`
|
|
98
98
|
<div class="flex-items-start" style="margin-top:12px">
|
|
99
99
|
<div class="label"><span>富文本:</span></div>
|
|
100
100
|
<div style="flex:1">
|
|
@@ -103,44 +103,44 @@
|
|
|
103
103
|
.uploadImage=${this.uploadImage}
|
|
104
104
|
?is-edit=${!0}
|
|
105
105
|
></qxs-blocksuite-editor>
|
|
106
|
-
${this.showAction?"":
|
|
106
|
+
${this.showAction?"":t.html`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
`:""}
|
|
110
110
|
|
|
111
|
-
${this.showAnalysis?
|
|
111
|
+
${this.showAnalysis?t.html`
|
|
112
112
|
<div class="flex-items-start" style="margin-top:12px">
|
|
113
113
|
<div class="label"><span>解析:</span></div>
|
|
114
114
|
<div style="flex:1">
|
|
115
115
|
<div class="el-input">
|
|
116
116
|
<textarea rows="2" .value=${this._analysis}
|
|
117
|
-
@input=${
|
|
117
|
+
@input=${t=>{this._analysis=t.target.value}}
|
|
118
118
|
placeholder="请输入题目解析"></textarea>
|
|
119
119
|
</div>
|
|
120
120
|
</div>
|
|
121
121
|
</div>
|
|
122
122
|
`:""}
|
|
123
|
-
`}render(){return
|
|
124
|
-
<qxs-subject-layout
|
|
123
|
+
`}render(){return t.html`
|
|
124
|
+
<qxs-subject-layout .showEdit=${this.isEdit}>
|
|
125
125
|
<div slot="preview">${this._renderPreview()}</div>
|
|
126
126
|
<div slot="edit">${this._renderEdit()}</div>
|
|
127
|
-
${this.showAction?
|
|
127
|
+
${this.showAction?t.html`
|
|
128
128
|
<qxs-subject-action
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
.isEdit=${this.isEdit}
|
|
130
|
+
.isSet=${this.isSet}
|
|
131
|
+
.showAdd=${this.showAdd}
|
|
132
|
+
.showRichText=${this._showRichText}
|
|
133
133
|
exam-answer-relation-type=${this.examAnswerRelationType}
|
|
134
134
|
@delete=${()=>this._emit("delete")}
|
|
135
135
|
@save=${this._save}
|
|
136
136
|
@edit=${()=>this._emit("edit")}
|
|
137
|
-
@add=${
|
|
138
|
-
@set-key=${
|
|
137
|
+
@add=${t=>this._emit("add",t.detail)}
|
|
138
|
+
@set-key=${t=>{this._emit("set-key",t.detail)}}
|
|
139
139
|
@on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
|
|
140
140
|
></qxs-subject-action>
|
|
141
141
|
`:""}
|
|
142
142
|
</qxs-subject-layout>
|
|
143
|
-
`}},exports.QxsTextFill.styles=
|
|
143
|
+
`}},exports.QxsTextFill.styles=t.css`
|
|
144
144
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
145
145
|
*, ::before, ::after { box-sizing: border-box; }
|
|
146
146
|
|
|
@@ -229,5 +229,5 @@
|
|
|
229
229
|
.modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }
|
|
230
230
|
.modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }
|
|
231
231
|
.modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }
|
|
232
|
-
`,
|
|
232
|
+
`,a([e.property({type:Number,attribute:"order-index"})],exports.QxsTextFill.prototype,"orderIndex",2),a([e.property({type:String})],exports.QxsTextFill.prototype,"title",2),a([e.property({type:String,attribute:"custom-id"})],exports.QxsTextFill.prototype,"customId",2),a([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsTextFill.prototype,"isEdit",2),a([e.property({type:Boolean,attribute:"is-save"})],exports.QxsTextFill.prototype,"isSave",2),a([e.property({type:Boolean,attribute:"is-set"})],exports.QxsTextFill.prototype,"isSet",2),a([e.property({type:Boolean,attribute:"is-key"})],exports.QxsTextFill.prototype,"isKey",2),a([e.property({type:Boolean,attribute:"show-action"})],exports.QxsTextFill.prototype,"showAction",2),a([e.property({type:Boolean,attribute:"show-add"})],exports.QxsTextFill.prototype,"showAdd",2),a([e.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsTextFill.prototype,"showAnswerSetting",2),a([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsTextFill.prototype,"showAnalysis",2),a([e.property({type:String,attribute:"rich-text-content"})],exports.QxsTextFill.prototype,"richTextContent",2),a([e.property({type:String})],exports.QxsTextFill.prototype,"analysis",2),a([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsTextFill.prototype,"examAnswerRelationType",2),a([e.property({type:String,attribute:"exam-expand"})],exports.QxsTextFill.prototype,"examExpand",2),a([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsTextFill.prototype,"examAnswerSetting",2),a([e.property({type:Object})],exports.QxsTextFill.prototype,"uploadImage",2),a([e.property({type:Array,attribute:"answer-list"})],exports.QxsTextFill.prototype,"answerList",2),a([e.property({type:String,attribute:"model-value"})],exports.QxsTextFill.prototype,"modelValue",2),a([e.property({type:Boolean,attribute:"use-model"})],exports.QxsTextFill.prototype,"useModel",2),a([e.state()],exports.QxsTextFill.prototype,"_answers",2),a([e.state()],exports.QxsTextFill.prototype,"_title",2),a([e.state()],exports.QxsTextFill.prototype,"_analysis",2),a([e.state()],exports.QxsTextFill.prototype,"_isInOrder",2),a([e.state()],exports.QxsTextFill.prototype,"_isIgnoreCase",2),a([e.state()],exports.QxsTextFill.prototype,"_keywordCount",2),a([e.state()],exports.QxsTextFill.prototype,"_correct",2),a([e.state()],exports.QxsTextFill.prototype,"_showRichText",2),a([e.state()],exports.QxsTextFill.prototype,"_richText",2),exports.QxsTextFill=a([s.safeCustomElement("qxs-text-fill")],exports.QxsTextFill);
|
|
233
233
|
//# sourceMappingURL=text-fill.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-fill.cjs","sources":["../../../../packages/components-wc/src/subject/text-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\n\ninterface TextAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n customAnswerId?: string | number\n}\n\nconst TAG_COLORS = [\n { bg: '#ecf5ff', color: '#3D61E3', border: '#d9ecff' }, // primary\n { bg: '#f0f9eb', color: '#67c23a', border: '#c2e7b0' }, // success\n { bg: '#fdf6ec', color: '#e6a23c', border: '#faecd8' }, // warning\n { bg: '#fef0f0', color: '#f56c6c', border: '#fde2e2' }, // danger\n { bg: '#f4f4f5', color: '#909399', border: '#e9e9eb' }, // info\n]\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-text-fill')\nexport class QxsTextFill extends LitElement {\n private readonly _iconPlus = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n private readonly _iconRemove = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n\n static styles = 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-answer { display: flex; flex-direction: column; margin-top: 12px; }\n .preview-answer .radio { margin-top: 8px; padding-left: 8px; display: flex; align-items: center; gap: 6px; }\n .preview-answer .order { color: #909399; }\n .preview-answer .correct { color: #67c23a; }\n .preview-answer .result-info { color: #909399; }\n\n .flex { display: flex; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 60px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 360px; position: relative; display: block; }\n .answer-item .input input {\n height: 32px; padding: 0 50px 0 8px;\n font-size: 13px; line-height: 32px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n transition: border-color .2s; box-sizing: border-box;\n }\n .answer-item .input input:focus { border-color: #3D61E3; outline: none; }\n .answer-item .input input:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .answer-item .input .char-counter {\n position: absolute; right: 8px; top: 50%; transform: translateY(-50%);\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-item .correct { margin: 0 10px; color: #909399; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }\n .answer-item .correct:hover { color: #3D61E3; }\n .answer-item .correct.is-correct { color: #67c23a; }\n .answer-item .correct input { width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3; }\n\n .answer-item .icon {\n margin-left: 6px; cursor: pointer; display: inline-flex;\n align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 4px;\n border: 1px solid #dcdfe6; background: #fff; color: #909399;\n transition: all 0.2s;\n }\n .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }\n\n .answer-item .link { margin-left: 8px; color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .answer-item .link { color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; line-height: 1; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; }\n .modal { background: #fff; border-radius: 6px; width: 520px; max-width: 90vw; box-shadow: 0 12px 32px rgba(0,0,0,.12); display: flex; flex-direction: column; }\n .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #e4e7ed; }\n .modal-title { font-size: 14px; font-weight: 600; color: #303133; }\n .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }\n .modal-close:hover { color: #3D61E3; }\n .modal-body { padding: 20px; }\n .modal-body textarea { min-height: 120px; }\n .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e4e7ed; }\n .modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid #dcdfe6; background: #fff; color: #606266; }\n .modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }\n .modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }\n `\n\n @property({ type: Number, attribute: 'order-index' }) orderIndex = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) customId = ''\n @property({ type: Boolean, attribute: 'is-edit' }) isEdit = false\n @property({ type: Boolean, attribute: 'is-save' }) isSave = false\n @property({ type: Boolean, attribute: 'is-set' }) isSet = false\n @property({ type: Boolean, attribute: 'is-key' }) isKey = false\n @property({ type: Boolean, attribute: 'show-action' }) showAction = true\n @property({ type: Boolean, attribute: 'show-add' }) showAdd = true\n @property({ type: Boolean, attribute: 'show-answer-setting' }) showAnswerSetting = false\n @property({ type: Boolean, attribute: 'show-analysis' }) showAnalysis = true\n @property({ type: String, attribute: 'rich-text-content' }) richTextContent = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n @property({ type: String, attribute: 'exam-expand' }) examExpand = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n examAnswerSetting: { isInOrder: boolean, isIgnoreCase: boolean, keywordCount: number } = { isInOrder: true, isIgnoreCase: true, keywordCount: 1 }\n @property({ type: Object })\n uploadImage: (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' }) answerList: any[] = []\n\n // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) modelValue = ''\n @property({ type: Boolean, attribute: 'use-model' }) useModel = false\n\n @state() private _answers: TextAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _isInOrder = true\n @state() private _isIgnoreCase = true\n @state() private _keywordCount = 1\n @state() private _correct = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n\n private readonly TITLE_MAX = 200\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n if (!this.isEdit && (changed.has('title') || changed.has('answerList') || changed.has('analysis') || changed.has('examAnswerSetting') || changed.has('richTextContent') || changed.has('examExpand'))) {\n this._syncProps()\n }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('modelValue') && this.useModel) {\n this._title = this.modelValue\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return String(answer?.title ?? answer?.answer ?? '')\n }\n\n private _normalizedAnswerList(source: any[] = []) {\n return (Array.isArray(source) ? source : []).map((answer: any) => ({\n ...answer,\n answerId: answer?.answerId ?? answer?.examAnswerId,\n title: this._normalizeAnswerTitle(answer),\n }))\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n if (this.answerList?.length) {\n this._answers = this._normalizedAnswerList(this.answerList).map((a: any) => ({\n title: a.title || '',\n tag: '',\n showInput: false,\n answerId: a.answerId,\n customAnswerId: a.customAnswerId,\n }))\n }\n else {\n this._answers = [{ title: '', tag: '', showInput: false }]\n }\n if (this.examAnswerSetting) {\n this._isInOrder = !!this.examAnswerSetting.isInOrder\n this._isIgnoreCase = !!this.examAnswerSetting.isIgnoreCase\n this._keywordCount = this.examAnswerSetting.keywordCount || 1\n }\n this._richText = this.richTextContent || ''\n this._showRichText = !!this.richTextContent\n this._correct = this.examExpand || ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n // 双向绑定:通知外部更新\n if (this.useModel) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private _addTag(i: number) {\n const a = { ...this._answers[i] }\n if (a.tag) {\n a.title = a.title ? [a.title, a.tag].join(',') : a.tag\n a.tag = ''\n }\n a.showInput = false\n this._answers = this._answers.map((x, j) => j === i ? a : x)\n }\n\n private _closeTag(tag: string, i: number) {\n const a = { ...this._answers[i] }\n a.title = a.title.split(',').filter(t => t !== tag).join(',')\n this._answers = this._answers.map((x, j) => j === i ? a : x)\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this.customId || undefined, answerType: 'text_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : this._normalizedAnswerList(this.answerList || [])\n const analysis = this.isEdit ? this._analysis : this.analysis || ''\n const correct = this.isEdit ? this._correct : (this as any).examExpand || ''\n const keywordCount = this.isEdit ? this._keywordCount : this.examAnswerSetting?.keywordCount || 1\n const isInOrder = this.isEdit ? this._isInOrder : this.examAnswerSetting?.isInOrder ?? true\n const isIgnoreCase = this.isEdit ? this._isIgnoreCase : this.examAnswerSetting?.isIgnoreCase ?? true\n const showRichText = this.isEdit ? this._showRichText : !!this.richTextContent\n const richText = this.isEdit ? this._richText : this.richTextContent || ''\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (keywordCount || correct) {\n if (!keywordCount) {\n reject(new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row))\n return\n }\n if (!correct) {\n reject(new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row))\n return\n }\n if (answers.length !== keywordCount) {\n reject(new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row))\n return\n }\n const msg: string[] = []\n answers.forEach((item: any, i: number) => {\n if (!this._normalizeAnswerTitle(item)) { msg.push(`关键词${i + 1}未设置`) }\n })\n if (msg.length) {\n reject(new SubjectError(msg.join(','), 'KEYWORD_EMPTY', 'answers', row))\n return\n }\n }\n const result: any = {\n answerType: SubjectType.TEXT_FILL,\n title,\n answers: answers\n .filter((a: any) => this._normalizeAnswerTitle(a))\n .map((a: any) => ({\n title: this._normalizeAnswerTitle(a),\n ...(a.answerId ? { answerId: a.answerId } : {}),\n ...(a.customAnswerId ? { customAnswerId: a.customAnswerId } : {}),\n })),\n analysis,\n isSetCorrectAnswer: !!correct,\n isKey: this.isKey,\n examExpand: correct,\n examAnswerSettingBO: { isIgnoreCase, isInOrder, keywordCount },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this.customId) { result.customId = this.customId }\n resolve(result)\n })\n }\n\n private _addAnswer() {\n if (this.isSave) { return }\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 2 || this.isSave) { return }\n this._answers = this._answers.filter((_, i) => i !== index)\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.customId || undefined, answerType: 'text_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : this._normalizedAnswerList(this.answerList || [])\n const correct = this.isEdit ? this._correct : (this as any).examExpand || ''\n const keywordCount = this.isEdit ? this._keywordCount : this.examAnswerSetting?.keywordCount || 1\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (keywordCount || correct) {\n if (!keywordCount) {\n errors.push(new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row))\n }\n if (!correct) {\n errors.push(new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row))\n }\n if (answers.length !== keywordCount) {\n errors.push(new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row))\n }\n answers.forEach((item: any, i: number) => {\n if (!this._normalizeAnswerTitle(item)) {\n errors.push(new SubjectError(`关键词${i + 1}未设置`, 'KEYWORD_EMPTY', 'answers', row))\n }\n })\n }\n\n return errors\n }\n\n private _renderPreview() {\n const previewAnswers = this.isEdit ? this._answers : this._normalizedAnswerList(this.answerList || [])\n const previewCorrect = this.isEdit ? this._correct : (this.examExpand || '')\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this.orderIndex + 1}.${this.title}(问答题)</span>\n ${this.richTextContent ? html`<div class=\"rich-text\" .innerHTML=${this.richTextContent}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div style=\"margin-top:8px;color:#a8abb2\">\n ${previewAnswers.map((a, i) => a.title\n ? html`\n <span style=\"margin-right:10px\">关键词${i + 1}: ${a.title}</span>\n `\n : '')}\n </div>\n `\n : ''}\n ${previewCorrect ? html`<div style=\"margin-top:8px;color:#a8abb2\">正确答案:${previewCorrect}</div>` : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title} ?disabled=${this.isSave}\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 ${this.showAnswerSetting\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <div style=\"flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px\">\n <span style=\"font-size:13px;color:#606266\">共答对</span>\n <input type=\"number\" style=\"width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px\"\n .value=${String(this._keywordCount)} min=\"1\"\n @change=${(e: Event) => { this._keywordCount = Number((e.target as HTMLInputElement).value) }} />\n <span style=\"font-size:13px;color:#606266\">个关键词,算是正确的</span>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n </div>\n `\n : ''}\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答案:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._correct} ?disabled=${this.isSave}\n maxlength=\"200\"\n @input=${(e: Event) => { this._correct = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入正确答案\"></textarea>\n <span class=\"char-counter\">${this._correct.length}/200</span>\n </div>\n </div>\n </div>\n\n <div class=\"answer-list\" style=\"margin-top:12px\">\n <span style=\"padding-left:60px;font-size:12px;color:#909399\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\">\n <span class=\"label\">关键词${i + 1}:</span>\n <div class=\"answer-tags\" style=\"display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px\">\n ${a.title.split(',').filter(Boolean).map((tag) => {\n const c = TAG_COLORS[i % TAG_COLORS.length]; return html`\n <span style=\"display:inline-flex;align-items:center;background:${c.bg};color:${c.color};border:1px solid ${c.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px\">\n ${tag}\n ${!this.isSave ? html`<span style=\"cursor:pointer;margin-left:4px;color:#909399\" @click=${() => this._closeTag(tag, i)}>×</span>` : ''}\n </span>\n `\n })}\n ${!this.isSave\n ? html`\n ${a.showInput\n ? html`\n <input type=\"text\" style=\"width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._addTag(i) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._addTag(i)} />\n <button class=\"el-link\" @click=${() => this._addTag(i)}>确认</button>\n `\n : html`\n <button class=\"link\" @click=${() => { this._answers = this._answers.map((x, j) => j === i ? { ...x, showInput: true } : x); this.updateComplete.then(() => { (this.shadowRoot?.querySelector(`input[style*=\"width:80px\"]`) as HTMLInputElement)?.focus() }) }}>\n ${a.title ? '添加同义词' : '添加关键词'}\n </button>\n `}\n `\n : ''}\n </div>\n <span class=\"icon ${this.isSave ? 'disabled' : ''}\" @click=${() => this._addAnswer()}>${this._iconPlus}</span>\n <span class=\"icon ${this.isSave || this._answers.length < 2 ? 'disabled' : ''}\" @click=${() => this._deleteAnswer(i)}>${this._iconRemove}</span>\n </div>\n `)}\n </div>\n\n ${this._showRichText\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .uploadImage=${this.uploadImage}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n ${!this.showAction\n ? html`<div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>`\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this.showAnalysis\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout ?show-edit=${this.isEdit}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this.showAction\n ? html`\n <qxs-subject-action\n ?is-edit=${this.isEdit}\n ?is-set=${this.isSet}\n ?show-add=${this.showAdd}\n ?show-rich-text=${this._showRichText}\n exam-answer-relation-type=${this.examAnswerRelationType}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["TAG_COLORS","bg","color","border","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","orderIndex","title","customId","isEdit","isSave","isSet","isKey","showAction","showAdd","showAnswerSetting","showAnalysis","richTextContent","analysis","examAnswerRelationType","examExpand","examAnswerSetting","isInOrder","isIgnoreCase","keywordCount","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","answerList","modelValue","useModel","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","TITLE_MAX","willUpdate","changed","has","_syncProps","_normalizeAnswerTitle","answer","String","_normalizedAnswerList","source","length","undefined","Array","isArray","map","answerId","examAnswerId","a","customAnswerId","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","slice","_addTag","i","join","x","j","_closeTag","split","filter","t","toJSON","row","answerType","answers","correct","showRichText","richText","SubjectError","msg","forEach","item","push","SubjectType","TEXT_FILL","isSetCorrectAnswer","examAnswerSettingBO","examRichTextContent","_addAnswer","_deleteAnswer","index","_","_save","stopImmediatePropagation","data","err","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","_renderPreview","previewAnswers","previewCorrect","some","_renderEdit","Number","checked","Boolean","c","key","updateComplete","then","shadowRoot","querySelector","focus","render","styles","css","__decorateClass","property","type","attribute","prototype","state","safeCustomElement"],"mappings":"kiBAcA,MAAMA,EAAa,CACjB,CAAEC,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CA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AAA,CAAhBK,EAAAA,SAhIUzK,QAAAA,YAgIMwK,UAAA,WAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAjIUzK,QAAAA,YAiIMwK,UAAA,SAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAlIUzK,QAAAA,YAkIMwK,UAAA,YAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAnIUzK,QAAAA,YAmIMwK,UAAA,aAAA,GACAJ,EAAA,CAAhBK,EAAAA,SApIUzK,QAAAA,YAoIMwK,UAAA,gBAAA,GACAJ,EAAA,CAAhBK,EAAAA,SArIUzK,QAAAA,YAqIMwK,UAAA,gBAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAtIUzK,QAAAA,YAsIMwK,UAAA,WAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAvIUzK,QAAAA,YAuIMwK,UAAA,gBAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAxIUzK,QAAAA,YAwIMwK,UAAA,YAAA,GAxINxK,QAAAA,YAANoK,EAAA,CADNM,EAAAA,kBAAkB,kBACN1K,QAAAA"}
|
|
1
|
+
{"version":3,"file":"text-fill.cjs","sources":["../../../../packages/components-wc/src/subject/text-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\n\ninterface TextAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n customAnswerId?: string | number\n}\n\nconst TAG_COLORS = [\n { bg: '#ecf5ff', color: '#3D61E3', border: '#d9ecff' }, // primary\n { bg: '#f0f9eb', color: '#67c23a', border: '#c2e7b0' }, // success\n { bg: '#fdf6ec', color: '#e6a23c', border: '#faecd8' }, // warning\n { bg: '#fef0f0', color: '#f56c6c', border: '#fde2e2' }, // danger\n { bg: '#f4f4f5', color: '#909399', border: '#e9e9eb' }, // info\n]\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-text-fill')\nexport class QxsTextFill extends LitElement {\n private readonly _iconPlus = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n private readonly _iconRemove = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\n\n static styles = 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-answer { display: flex; flex-direction: column; margin-top: 12px; }\n .preview-answer .radio { margin-top: 8px; padding-left: 8px; display: flex; align-items: center; gap: 6px; }\n .preview-answer .order { color: #909399; }\n .preview-answer .correct { color: #67c23a; }\n .preview-answer .result-info { color: #909399; }\n\n .flex { display: flex; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 60px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 360px; position: relative; display: block; }\n .answer-item .input input {\n height: 32px; padding: 0 50px 0 8px;\n font-size: 13px; line-height: 32px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n transition: border-color .2s; box-sizing: border-box;\n }\n .answer-item .input input:focus { border-color: #3D61E3; outline: none; }\n .answer-item .input input:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .answer-item .input .char-counter {\n position: absolute; right: 8px; top: 50%; transform: translateY(-50%);\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-item .correct { margin: 0 10px; color: #909399; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }\n .answer-item .correct:hover { color: #3D61E3; }\n .answer-item .correct.is-correct { color: #67c23a; }\n .answer-item .correct input { width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3; }\n\n .answer-item .icon {\n margin-left: 6px; cursor: pointer; display: inline-flex;\n align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 4px;\n border: 1px solid #dcdfe6; background: #fff; color: #909399;\n transition: all 0.2s;\n }\n .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }\n\n .answer-item .link { margin-left: 8px; color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .answer-item .link { color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; line-height: 1; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; }\n .modal { background: #fff; border-radius: 6px; width: 520px; max-width: 90vw; box-shadow: 0 12px 32px rgba(0,0,0,.12); display: flex; flex-direction: column; }\n .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #e4e7ed; }\n .modal-title { font-size: 14px; font-weight: 600; color: #303133; }\n .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }\n .modal-close:hover { color: #3D61E3; }\n .modal-body { padding: 20px; }\n .modal-body textarea { min-height: 120px; }\n .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e4e7ed; }\n .modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid #dcdfe6; background: #fff; color: #606266; }\n .modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }\n .modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }\n `\n\n @property({ type: Number, attribute: 'order-index' }) orderIndex = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) customId = ''\n @property({ type: Boolean, attribute: 'is-edit' }) isEdit = false\n @property({ type: Boolean, attribute: 'is-save' }) isSave = false\n @property({ type: Boolean, attribute: 'is-set' }) isSet = false\n @property({ type: Boolean, attribute: 'is-key' }) isKey = false\n @property({ type: Boolean, attribute: 'show-action' }) showAction = true\n @property({ type: Boolean, attribute: 'show-add' }) showAdd = true\n @property({ type: Boolean, attribute: 'show-answer-setting' }) showAnswerSetting = false\n @property({ type: Boolean, attribute: 'show-analysis' }) showAnalysis = true\n @property({ type: String, attribute: 'rich-text-content' }) richTextContent = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n @property({ type: String, attribute: 'exam-expand' }) examExpand = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n examAnswerSetting: { isInOrder: boolean, isIgnoreCase: boolean, keywordCount: number } = { isInOrder: true, isIgnoreCase: true, keywordCount: 1 }\n @property({ type: Object })\n uploadImage: (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' }) answerList: any[] = []\n\n // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) modelValue = ''\n @property({ type: Boolean, attribute: 'use-model' }) useModel = false\n\n @state() private _answers: TextAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _isInOrder = true\n @state() private _isIgnoreCase = true\n @state() private _keywordCount = 1\n @state() private _correct = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n\n private readonly TITLE_MAX = 200\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n if (!this.isEdit && (changed.has('title') || changed.has('answerList') || changed.has('analysis') || changed.has('examAnswerSetting') || changed.has('richTextContent') || changed.has('examExpand'))) {\n this._syncProps()\n }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('modelValue') && this.useModel) {\n this._title = this.modelValue\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return String(answer?.title ?? answer?.answer ?? '')\n }\n\n private _normalizedAnswerList(source: any[] = []) {\n return (Array.isArray(source) ? source : []).map((answer: any) => ({\n ...answer,\n answerId: answer?.answerId ?? answer?.examAnswerId,\n title: this._normalizeAnswerTitle(answer),\n }))\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n if (this.answerList?.length) {\n this._answers = this._normalizedAnswerList(this.answerList).map((a: any) => ({\n title: a.title || '',\n tag: '',\n showInput: false,\n answerId: a.answerId,\n customAnswerId: a.customAnswerId,\n }))\n }\n else {\n this._answers = [{ title: '', tag: '', showInput: false }]\n }\n if (this.examAnswerSetting) {\n this._isInOrder = !!this.examAnswerSetting.isInOrder\n this._isIgnoreCase = !!this.examAnswerSetting.isIgnoreCase\n this._keywordCount = this.examAnswerSetting.keywordCount || 1\n }\n this._richText = this.richTextContent || ''\n this._showRichText = !!this.richTextContent\n this._correct = this.examExpand || ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n // 双向绑定:通知外部更新\n if (this.useModel) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private _addTag(i: number) {\n const a = { ...this._answers[i] }\n if (a.tag) {\n a.title = a.title ? [a.title, a.tag].join(',') : a.tag\n a.tag = ''\n }\n a.showInput = false\n this._answers = this._answers.map((x, j) => j === i ? a : x)\n }\n\n private _closeTag(tag: string, i: number) {\n const a = { ...this._answers[i] }\n a.title = a.title.split(',').filter(t => t !== tag).join(',')\n this._answers = this._answers.map((x, j) => j === i ? a : x)\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this.customId || undefined, answerType: 'text_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : this._normalizedAnswerList(this.answerList || [])\n const analysis = this.isEdit ? this._analysis : this.analysis || ''\n const correct = this.isEdit ? this._correct : (this as any).examExpand || ''\n const keywordCount = this.isEdit ? this._keywordCount : this.examAnswerSetting?.keywordCount || 1\n const isInOrder = this.isEdit ? this._isInOrder : this.examAnswerSetting?.isInOrder ?? true\n const isIgnoreCase = this.isEdit ? this._isIgnoreCase : this.examAnswerSetting?.isIgnoreCase ?? true\n const showRichText = this.isEdit ? this._showRichText : !!this.richTextContent\n const richText = this.isEdit ? this._richText : this.richTextContent || ''\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (keywordCount || correct) {\n if (!keywordCount) {\n reject(new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row))\n return\n }\n if (!correct) {\n reject(new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row))\n return\n }\n if (answers.length !== keywordCount) {\n reject(new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row))\n return\n }\n const msg: string[] = []\n answers.forEach((item: any, i: number) => {\n if (!this._normalizeAnswerTitle(item)) { msg.push(`关键词${i + 1}未设置`) }\n })\n if (msg.length) {\n reject(new SubjectError(msg.join(','), 'KEYWORD_EMPTY', 'answers', row))\n return\n }\n }\n const result: any = {\n answerType: SubjectType.TEXT_FILL,\n title,\n answers: answers\n .filter((a: any) => this._normalizeAnswerTitle(a))\n .map((a: any) => ({\n title: this._normalizeAnswerTitle(a),\n ...(a.answerId ? { answerId: a.answerId } : {}),\n ...(a.customAnswerId ? { customAnswerId: a.customAnswerId } : {}),\n })),\n analysis,\n isSetCorrectAnswer: !!correct,\n isKey: this.isKey,\n examExpand: correct,\n examAnswerSettingBO: { isIgnoreCase, isInOrder, keywordCount },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this.customId) { result.customId = this.customId }\n resolve(result)\n })\n }\n\n private _addAnswer() {\n if (this.isSave) { return }\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 2 || this.isSave) { return }\n this._answers = this._answers.filter((_, i) => i !== index)\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.customId || undefined, answerType: 'text_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title || ''\n const answers = this.isEdit ? this._answers : this._normalizedAnswerList(this.answerList || [])\n const correct = this.isEdit ? this._correct : (this as any).examExpand || ''\n const keywordCount = this.isEdit ? this._keywordCount : this.examAnswerSetting?.keywordCount || 1\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (keywordCount || correct) {\n if (!keywordCount) {\n errors.push(new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row))\n }\n if (!correct) {\n errors.push(new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row))\n }\n if (answers.length !== keywordCount) {\n errors.push(new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row))\n }\n answers.forEach((item: any, i: number) => {\n if (!this._normalizeAnswerTitle(item)) {\n errors.push(new SubjectError(`关键词${i + 1}未设置`, 'KEYWORD_EMPTY', 'answers', row))\n }\n })\n }\n\n return errors\n }\n\n private _renderPreview() {\n const previewAnswers = this.isEdit ? this._answers : this._normalizedAnswerList(this.answerList || [])\n const previewCorrect = this.isEdit ? this._correct : (this.examExpand || '')\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this.orderIndex + 1}.${this.title}(问答题)</span>\n ${this.richTextContent ? html`<div class=\"rich-text\" .innerHTML=${this.richTextContent}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div style=\"margin-top:8px;color:#a8abb2\">\n ${previewAnswers.map((a, i) => a.title\n ? html`\n <span style=\"margin-right:10px\">关键词${i + 1}: ${a.title}</span>\n `\n : '')}\n </div>\n `\n : ''}\n ${previewCorrect ? html`<div style=\"margin-top:8px;color:#a8abb2\">正确答案:${previewCorrect}</div>` : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title} ?disabled=${this.isSave}\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 ${this.showAnswerSetting\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <div style=\"flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px\">\n <span style=\"font-size:13px;color:#606266\">共答对</span>\n <input type=\"number\" style=\"width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px\"\n .value=${String(this._keywordCount)} min=\"1\"\n @change=${(e: Event) => { this._keywordCount = Number((e.target as HTMLInputElement).value) }} />\n <span style=\"font-size:13px;color:#606266\">个关键词,算是正确的</span>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n </div>\n `\n : ''}\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答案:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._correct} ?disabled=${this.isSave}\n maxlength=\"200\"\n @input=${(e: Event) => { this._correct = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入正确答案\"></textarea>\n <span class=\"char-counter\">${this._correct.length}/200</span>\n </div>\n </div>\n </div>\n\n <div class=\"answer-list\" style=\"margin-top:12px\">\n <span style=\"padding-left:60px;font-size:12px;color:#909399\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\">\n <span class=\"label\">关键词${i + 1}:</span>\n <div class=\"answer-tags\" style=\"display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px\">\n ${a.title.split(',').filter(Boolean).map((tag) => {\n const c = TAG_COLORS[i % TAG_COLORS.length]; return html`\n <span style=\"display:inline-flex;align-items:center;background:${c.bg};color:${c.color};border:1px solid ${c.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px\">\n ${tag}\n ${!this.isSave ? html`<span style=\"cursor:pointer;margin-left:4px;color:#909399\" @click=${() => this._closeTag(tag, i)}>×</span>` : ''}\n </span>\n `\n })}\n ${!this.isSave\n ? html`\n ${a.showInput\n ? html`\n <input type=\"text\" style=\"width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._addTag(i) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._addTag(i)} />\n <button class=\"el-link\" @click=${() => this._addTag(i)}>确认</button>\n `\n : html`\n <button class=\"link\" @click=${() => { this._answers = this._answers.map((x, j) => j === i ? { ...x, showInput: true } : x); this.updateComplete.then(() => { (this.shadowRoot?.querySelector(`input[style*=\"width:80px\"]`) as HTMLInputElement)?.focus() }) }}>\n ${a.title ? '添加同义词' : '添加关键词'}\n </button>\n `}\n `\n : ''}\n </div>\n <span class=\"icon ${this.isSave ? 'disabled' : ''}\" @click=${() => this._addAnswer()}>${this._iconPlus}</span>\n <span class=\"icon ${this.isSave || this._answers.length < 2 ? 'disabled' : ''}\" @click=${() => this._deleteAnswer(i)}>${this._iconRemove}</span>\n </div>\n `)}\n </div>\n\n ${this._showRichText\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .uploadImage=${this.uploadImage}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n ${!this.showAction\n ? html`<div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>`\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this.showAnalysis\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout .showEdit=${this.isEdit}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this.showAction\n ? html`\n <qxs-subject-action\n .isEdit=${this.isEdit}\n .isSet=${this.isSet}\n .showAdd=${this.showAdd}\n .showRichText=${this._showRichText}\n exam-answer-relation-type=${this.examAnswerRelationType}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["TAG_COLORS","bg","color","border","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","orderIndex","title","customId","isEdit","isSave","isSet","isKey","showAction","showAdd","showAnswerSetting","showAnalysis","richTextContent","analysis","examAnswerRelationType","examExpand","examAnswerSetting","isInOrder","isIgnoreCase","keywordCount","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","answerList","modelValue","useModel","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","TITLE_MAX","willUpdate","changed","has","_syncProps","_normalizeAnswerTitle","answer","String","_normalizedAnswerList","source","length","undefined","Array","isArray","map","answerId","examAnswerId","a","customAnswerId","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","slice","_addTag","i","join","x","j","_closeTag","split","filter","t","toJSON","row","answerType","answers","correct","showRichText","richText","SubjectError","msg","forEach","item","push","SubjectType","TEXT_FILL","isSetCorrectAnswer","examAnswerSettingBO","examRichTextContent","_addAnswer","_deleteAnswer","index","_","_save","stopImmediatePropagation","data","err","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","_renderPreview","previewAnswers","previewCorrect","some","_renderEdit","Number","checked","Boolean","c","key","updateComplete","then","shadowRoot","querySelector","focus","render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AAMvG,OAAQwG,UAAW,iBA7H1BvK,QAAAA,YA6H2CwK,UAAA,aAAA,GACDJ,EAAA,CAApDC,EAAAA,SAAS,CAAEC,KAAMb,QAASc,UAAW,eA9H3BvK,QAAAA,YA8H0CwK,UAAA,WAAA,GAEpCJ,EAAA,CAAhBK,EAAAA,SAhIUzK,QAAAA,YAgIMwK,UAAA,WAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAjIUzK,QAAAA,YAiIMwK,UAAA,SAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAlIUzK,QAAAA,YAkIMwK,UAAA,YAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAnIUzK,QAAAA,YAmIMwK,UAAA,aAAA,GACAJ,EAAA,CAAhBK,EAAAA,SApIUzK,QAAAA,YAoIMwK,UAAA,gBAAA,GACAJ,EAAA,CAAhBK,EAAAA,SArIUzK,QAAAA,YAqIMwK,UAAA,gBAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAtIUzK,QAAAA,YAsIMwK,UAAA,WAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAvIUzK,QAAAA,YAuIMwK,UAAA,gBAAA,GACAJ,EAAA,CAAhBK,EAAAA,SAxIUzK,QAAAA,YAwIMwK,UAAA,YAAA,GAxINxK,QAAAA,YAANoK,EAAA,CADNM,EAAAA,kBAAkB,kBACN1K,QAAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qxs-bns/components-wc",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.23",
|
|
5
5
|
"description": "QXS Business Components - Web Components (framework agnostic)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://qxs-bns.pages.dev/guide/components-wc/",
|
|
@@ -28,6 +28,21 @@
|
|
|
28
28
|
"import": "./es/index.mjs",
|
|
29
29
|
"require": "./lib/index.cjs"
|
|
30
30
|
},
|
|
31
|
+
"./core": {
|
|
32
|
+
"types": "./types/index.d.ts",
|
|
33
|
+
"import": "./es/entry-subject.mjs",
|
|
34
|
+
"require": "./lib/entry-subject.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./editor": {
|
|
37
|
+
"types": "./types/index.d.ts",
|
|
38
|
+
"import": "./es/entry-editor.mjs",
|
|
39
|
+
"require": "./lib/entry-editor.cjs"
|
|
40
|
+
},
|
|
41
|
+
"./all": {
|
|
42
|
+
"types": "./types/index.d.ts",
|
|
43
|
+
"import": "./es/index.mjs",
|
|
44
|
+
"require": "./lib/index.cjs"
|
|
45
|
+
},
|
|
31
46
|
"./es/*": {
|
|
32
47
|
"types": "./types/*.d.ts",
|
|
33
48
|
"import": "./es/*.mjs"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class S{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const n=t=>new S("string"==typeof t?t:t+"",void 0,s),i=(s,o)=>{if(e)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),S=t.litNonce;void 0!==S&&o.setAttribute("nonce",S),o.textContent=e.cssText,s.appendChild(o)}},l=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return n(e)})(t):t;export{S as CSSResult,i as adoptStyles,l as getCompatibleStyle,e as supportsAdoptingStyleSheets,n as unsafeCSS};
|
|
7
|
-
//# sourceMappingURL=css-tag.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css-tag.mjs","sources":["../../../../../../../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1],t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n"],"names":["t","globalThis","e","ShadowRoot","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet","s","Symbol","o","WeakMap","n","constructor","this","_$cssResult$","Error","cssText","styleSheet","length","get","replaceSync","set","toString","r","S","adoptStyles","adoptedStyleSheets","map","document","createElement","litNonce","setAttribute","textContent","appendChild","c","cssRules"],"mappings":";;;;;AAMA,MAGMA,EAASC,WAKFC,EACXF,EAAOG,kBAAA,IACNH,EAAOI,UAA0BJ,EAAOI,SAASC,eAClD,uBAAwBC,SAASC,WACjC,YAAaC,cAAcD,UAkBvBE,EAAoBC,SAEpBC,EAAc,IAAIC,QAAA,MASXC,EAOXC,WAAAA,CACEd,EACAE,EACAS,GAEA,GAVFI,KAAeC,cAAA,EAUTL,IAAcF,EAChB,MAAUQ,MACR,qEAGJF,KAAKG,QAAUlB,EACfe,KAAKf,EAAWE,CAClB,CAIA,cAAAiB,GAGE,IAAInB,EAAae,KAAKJ,EACtB,MAAMF,EAAUM,KAAKf,EACrB,GAAIE,QAAA,IAA+BF,EAA0B,CAC3D,MAAME,WAAYO,GAA4C,IAAnBA,EAAQW,OAC/ClB,IACFF,EAAaW,EAAYU,IAAIZ,SAAA,IAE3BT,KACDe,KAAKJ,EAAcX,EAAa,IAAIQ,eAAiBc,YACpDP,KAAKG,SAEHhB,GACFS,EAAYY,IAAId,EAAST,GAG/B,CACA,OAAOA,CACT,CAEAwB,QAAAA,GACE,OAAOT,KAAKG,OACd,EAWF,MAsBaO,EAAazB,GACxB,IAAKa,EACc,iBAAVb,EAAqBA,EAAeA,EAAP,QAAA,EAEpCS,GAsCSiB,EAAcC,CACzBlB,EACAE,KAEA,GAAIT,EACDO,EAA0BmB,mBAAqBjB,EAAOkB,IAAK7B,GAC1DA,aAAaQ,cAAgBR,EAAIA,EAAEmB,iBAGrC,IAAK,MAAMjB,KAAKS,EAAQ,CACtB,MAAMA,EAAQmB,SAASC,cAAc,SAE/BlB,EAASb,EAAyBgC,cAAA,IACpCnB,GACFF,EAAMsB,aAAa,QAASpB,GAE9BF,EAAMuB,YAAehC,EAAgBgB,QACrCT,EAAW0B,YAAYxB,EACzB,GAYSyB,EACXlC,EAEKF,GAAyBA,EACzBA,GACCA,aAAaQ,cAbW,CAACR,IAC/B,IAAIE,EAAU,GACd,IAAK,MAAMO,KAAQT,EAAMqC,SACvBnC,GAAWO,EAAKS,QAElB,OAAOO,EAAUvB,EAAA,EALa,CAa6BF,GAAKA","x_google_ignoreList":[0]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{notEqual as t,defaultConverter as e}from"../reactive-element.mjs";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2017 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/const r={attribute:!0,type:String,converter:e,reflect:!1,hasChanged:t},o=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,e=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;const{kind:a,metadata:n}=o;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),"setter"===a&&((t=Object.create(t)).wrapped=!0),s.set(o.name,t),"accessor"===a){const{name:r}=o;return{set(o){const a=e.get.call(this);e.set.call(this,o),this.requestUpdate(r,a,t,!0,o)},init(e){return void 0!==e&&this.C(r,void 0,t,e),e}}}if("setter"===a){const{name:r}=o;return function(o){const a=this[r];e.call(this,o),this.requestUpdate(r,a,t,!0,o)}}throw Error("Unsupported decorator location: "+a)};function a(t){return(e,r)=>"object"==typeof r?o(t,e,r):((t,e,r)=>{const o=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),o?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}export{a as property,o as standardProperty};
|
|
7
|
-
//# sourceMappingURL=property.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"property.mjs","sources":["../../../../../../../../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js"],"sourcesContent":["import{notEqual as t,defaultConverter as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:e,reflect:!1,hasChanged:t},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),\"setter\"===n&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t,!0,r)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t,!0,r)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n"],"names":["o","attribute","type","String","converter","e","reflect","hasChanged","t","r","arguments","length","undefined","kind","n","metadata","i","s","globalThis","litPropertyMetadata","get","set","Map","Object","create","wrapped","name","call","this","requestUpdate","init","C","Error","hasOwnProperty","constructor","createProperty","getOwnPropertyDescriptor"],"mappings":";;;;;GAwEA,MAoBMA,EAAkD,CACtDC,WAAA,EACAC,KAAMC,OACNC,UAAWC,EACXC,SAAA,EACAC,WAAYC,GAaDC,EAAmB,WAG9B,IAFAD,EAAAE,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAA+BV,EA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
|
|
1
|
-
{"version":3,"file":"state.mjs","sources":["../../../../../../../../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js"],"sourcesContent":["import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n"],"names":["r","t","state","attribute"],"mappings":";;;;;GAwCM,SAAUA,EAAMA,GACpB,OAAOC,EAAS,IACXD,EAIHE,OAAA,EACAC,WAAA,GAEJ","x_google_ignoreList":[0]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{getCompatibleStyle as t,adoptStyles as e}from"./css-tag.mjs";export{CSSResult,supportsAdoptingStyleSheets,unsafeCSS}from"./css-tag.mjs";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2017 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/const{is:s,defineProperty:i,getOwnPropertyDescriptor:r,getOwnPropertyNames:o,getOwnPropertySymbols:n,getPrototypeOf:a}=Object,h=globalThis,l=h.trustedTypes,c=l?l.emptyScript:"",p=h.reactiveElementPolyfillSupport,d=(t,e)=>t,u={toAttribute(t,e){switch(e){case Boolean:t=t?c:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},f=(t,e)=>!s(t,e),E={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;class _ extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E;if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);void 0!==r&&i(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=r(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const r=i?.call(this);o?.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??E}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=a(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,e=[...o(t),...n(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const s=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)s.unshift(t(e))}else void 0!==e&&s.push(t(e));return s}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return e(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:u).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=i;const o=r.fromAttribute(e,t.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0;if(void 0!==t){const o=this.constructor;if(!1===i&&(r=this[t]),s??=o.getPropertyOptions(t),!((s.hasChanged??f)(r,e)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,s,i){let{useDefault:r,reflect:o,wrapped:n}=s;r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==n||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,s,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[d("elementProperties")]=new Map,_[d("finalized")]=new Map,p?.({ReactiveElement:_}),(h.reactiveElementVersions??=[]).push("2.1.2");export{_ as ReactiveElement,e as adoptStyles,u as defaultConverter,t as getCompatibleStyle,f as notEqual};
|
|
7
|
-
//# sourceMappingURL=reactive-element.mjs.map
|