UNPKG

yanzhen-design-vue

Version:

39 lines (38 loc) 1.52 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const vue = require("vue"); const core = require("@yanzhen-lowcode/core"); const utilsVue = require("@yanzhen-libs/utils-vue"); const lodashEs = require("lodash-es"); const textPreview = require("./src/text-preview.cjs"); function defaultTextPreviewOptions(options) { return { props: utilsVue.buildProps({ ...(options == null ? void 0 : options.props) ?? {}, ...textPreview.textPreviewProps }), emits: utilsVue.buildEmits({ ...(options == null ? void 0 : options.emits) ?? {}, ...textPreview.textPreviewEmits }), apis: lodashEs.mergeWith({}, options == null ? void 0 : options.apis) }; } function defineTextPreviewComponent(name, options) { const defaultOptions = defaultTextPreviewOptions(options); return core.defineComponent(name, { ...defaultOptions, ...lodashEs.omit(options, ...Object.keys(defaultOptions)), component: (options == null ? void 0 : options.component) ?? vue.defineAsyncComponent({ loader: () => Promise.resolve().then(() => require("./src/text-preview.vue.cjs")), delay: 300, onError() { } }) }); } const TextPreview = defineTextPreviewComponent("text-preview"); const YzSchemaTextPreview = core.withInstall(TextPreview); exports.YzSchemaTextPreview = YzSchemaTextPreview; exports.default = YzSchemaTextPreview; exports.defineTextPreviewComponent = defineTextPreviewComponent;