From 37441ceec6ff8c7481660339be7d47f920cf56ae Mon Sep 17 00:00:00 2001 From: liushilong <2224574157@qq.com> Date: Fri, 29 Mar 2024 11:53:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=BC=E5=90=88=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patches/naive-ui+2.38.1.patch | 91 ++++++++++++++++++++ src/components/Search/Search.vue | 2 +- src/layout/components/Header/SearchModal.vue | 2 +- 3 files changed, 93 insertions(+), 2 deletions(-) diff --git a/patches/naive-ui+2.38.1.patch b/patches/naive-ui+2.38.1.patch index 8748dc4..83ce776 100644 --- a/patches/naive-ui+2.38.1.patch +++ b/patches/naive-ui+2.38.1.patch @@ -27,6 +27,29 @@ index 3aacec9..a63ab54 100644 key: "controlled-success", class: `${mergedClsPrefix}-form-item-feedback ${mergedClsPrefix}-form-item-feedback--success` }, feedbackNodes) : h("div", { +diff --git a/node_modules/naive-ui/es/modal/src/Modal.mjs b/node_modules/naive-ui/es/modal/src/Modal.mjs +index 9508b72..63f417b 100644 +--- a/node_modules/naive-ui/es/modal/src/Modal.mjs ++++ b/node_modules/naive-ui/es/modal/src/Modal.mjs +@@ -13,6 +13,10 @@ import { modalInjectionKey, modalProviderInjectionKey } from "./interface.mjs"; + import style from "./styles/index.cssr.mjs"; + export const modalProps = Object.assign(Object.assign(Object.assign(Object.assign({}, useTheme.props), { + show: Boolean, ++ showMask: { ++ type: Boolean, ++ default: true ++ }, + unstableShowMask: { + type: Boolean, + default: true +@@ -309,6 +313,7 @@ export default defineComponent({ + "aria-hidden": true, + ref: "containerRef", + class: `${mergedClsPrefix}-modal-mask`, ++ style: this.showMask ? '' : {background:'none'}, + onClick: this.handleClickoutside + }) : null; + } diff --git a/node_modules/naive-ui/es/pagination/src/Pagination.mjs b/node_modules/naive-ui/es/pagination/src/Pagination.mjs index 5bd975b..e1c6ebc 100644 --- a/node_modules/naive-ui/es/pagination/src/Pagination.mjs @@ -161,3 +184,71 @@ index 4f47aad..6dae078 100644 }); } }))) : null)); +diff --git a/node_modules/naive-ui/lib/modal/src/Modal.js b/node_modules/naive-ui/lib/modal/src/Modal.js +index 47f6ac2..801e8e7 100644 +--- a/node_modules/naive-ui/lib/modal/src/Modal.js ++++ b/node_modules/naive-ui/lib/modal/src/Modal.js +@@ -17,7 +17,11 @@ const presetProps_1 = require("./presetProps"); + const BodyWrapper_1 = __importDefault(require("./BodyWrapper")); + const interface_1 = require("./interface"); + const index_cssr_1 = __importDefault(require("./styles/index.cssr")); +-exports.modalProps = Object.assign(Object.assign(Object.assign(Object.assign({}, _mixins_1.useTheme.props), { show: Boolean, unstableShowMask: { ++exports.modalProps = Object.assign(Object.assign(Object.assign(Object.assign({}, _mixins_1.useTheme.props), { ++ show: Boolean, showMask: { ++ type: Boolean, ++ default: true, ++ }, unstableShowMask: { + type: Boolean, + default: true + }, maskClosable: { +@@ -38,7 +42,8 @@ exports.modalProps = Object.assign(Object.assign(Object.assign(Object.assign({}, + }, closeOnEsc: { + type: Boolean, + default: true +- }, blockScroll: { type: Boolean, default: true } }), presetProps_1.presetProps), { ++ }, blockScroll: { type: Boolean, default: true } ++}), presetProps_1.presetProps), { + // events + onEsc: Function, 'onUpdate:show': [Function, Array], onUpdateShow: [Function, Array], onAfterEnter: Function, onBeforeLeave: Function, onAfterLeave: Function, onClose: Function, onPositiveClick: Function, onNegativeClick: Function, onMaskClick: Function, + // private +@@ -47,7 +52,8 @@ exports.modalProps = Object.assign(Object.assign(Object.assign(Object.assign({}, + default: undefined + }, + // deprecated +- overlayStyle: [String, Object], onBeforeHide: Function, onAfterHide: Function, onHide: Function }); ++ overlayStyle: [String, Object], onBeforeHide: Function, onAfterHide: Function, onHide: Function ++}); + exports.default = (0, vue_1.defineComponent)({ + name: 'Modal', + inheritAttrs: false, +@@ -226,21 +232,25 @@ exports.default = (0, vue_1.defineComponent)({ + var _a; + (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this); + const { unstableShowMask } = this; +- return (0, vue_1.withDirectives)((0, vue_1.h)("div", { role: "none", ref: "containerRef", class: [ ++ return (0, vue_1.withDirectives)((0, vue_1.h)("div", { ++ role: "none", ref: "containerRef", class: [ + `${mergedClsPrefix}-modal-container`, + this.themeClass, + this.namespace +- ], style: this.cssVars }, +- (0, vue_1.h)(BodyWrapper_1.default, Object.assign({ style: this.overlayStyle }, this.$attrs, { ref: "bodyWrapper", displayDirective: this.displayDirective, show: this.show, preset: this.preset, autoFocus: this.autoFocus, trapFocus: this.trapFocus, blockScroll: this.blockScroll }, this.presetProps, { onEsc: this.handleEsc, onClose: this.handleCloseClick, onNegativeClick: this.handleNegativeClick, onPositiveClick: this.handlePositiveClick, onBeforeLeave: this.handleBeforeLeave, onAfterEnter: this.onAfterEnter, onAfterLeave: this.handleAfterLeave, onClickoutside: unstableShowMask ? undefined : this.handleClickoutside, renderMask: unstableShowMask ++ ], style: this.cssVars ++ }, ++ (0, vue_1.h)(BodyWrapper_1.default, Object.assign({ style: this.overlayStyle }, this.$attrs, { ref: "bodyWrapper", displayDirective: this.displayDirective, show: this.show, preset: this.preset, autoFocus: this.autoFocus, trapFocus: this.trapFocus, blockScroll: this.blockScroll }, this.presetProps, { ++ onEsc: this.handleEsc, onClose: this.handleCloseClick, onNegativeClick: this.handleNegativeClick, onPositiveClick: this.handlePositiveClick, onBeforeLeave: this.handleBeforeLeave, onAfterEnter: this.onAfterEnter, onAfterLeave: this.handleAfterLeave, onClickoutside: unstableShowMask ? undefined : this.handleClickoutside, renderMask: unstableShowMask + ? () => { + var _a; + return ((0, vue_1.h)(vue_1.Transition, { name: "fade-in-transition", key: "mask", appear: (_a = this.internalAppear) !== null && _a !== void 0 ? _a : this.isMounted }, { + default: () => { +- return this.show ? ((0, vue_1.h)("div", { "aria-hidden": true, ref: "containerRef", class: `${mergedClsPrefix}-modal-mask`, onClick: this.handleClickoutside })) : null; ++ return this.show ? ((0, vue_1.h)("div", { "aria-hidden": true, ref: "containerRef", class: `${mergedClsPrefix}-modal-mask` ,style:this.showMask ? '' : {background:'none'}, onClick: this.handleClickoutside })) : null; + } + })); + } +- : undefined }), this.$slots)), [ ++ : undefined ++ }), this.$slots)), [ + [ + vdirs_1.zindexable, + { diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue index b628761..ebd6294 100644 --- a/src/components/Search/Search.vue +++ b/src/components/Search/Search.vue @@ -115,7 +115,7 @@ function highlightText(text, query) {