UNPKG

vxe-design

Version:

A PC-based visual designer based on Vxe UI, used for building zero-code and low-code platforms

83 lines (82 loc) 2.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WidgetSubtableFormComponent = void 0; var _vue = require("vue"); var _comp = require("../../ui/src/comp"); var _core = require("@vxe-ui/core"); var _use = require("../../form-design/src/use"); const WidgetSubtableFormComponent = exports.WidgetSubtableFormComponent = (0, _comp.defineVxeComponent)({ props: { renderOpts: { type: Object, default: () => ({}) }, renderParams: { type: Object, default: () => ({}) } }, emits: [], setup(props) { const VxeUIFormComponent = _core.VxeUI.getComponent('vxe-form'); const VxeUIFormItemComponent = _core.VxeUI.getComponent('vxe-form-item'); const VxeUIInputComponent = _core.VxeUI.getComponent('vxe-input'); const VxeUISwitchComponent = _core.VxeUI.getComponent('vxe-switch'); const $xeFormDesign = (0, _vue.inject)('$xeFormDesign', null); if (!$xeFormDesign) { return () => []; } const { computeKebabCaseName } = (0, _use.useWidgetName)(props); return () => { const { renderParams } = props; const { widget } = renderParams; const { options } = widget; const kebabCaseName = computeKebabCaseName.value; return (0, _vue.h)(VxeUIFormComponent, { class: `vxe-form-design--widget-${kebabCaseName}-form`, vertical: true, span: 24, titleBold: true, titleOverflow: true, data: options }, { default() { return [(0, _vue.h)(VxeUIFormItemComponent, { title: (0, _core.getI18n)('vxe.formDesign.widgetProp.name') }, { default() { return (0, _vue.h)(VxeUIInputComponent, { modelValue: widget.title, 'onUpdate:modelValue'(val) { widget.title = val; } }); } }), (0, _vue.h)(VxeUIFormItemComponent, { title: (0, _core.getI18n)('vxe.formDesign.widgetProp.subtableProp.showCheckbox'), field: 'showCheckbox' }, { default() { return (0, _vue.h)(VxeUISwitchComponent, { modelValue: options.showCheckbox, 'onUpdate:modelValue'(val) { options.showCheckbox = val; } }); } })]; } }); }; } });