@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
151 lines (150 loc) • 3.01 kB
JavaScript
import a, { modalProps as l } from "../../components/modal/index.esm.js";
import { resolveAppearance as i, createPropsResolver as p } from "../../components/dynamic-resolver/index.esm.js";
const c = "https://json-schema.org/draft/2020-12/schema", d = "https://farris-design.gitee.io/modal.schema.json", u = "modal", f = "弹窗组件", y = "object", b = {
id: {
description: "组件唯一标识",
type: "string"
},
type: {
description: "组件类型",
type: "string",
default: "modal"
},
appearance: {
description: "组件外观",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
},
name: {
description: "名称",
type: "string",
default: null
},
title: {
description: "标题",
type: "string"
},
width: {
description: "窗口宽度",
type: "number",
default: 900
},
height: {
description: "窗口高度",
type: "number",
default: 600
},
contents: {
description: "弹窗子组件集合",
type: "array",
default: []
},
modelValue: {
description: "是否显示",
type: "boolean",
default: !1
},
showCloseButton: {
description: "显示关闭按钮",
type: "boolean",
default: !0
},
showMaxButton: {
description: "显示最大化按钮",
type: "boolean",
default: !0
},
enableEsc: {
description: "允许ESC关闭",
type: "boolean",
default: !0
},
resizeable: {
description: "允许调整窗口尺寸",
type: "boolean",
default: !0
},
fitContent: {
description: "是否自适应",
type: "boolean",
default: !1
},
showButtons: {
description: "是否显示底部按钮",
type: "boolean",
default: !0
},
mask: {
description: "是否模态",
type: "boolean",
default: !0
},
draggable: {
description: "是否允许拖拽调整位置",
type: "boolean",
default: !0
},
onAccept: {
description: "确定事件",
type: "object",
default: null
},
onCancel: {
description: "取消事件",
type: "object",
default: null
},
beforeClose: {
description: "关闭前事件",
type: "object",
default: null
}
}, m = [
"id",
"type"
], g = {
onAccept: "确定事件",
onCancel: "取消事件",
beforeClose: "关闭前回调"
}, h = {
$schema: c,
$id: d,
title: u,
description: f,
type: y,
properties: b,
required: m,
events: g
}, v = /* @__PURE__ */ new Map([
["appearance", i]
]);
function C(t, e, o) {
return e;
}
function j() {
function t(e, o, n) {
const r = {};
return r.beforeClose = (s) => o.call("beforeClose", e, [s, e], n), r;
}
return {
resolve: t
};
}
const M = p(l, h, v, C), R = j(), $ = {
register: (t, e, o, n) => {
t.modal = a, e.modal = M, n.modal = { callbackResolver: R };
}
};
export {
R as callbackResolver,
$ as default,
M as propsResolver
};