@qxs-bns/components 0.0.91 → 0.0.92
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/base/uid.mjs +1 -1
- package/es/base/uid.mjs.map +1 -1
- package/es/data-chart.mjs +15 -14
- package/es/data-chart.mjs.map +1 -1
- package/es/editor/blocksuite-editor.mjs +62 -51
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/editor/content-format.mjs +8 -1
- package/es/editor/content-format.mjs.map +1 -1
- package/es/editor/index.mjs +1 -1
- package/es/editor/index.mjs.map +1 -1
- package/es/editor/toolbar.mjs +1 -1
- package/es/editor/toolbar.mjs.map +1 -1
- package/es/entry-data-chart.mjs +1 -1
- package/es/entry-editor.mjs +1 -1
- package/es/entry-file-upload.mjs +1 -1
- package/es/entry-fixed-action-bar.mjs +1 -1
- package/es/entry-icon.mjs +1 -1
- package/es/entry-image-upload.mjs +1 -1
- package/es/entry-photo-crop-tool.mjs +1 -1
- package/es/entry-subject.mjs +1 -1
- package/es/file-upload.mjs +25 -18
- package/es/file-upload.mjs.map +1 -1
- package/es/fixed-action-bar.mjs +5 -5
- package/es/fixed-action-bar.mjs.map +1 -1
- package/es/icon.mjs +7 -7
- package/es/icon.mjs.map +1 -1
- package/es/image-upload.mjs +26 -26
- package/es/image-upload.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/node_modules/.pnpm/marked@17.0.6/node_modules/marked/lib/marked.esm.mjs +59 -1
- package/es/node_modules/.pnpm/marked@17.0.6/node_modules/marked/lib/marked.esm.mjs.map +1 -1
- package/es/node_modules/.pnpm/turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.mjs +16 -1
- package/es/node_modules/.pnpm/turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.mjs.map +1 -1
- package/es/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.mjs +62 -0
- package/es/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.mjs.map +1 -0
- package/es/photo-crop-tool.mjs +12 -12
- package/es/photo-crop-tool.mjs.map +1 -1
- package/es/subject/action.mjs +58 -58
- package/es/subject/action.mjs.map +1 -1
- package/es/subject/blank-fill.mjs +80 -80
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/draft.mjs +1 -1
- package/es/subject/draft.mjs.map +1 -1
- package/es/subject/layout.mjs +4 -4
- package/es/subject/layout.mjs.map +1 -1
- package/es/subject/page-end.mjs +5 -5
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/pagination.mjs +1 -1
- package/es/subject/pagination.mjs.map +1 -1
- package/es/subject/runtime.mjs +1 -1
- package/es/subject/runtime.mjs.map +1 -1
- package/es/subject/scale.mjs +53 -50
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/shared-methods.mjs +1 -1
- package/es/subject/shared-methods.mjs.map +1 -1
- package/es/subject/shared-styles.mjs +53 -15
- package/es/subject/shared-styles.mjs.map +1 -1
- package/es/subject/single-interactions.mjs +2 -0
- package/es/subject/single-interactions.mjs.map +1 -0
- package/es/subject/single-model.mjs +2 -0
- package/es/subject/single-model.mjs.map +1 -0
- package/es/subject/single-state.mjs +2 -0
- package/es/subject/single-state.mjs.map +1 -0
- package/es/subject/single.mjs +177 -177
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/sort-controller.mjs +1 -1
- package/es/subject/sort-controller.mjs.map +1 -1
- package/es/subject/sortable.mjs +13 -13
- package/es/subject/sortable.mjs.map +1 -1
- package/es/subject/sorting-card.mjs +12 -12
- package/es/subject/sorting-card.mjs.map +1 -1
- package/es/subject/subject-shared.mjs +2 -0
- package/es/subject/subject-shared.mjs.map +1 -0
- package/es/subject/text-fill.mjs +73 -73
- package/es/subject/text-fill.mjs.map +1 -1
- package/es/subject/title-prefix.mjs +1 -1
- package/es/subject/title-prefix.mjs.map +1 -1
- package/es/subject/types.mjs +1 -1
- package/es/subject/types.mjs.map +1 -1
- package/lib/base/define.cjs +1 -1
- package/lib/base/define.cjs.map +1 -1
- package/lib/base/uid.cjs +1 -1
- package/lib/base/uid.cjs.map +1 -1
- package/lib/data-chart.cjs +16 -15
- package/lib/data-chart.cjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +62 -51
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/editor/content-format.cjs +8 -1
- package/lib/editor/content-format.cjs.map +1 -1
- package/lib/editor/index.cjs +1 -1
- package/lib/editor/index.cjs.map +1 -1
- package/lib/editor/toolbar.cjs +1 -1
- package/lib/editor/toolbar.cjs.map +1 -1
- package/lib/entry-data-chart.cjs +1 -1
- package/lib/entry-editor.cjs +1 -1
- package/lib/entry-file-upload.cjs +1 -1
- package/lib/entry-fixed-action-bar.cjs +1 -1
- package/lib/entry-icon.cjs +1 -1
- package/lib/entry-image-upload.cjs +1 -1
- package/lib/entry-photo-crop-tool.cjs +1 -1
- package/lib/entry-subject.cjs +1 -1
- package/lib/file-upload.cjs +24 -17
- package/lib/file-upload.cjs.map +1 -1
- package/lib/fixed-action-bar.cjs +6 -6
- package/lib/fixed-action-bar.cjs.map +1 -1
- package/lib/icon.cjs +9 -9
- package/lib/icon.cjs.map +1 -1
- package/lib/image-upload.cjs +26 -26
- package/lib/image-upload.cjs.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/node_modules/.pnpm/marked@17.0.6/node_modules/marked/lib/marked.esm.cjs +59 -1
- package/lib/node_modules/.pnpm/marked@17.0.6/node_modules/marked/lib/marked.esm.cjs.map +1 -1
- package/lib/node_modules/.pnpm/turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.cjs +16 -1
- package/lib/node_modules/.pnpm/turndown-plugin-gfm@1.0.2/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.cjs.map +1 -1
- package/lib/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.cjs +62 -0
- package/lib/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.cjs.map +1 -0
- package/lib/photo-crop-tool.cjs +11 -11
- package/lib/photo-crop-tool.cjs.map +1 -1
- package/lib/subject/action.cjs +42 -42
- package/lib/subject/action.cjs.map +1 -1
- package/lib/subject/blank-fill.cjs +80 -80
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/draft.cjs +1 -1
- package/lib/subject/draft.cjs.map +1 -1
- package/lib/subject/layout.cjs +4 -4
- package/lib/subject/layout.cjs.map +1 -1
- package/lib/subject/page-end.cjs +4 -4
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/pagination.cjs +1 -1
- package/lib/subject/pagination.cjs.map +1 -1
- package/lib/subject/runtime.cjs +1 -1
- package/lib/subject/runtime.cjs.map +1 -1
- package/lib/subject/scale.cjs +53 -50
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/shared-methods.cjs +1 -1
- package/lib/subject/shared-methods.cjs.map +1 -1
- package/lib/subject/shared-styles.cjs +54 -16
- package/lib/subject/shared-styles.cjs.map +1 -1
- package/lib/subject/single-interactions.cjs +2 -0
- package/lib/subject/single-interactions.cjs.map +1 -0
- package/lib/subject/single-model.cjs +2 -0
- package/lib/subject/single-model.cjs.map +1 -0
- package/lib/subject/single-state.cjs +2 -0
- package/lib/subject/single-state.cjs.map +1 -0
- package/lib/subject/single.cjs +177 -177
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/sort-controller.cjs +1 -1
- package/lib/subject/sort-controller.cjs.map +1 -1
- package/lib/subject/sortable.cjs +15 -15
- package/lib/subject/sortable.cjs.map +1 -1
- package/lib/subject/sorting-card.cjs +12 -12
- package/lib/subject/sorting-card.cjs.map +1 -1
- package/lib/subject/subject-shared.cjs +2 -0
- package/lib/subject/subject-shared.cjs.map +1 -0
- package/lib/subject/text-fill.cjs +81 -81
- package/lib/subject/text-fill.cjs.map +1 -1
- package/lib/subject/title-prefix.cjs +1 -1
- package/lib/subject/title-prefix.cjs.map +1 -1
- package/lib/subject/types.cjs +1 -1
- package/lib/subject/types.cjs.map +1 -1
- package/package.json +5 -5
- package/types/editor/blocksuite-editor.d.ts +2 -0
- package/types/editor/toolbar.d.ts +1 -1
- package/types/file-upload.d.ts +2 -0
- package/types/subject/blank-fill.d.ts +1 -1
- package/types/subject/runtime.d.ts +1 -1
- package/types/subject/scale.d.ts +1 -1
- package/types/subject/single-interactions.d.ts +46 -0
- package/types/subject/single-model.d.ts +88 -0
- package/types/subject/single-state.d.ts +42 -0
- package/types/subject/single.d.ts +7 -85
- package/types/subject/sortable.d.ts +1 -1
- package/types/subject/subject-shared.d.ts +43 -0
- package/types/subject/text-fill.d.ts +1 -1
- package/README.md +0 -562
- package/es/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.mjs +0 -2
- package/es/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.mjs.map +0 -1
- package/es/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.es.mjs +0 -2
- package/es/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.es.mjs.map +0 -1
- package/es/package.json.mjs +0 -2
- package/es/package.json.mjs.map +0 -1
- package/es/src/alert/index.mjs +0 -2
- package/es/src/alert/index.mjs.map +0 -1
- package/es/src/alert/src/alert.mjs +0 -2
- package/es/src/alert/src/alert.mjs.map +0 -1
- package/es/src/components.mjs +0 -2
- package/es/src/components.mjs.map +0 -1
- package/es/src/data-chart/index.mjs +0 -2
- package/es/src/data-chart/index.mjs.map +0 -1
- package/es/src/defaults.mjs +0 -2
- package/es/src/defaults.mjs.map +0 -1
- package/es/src/dialog/src/dialog.mjs +0 -2
- package/es/src/dialog/src/dialog.mjs.map +0 -1
- package/es/src/feedback-plugin/index.mjs +0 -2
- package/es/src/feedback-plugin/index.mjs.map +0 -1
- package/es/src/file-upload/index.mjs +0 -2
- package/es/src/file-upload/index.mjs.map +0 -1
- package/es/src/icon/index.mjs +0 -2
- package/es/src/icon/index.mjs.map +0 -1
- package/es/src/icon/src/icon.mjs +0 -2
- package/es/src/icon/src/icon.mjs.map +0 -1
- package/es/src/image-upload/index.mjs +0 -2
- package/es/src/image-upload/index.mjs.map +0 -1
- package/es/src/make-installer.mjs +0 -2
- package/es/src/make-installer.mjs.map +0 -1
- package/es/src/message/src/message.mjs +0 -2
- package/es/src/message/src/message.mjs.map +0 -1
- package/es/src/photo-crop-tool/index.mjs +0 -2
- package/es/src/photo-crop-tool/index.mjs.map +0 -1
- package/es/src/tiny-mce-editor/index.mjs +0 -2
- package/es/src/tiny-mce-editor/index.mjs.map +0 -1
- package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs +0 -2
- package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue.mjs.map +0 -1
- package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue2.mjs +0 -2
- package/es/src/tiny-mce-editor/src/tiny-mce-editor.vue2.mjs.map +0 -1
- package/es/src/ui/button/index.mjs +0 -2
- package/es/src/ui/button/index.mjs.map +0 -1
- package/es/src/ui/checkbox/index.mjs +0 -2
- package/es/src/ui/checkbox/index.mjs.map +0 -1
- package/es/src/ui/dialog/index.mjs +0 -2
- package/es/src/ui/dialog/index.mjs.map +0 -1
- package/es/src/ui/input/index.mjs +0 -2
- package/es/src/ui/input/index.mjs.map +0 -1
- package/es/src/ui/input-number/index.mjs +0 -2
- package/es/src/ui/input-number/index.mjs.map +0 -1
- package/es/src/ui/layout/index.mjs +0 -2
- package/es/src/ui/layout/index.mjs.map +0 -1
- package/es/src/ui/link/index.mjs +0 -2
- package/es/src/ui/link/index.mjs.map +0 -1
- package/es/src/ui/popover/index.mjs +0 -2
- package/es/src/ui/popover/index.mjs.map +0 -1
- package/es/src/ui/radio/index.mjs +0 -2
- package/es/src/ui/radio/index.mjs.map +0 -1
- package/es/src/ui/scrollbar/index.mjs +0 -2
- package/es/src/ui/scrollbar/index.mjs.map +0 -1
- package/es/src/ui/select/index.mjs +0 -2
- package/es/src/ui/select/index.mjs.map +0 -1
- package/es/src/ui/table/index.mjs +0 -2
- package/es/src/ui/table/index.mjs.map +0 -1
- package/es/src/ui/tag/index.mjs +0 -2
- package/es/src/ui/tag/index.mjs.map +0 -1
- package/es/src/wc-bridge.mjs +0 -2
- package/es/src/wc-bridge.mjs.map +0 -1
- package/es/src/withInstall.mjs +0 -2
- package/es/src/withInstall.mjs.map +0 -1
- package/lib/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.cjs +0 -2
- package/lib/node_modules/.pnpm/@iconify_vue@5.0.0_vue@3.5.18_typescript@5.9.2_/node_modules/@iconify/vue/dist/iconify.cjs.map +0 -1
- package/lib/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.es.cjs +0 -2
- package/lib/node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.es.cjs.map +0 -1
- package/lib/package.json.cjs +0 -2
- package/lib/package.json.cjs.map +0 -1
- package/lib/src/alert/index.cjs +0 -2
- package/lib/src/alert/index.cjs.map +0 -1
- package/lib/src/alert/src/alert.cjs +0 -2
- package/lib/src/alert/src/alert.cjs.map +0 -1
- package/lib/src/components.cjs +0 -2
- package/lib/src/components.cjs.map +0 -1
- package/lib/src/data-chart/index.cjs +0 -2
- package/lib/src/data-chart/index.cjs.map +0 -1
- package/lib/src/defaults.cjs +0 -2
- package/lib/src/defaults.cjs.map +0 -1
- package/lib/src/dialog/src/dialog.cjs +0 -2
- package/lib/src/dialog/src/dialog.cjs.map +0 -1
- package/lib/src/feedback-plugin/index.cjs +0 -2
- package/lib/src/feedback-plugin/index.cjs.map +0 -1
- package/lib/src/file-upload/index.cjs +0 -2
- package/lib/src/file-upload/index.cjs.map +0 -1
- package/lib/src/icon/index.cjs +0 -2
- package/lib/src/icon/index.cjs.map +0 -1
- package/lib/src/icon/src/icon.cjs +0 -2
- package/lib/src/icon/src/icon.cjs.map +0 -1
- package/lib/src/image-upload/index.cjs +0 -2
- package/lib/src/image-upload/index.cjs.map +0 -1
- package/lib/src/make-installer.cjs +0 -2
- package/lib/src/make-installer.cjs.map +0 -1
- package/lib/src/message/src/message.cjs +0 -2
- package/lib/src/message/src/message.cjs.map +0 -1
- package/lib/src/photo-crop-tool/index.cjs +0 -2
- package/lib/src/photo-crop-tool/index.cjs.map +0 -1
- package/lib/src/tiny-mce-editor/index.cjs +0 -2
- package/lib/src/tiny-mce-editor/index.cjs.map +0 -1
- package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs +0 -2
- package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue.cjs.map +0 -1
- package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue2.cjs +0 -2
- package/lib/src/tiny-mce-editor/src/tiny-mce-editor.vue2.cjs.map +0 -1
- package/lib/src/ui/button/index.cjs +0 -2
- package/lib/src/ui/button/index.cjs.map +0 -1
- package/lib/src/ui/checkbox/index.cjs +0 -2
- package/lib/src/ui/checkbox/index.cjs.map +0 -1
- package/lib/src/ui/dialog/index.cjs +0 -2
- package/lib/src/ui/dialog/index.cjs.map +0 -1
- package/lib/src/ui/input/index.cjs +0 -2
- package/lib/src/ui/input/index.cjs.map +0 -1
- package/lib/src/ui/input-number/index.cjs +0 -2
- package/lib/src/ui/input-number/index.cjs.map +0 -1
- package/lib/src/ui/layout/index.cjs +0 -2
- package/lib/src/ui/layout/index.cjs.map +0 -1
- package/lib/src/ui/link/index.cjs +0 -2
- package/lib/src/ui/link/index.cjs.map +0 -1
- package/lib/src/ui/popover/index.cjs +0 -2
- package/lib/src/ui/popover/index.cjs.map +0 -1
- package/lib/src/ui/radio/index.cjs +0 -2
- package/lib/src/ui/radio/index.cjs.map +0 -1
- package/lib/src/ui/scrollbar/index.cjs +0 -2
- package/lib/src/ui/scrollbar/index.cjs.map +0 -1
- package/lib/src/ui/select/index.cjs +0 -2
- package/lib/src/ui/select/index.cjs.map +0 -1
- package/lib/src/ui/table/index.cjs +0 -2
- package/lib/src/ui/table/index.cjs.map +0 -1
- package/lib/src/ui/tag/index.cjs +0 -2
- package/lib/src/ui/tag/index.cjs.map +0 -1
- package/lib/src/wc-bridge.cjs +0 -2
- package/lib/src/wc-bridge.cjs.map +0 -1
- package/lib/src/withInstall.cjs +0 -2
- package/lib/src/withInstall.cjs.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/src/alert/index.d.ts +0 -66
- package/types/src/alert/index.d.ts.map +0 -1
- package/types/src/alert/src/alert.d.ts +0 -73
- package/types/src/alert/src/alert.d.ts.map +0 -1
- package/types/src/components.d.ts +0 -10
- package/types/src/components.d.ts.map +0 -1
- package/types/src/data-chart/index.d.ts +0 -13
- package/types/src/data-chart/index.d.ts.map +0 -1
- package/types/src/defaults.d.ts +0 -6
- package/types/src/defaults.d.ts.map +0 -1
- package/types/src/dialog/index.d.ts +0 -3
- package/types/src/dialog/index.d.ts.map +0 -1
- package/types/src/dialog/src/dialog.d.ts +0 -25
- package/types/src/dialog/src/dialog.d.ts.map +0 -1
- package/types/src/feedback-plugin/index.d.ts +0 -9
- package/types/src/feedback-plugin/index.d.ts.map +0 -1
- package/types/src/file-upload/index.d.ts +0 -12
- package/types/src/file-upload/index.d.ts.map +0 -1
- package/types/src/icon/index.d.ts +0 -56
- package/types/src/icon/index.d.ts.map +0 -1
- package/types/src/icon/src/icon.d.ts +0 -62
- package/types/src/icon/src/icon.d.ts.map +0 -1
- package/types/src/image-upload/index.d.ts +0 -12
- package/types/src/image-upload/index.d.ts.map +0 -1
- package/types/src/make-installer.d.ts +0 -6
- package/types/src/make-installer.d.ts.map +0 -1
- package/types/src/message/index.d.ts +0 -3
- package/types/src/message/index.d.ts.map +0 -1
- package/types/src/message/src/message.d.ts +0 -21
- package/types/src/message/src/message.d.ts.map +0 -1
- package/types/src/message/src/toaster.vue.d.ts +0 -3
- package/types/src/message/src/toaster.vue.d.ts.map +0 -1
- package/types/src/photo-crop-tool/index.d.ts +0 -12
- package/types/src/photo-crop-tool/index.d.ts.map +0 -1
- package/types/src/subject-action/index.d.ts +0 -93
- package/types/src/subject-action/index.d.ts.map +0 -1
- package/types/src/subject-action/src/subject-action.vue.d.ts +0 -92
- package/types/src/subject-action/src/subject-action.vue.d.ts.map +0 -1
- package/types/src/subject-layout/index.d.ts +0 -30
- package/types/src/subject-layout/index.d.ts.map +0 -1
- package/types/src/subject-layout/src/subject-layout.vue.d.ts +0 -20
- package/types/src/subject-layout/src/subject-layout.vue.d.ts.map +0 -1
- package/types/src/subject-list/index.d.ts +0 -20
- package/types/src/subject-list/index.d.ts.map +0 -1
- package/types/src/subject-list/src/components/SubjectPageEnd.vue.d.ts +0 -24
- package/types/src/subject-list/src/components/SubjectPageEnd.vue.d.ts.map +0 -1
- package/types/src/subject-list/src/components/subject-blank-fill.vue.d.ts +0 -32
- package/types/src/subject-list/src/components/subject-blank-fill.vue.d.ts.map +0 -1
- package/types/src/subject-list/src/components/subject-scale.vue.d.ts +0 -29
- package/types/src/subject-list/src/components/subject-scale.vue.d.ts.map +0 -1
- package/types/src/subject-list/src/components/subject-single.vue.d.ts +0 -37
- package/types/src/subject-list/src/components/subject-single.vue.d.ts.map +0 -1
- package/types/src/subject-list/src/components/subject-text-fill.vue.d.ts +0 -34
- package/types/src/subject-list/src/components/subject-text-fill.vue.d.ts.map +0 -1
- package/types/src/subject-list/src/subject-list.vue.d.ts +0 -21
- package/types/src/subject-list/src/subject-list.vue.d.ts.map +0 -1
- package/types/src/subject-type/index.d.ts +0 -8
- package/types/src/subject-type/index.d.ts.map +0 -1
- package/types/src/subject-type/src/subject-type.vue.d.ts +0 -7
- package/types/src/subject-type/src/subject-type.vue.d.ts.map +0 -1
- package/types/src/tiny-mce-editor/index.d.ts +0 -20
- package/types/src/tiny-mce-editor/index.d.ts.map +0 -1
- package/types/src/tiny-mce-editor/src/tiny-mce-editor.vue.d.ts +0 -32
- package/types/src/tiny-mce-editor/src/tiny-mce-editor.vue.d.ts.map +0 -1
- package/types/src/ui/button/index.d.ts +0 -96
- package/types/src/ui/button/index.d.ts.map +0 -1
- package/types/src/ui/checkbox/index.d.ts +0 -111
- package/types/src/ui/checkbox/index.d.ts.map +0 -1
- package/types/src/ui/dialog/index.d.ts +0 -134
- package/types/src/ui/dialog/index.d.ts.map +0 -1
- package/types/src/ui/index.d.ts +0 -16
- package/types/src/ui/index.d.ts.map +0 -1
- package/types/src/ui/input/index.d.ts +0 -132
- package/types/src/ui/input/index.d.ts.map +0 -1
- package/types/src/ui/input-number/index.d.ts +0 -106
- package/types/src/ui/input-number/index.d.ts.map +0 -1
- package/types/src/ui/layout/index.d.ts +0 -373
- package/types/src/ui/layout/index.d.ts.map +0 -1
- package/types/src/ui/link/index.d.ts +0 -57
- package/types/src/ui/link/index.d.ts.map +0 -1
- package/types/src/ui/popover/index.d.ts +0 -89
- package/types/src/ui/popover/index.d.ts.map +0 -1
- package/types/src/ui/radio/index.d.ts +0 -84
- package/types/src/ui/radio/index.d.ts.map +0 -1
- package/types/src/ui/scrollbar/index.d.ts +0 -35
- package/types/src/ui/scrollbar/index.d.ts.map +0 -1
- package/types/src/ui/select/index.d.ts +0 -113
- package/types/src/ui/select/index.d.ts.map +0 -1
- package/types/src/ui/table/index.d.ts +0 -152
- package/types/src/ui/table/index.d.ts.map +0 -1
- package/types/src/ui/tag/index.d.ts +0 -69
- package/types/src/ui/tag/index.d.ts.map +0 -1
- package/types/src/wc-bridge.d.ts +0 -23
- package/types/src/wc-bridge.d.ts.map +0 -1
- package/types/src/withInstall.d.ts +0 -4
- package/types/src/withInstall.d.ts.map +0 -1
- package/types/tsconfig.tsbuildinfo +0 -1
package/es/subject/single.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{html as e,css as t,LitElement as s}from"lit";import{property as i,state as r}from"lit/decorators.js";import{safeCustomElement as o}from"../base/define.mjs";import{uid as a}from"../base/uid.mjs";import{SUB_TEXT_EDITOR_TOOLBAR as n}from"../editor/toolbar.mjs";import{emitSubjectEvent as l,showSubjectToast as c,emitSubjectModelValue as h,getSubjectImageResources as d,getSubjectVideoResource as p,resolveSubjectCategoryLabel as u,buildSubjectPreviewTitle as w,buildSubjectSortingTitle as m}from"./shared-methods.mjs";import{subjectHostStyles as g,subjectControlResetStyles as x,subjectPreviewBaseStyles as y,subjectFormBaseStyles as _,subjectTextareaStyles as v}from"./shared-styles.mjs";import{sortingCardStyles as f,renderSortingCard as b}from"./sorting-card.mjs";import{SubjectTypeLabel as $}from"./types.mjs";var k=Object.defineProperty,A=Object.getOwnPropertyDescriptor,C=(e,t,s,i)=>{for(var r,o=i>1?void 0:i?A(t,s):t,a=e.length-1;a>=0;a--)(r=e[a])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&k(t,s,o),o};class I extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"VALIDATION_ERROR",s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;super(e),this.code=t,this.field=s,this.row=i,this.name="SubjectError"}static from(e){return new I(e.message,e.code,e.field,e.row)}}const T=e`<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>`,S=e`<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>`,E=e`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>`;function R(e){return e.replace(/^\d+\.\s*/,"").replace(/[\s,,。.!!??;;::、'"“”‘’()()[\]【】\-_/\\]+/g,"").toLowerCase()}function L(e){return String(e??"").trim()}function D(e){return String(e??"").split(",").map(e=>e.trim()).filter(Boolean).join(",")}let O=class extends s{constructor(){super(...arguments),this["order-index"]=0,this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["is-set-correct-answer"]=!1,this.lockAnswerKey=!1,this["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["hide-add-rich-text"]=!1,this["show-rich-text"]=!1,this["show-delete-action"]=!0,this["show-save-action"]=!0,this.sorting=!1,this["show-answer-setting"]=!1,this["show-key"]=!1,this["show-analysis"]=!1,this.type="single",this["answer-check-type"]=1,this["exam-answer-relation-type"]=0,this["rich-text-content"]="",this.analysis="",this["least-answer-count"]=null,this["exam-expand"]="",this["custom-id"]="",this["exam-id"]=0,this["category-id"]="",this["upload-image"]=async e=>new Promise((t,s)=>{const i=new FileReader;i.onload=e=>t(e.target?.result),i.onerror=s,i.readAsDataURL(e)}),this["tag-list"]=[],this["category-list"]=[],this["ai-answer"]="",this["resource-list"]=[],this["show-tag"]=!1,this["show-category"]=!1,this["show-ai"]=!1,this["show-resource"]=!1,this["show-jump"]=!1,this["has-jump"]=!1,this["search-api"]="",this["model-value"]="",this["use-model"]=!1,this._answers=[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.title="",this._title="",this._analysis="",this._richText="",this._showRichText=!1,this._leastAnswerCount=null,this._answerCheckType=1,this._isKey=!1,this._orderList=[],this._selectedTagList=[],this._categoryId="",this._searchResults=[],this._searchOpen=!1,this._searchLoading=!1,this._sortDropdownOpen=!1,this._imageViewerOpen=!1,this._imageViewerIndex=0,this._videoViewerOpen=!1,this._correctHintDialogOpen=!1,this._hasShownCorrectHint=!1,this._changeTypeDialogOpen=!1,this._searchTimer=null,this._searchToken=0,this.TITLE_MAX=200,this.ANSWER_MAX=100,this._handleDocumentClick=e=>{const t=e.composedPath(),s=this.shadowRoot?.querySelector(".multi-select-wrapper"),i=this.shadowRoot?.querySelector(".search-wrap");s&&!t.includes(s)&&(this._sortDropdownOpen=!1),i&&!t.includes(i)&&(this._searchOpen=!1),this.requestUpdate()}}get"answer-list"(){return this._answers}set"answer-list"(e){if(this["is-edit"])return;const t=Array.isArray(e)?e:[];this._answers=t.length?t.map(e=>this._normalizeAnswerItem(e)):[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.requestUpdate("answer-list")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this._syncExternalProps()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick),this._searchTimer&&(window.clearTimeout(this._searchTimer),this._searchTimer=null)}willUpdate(e){e.has("is-edit")&&this["is-edit"]&&this._syncProps(),!this["is-edit"]&&(e.has("title")||e.has("answer-list")||e.has("analysis")||e.has("least-answer-count")||e.has("answer-check-type")||e.has("tag-list")||e.has("category-id")||e.has("rich-text-content"))&&this._syncExternalProps(),e.has("is-key")&&(this._isKey=this["is-key"]),e.has("tag-list")&&(this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(e=>({...e})):[]),e.has("category-id")&&(this._categoryId=this["category-id"]?String(this["category-id"]):""),(e.has("exam-expand")||e.has("answer-list"))&&this._syncExamExpand(),e.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_supportsLeastAnswerCount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.type;return"multiple"===e||"sort"===e}_normalizeLeastAnswerCount(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.type;if(!this._supportsLeastAnswerCount(t)||""===e||null==e)return null;const s=Number(e);return Number.isFinite(s)&&s>0?s:null}_leastAnswerCountSuffix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.type;return this._supportsLeastAnswerCount(t)&&null!==e?`,至少选${e}项${"sort"===t?"并排序":""}`:""}_normalizeAnswerItem(e){const t={...e,title:L(e?.title??e?.answer??""),isCorrect:!!e?.isCorrect},s=e?.answerId??e?.examAnswerId;return void 0!==s&&(t.answerId=s),t}_syncExternalProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=this._normalizeLeastAnswerCount(this["least-answer-count"]),this._answerCheckType=this["answer-check-type"]||1,this._isKey=this["is-key"],this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(e=>({...e})):[],this._categoryId=this["category-id"]?String(this["category-id"]):"",this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],this["answer-list"]?.length&&(this._answers=this["answer-list"].map(e=>this._normalizeAnswerItem(e)))}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=this._normalizeLeastAnswerCount(this["least-answer-count"]),this._answerCheckType=this["answer-check-type"]||1,this._isKey=this["is-key"],this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(e=>({...e})):[],this._categoryId=this["category-id"]?String(this["category-id"]):"",this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],this["answer-list"]?.length&&(this._answers=this["answer-list"].map(e=>this._normalizeAnswerItem(e))),this._syncExamExpand()}_syncExamExpand(){if(!this["exam-expand"]||!this["answer-list"]?.length)return;const e=this["exam-expand"].split(","),t=this["answer-list"];this._orderList=e.map(e=>{const s=t.findIndex((t,s)=>String(t.answerId??t.orderIndex??s+1)===String(e));return s>=0?this._label(s):""}).filter(Boolean)}_emit(e,t){l(this,e,t)}_searchAnswerType(){return"single"===this.type?0:"multiple"===this.type?1:5}_queueSearch(e){this._searchTimer&&(window.clearTimeout(this._searchTimer),this._searchTimer=null);const t=e.trim();if(!t||!this["search-api"]&&"function"!=typeof this["search-handler"])return this._searchResults=[],this._searchOpen=!1,void(this._searchLoading=!1);this._searchTimer=window.setTimeout(()=>{this._runSearch(t)},300)}async _runSearch(e){const t=++this._searchToken;this._searchLoading=!0,this._searchOpen=!0,this.requestUpdate();try{let s=[];if("function"==typeof this["search-handler"])s=await this["search-handler"](e,this._searchAnswerType());else if(this["search-api"]){const t=new URLSearchParams({searchKey:e,answerType:String(this._searchAnswerType())}),i=await fetch(`${this["search-api"]}${this["search-api"].includes("?")?"&":"?"}${t.toString()}`);if(!i.ok)throw new Error(`HTTP ${i.status}`);const r=await i.json();s=(Array.isArray(r)?r:Array.isArray(r?.data)?r.data:[]).map(e=>({...e,value:e?.value||e?.title||""}))}if(t!==this._searchToken)return;this._searchResults=Array.isArray(s)?s:[]}catch(e){if(t!==this._searchToken)return;this._searchResults=[],c(e?.message||"题库搜索失败")}finally{t===this._searchToken&&(this._searchLoading=!1,this.requestUpdate())}}_selectSearchResult(e){const t=e.value||e.title||"";this._title=t,this._searchResults=[],this._searchOpen=!1,this["use-model"]&&h(this,this._title),this._emit("title-select",{...e,id:e.id??e.examId??e.questionId,title:e.title||t,value:t,customId:this["custom-id"]||""})}_applyAiAnswer(){if(!this["ai-answer"]?.trim())return void c("暂无 AI 推荐答案");const e=this["ai-answer"].split(/\r?\n/).map(e=>R(e)).filter(Boolean);let t=0;if("single"===this.type){let s=!1;this._answers=this._answers.map(i=>{const r=!s&&e.includes(R(i.title||""));return r&&(s=!0,t++),{...i,isCorrect:r}})}else this._answers=this._answers.map(s=>{const i=e.includes(R(s.title||""));return i&&t++,{...s,isCorrect:i}});t?this.requestUpdate():c("未找到匹配的选项,请检查选项内容是否一致")}_onCategoryChange(e){this._categoryId=e,this._emit("category-change",{value:e,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_setRelation(e,t){const s=e.customAnswerId?{...e}:{...e,customAnswerId:e.answerId||a()};this._answers=this._answers.map((e,i)=>i===t?s:e),this.requestUpdate(),this._emit("set-relation",{customId:this["custom-id"]||"",examId:this["exam-id"]||0,answerIndex:t,answer:s})}_relationLength(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>e+(Array.isArray(t?.relationAnswers)?t.relationAnswers.length:0),0)}_emitEditResultItem(e,t){this._emit("edit-result-item",{customId:this["custom-id"]||"",examId:this["exam-id"]||0,answerIndex:t,answer:{...e},resultItem:e.resultItem||""})}_resultSlotName(e){return`business-result-item-${e}`}_imageResources(){return d(this["resource-list"]||[])}_videoResource(){return p(this["resource-list"]||[])}_openImageViewer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._imageResources().length&&(this._imageViewerIndex=e,this._imageViewerOpen=!0)}_closeImageViewer(){this._imageViewerOpen=!1}_moveImage(e){const t=this._imageResources();t.length&&(this._imageViewerIndex=(this._imageViewerIndex+e+t.length)%t.length)}_openVideoViewer(){this._videoResource()?.url&&(this._videoViewerOpen=!0)}_closeVideoViewer(){this._videoViewerOpen=!1}_label(e){return String.fromCharCode(65+e)}get _titlePlaceholder(){return"single"===this.type?"单选题":"multiple"===this.type?"多选题":"排序题"}_setCorrect(e,t){this.lockAnswerKey||("single"===this.type?this._answers=this._answers.map(s=>({...s,isCorrect:s===e?t:!t&&!!s.isCorrect})):this._answers=this._answers.map(s=>s===e?{...s,isCorrect:t}:s),this.requestUpdate())}_onTitleInput(e){const t=e.target;t.value.length>this.TITLE_MAX&&(t.value=t.value.slice(0,this.TITLE_MAX)),this._title=t.value,this._queueSearch(this._title),this["use-model"]&&h(this,this._title)}_onAnswerInput(e,t){const s=e.target;s.value.length>this.ANSWER_MAX&&(s.value=s.value.slice(0,this.ANSWER_MAX)),this._answers[t].title=s.value,this.requestUpdate()}_addAnswer(e){const t=[...this._answers];t.splice(e+1,0,{title:"",isCorrect:!1,customAnswerId:a()}),this._answers=t}_deleteAnswer(e){this._answers.length<3||(this._answers=this._answers.filter((t,s)=>s!==e))}_toggleSortItem(e){const t=this._orderList.indexOf(e);this._orderList=t>=0?this._orderList.filter(t=>t!==e):[...this._orderList,e],this.requestUpdate()}_removeSortItem(e){this._orderList=this._orderList.filter(t=>t!==e),this.requestUpdate()}_getSortOrder(e){const t=this._orderList.indexOf(this._label(e));return t>=0?t+1:null}_sortAnswerValue(e){const t=e.charCodeAt(0)-65,s=this._answers[t];return s?.answerId??t+1}_rowMeta(){return{customId:this["custom-id"]||void 0,answerType:this.type,orderIndex:this["order-index"]}}_collectSnapshot(){const e=(this["is-edit"]?this._answers:this["answer-list"]||[]).map(e=>({...e,title:L(e?.title??e?.answer??""),isCorrect:!!e?.isCorrect,resultItem:L(e?.resultItem??"")})),t=this["is-edit"]?[...this._orderList]:(()=>{const e=this["exam-expand"];return e?e.split(",").map(e=>{const t=this["answer-list"]?.findIndex((t,s)=>String(t.answerId??t.orderIndex??s+1)===String(e));return t>=0?this._label(t):""}).filter(Boolean):[]})();return{title:L(this["is-edit"]?this._title:this.title||""),answers:e,analysis:L(this["is-edit"]?this._analysis:this.analysis||""),leastAnswerCount:this["is-edit"]?this._leastAnswerCount:this._normalizeLeastAnswerCount(this["least-answer-count"]),selectedTagList:Array.isArray(this._selectedTagList)?[...this._selectedTagList]:[],examExpand:this["is-edit"]?t.map(e=>this._sortAnswerValue(e)).join(","):this["exam-expand"]||"",showRichText:this["is-edit"]?this._showRichText:!!this["rich-text-content"],richText:this["is-edit"]?this._richText:this["rich-text-content"]||"",orderList:t}}_validateSnapshot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.type;const s=this._rowMeta(),i=[];e.title||i.push(new I("题目标题不能为空!","EMPTY_TITLE","title",s));let r=!1,o=0;e.answers.forEach((e,a)=>{e.title?.trim()||i.push(new I(`选项${String.fromCharCode(65+a)}未填写`,"ANSWER_EMPTY","answers",s)),"sort"!==t&&e.isCorrect&&(r=!0,o++)});return new Set(e.answers.map(e=>e.title)).size!==e.answers.length&&e.answers.length>0&&i.push(new I("选项不能重复","DUPLICATE_ANSWERS","answers",s)),"single"===t&&o>1&&i.push(new I("此题为单选题,设置了多个推荐/正确选项,请保存时确认是否切换为多选题","SINGLE_MULTI_CORRECT","answers",s)),"multiple"===t&&(1===o&&i.push(new I("请设置至少两个推荐/正确选项","CORRECT_COUNT_INVALID","answers",s)),o>0&&(r=!0),r&&null!==e.leastAnswerCount&&o<e.leastAnswerCount&&i.push(new I("至少选几项与推荐/正确选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",s))),"sort"===t&&(r=e.orderList.length>0,null!==e.leastAnswerCount&&e.orderList.length<e.leastAnswerCount&&i.push(new I("至少选几项与推荐/正确选项数不符","LEAST_ANSWER_COUNT_INVALID","orderList",s))),{errors:i,isSetCorrectAnswer:r,correctAnswerCount:o}}_serialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.type;const t=this._collectSnapshot(),{errors:s,isSetCorrectAnswer:i}=this._validateSnapshot(t,e);if(s.length)throw s[0];const r={answerType:String(e),examTypeEnum:String(e),title:t.title,answers:t.answers.map((e,t)=>{const s=e.resultItem?1:Array.isArray(e.answerRelations)&&e.answerRelations.length?2:null,i={...e,orderIndex:t+1,answer:e.title,relationType:s};return void 0!==e.answerId&&(i.examAnswerId=e.answerId),null===s&&delete i.relationType,i}),examExpand:t.examExpand,analysis:t.analysis,isSetCorrectAnswer:i,examRichTextContent:t.showRichText?t.richText:""};return this["exam-answer-relation-type"]&&(r.examAnswerRelationType=this["exam-answer-relation-type"]),this._supportsLeastAnswerCount(e)&&(r.leastAnswerCount=t.leastAnswerCount),this["custom-id"]&&(r.customId=this["custom-id"]),r}_shouldShowCorrectHint(){return"sort"===this.type?!this._orderList.length:!this._answers.some(e=>!!e.isCorrect)}async _finalizeSave(){try{const e=await this.toJSON();this._emit("save",e)}catch(e){c(e.message)}}async toJSON(){return Promise.resolve(this._serialize())}validate(){return this._validateSnapshot(this._collectSnapshot()).errors}setResultItem(e,t){e<0||e>=this._answers.length||(this._answers=this._answers.map((s,i)=>i===e?{...s,resultItem:t||""}:s),this.requestUpdate())}setAnswerRelation(e,t){e&&(this._answers=this._answers.map(s=>String(s.customAnswerId??s.answerId??"")===String(e)?{...s,answerRelations:t}:s),this.requestUpdate())}_renderCorrectHintDialog(){return this._correctHintDialogOpen?e`
|
|
2
|
-
<div class="modal-backdrop" @click=${()=>{this.
|
|
1
|
+
import{html as r,css as f,LitElement as _}from"lit";import{property as a,state as n}from"lit/decorators.js";import{safeCustomElement as $}from"../base/define.mjs";import{uid as x}from"../base/uid.mjs";import{SUB_TEXT_EDITOR_TOOLBAR as S}from"../editor/toolbar.mjs";import{emitSubjectEvent as j,showSubjectToast as h,emitSubjectModelValue as g,getSubjectImageResources as k,getSubjectVideoResource as q,resolveSubjectCategoryLabel as m,buildSubjectPreviewTitle as T,buildSubjectSortingTitle as A}from"./shared-methods.mjs";import{subjectHostStyles as C,subjectControlResetStyles as D,subjectPreviewBaseStyles as I,subjectFormBaseStyles as E,subjectTextareaStyles as R}from"./shared-styles.mjs";import{hasSingleSearchSource as L,searchSingleSubjects as O,buildSingleSearchSelection as V,dismissSingleCorrectHintDialog as w,acknowledgeSingleCorrectHint as z,dismissSingleChangeTypeDialog as d,resolveSingleSaveDecision as B,applySingleSaveDecisionToDialogs as P}from"./single-interactions.mjs";import{normalizeSingleAnswerList as H,buildSingleEditorState as M,resolveSingleOrderList as y,buildSingleSnapshot as K,validateSingleSnapshot as v,serializeSingleSnapshot as N,leastAnswerCountSuffix as U,normalizeLeastAnswerCount as b}from"./single-model.mjs";import{applySingleAiAnswer as X,countSingleRelationAnswers as W,setSingleCorrectState as F,updateSingleAnswerTitle as Y,insertSingleAnswerAfter as J,deleteSingleAnswerAt as Q,toggleSingleSortLetter as G,removeSingleSortLetter as Z,getSingleSortOrder as ee,resolveSingleSortAnswerValue as te,shouldShowSingleCorrectHint as se}from"./single-state.mjs";import{sortingCardStyles as ie,renderSortingCard as re}from"./sorting-card.mjs";import{trimText as oe}from"./subject-shared.mjs";import{SubjectError as qe,trimCommaSeparatedText as Te}from"./subject-shared.mjs";import{SubjectTypeLabel as ae}from"./types.mjs";var le=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,i=(e,t,o,l)=>{for(var c=l>1?void 0:l?ne(t,o):t,p=e.length-1,u;p>=0;p--)(u=e[p])&&(c=(l?u(t,o,c):u(c))||c);return l&&c&&le(t,o,c),c};const ce=r`<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>`,he=r`<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>`,de=r`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>`;let s=class extends _{constructor(){super(...arguments),this["order-index"]=0,this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["is-set-correct-answer"]=!1,this.lockAnswerKey=!1,this["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["hide-add-rich-text"]=!1,this["show-rich-text"]=!1,this["show-delete-action"]=!0,this["show-save-action"]=!0,this.sorting=!1,this["show-answer-setting"]=!1,this["show-key"]=!1,this["show-analysis"]=!1,this.type="single",this["answer-check-type"]=1,this["exam-answer-relation-type"]=0,this["rich-text-content"]="",this.analysis="",this["least-answer-count"]=null,this["exam-expand"]="",this["custom-id"]="",this["exam-id"]=0,this["category-id"]="",this["upload-image"]=async e=>new Promise((t,o)=>{const l=new FileReader;l.onload=c=>t(c.target?.result),l.onerror=o,l.readAsDataURL(e)}),this["tag-list"]=[],this["category-list"]=[],this["ai-answer"]="",this["resource-list"]=[],this["show-tag"]=!1,this["show-category"]=!1,this["show-ai"]=!1,this["show-resource"]=!1,this["show-jump"]=!1,this["has-jump"]=!1,this["search-api"]="",this["model-value"]="",this["use-model"]=!1,this._answers=[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.title="",this._title="",this._analysis="",this._richText="",this._showRichText=!1,this._leastAnswerCount=null,this._answerCheckType=1,this._isKey=!1,this._orderList=[],this._selectedTagList=[],this._categoryId="",this._searchResults=[],this._searchOpen=!1,this._searchLoading=!1,this._sortDropdownOpen=!1,this._imageViewerOpen=!1,this._imageViewerIndex=0,this._videoViewerOpen=!1,this._correctHintDialogOpen=!1,this._hasShownCorrectHint=!1,this._changeTypeDialogOpen=!1,this._searchTimer=null,this._searchToken=0,this.TITLE_MAX=200,this.ANSWER_MAX=100,this._handleDocumentClick=e=>{const t=e.composedPath(),o=this.shadowRoot?.querySelector(".multi-select-wrapper"),l=this.shadowRoot?.querySelector(".search-wrap");o&&!t.includes(o)&&(this._sortDropdownOpen=!1),l&&!t.includes(l)&&(this._searchOpen=!1),this.requestUpdate()}}get"answer-list"(){return this._answers}set"answer-list"(e){this["is-edit"]||(this._answers=H(e),this.requestUpdate("answer-list"))}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this._syncExternalProps()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick),this._searchTimer&&(window.clearTimeout(this._searchTimer),this._searchTimer=null)}willUpdate(e){e.has("is-edit")&&this["is-edit"]&&this._syncProps(),!this["is-edit"]&&(e.has("title")||e.has("answer-list")||e.has("analysis")||e.has("least-answer-count")||e.has("answer-check-type")||e.has("tag-list")||e.has("category-id")||e.has("rich-text-content"))&&this._syncExternalProps(),e.has("is-key")&&(this._isKey=this["is-key"]),e.has("tag-list")&&(this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(t=>({...t})):[]),e.has("category-id")&&(this._categoryId=this["category-id"]?String(this["category-id"]):""),(e.has("exam-expand")||e.has("answer-list"))&&this._syncExamExpand(),e.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_applyEditorState(e){this._title=e.title,this._analysis=e.analysis,this._leastAnswerCount=e.leastAnswerCount,this._answerCheckType=e.answerCheckType,this._isKey=e.isKey,this._selectedTagList=e.selectedTagList,this._categoryId=e.categoryId,this._richText=e.richText,this._showRichText=e.showRichText,e.answers&&(this._answers=e.answers),e.orderList&&(this._orderList=e.orderList)}_buildEditorState(e=!1){return M({answerType:this.type,title:this.title,analysis:this.analysis,leastAnswerCount:this["least-answer-count"],answerCheckType:this["answer-check-type"],isKey:this["is-key"],tagList:this["tag-list"],categoryId:this["category-id"],richTextContent:this["rich-text-content"],answerList:this["answer-list"],examExpand:this["exam-expand"],labelForIndex:t=>this._label(t),includeOrderList:e})}_syncExternalProps(){this._applyEditorState(this._buildEditorState())}_syncProps(){this._applyEditorState(this._buildEditorState(!0))}_syncExamExpand(){!this["exam-expand"]||!this["answer-list"]?.length||(this._orderList=y({examExpand:this["exam-expand"],answers:this["answer-list"],labelForIndex:e=>this._label(e)}))}_emit(e,t){j(this,e,t)}_queueSearch(e){this._searchTimer&&(window.clearTimeout(this._searchTimer),this._searchTimer=null);const t=e.trim();if(!t||!L(this["search-api"],this["search-handler"])){this._searchResults=[],this._searchOpen=!1,this._searchLoading=!1;return}this._searchTimer=window.setTimeout(()=>{this._runSearch(t)},300)}async _runSearch(e){const t=++this._searchToken;this._searchLoading=!0,this._searchOpen=!0,this.requestUpdate();try{const o=await O({answerType:this.type,query:e,searchApi:this["search-api"],searchHandler:this["search-handler"]});if(t!==this._searchToken)return;this._searchResults=o}catch(o){if(t!==this._searchToken)return;this._searchResults=[],h(o?.message||"题库搜索失败")}finally{t===this._searchToken&&(this._searchLoading=!1,this.requestUpdate())}}_selectSearchResult(e){const{selectedTitle:t,detail:o}=V(e,this["custom-id"]||"");this._title=t,this._searchResults=[],this._searchOpen=!1,this["use-model"]&&g(this,this._title),this._emit("title-select",o)}_applyAiAnswer(){if(!this["ai-answer"]?.trim()){h("暂无 AI 推荐答案");return}const e=X({answers:this._answers,aiAnswer:this["ai-answer"],answerType:this.type});if(!e.matchedCount){h("未找到匹配的选项,请检查选项内容是否一致");return}this._answers=e.answers}_onCategoryChange(e){this._categoryId=e,this._emit("category-change",{value:e,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_setRelation(e,t){const o=e.customAnswerId?{...e}:{...e,customAnswerId:e.answerId||x()};this._answers=this._answers.map((l,c)=>c===t?o:l),this.requestUpdate(),this._emit("set-relation",{customId:this["custom-id"]||"",examId:this["exam-id"]||0,answerIndex:t,answer:o})}_relationLength(e=[]){return W(e)}_emitEditResultItem(e,t){this._emit("edit-result-item",{customId:this["custom-id"]||"",examId:this["exam-id"]||0,answerIndex:t,answer:{...e},resultItem:e.resultItem||""})}_resultSlotName(e){return`business-result-item-${e}`}_imageResources(){return k(this["resource-list"]||[])}_videoResource(){return q(this["resource-list"]||[])}_openImageViewer(e=0){this._imageResources().length&&(this._imageViewerIndex=e,this._imageViewerOpen=!0)}_closeImageViewer(){this._imageViewerOpen=!1}_moveImage(e){const t=this._imageResources();t.length&&(this._imageViewerIndex=(this._imageViewerIndex+e+t.length)%t.length)}_openVideoViewer(){this._videoResource()?.url&&(this._videoViewerOpen=!0)}_closeVideoViewer(){this._videoViewerOpen=!1}_label(e){return String.fromCharCode(65+e)}get _titlePlaceholder(){return this.type==="single"?"单选题":this.type==="multiple"?"多选题":"排序题"}_setCorrect(e,t){if(this.lockAnswerKey)return;const o=typeof e=="number"?e:this._answers.indexOf(e);o<0||(this._answers=F(this._answers,this.type,o,t))}_onTitleInput(e){const t=e.target;t.value.length>this.TITLE_MAX&&(t.value=t.value.slice(0,this.TITLE_MAX)),this._title=t.value,this._queueSearch(this._title),this["use-model"]&&g(this,this._title)}_onAnswerInput(e,t){const o=e.target;o.value.length>this.ANSWER_MAX&&(o.value=o.value.slice(0,this.ANSWER_MAX)),this._answers=Y(this._answers,t,o.value,this.ANSWER_MAX)}_addAnswer(e){this._answers=J(this._answers,e,()=>x())}_deleteAnswer(e){this._answers=Q(this._answers,e)}_toggleSortItem(e){this._orderList=G(this._orderList,e)}_removeSortItem(e){this._orderList=Z(this._orderList,e)}_getSortOrder(e){return ee(this._orderList,this._label(e))}_sortAnswerValue(e){return te(e,this._answers)}_rowMeta(){return{customId:this["custom-id"]||void 0,answerType:this.type,orderIndex:this["order-index"]}}_dialogState(){return{correctHintDialogOpen:this._correctHintDialogOpen,changeTypeDialogOpen:this._changeTypeDialogOpen,hasShownCorrectHint:this._hasShownCorrectHint}}_applyDialogState(e){this._correctHintDialogOpen=e.correctHintDialogOpen,this._changeTypeDialogOpen=e.changeTypeDialogOpen,this._hasShownCorrectHint=e.hasShownCorrectHint}_collectSnapshot(){const e=this["is-edit"]?[...this._orderList]:y({examExpand:this["exam-expand"],answers:this["answer-list"],labelForIndex:t=>this._label(t)});return K({answerType:this.type,title:this["is-edit"]?this._title:this.title||"",answers:this["is-edit"]?this._answers:this["answer-list"]||[],analysis:this["is-edit"]?this._analysis:this.analysis||"",leastAnswerCount:this["is-edit"]?this._leastAnswerCount:this["least-answer-count"],selectedTagList:this._selectedTagList,examExpand:this["is-edit"]?"":this["exam-expand"]||"",showRichText:this["is-edit"]?this._showRichText:!!this["rich-text-content"],richText:this["is-edit"]?this._richText:this["rich-text-content"]||"",orderList:e,sortAnswerValue:this["is-edit"]?t=>this._sortAnswerValue(t):void 0})}_serialize(e=this.type){const t=this._collectSnapshot(),{errors:o,isSetCorrectAnswer:l}=v(t,e,this._rowMeta());if(o.length)throw o[0];return N(t,{answerType:e,isSetCorrectAnswer:l,examAnswerRelationType:this["exam-answer-relation-type"],customId:this["custom-id"]})}_shouldShowCorrectHint(){return se({answerType:this.type,answers:this._answers,orderList:this._orderList})}async _finalizeSave(){try{const e=await this.toJSON();this._emit("save",e)}catch(e){h(e.message)}}async toJSON(){return Promise.resolve(this._serialize())}validate(){return v(this._collectSnapshot(),this.type,this._rowMeta()).errors}setResultItem(e,t){e<0||e>=this._answers.length||(this._answers=this._answers.map((o,l)=>l===e?{...o,resultItem:t||""}:o),this.requestUpdate())}setAnswerRelation(e,t){e&&(this._answers=this._answers.map(o=>String(o.customAnswerId??o.answerId??"")===String(e)?{...o,answerRelations:t}:o),this.requestUpdate())}_renderCorrectHintDialog(){return this._correctHintDialogOpen?r`
|
|
2
|
+
<div class="modal-backdrop" @click=${()=>{this._applyDialogState(w(this._dialogState()))}}>
|
|
3
3
|
<div class="modal correct-hint-dialog" @click=${e=>e.stopPropagation()}>
|
|
4
4
|
<div class="modal-header">
|
|
5
5
|
<span class="modal-title">温馨提示</span>
|
|
@@ -10,109 +10,109 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
12
|
<div class="modal-footer">
|
|
13
|
-
<button @click=${async()=>{this.
|
|
14
|
-
<button class="primary" @click=${()=>{this.
|
|
13
|
+
<button @click=${async()=>{this._applyDialogState(z(this._dialogState())),await this._finalizeSave()}}>完成编辑</button>
|
|
14
|
+
<button class="primary" @click=${()=>{this._applyDialogState(w(this._dialogState()))}}>去设置</button>
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
|
-
`:""}_renderChangeTypeDialog(){return this._changeTypeDialogOpen?
|
|
19
|
-
<div class="modal-backdrop" @click=${()=>{this.
|
|
18
|
+
`:""}_renderChangeTypeDialog(){return this._changeTypeDialogOpen?r`
|
|
19
|
+
<div class="modal-backdrop" @click=${()=>{this._applyDialogState(d(this._dialogState()))}}>
|
|
20
20
|
<div class="modal" @click=${e=>e.stopPropagation()}>
|
|
21
21
|
<div class="modal-header">
|
|
22
22
|
<span class="modal-title">提示</span>
|
|
23
|
-
<button class="modal-close" @click=${()=>{this.
|
|
23
|
+
<button class="modal-close" @click=${()=>{this._applyDialogState(d(this._dialogState()))}}>✕</button>
|
|
24
24
|
</div>
|
|
25
25
|
<div class="modal-body">
|
|
26
26
|
<div class="value-text">此题为单选题,设置了多个推荐/正确选项,是否切换成多选题?</div>
|
|
27
27
|
</div>
|
|
28
28
|
<div class="modal-footer">
|
|
29
|
-
<button @click=${()=>{this.
|
|
30
|
-
<button class="primary" @click=${()=>{try{const e=this._serialize("multiple");this.
|
|
29
|
+
<button @click=${()=>{this._applyDialogState(d(this._dialogState()))}}>取消</button>
|
|
30
|
+
<button class="primary" @click=${()=>{try{const e=this._serialize("multiple");this._applyDialogState(d(this._dialogState())),this._emit("save",e)}catch(e){h(e?.message||"保存失败")}}}>切换</button>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
|
-
`:""}_renderSearchDropdown(){return
|
|
34
|
+
`:""}_renderSearchDropdown(){return!this["is-edit"]||!this._searchOpen&&!this._searchLoading?"":r`
|
|
35
35
|
<div class="search-dropdown">
|
|
36
|
-
${this._searchLoading?
|
|
37
|
-
<div class="search-item" @click=${()=>this._selectSearchResult(
|
|
38
|
-
`):
|
|
36
|
+
${this._searchLoading?r`<div class="search-empty">搜索中...</div>`:this._searchResults.length?this._searchResults.map(e=>r`
|
|
37
|
+
<div class="search-item" @click=${()=>this._selectSearchResult(e)}>${e.value||e.title}</div>
|
|
38
|
+
`):r`<div class="search-empty">暂无匹配题目</div>`}
|
|
39
39
|
</div>
|
|
40
|
-
|
|
40
|
+
`}_renderCategorySection(){return this["show-category"]?r`
|
|
41
41
|
<div class="flex-items-start section-row">
|
|
42
42
|
<div class="label"><span>分类:</span></div>
|
|
43
43
|
<div style="flex:1">
|
|
44
|
-
${this["is-edit"]?
|
|
44
|
+
${this["is-edit"]?r`
|
|
45
45
|
<select class="el-select" .value=${String(this._categoryId)}
|
|
46
46
|
@change=${e=>this._onCategoryChange(e.target.value)}>
|
|
47
47
|
<option value="">选择分类</option>
|
|
48
|
-
${this["category-list"].map(
|
|
49
|
-
<option value=${String(
|
|
48
|
+
${this["category-list"].map(e=>r`
|
|
49
|
+
<option value=${String(e.categoryId)} ?selected=${String(e.categoryId)===String(this._categoryId)}>${e.title}</option>
|
|
50
50
|
`)}
|
|
51
51
|
</select>
|
|
52
|
-
`:
|
|
52
|
+
`:r`<span class="value-text">${m(this["category-list"],this._categoryId)}</span>`}
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
|
-
`:""}_renderAiSection(){return
|
|
55
|
+
`:""}_renderAiSection(){return!this["show-ai"]||!["single","multiple"].includes(this.type)?"":r`
|
|
56
56
|
<div class="flex-items-start section-row">
|
|
57
57
|
<div class="label"><span>AI推荐:</span></div>
|
|
58
58
|
<div style="flex:1">
|
|
59
59
|
<span class="value-text">${this["ai-answer"]||"暂无"}</span>
|
|
60
|
-
${this["is-edit"]?
|
|
60
|
+
${this["is-edit"]?r`<div style="margin-top:8px"><span class="el-link" @click=${()=>this._applyAiAnswer()}>一键勾选</span></div>`:""}
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
|
-
|
|
63
|
+
`}_renderResourceSection(){if(!this["show-resource"])return"";const e=this._imageResources(),t=this._videoResource();return r`
|
|
64
64
|
<div class="flex-items-start section-row">
|
|
65
65
|
<div class="label"><span>资源:</span></div>
|
|
66
66
|
<div style="flex:1">
|
|
67
67
|
<div class="resource-summary">
|
|
68
|
-
图片 ${
|
|
68
|
+
图片 ${e.length} 张${t?",含视频资源":""}
|
|
69
69
|
</div>
|
|
70
70
|
<div class="resource-actions">
|
|
71
|
-
${
|
|
72
|
-
${
|
|
73
|
-
${
|
|
71
|
+
${e.length?r`<span class="el-link" @click=${()=>this._openImageViewer(0)}>查看图片</span>`:""}
|
|
72
|
+
${t?.url?r`<span class="el-link" @click=${()=>this._openVideoViewer()}>查看视频</span>`:""}
|
|
73
|
+
${!e.length&&!t?.url?r`<span class="muted-text">暂无资源</span>`:""}
|
|
74
74
|
</div>
|
|
75
|
-
${
|
|
75
|
+
${e.length?r`
|
|
76
76
|
<div class="resource-thumbs">
|
|
77
|
-
${
|
|
78
|
-
<img class="resource-thumb" src=${
|
|
77
|
+
${e.slice(0,4).map((o,l)=>r`
|
|
78
|
+
<img class="resource-thumb" src=${o} alt="resource" @click=${()=>this._openImageViewer(l)} />
|
|
79
79
|
`)}
|
|
80
80
|
</div>
|
|
81
81
|
`:""}
|
|
82
82
|
</div>
|
|
83
83
|
</div>
|
|
84
|
-
`}_renderImageViewer(){if(!this._imageViewerOpen)return"";const
|
|
84
|
+
`}_renderImageViewer(){if(!this._imageViewerOpen)return"";const e=this._imageResources(),t=e[this._imageViewerIndex];return t?r`
|
|
85
85
|
<div class="modal-backdrop" @click=${()=>this._closeImageViewer()}>
|
|
86
|
-
<div class="modal" @click=${
|
|
86
|
+
<div class="modal" @click=${o=>o.stopPropagation()}>
|
|
87
87
|
<div class="modal-header">
|
|
88
88
|
<span class="modal-title">图片预览</span>
|
|
89
89
|
<button class="modal-close" @click=${()=>this._closeImageViewer()}>✕</button>
|
|
90
90
|
</div>
|
|
91
91
|
<div class="modal-body">
|
|
92
|
-
<div class="media-stage"><img src=${
|
|
92
|
+
<div class="media-stage"><img src=${t} alt="resource-preview" /></div>
|
|
93
93
|
</div>
|
|
94
94
|
<div class="modal-footer">
|
|
95
95
|
<div class="media-footer">
|
|
96
|
-
<span class="muted-text">${this._imageViewerIndex+1} / ${
|
|
96
|
+
<span class="muted-text">${this._imageViewerIndex+1} / ${e.length}</span>
|
|
97
97
|
<div class="group">
|
|
98
|
-
${
|
|
99
|
-
${
|
|
98
|
+
${e.length>1?r`<button @click=${()=>this._moveImage(-1)}>上一张</button>`:""}
|
|
99
|
+
${e.length>1?r`<button @click=${()=>this._moveImage(1)}>下一张</button>`:""}
|
|
100
100
|
<button class="primary" @click=${()=>this._closeImageViewer()}>关闭</button>
|
|
101
101
|
</div>
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
104
|
</div>
|
|
105
105
|
</div>
|
|
106
|
-
`:""}_renderVideoViewer(){const
|
|
106
|
+
`:""}_renderVideoViewer(){const e=this._videoResource();return!this._videoViewerOpen||!e?.url?"":r`
|
|
107
107
|
<div class="modal-backdrop" @click=${()=>this._closeVideoViewer()}>
|
|
108
|
-
<div class="modal" @click=${
|
|
108
|
+
<div class="modal" @click=${t=>t.stopPropagation()}>
|
|
109
109
|
<div class="modal-header">
|
|
110
110
|
<span class="modal-title">视频预览</span>
|
|
111
111
|
<button class="modal-close" @click=${()=>this._closeVideoViewer()}>✕</button>
|
|
112
112
|
</div>
|
|
113
113
|
<div class="modal-body">
|
|
114
114
|
<div class="media-stage">
|
|
115
|
-
<video src=${
|
|
115
|
+
<video src=${e.url} controls playsinline></video>
|
|
116
116
|
</div>
|
|
117
117
|
</div>
|
|
118
118
|
<div class="modal-footer">
|
|
@@ -120,37 +120,37 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
120
120
|
</div>
|
|
121
121
|
</div>
|
|
122
122
|
</div>
|
|
123
|
-
|
|
123
|
+
`}async _save(e){e?.stopImmediatePropagation();const t=B({errors:this.validate(),hasShownCorrectHint:this._hasShownCorrectHint,shouldShowCorrectHint:this._shouldShowCorrectHint()});if(t.kind==="error"){h(t.error.message);return}const o=P(this._dialogState(),t);this._applyDialogState(o),t.kind==="save"&&await this._finalizeSave()}_renderPreview(){const e=this.type==="single"?"(单选题)":`(${this._titlePlaceholder}${U(b(this["least-answer-count"],this.type),this.type)})`,t=this["answer-list"],o=T(this["subject-prefix"],this["order-index"],this.title||"");return r`
|
|
124
124
|
<div class="preview">
|
|
125
125
|
<div class="preview-header">
|
|
126
126
|
<div class="preview-title-row">
|
|
127
|
-
<span class="title">${
|
|
128
|
-
<span class="preview-type">${
|
|
127
|
+
<span class="title">${o}</span>
|
|
128
|
+
<span class="preview-type">${e.replace(/[()]/g,"")}</span>
|
|
129
129
|
</div>
|
|
130
|
-
${this["show-rich-text"]&&this["rich-text-content"]?
|
|
130
|
+
${this["show-rich-text"]&&this["rich-text-content"]?r`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
131
131
|
</div>
|
|
132
132
|
<div class="preview-answer">
|
|
133
|
-
${
|
|
133
|
+
${t.map((l,c)=>r`
|
|
134
134
|
<div class="radio">
|
|
135
|
-
<input type="${"sort"
|
|
136
|
-
<span class="order">${this._label(
|
|
135
|
+
<input type="${this.type==="sort"?"checkbox":"radio"}" .checked=${!!l.isCorrect} disabled />
|
|
136
|
+
<span class="order">${this._label(c)}.</span>
|
|
137
137
|
<div class="answer-main">
|
|
138
|
-
<span class="answer-text">${
|
|
139
|
-
${"sort"
|
|
138
|
+
<span class="answer-text">${l.title}</span>
|
|
139
|
+
${this.type!=="sort"&&l.isCorrect?r`<span class="correct">推荐 / 正确选项</span>`:""}
|
|
140
140
|
</div>
|
|
141
|
-
${
|
|
141
|
+
${this.type!=="sort"&&(this["exam-answer-relation-type"]===1||this["exam-answer-relation-type"]===2)?r`
|
|
142
142
|
<div class="answer-meta">
|
|
143
|
-
${
|
|
144
|
-
${
|
|
143
|
+
${this["exam-answer-relation-type"]===1?r`<span class="result-info">${l.resultItem?"已设置结果项":"未设置结果项"}</span>`:""}
|
|
144
|
+
${this["exam-answer-relation-type"]===2?r`<span class="result-info">${Array.isArray(l.answerRelations)&&l.answerRelations.length?`关联了${this._relationLength(l.answerRelations)}项`:"未设置关联"}</span>`:""}
|
|
145
145
|
</div>
|
|
146
|
-
|
|
146
|
+
`:""}
|
|
147
147
|
</div>
|
|
148
148
|
`)}
|
|
149
149
|
</div>
|
|
150
|
-
${this["show-category"]&&this._categoryId?
|
|
150
|
+
${this["show-category"]&&this._categoryId?r`<div class="section-row"><span class="value-text">分类:${m(this["category-list"],this._categoryId)}</span></div>`:""}
|
|
151
151
|
${this["show-resource"]?this._renderResourceSection():""}
|
|
152
152
|
</div>
|
|
153
|
-
`}_renderSorting(){const e=
|
|
153
|
+
`}_renderSorting(){const e=oe(this["is-edit"]?this._title:this.title||"")||"未命名题目",t=A(this["subject-prefix"],this["order-index"],e);return re(t,ae[this.type]||this.type)}_renderEdit(){return r`
|
|
154
154
|
<div class="edit-form">
|
|
155
155
|
<div class="edit-row">
|
|
156
156
|
<div class="label"><span>题目:</span></div>
|
|
@@ -166,15 +166,15 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
166
166
|
</div>
|
|
167
167
|
</div>
|
|
168
168
|
|
|
169
|
-
${["multiple","sort"].includes(this.type)?
|
|
169
|
+
${["multiple","sort"].includes(this.type)?r`
|
|
170
170
|
<div class="edit-row section-row">
|
|
171
171
|
<div class="label"><span>设置:</span></div>
|
|
172
172
|
<div class="row-body">
|
|
173
|
-
<select class="el-select" .value=${
|
|
174
|
-
@change=${e=>{const t=e.target.value;this._leastAnswerCount=this.
|
|
173
|
+
<select class="el-select" .value=${this._leastAnswerCount===null?"":String(this._leastAnswerCount)} ?disabled=${this.lockAnswerKey}
|
|
174
|
+
@change=${e=>{const t=e.target.value;this._leastAnswerCount=b(t,this.type)}}>
|
|
175
175
|
<option value="">至少选择几项</option>
|
|
176
|
-
${Array.from({length:Math.max(0,this._answers.length-1)},(e,t)=>t+2).map(
|
|
177
|
-
<option value=${
|
|
176
|
+
${Array.from({length:Math.max(0,this._answers.length-1)},(e,t)=>t+2).map(e=>r`
|
|
177
|
+
<option value=${e} ?selected=${this._leastAnswerCount===e}>至少选择${e}项</option>
|
|
178
178
|
`)}
|
|
179
179
|
</select>
|
|
180
180
|
</div>
|
|
@@ -182,50 +182,50 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
182
182
|
`:""}
|
|
183
183
|
|
|
184
184
|
<div class="edit-row section-row edit-row--compact">
|
|
185
|
-
<div class="label"><span>${"sort"
|
|
185
|
+
<div class="label"><span>${this.type==="sort"?"排序项:":"选项:"}</span></div>
|
|
186
186
|
<div class="row-body">
|
|
187
187
|
<div class="answer-list">
|
|
188
|
-
${this._answers.map((t
|
|
188
|
+
${this._answers.map((e,t)=>r`
|
|
189
189
|
<div class="answer-item">
|
|
190
|
-
<span class="label">${this._label(
|
|
190
|
+
<span class="label">${this._label(t)}.</span>
|
|
191
191
|
<div class="input">
|
|
192
|
-
<input type="text" .value=${
|
|
192
|
+
<input type="text" .value=${e.title}
|
|
193
193
|
maxlength=${this.ANSWER_MAX}
|
|
194
|
-
@input=${
|
|
195
|
-
placeholder="选项${this._label(
|
|
196
|
-
<span class="char-counter">${
|
|
194
|
+
@input=${o=>this._onAnswerInput(o,t)}
|
|
195
|
+
placeholder="选项${this._label(t)}" />
|
|
196
|
+
<span class="char-counter">${e.title.length}/${this.ANSWER_MAX}</span>
|
|
197
197
|
</div>
|
|
198
198
|
|
|
199
|
-
${"sort"
|
|
199
|
+
${this.type==="sort"&&this._getSortOrder(t)!==null?r`<span class="sort-badge">第${this._getSortOrder(t)}位</span>`:""}
|
|
200
200
|
|
|
201
|
-
${["single","multiple"].includes(this.type)?
|
|
202
|
-
<label class="correct ${
|
|
203
|
-
<input type="checkbox" .checked=${
|
|
204
|
-
@change=${
|
|
201
|
+
${["single","multiple"].includes(this.type)?r`
|
|
202
|
+
<label class="correct ${e.isCorrect?"is-correct":""}">
|
|
203
|
+
<input type="checkbox" .checked=${e.isCorrect} ?disabled=${this.lockAnswerKey}
|
|
204
|
+
@change=${o=>this._setCorrect(t,o.target.checked)} />
|
|
205
205
|
<span class="correct-text">推荐/正确选项</span>
|
|
206
206
|
</label>
|
|
207
207
|
`:""}
|
|
208
208
|
|
|
209
209
|
<span class="icon"
|
|
210
|
-
@click=${()=>this._addAnswer(
|
|
211
|
-
${
|
|
210
|
+
@click=${()=>this._addAnswer(t)}>
|
|
211
|
+
${ce}
|
|
212
212
|
</span>
|
|
213
213
|
<span class="icon ${this._answers.length<3?"disabled":""}"
|
|
214
|
-
@click=${()=>this._deleteAnswer(
|
|
215
|
-
${
|
|
214
|
+
@click=${()=>this._deleteAnswer(t)}>
|
|
215
|
+
${he}
|
|
216
216
|
</span>
|
|
217
217
|
|
|
218
|
-
${
|
|
219
|
-
<slot name=${this._resultSlotName(
|
|
220
|
-
<button class="el-link" @click=${()=>this._emitEditResultItem(t
|
|
221
|
-
${
|
|
218
|
+
${this["exam-answer-relation-type"]===1&&this.type!=="sort"?r`
|
|
219
|
+
<slot name=${this._resultSlotName(t)}>
|
|
220
|
+
<button class="el-link" @click=${()=>this._emitEditResultItem(e,t)}>
|
|
221
|
+
${e.resultItem?"编辑结果":"添加结果"}
|
|
222
222
|
</button>
|
|
223
223
|
</slot>
|
|
224
224
|
`:""}
|
|
225
225
|
|
|
226
|
-
${
|
|
227
|
-
<button class="el-link" @click=${()=>this._setRelation(t
|
|
228
|
-
${Array.isArray(
|
|
226
|
+
${this["exam-answer-relation-type"]===2&&this.type!=="sort"?r`
|
|
227
|
+
<button class="el-link" @click=${()=>this._setRelation(e,t)}>
|
|
228
|
+
${Array.isArray(e.answerRelations)&&e.answerRelations.length?`关联了${this._relationLength(e.answerRelations)}项`:"关联检查"}
|
|
229
229
|
</button>
|
|
230
230
|
`:""}
|
|
231
231
|
|
|
@@ -235,27 +235,27 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
235
235
|
</div>
|
|
236
236
|
</div>
|
|
237
237
|
|
|
238
|
-
${"sort"
|
|
238
|
+
${this.type==="sort"?r`
|
|
239
239
|
<div class="edit-row section-row">
|
|
240
240
|
<div class="label"><span>排序答案:</span></div>
|
|
241
241
|
<div class="row-body">
|
|
242
242
|
<div class="multi-select-wrapper">
|
|
243
243
|
<div class="multi-select ${this._sortDropdownOpen?"focused":""} ${this.lockAnswerKey?"disabled":""}"
|
|
244
244
|
@click=${()=>{this.lockAnswerKey||(this._sortDropdownOpen=!this._sortDropdownOpen,this.requestUpdate())}}>
|
|
245
|
-
${this._orderList.length>0?this._orderList.map(
|
|
245
|
+
${this._orderList.length>0?this._orderList.map(e=>r`
|
|
246
246
|
<span class="tag">
|
|
247
|
-
${
|
|
248
|
-
<span class="tag-close" @click=${
|
|
247
|
+
${e}
|
|
248
|
+
<span class="tag-close" @click=${t=>{this.lockAnswerKey||(t.stopPropagation(),this._removeSortItem(e))}}>✕</span>
|
|
249
249
|
</span>
|
|
250
|
-
`):
|
|
251
|
-
<span class="arrow">${
|
|
250
|
+
`):r`<span class="placeholder">请按顺序选择排序答案</span>`}
|
|
251
|
+
<span class="arrow">${de}</span>
|
|
252
252
|
</div>
|
|
253
|
-
${this._sortDropdownOpen?
|
|
253
|
+
${this._sortDropdownOpen?r`
|
|
254
254
|
<div class="multi-select-dropdown">
|
|
255
|
-
${this._answers.map((t
|
|
256
|
-
<div class="multi-select-option ${this._orderList.includes(this._label(
|
|
257
|
-
@click=${()=>{this.lockAnswerKey||(this._toggleSortItem(this._label(
|
|
258
|
-
${this._label(
|
|
255
|
+
${this._answers.map((e,t)=>r`
|
|
256
|
+
<div class="multi-select-option ${this._orderList.includes(this._label(t))?"selected":""}"
|
|
257
|
+
@click=${()=>{this.lockAnswerKey||(this._toggleSortItem(this._label(t)),this.requestUpdate())}}>
|
|
258
|
+
${this._label(t)}
|
|
259
259
|
</div>
|
|
260
260
|
`)}
|
|
261
261
|
</div>
|
|
@@ -273,25 +273,25 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
273
273
|
|
|
274
274
|
${this._renderResourceSection()}
|
|
275
275
|
|
|
276
|
-
${this["show-rich-text"]&&this._showRichText?
|
|
276
|
+
${this["show-rich-text"]&&this._showRichText?r`
|
|
277
277
|
<div class="edit-row section-row">
|
|
278
278
|
<div class="label"><span>副文本:</span></div>
|
|
279
279
|
<div class="row-body">
|
|
280
280
|
<slot name="sub-text">
|
|
281
281
|
<qxs-blocksuite-editor
|
|
282
282
|
.content=${this._richText}
|
|
283
|
-
.toolbar=${
|
|
283
|
+
.toolbar=${S}
|
|
284
284
|
.upload-image=${this["upload-image"]}
|
|
285
285
|
?is-edit=${!0}
|
|
286
286
|
@input=${e=>{this._richText=e.target.getContent()}}
|
|
287
287
|
></qxs-blocksuite-editor>
|
|
288
288
|
</slot>
|
|
289
|
-
${this["show-action"]?"":
|
|
289
|
+
${this["show-action"]?"":r`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
|
|
290
290
|
</div>
|
|
291
291
|
</div>
|
|
292
292
|
`:""}
|
|
293
293
|
|
|
294
|
-
${this["show-analysis"]?
|
|
294
|
+
${this["show-analysis"]?r`
|
|
295
295
|
<div class="edit-row section-row">
|
|
296
296
|
<div class="label"><span>解析:</span></div>
|
|
297
297
|
<div class="row-body">
|
|
@@ -302,10 +302,10 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
302
302
|
</div>
|
|
303
303
|
`:""}
|
|
304
304
|
</div>
|
|
305
|
-
`}render(){if(this.sorting)return this._renderSorting();const
|
|
305
|
+
`}render(){if(this.sorting)return this._renderSorting();const e=this["is-edit"]?r`<div slot="edit">${this._renderEdit()}</div>`:r`<div slot="preview">${this._renderPreview()}</div>`;return r`
|
|
306
306
|
<qxs-subject-layout .show-edit=${this["is-edit"]}>
|
|
307
|
-
${
|
|
308
|
-
${this["show-action"]?
|
|
307
|
+
${e}
|
|
308
|
+
${this["show-action"]?r`
|
|
309
309
|
<qxs-subject-action
|
|
310
310
|
.is-edit=${this["is-edit"]}
|
|
311
311
|
.is-set=${this["is-set"]}
|
|
@@ -318,9 +318,9 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
318
318
|
@delete=${()=>this._emit("delete")}
|
|
319
319
|
@save=${this._save}
|
|
320
320
|
@edit=${()=>this._emit("edit")}
|
|
321
|
-
@move=${
|
|
321
|
+
@move=${t=>this._emit("move",t.detail)}
|
|
322
322
|
@jump=${()=>this._emit("jump",{customId:this["custom-id"]||"",examId:this["exam-id"]||0,answerType:this.type})}
|
|
323
|
-
@add=${
|
|
323
|
+
@add=${t=>this._emit("add",t.detail)}
|
|
324
324
|
@on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
|
|
325
325
|
></qxs-subject-action>
|
|
326
326
|
`:""}
|
|
@@ -330,15 +330,15 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
330
330
|
${this._renderChangeTypeDialog()}
|
|
331
331
|
${this._renderImageViewer()}
|
|
332
332
|
${this._renderVideoViewer()}
|
|
333
|
-
`}};
|
|
333
|
+
`}};s.styles=[ie,C,D,I,E,R,f`
|
|
334
334
|
.preview-answer { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
|
|
335
335
|
.preview-answer .radio { display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: 10px; row-gap: 3px; align-items: center; }
|
|
336
|
-
.preview-answer .order { color: #6b7280; font-size: 13px; font-weight: 600; }
|
|
336
|
+
.preview-answer .order { color: var(--qxs-subject-text-soft, #6b7280); font-size: 13px; font-weight: 600; }
|
|
337
337
|
.preview-answer .answer-main { min-width: 0; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
|
|
338
|
-
.preview-answer .answer-text { min-width: 0; font-size: 14px; line-height: 1.7; font-weight: 500; color: #303133; }
|
|
339
|
-
.preview-answer .answer-meta { grid-column: 3; display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; line-height: 1.6; color: #8b95a7; }
|
|
340
|
-
.preview-answer .correct { color: #3D61E3; font-weight: 600; }
|
|
341
|
-
.preview-answer .result-info { color: #8b95a7; }
|
|
338
|
+
.preview-answer .answer-text { min-width: 0; font-size: 14px; line-height: 1.7; font-weight: 500; color: var(--qxs-subject-text-primary, #303133); }
|
|
339
|
+
.preview-answer .answer-meta { grid-column: 3; display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; line-height: 1.6; color: var(--qxs-subject-text-muted, #8b95a7); }
|
|
340
|
+
.preview-answer .correct { color: var(--qxs-subject-color-primary, #3D61E3); font-weight: 600; }
|
|
341
|
+
.preview-answer .result-info { color: var(--qxs-subject-text-muted, #8b95a7); }
|
|
342
342
|
|
|
343
343
|
.flex { display: flex; }
|
|
344
344
|
.flex-items-center { display: flex; align-items: center; }
|
|
@@ -360,7 +360,7 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
360
360
|
margin-top: 6px;
|
|
361
361
|
font-size: 12px;
|
|
362
362
|
line-height: 1.6;
|
|
363
|
-
color: #909399;
|
|
363
|
+
color: var(--qxs-subject-text-secondary, #909399);
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
.answer-list { display: flex; flex-direction: column; gap: 10px; }
|
|
@@ -375,25 +375,25 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
375
375
|
min-width: 28px;
|
|
376
376
|
font-size: 13px;
|
|
377
377
|
font-weight: 600;
|
|
378
|
-
color: #6b7280;
|
|
378
|
+
color: var(--qxs-subject-text-soft, #6b7280);
|
|
379
379
|
letter-spacing: 0;
|
|
380
380
|
}
|
|
381
381
|
.answer-item .input { flex: 1; min-width: 240px; max-width: 380px; position: relative; display: block; }
|
|
382
382
|
.answer-item .input input {
|
|
383
383
|
height: 36px; padding: 0 56px 0 10px;
|
|
384
384
|
font-size: 13px; line-height: 32px;
|
|
385
|
-
border: 1px solid #dcdfe6; border-radius: 6px; width: 100%;
|
|
385
|
+
border: 1px solid var(--qxs-subject-border, #dcdfe6); border-radius: 6px; width: 100%;
|
|
386
386
|
transition: border-color .2s; box-sizing: border-box;
|
|
387
387
|
}
|
|
388
|
-
.answer-item .input input:focus { border-color: #3D61E3; outline: none; }
|
|
389
|
-
.answer-item .input input:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
|
|
388
|
+
.answer-item .input input:focus { border-color: var(--qxs-subject-color-primary, #3D61E3); outline: none; }
|
|
389
|
+
.answer-item .input input:disabled { background: var(--qxs-subject-fill-light, #f5f7fa); color: var(--qxs-subject-text-disabled, #c0c4cc); cursor: not-allowed; }
|
|
390
390
|
.answer-item .input .char-counter {
|
|
391
391
|
position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
|
|
392
|
-
font-size: 12px; color: #909399; line-height: 1; pointer-events: none;
|
|
392
|
+
font-size: 12px; color: var(--qxs-subject-text-secondary, #909399); line-height: 1; pointer-events: none;
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
.answer-item .correct {
|
|
396
|
-
color: #909399;
|
|
396
|
+
color: var(--qxs-subject-text-secondary, #909399);
|
|
397
397
|
cursor: pointer;
|
|
398
398
|
display: inline-flex;
|
|
399
399
|
align-items: center;
|
|
@@ -401,15 +401,15 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
401
401
|
min-height: 20px;
|
|
402
402
|
white-space: nowrap;
|
|
403
403
|
}
|
|
404
|
-
.answer-item .correct:hover { color: #3D61E3; }
|
|
405
|
-
.answer-item .correct.is-correct { color: #67c23a; }
|
|
404
|
+
.answer-item .correct:hover { color: var(--qxs-subject-color-primary, #3D61E3); }
|
|
405
|
+
.answer-item .correct.is-correct { color: var(--qxs-subject-color-success, #67c23a); }
|
|
406
406
|
.answer-item .correct input {
|
|
407
407
|
width: 14px;
|
|
408
408
|
height: 14px;
|
|
409
409
|
margin: 0;
|
|
410
410
|
flex: 0 0 auto;
|
|
411
411
|
cursor: pointer;
|
|
412
|
-
accent-color: #3D61E3;
|
|
412
|
+
accent-color: var(--qxs-subject-color-primary, #3D61E3);
|
|
413
413
|
}
|
|
414
414
|
.answer-item .correct .correct-text {
|
|
415
415
|
display: inline-flex;
|
|
@@ -421,74 +421,74 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
421
421
|
margin-left: 6px; cursor: pointer; display: inline-flex;
|
|
422
422
|
align-items: center; justify-content: center;
|
|
423
423
|
width: 24px; height: 24px; border-radius: 4px;
|
|
424
|
-
border: 1px solid #dcdfe6; background: #fff; color: #909399;
|
|
424
|
+
border: 1px solid var(--qxs-subject-border, #dcdfe6); background: var(--qxs-subject-fill-blank, #fff); color: var(--qxs-subject-text-secondary, #909399);
|
|
425
425
|
transition: all 0.2s;
|
|
426
426
|
}
|
|
427
|
-
.answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }
|
|
428
|
-
.answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
|
|
427
|
+
.answer-item .icon:hover { color: var(--qxs-subject-color-primary, #3D61E3); border-color: var(--qxs-subject-color-primary, #3D61E3); background: var(--qxs-subject-fill-soft-primary, #ecf5ff); }
|
|
428
|
+
.answer-item .icon.disabled { color: var(--qxs-subject-border-light, #e4e7ed); border-color: var(--qxs-subject-border-light, #e4e7ed); cursor: not-allowed; }
|
|
429
429
|
|
|
430
430
|
.answer-item .link {
|
|
431
|
-
color: #3D61E3;
|
|
431
|
+
color: var(--qxs-subject-color-primary, #3D61E3);
|
|
432
432
|
cursor: pointer;
|
|
433
433
|
font-size: 12px;
|
|
434
434
|
white-space: nowrap;
|
|
435
435
|
}
|
|
436
|
-
.answer-item .link:hover { color: #2D4CB8; }
|
|
436
|
+
.answer-item .link:hover { color: var(--qxs-subject-color-primary-hover, #2D4CB8); }
|
|
437
437
|
|
|
438
438
|
.el-select {
|
|
439
|
-
width: 150px; height: 34px; border: 1px solid #dcdfe6; border-radius: 6px;
|
|
440
|
-
padding: 0 8px; font-size: 13px; background: #fff; appearance: none;
|
|
439
|
+
width: 150px; height: 34px; border: 1px solid var(--qxs-subject-border, #dcdfe6); border-radius: 6px;
|
|
440
|
+
padding: 0 8px; font-size: 13px; background: var(--qxs-subject-fill-blank, #fff); appearance: none;
|
|
441
441
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
|
|
442
442
|
background-repeat: no-repeat; background-position: right 8px center;
|
|
443
443
|
}
|
|
444
|
-
.el-select:focus { border-color: #3D61E3; outline: none; }
|
|
445
|
-
.el-select:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
|
|
444
|
+
.el-select:focus { border-color: var(--qxs-subject-color-primary, #3D61E3); outline: none; }
|
|
445
|
+
.el-select:disabled { background: var(--qxs-subject-fill-light, #f5f7fa); color: var(--qxs-subject-text-disabled, #c0c4cc); cursor: not-allowed; }
|
|
446
446
|
|
|
447
|
-
.sort-badge { font-weight: bold; color: #3D61E3; margin-left: 10px; }
|
|
447
|
+
.sort-badge { font-weight: bold; color: var(--qxs-subject-color-primary, #3D61E3); margin-left: 10px; }
|
|
448
448
|
|
|
449
|
-
.el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }
|
|
450
|
-
.el-link:hover { color: #2D4CB8; }
|
|
451
|
-
.el-link.danger { color: #f56c6c; }
|
|
449
|
+
.el-link { color: var(--qxs-subject-color-primary, #3D61E3); cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }
|
|
450
|
+
.el-link:hover { color: var(--qxs-subject-color-primary-hover, #2D4CB8); }
|
|
451
|
+
.el-link.danger { color: var(--qxs-subject-color-danger, #f56c6c); }
|
|
452
452
|
|
|
453
|
-
.value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }
|
|
454
|
-
.muted-text { font-size: 12px; color: #909399; }
|
|
453
|
+
.value-text { font-size: 13px; color: var(--qxs-subject-text-regular, #606266); white-space: pre-wrap; }
|
|
454
|
+
.muted-text { font-size: 12px; color: var(--qxs-subject-text-secondary, #909399); }
|
|
455
455
|
|
|
456
456
|
.search-wrap { position: relative; }
|
|
457
457
|
.search-dropdown {
|
|
458
458
|
position: absolute; z-index: 120; left: 0; right: 0; top: calc(100% + 4px);
|
|
459
|
-
background: #fff; border: 1px solid #e4e7ed; border-radius: 6px;
|
|
460
|
-
box-shadow: 0 8px 20px rgba(0,0,0,.12); overflow: hidden;
|
|
459
|
+
background: var(--qxs-subject-fill-blank, #fff); border: 1px solid var(--qxs-subject-border-light, #e4e7ed); border-radius: 6px;
|
|
460
|
+
box-shadow: var(--qxs-subject-shadow-soft, 0 8px 20px rgba(0,0,0,.12)); overflow: hidden;
|
|
461
461
|
}
|
|
462
462
|
.search-item {
|
|
463
463
|
padding: 10px 12px; cursor: pointer; transition: background .2s;
|
|
464
|
-
font-size: 13px; color: #606266; line-height: 1.4;
|
|
464
|
+
font-size: 13px; color: var(--qxs-subject-text-regular, #606266); line-height: 1.4;
|
|
465
465
|
}
|
|
466
|
-
.search-item:hover { background: #f5f7fa; color: #3D61E3; }
|
|
467
|
-
.search-empty { padding: 10px 12px; font-size: 12px; color: #909399; }
|
|
466
|
+
.search-item:hover { background: var(--qxs-subject-fill-light, #f5f7fa); color: var(--qxs-subject-color-primary, #3D61E3); }
|
|
467
|
+
.search-empty { padding: 10px 12px; font-size: 12px; color: var(--qxs-subject-text-secondary, #909399); }
|
|
468
468
|
|
|
469
469
|
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
|
|
470
470
|
.tag-item {
|
|
471
471
|
display: inline-flex; align-items: center; gap: 4px;
|
|
472
472
|
padding: 4px 8px; font-size: 12px; line-height: 1;
|
|
473
|
-
color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;
|
|
473
|
+
color: var(--qxs-subject-color-primary, #3D61E3); background: var(--qxs-subject-fill-soft-primary, #ecf5ff); border: 1px solid var(--qxs-subject-fill-soft-primary-border, #d9ecff); border-radius: 4px;
|
|
474
474
|
}
|
|
475
|
-
.tag-item .close { cursor: pointer; color: #909399; }
|
|
476
|
-
.tag-item .close:hover { color: #f56c6c; }
|
|
477
|
-
.tag-hint { font-size: 12px; color: #909399; }
|
|
475
|
+
.tag-item .close { cursor: pointer; color: var(--qxs-subject-text-secondary, #909399); }
|
|
476
|
+
.tag-item .close:hover { color: var(--qxs-subject-color-danger, #f56c6c); }
|
|
477
|
+
.tag-hint { font-size: 12px; color: var(--qxs-subject-text-secondary, #909399); }
|
|
478
478
|
|
|
479
479
|
.resource-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
|
|
480
|
-
.resource-summary { font-size: 12px; color: #606266; }
|
|
480
|
+
.resource-summary { font-size: 12px; color: var(--qxs-subject-text-regular, #606266); }
|
|
481
481
|
.resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
|
|
482
482
|
.resource-thumb {
|
|
483
483
|
width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
|
|
484
|
-
border: 1px solid #e4e7ed; cursor: pointer; background: #f5f7fa;
|
|
484
|
+
border: 1px solid var(--qxs-subject-border-light, #e4e7ed); cursor: pointer; background: var(--qxs-subject-fill-light, #f5f7fa);
|
|
485
485
|
}
|
|
486
486
|
.resource-video {
|
|
487
487
|
display: inline-flex; align-items: center; justify-content: center;
|
|
488
|
-
min-width: 88px; height: 30px; padding: 0 10px; border: 1px solid #dcdfe6; border-radius: 4px;
|
|
489
|
-
color: #606266; background: #fff; cursor: pointer; font-size: 12px; transition: all .2s;
|
|
488
|
+
min-width: 88px; height: 30px; padding: 0 10px; border: 1px solid var(--qxs-subject-border, #dcdfe6); border-radius: 4px;
|
|
489
|
+
color: var(--qxs-subject-text-regular, #606266); background: var(--qxs-subject-fill-blank, #fff); cursor: pointer; font-size: 12px; transition: all .2s;
|
|
490
490
|
}
|
|
491
|
-
.resource-video:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }
|
|
491
|
+
.resource-video:hover { color: var(--qxs-subject-color-primary, #3D61E3); border-color: var(--qxs-subject-color-primary, #3D61E3); background: var(--qxs-subject-fill-soft-primary, #ecf5ff); }
|
|
492
492
|
.media-stage { display: flex; align-items: center; justify-content: center; min-height: 240px; }
|
|
493
493
|
.media-stage img, .media-stage video { max-width: 100%; max-height: 60vh; border-radius: 6px; }
|
|
494
494
|
.media-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
|
|
@@ -497,40 +497,40 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
497
497
|
/* Multi-select with tags (Element Plus style) */
|
|
498
498
|
.multi-select-wrapper { position: relative; }
|
|
499
499
|
.multi-select {
|
|
500
|
-
width: 240px; min-height: 36px; border: 1px solid #dcdfe6; border-radius: 6px;
|
|
501
|
-
padding: 0 30px 0 8px; font-size: 13px; background: #fff; cursor: pointer;
|
|
500
|
+
width: 240px; min-height: 36px; border: 1px solid var(--qxs-subject-border, #dcdfe6); border-radius: 6px;
|
|
501
|
+
padding: 0 30px 0 8px; font-size: 13px; background: var(--qxs-subject-fill-blank, #fff); cursor: pointer;
|
|
502
502
|
display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;
|
|
503
503
|
transition: border-color .2s; position: relative; overflow: hidden;
|
|
504
504
|
}
|
|
505
|
-
.multi-select:hover { border-color: #c0c4cc; }
|
|
506
|
-
.multi-select.focused { border-color: #3D61E3; }
|
|
507
|
-
.multi-select.disabled { background: #f5f7fa; cursor: not-allowed; }
|
|
508
|
-
.multi-select .placeholder { color: #c0c4cc; font-size: 13px; padding: 4px 0; }
|
|
505
|
+
.multi-select:hover { border-color: var(--qxs-subject-text-disabled, #c0c4cc); }
|
|
506
|
+
.multi-select.focused { border-color: var(--qxs-subject-color-primary, #3D61E3); }
|
|
507
|
+
.multi-select.disabled { background: var(--qxs-subject-fill-light, #f5f7fa); cursor: not-allowed; }
|
|
508
|
+
.multi-select .placeholder { color: var(--qxs-subject-text-disabled, #c0c4cc); font-size: 13px; padding: 4px 0; }
|
|
509
509
|
.multi-select .arrow {
|
|
510
510
|
position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
|
|
511
|
-
color: #c0c4cc; display: inline-flex; transition: transform .2s;
|
|
511
|
+
color: var(--qxs-subject-text-disabled, #c0c4cc); display: inline-flex; transition: transform .2s;
|
|
512
512
|
}
|
|
513
|
-
.multi-select.focused .arrow { transform: translateY(-50%) rotate(180deg); color: #3D61E3; }
|
|
513
|
+
.multi-select.focused .arrow { transform: translateY(-50%) rotate(180deg); color: var(--qxs-subject-color-primary, #3D61E3); }
|
|
514
514
|
.multi-select .tag {
|
|
515
515
|
display: inline-flex; align-items: center; gap: 2px;
|
|
516
|
-
background: #f0f2f5; border-radius: 3px; padding: 0 6px; height: 20px;
|
|
517
|
-
font-size: 12px; color: #606266; line-height: 20px;
|
|
516
|
+
background: var(--qxs-subject-fill-dark, #f0f2f5); border-radius: 3px; padding: 0 6px; height: 20px;
|
|
517
|
+
font-size: 12px; color: var(--qxs-subject-text-regular, #606266); line-height: 20px;
|
|
518
518
|
}
|
|
519
519
|
.multi-select .tag .tag-close {
|
|
520
|
-
display: inline-flex; cursor: pointer; color: #909399; margin-left: 2px; line-height: 1;
|
|
520
|
+
display: inline-flex; cursor: pointer; color: var(--qxs-subject-text-secondary, #909399); margin-left: 2px; line-height: 1;
|
|
521
521
|
}
|
|
522
|
-
.multi-select .tag .tag-close:hover { color: #3D61E3; }
|
|
522
|
+
.multi-select .tag .tag-close:hover { color: var(--qxs-subject-color-primary, #3D61E3); }
|
|
523
523
|
.multi-select-dropdown {
|
|
524
|
-
position: absolute; z-index: 100; background: #fff; left: 0; top: 100%; margin-top: 4px;
|
|
525
|
-
border: 1px solid #e4e7ed; border-radius: 3px;
|
|
526
|
-
box-shadow: 0 4px 12px rgba(0,0,0,.12); min-width: 240px; max-height: 140px; overflow-y: auto;
|
|
524
|
+
position: absolute; z-index: 100; background: var(--qxs-subject-fill-blank, #fff); left: 0; top: 100%; margin-top: 4px;
|
|
525
|
+
border: 1px solid var(--qxs-subject-border-light, #e4e7ed); border-radius: 3px;
|
|
526
|
+
box-shadow: var(--qxs-subject-shadow-soft, 0 4px 12px rgba(0,0,0,.12)); min-width: 240px; max-height: 140px; overflow-y: auto;
|
|
527
527
|
}
|
|
528
528
|
.multi-select-option {
|
|
529
|
-
padding: 4px 12px; font-size: 13px; color: #606266; cursor: pointer;
|
|
529
|
+
padding: 4px 12px; font-size: 13px; color: var(--qxs-subject-text-regular, #606266); cursor: pointer;
|
|
530
530
|
transition: background .2s;
|
|
531
531
|
}
|
|
532
|
-
.multi-select-option:hover { background: #f5f7fa; }
|
|
533
|
-
.multi-select-option.selected { color: #3D61E3; font-weight: 500; }
|
|
532
|
+
.multi-select-option:hover { background: var(--qxs-subject-fill-light, #f5f7fa); }
|
|
533
|
+
.multi-select-option.selected { color: var(--qxs-subject-color-primary, #3D61E3); font-weight: 500; }
|
|
534
534
|
|
|
535
535
|
@media (max-width: 720px) {
|
|
536
536
|
.edit-row,
|
|
@@ -558,31 +558,31 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
558
558
|
}
|
|
559
559
|
|
|
560
560
|
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; }
|
|
561
|
-
.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; }
|
|
562
|
-
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #e4e7ed; }
|
|
563
|
-
.modal-title { font-size: 14px; font-weight: 600; color: #303133; }
|
|
564
|
-
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }
|
|
565
|
-
.modal-close:hover { color: #3D61E3; }
|
|
561
|
+
.modal { background: var(--qxs-subject-fill-blank, #fff); border-radius: 6px; width: 520px; max-width: 90vw; box-shadow: var(--qxs-subject-shadow-soft, 0 12px 32px rgba(0,0,0,.12)); display: flex; flex-direction: column; }
|
|
562
|
+
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--qxs-subject-border-light, #e4e7ed); }
|
|
563
|
+
.modal-title { font-size: 14px; font-weight: 600; color: var(--qxs-subject-text-primary, #303133); }
|
|
564
|
+
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--qxs-subject-text-secondary, #909399); padding: 0; line-height: 1; }
|
|
565
|
+
.modal-close:hover { color: var(--qxs-subject-color-primary, #3D61E3); }
|
|
566
566
|
.modal-body { padding: 20px; }
|
|
567
567
|
.modal-body textarea { min-height: 120px; }
|
|
568
|
-
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e4e7ed; }
|
|
569
|
-
.modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid #dcdfe6; background: #fff; color: #606266; }
|
|
570
|
-
.modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }
|
|
571
|
-
.modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }
|
|
572
|
-
.modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }
|
|
568
|
+
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--qxs-subject-border-light, #e4e7ed); }
|
|
569
|
+
.modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid var(--qxs-subject-border, #dcdfe6); background: var(--qxs-subject-fill-blank, #fff); color: var(--qxs-subject-text-regular, #606266); }
|
|
570
|
+
.modal-footer button:hover { color: var(--qxs-subject-color-primary, #3D61E3); border-color: var(--qxs-subject-fill-soft-primary-border-strong, #a0cfff); }
|
|
571
|
+
.modal-footer button.primary { background: var(--qxs-subject-color-primary, #3D61E3); border-color: var(--qxs-subject-color-primary, #3D61E3); color: var(--qxs-subject-fill-blank, #fff); }
|
|
572
|
+
.modal-footer button.primary:hover { background: var(--qxs-subject-color-primary-hover, #2D4CB8); border-color: var(--qxs-subject-color-primary-hover, #2D4CB8); }
|
|
573
573
|
.correct-hint-dialog { width: 520px; max-width: min(90vw, 520px); }
|
|
574
574
|
.correct-hint-dialog .modal-header { padding: 18px 20px 14px; }
|
|
575
|
-
.correct-hint-dialog .modal-title { font-size: 16px; font-weight: 700; color: #303133; }
|
|
575
|
+
.correct-hint-dialog .modal-title { font-size: 16px; font-weight: 700; color: var(--qxs-subject-text-primary, #303133); }
|
|
576
576
|
.correct-hint-dialog .modal-close { display: none; }
|
|
577
577
|
.correct-hint-dialog .modal-body {
|
|
578
578
|
padding: 32px 28px 20px;
|
|
579
579
|
font-size: 14px;
|
|
580
580
|
line-height: 1.8;
|
|
581
|
-
color: #303133;
|
|
581
|
+
color: var(--qxs-subject-text-primary, #303133);
|
|
582
582
|
text-align: center;
|
|
583
583
|
}
|
|
584
584
|
.correct-hint-copy { max-width: 420px; margin: 0 auto; }
|
|
585
|
-
.correct-hint-highlight { color: #4c6fff; }
|
|
585
|
+
.correct-hint-highlight { color: var(--qxs-subject-color-primary, #4c6fff); }
|
|
586
586
|
.correct-hint-dialog .modal-footer {
|
|
587
587
|
justify-content: center;
|
|
588
588
|
gap: 12px;
|
|
@@ -596,5 +596,5 @@ import{html as e,css as t,LitElement as s}from"lit";import{property as i,state a
|
|
|
596
596
|
font-size: 14px;
|
|
597
597
|
border-radius: 4px;
|
|
598
598
|
}
|
|
599
|
-
`]
|
|
599
|
+
`];i([a({type:Number,attribute:"order-index"})],s.prototype,"order-index",2);i([a({type:String,attribute:"subject-prefix"})],s.prototype,"subject-prefix",2);i([a({type:Boolean,attribute:"is-edit"})],s.prototype,"is-edit",2);i([a({type:Boolean,attribute:"is-save"})],s.prototype,"is-save",2);i([a({type:Boolean,attribute:"is-set"})],s.prototype,"is-set",2);i([a({type:Boolean,attribute:"is-set-correct-answer"})],s.prototype,"is-set-correct-answer",2);i([a({type:Boolean,attribute:"lock-answer-key"})],s.prototype,"lockAnswerKey",2);i([a({type:Boolean,attribute:"is-key"})],s.prototype,"is-key",2);i([a({type:Boolean,attribute:"show-action"})],s.prototype,"show-action",2);i([a({type:Boolean,attribute:"show-add"})],s.prototype,"show-add",2);i([a({type:Boolean,attribute:"hide-add-rich-text"})],s.prototype,"hide-add-rich-text",2);i([a({type:Boolean,attribute:"show-rich-text"})],s.prototype,"show-rich-text",2);i([a({type:Boolean,attribute:"show-delete-action"})],s.prototype,"show-delete-action",2);i([a({type:Boolean,attribute:"show-save-action"})],s.prototype,"show-save-action",2);i([a({type:Boolean,reflect:!0})],s.prototype,"sorting",2);i([a({type:Boolean,attribute:"show-answer-setting"})],s.prototype,"show-answer-setting",2);i([a({type:Boolean,attribute:"show-key"})],s.prototype,"show-key",2);i([a({type:Boolean,attribute:"show-analysis"})],s.prototype,"show-analysis",2);i([a({attribute:"question-type",reflect:!0})],s.prototype,"type",2);i([a({type:Number,attribute:"answer-check-type"})],s.prototype,"answer-check-type",2);i([a({type:Number,attribute:"exam-answer-relation-type"})],s.prototype,"exam-answer-relation-type",2);i([a({type:String,attribute:"rich-text-content"})],s.prototype,"rich-text-content",2);i([a({type:String})],s.prototype,"analysis",2);i([a({type:Number,attribute:"least-answer-count"})],s.prototype,"least-answer-count",2);i([a({type:String,attribute:"exam-expand"})],s.prototype,"exam-expand",2);i([a({type:String,attribute:"custom-id"})],s.prototype,"custom-id",2);i([a({type:Number,attribute:"exam-id"})],s.prototype,"exam-id",2);i([a({type:String,attribute:"category-id"})],s.prototype,"category-id",2);i([a({type:Object,attribute:"upload-image"})],s.prototype,"upload-image",2);i([a({type:Array,attribute:"answer-list"})],s.prototype,"answer-list",1);i([a({type:Array,attribute:"tag-list"})],s.prototype,"tag-list",2);i([a({type:Array,attribute:"category-list"})],s.prototype,"category-list",2);i([a({type:String,attribute:"ai-answer"})],s.prototype,"ai-answer",2);i([a({type:Array,attribute:"resource-list"})],s.prototype,"resource-list",2);i([a({type:Boolean,attribute:"show-tag"})],s.prototype,"show-tag",2);i([a({type:Boolean,attribute:"show-category"})],s.prototype,"show-category",2);i([a({type:Boolean,attribute:"show-ai"})],s.prototype,"show-ai",2);i([a({type:Boolean,attribute:"show-resource"})],s.prototype,"show-resource",2);i([a({type:Boolean,attribute:"show-jump"})],s.prototype,"show-jump",2);i([a({type:Boolean,attribute:"has-jump"})],s.prototype,"has-jump",2);i([a({type:String,attribute:"search-api"})],s.prototype,"search-api",2);i([a({type:Object,attribute:"search-handler"})],s.prototype,"search-handler",2);i([a({type:String,attribute:"model-value"})],s.prototype,"model-value",2);i([a({type:Boolean,attribute:"use-model"})],s.prototype,"use-model",2);i([n()],s.prototype,"_answers",2);i([a({type:String})],s.prototype,"title",2);i([n()],s.prototype,"_title",2);i([n()],s.prototype,"_analysis",2);i([n()],s.prototype,"_richText",2);i([n()],s.prototype,"_showRichText",2);i([n()],s.prototype,"_leastAnswerCount",2);i([n()],s.prototype,"_answerCheckType",2);i([n()],s.prototype,"_isKey",2);i([n()],s.prototype,"_orderList",2);i([n()],s.prototype,"_selectedTagList",2);i([n()],s.prototype,"_categoryId",2);i([n()],s.prototype,"_searchResults",2);i([n()],s.prototype,"_searchOpen",2);i([n()],s.prototype,"_searchLoading",2);i([n()],s.prototype,"_sortDropdownOpen",2);i([n()],s.prototype,"_imageViewerOpen",2);i([n()],s.prototype,"_imageViewerIndex",2);i([n()],s.prototype,"_videoViewerOpen",2);i([n()],s.prototype,"_correctHintDialogOpen",2);i([n()],s.prototype,"_hasShownCorrectHint",2);i([n()],s.prototype,"_changeTypeDialogOpen",2);s=i([$("qxs-subject-single")],s);export{s as QxsSubjectSingle,qe as SubjectError,Te as trimCommaSeparatedText,oe as trimText};
|
|
600
600
|
//# sourceMappingURL=single.mjs.map
|