{"version":3,"file":"form-create.min.js","sources":["../../../node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js","../../utils/lib/slot.js","../../../components/element-ui/checkbox/src/component.jsx","../../utils/lib/toarray.js","../../../node_modules/style-inject/dist/style-inject.es.js","../../../components/element-ui/frame/src/component.jsx","../../../components/element-ui/radio/src/component.jsx","../../utils/lib/type.js","../../../components/element-ui/select/src/component.jsx","../../../components/element-ui/tree/src/component.jsx","../../../components/element-ui/upload/src/component.jsx","../../../components/element-ui/group/src/component.jsx","../../../components/common/subform/src/component.jsx","../src/components/index.js","../../utils/lib/modify.js","../../utils/lib/extend.js","../../core/src/components/formCreate.js","../../utils/lib/mergeprops.js","../../core/src/frame/attrs.js","../../utils/lib/deepextend.js","../../utils/lib/console.js","../../core/src/frame/util.js","../../utils/lib/tostring.js","../../utils/lib/toline.js","../../utils/lib/unique.js","../../utils/lib/deepset.js","../../core/src/factory/creator.js","../../core/src/factory/maker.js","../../core/src/frame/api.js","../../core/src/render/cache.js","../../utils/lib/tocase.js","../../core/src/render/render.js","../../core/src/render/index.js","../../core/src/handler/inject.js","../../core/src/handler/page.js","../../core/src/handler/render.js","../../core/src/factory/context.js","../../core/src/handler/loader.js","../../core/src/handler/input.js","../../core/src/handler/helper.js","../../core/src/factory/parser.js","../../core/src/handler/context.js","../../core/src/handler/lifecycle.js","../../core/src/handler/effect.js","../../core/src/handler/index.js","../../core/src/frame/fetch.js","../../core/src/components/fragment.js","../../core/src/factory/node.js","../../core/src/factory/manager.js","../../core/src/frame/provider.js","../../core/src/frame/index.js","../src/parsers/datePicker.js","../src/parsers/hidden.js","../src/parsers/input.js","../src/parsers/slider.js","../src/parsers/timePicker.js","../src/parsers/row.js","../src/parsers/select.js","../src/parsers/index.js","../src/core/alias.js","../src/core/config.js","../src/core/manager.js","../src/core/maker.js","../src/core/api.js","../src/core/index.js","../src/index.js"],"sourcesContent":["\"use strict\";function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c {\n if (!exclude || exclude.indexOf(name) === -1) {\n lst.push(slots[name])\n }\n return lst;\n }, [])\n}","import getSlot from '@form-create/utils/lib/slot';\n\nconst NAME = 'fcCheckbox';\n\nexport default {\n name: NAME,\n props: {\n formCreateRule: {\n type: Object,\n default: () => ({})\n },\n formCreateOptions: {\n type: Array,\n default: () => []\n },\n value: {\n type: Array,\n default: () => []\n },\n type: String,\n },\n watch: {\n value() {\n this.update();\n }\n },\n data() {\n return {\n trueValue: []\n }\n },\n methods: {\n onInput(n) {\n this.$emit('input', this.formCreateOptions.filter((opt) => n.indexOf(opt.label) !== -1).map((opt) => opt.value).filter(v => v !== undefined));\n },\n update() {\n this.trueValue = this.value ? this.formCreateOptions.filter((opt) => this.value.indexOf(opt.value) !== -1)\n .map((option) => option.label) : []\n }\n },\n created() {\n this.update();\n },\n render() {\n return {this.formCreateOptions.map((opt, index) => {\n const props = {...opt};\n const Type = this.type === 'button' ? 'ElCheckboxButton' : 'ElCheckbox';\n delete props.value;\n return \n })}{getSlot(this.$slots)}\n }\n}\n","export default function toArray(value) {\n return Array.isArray(value)\n ? value\n : ([null, undefined, ''].indexOf(value) > -1 ? [] : [value]);\n}\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import toArray from '@form-create/utils/lib/toarray';\nimport './style.css';\n\nconst NAME = 'fcFrame';\n\nexport default {\n name: NAME,\n props: {\n formCreateField: String,\n type: {\n type: String,\n default: 'input'\n },\n field: String,\n helper: {\n type: Boolean,\n default: true\n },\n disabled: {\n type: Boolean,\n default: false\n },\n src: {\n type: String,\n required: true\n },\n icon: {\n type: String,\n default: 'el-icon-upload2'\n },\n width: {\n type: String,\n default: '500px'\n },\n height: {\n type: String,\n default: '370px'\n },\n maxLength: {\n type: Number,\n default: 0\n },\n okBtnText: {\n type: String,\n default: '确定'\n },\n closeBtnText: {\n type: String,\n default: '关闭'\n },\n modalTitle: String,\n handleIcon: {\n type: [String, Boolean],\n default: undefined\n },\n title: String,\n allowRemove: {\n type: Boolean,\n default: true\n },\n onOpen: {\n type: Function,\n default: () => {\n }\n },\n onOk: {\n type: Function,\n default: () => {\n }\n },\n onCancel: {\n type: Function,\n default: () => {\n }\n },\n onLoad: {\n type: Function,\n default: () => {\n }\n },\n onBeforeRemove: {\n type: Function,\n default: () => {\n }\n },\n onRemove: {\n type: Function,\n default: () => {\n }\n },\n onHandle: {\n type: Function,\n default(src) {\n this.previewImage = this.getSrc(src);\n this.previewVisible = true;\n }\n },\n modal: {\n type: Object,\n default: () => ({})\n },\n srcKey: {\n type: [String, Number]\n },\n value: [Array, String, Number, Object],\n previewMask: undefined,\n footer: {\n type: Boolean,\n default: true\n },\n reload: {\n type: Boolean,\n default: true\n },\n closeBtn: {\n type: Boolean,\n default: true\n },\n okBtn: {\n type: Boolean,\n default: true\n },\n\n },\n data() {\n return {\n fileList: toArray(this.value),\n previewVisible: false,\n frameVisible: false,\n previewImage: ''\n }\n },\n watch: {\n value(n) {\n this.fileList = toArray(n);\n },\n fileList(n) {\n const val = this.maxLength === 1 ? (n[0] || '') : n;\n this.$emit('input', val);\n this.$emit('change', val);\n },\n src(n) {\n this.modalVm && (this.modalVm.src = n);\n }\n },\n methods: {\n key(unique) {\n return unique;\n },\n closeModel(close) {\n this.$emit(close ? '$close' : '$ok');\n if (this.reload) {\n this.$off('$ok');\n this.$off('$close');\n }\n this.frameVisible = false;\n },\n handleCancel() {\n this.previewVisible = false;\n },\n\n showModel() {\n if (this.disabled || false === this.onOpen()) {\n return;\n }\n this.frameVisible = true;\n },\n\n makeInput() {\n const props = {\n type: 'text',\n value: (this.fileList.map(v => this.getSrc(v))).toString(),\n readonly: true\n };\n\n return \n {this.fileList.length ? this.fileList = []}/> : null}\n this.showModel()}} slot=\"append\"/>\n \n },\n\n makeGroup(children) {\n if (!this.maxLength || this.fileList.length < this.maxLength) {\n children.push(this.makeBtn());\n }\n return
{...children}
\n },\n\n makeItem(index, children) {\n return
{...children}
;\n },\n valid(f) {\n const field = this.formCreateField || this.field;\n if (field && f !== field) {\n throw new Error('[frame]无效的字段值');\n }\n },\n\n makeIcons(val, index) {\n if (this.handleIcon !== false || this.allowRemove === true) {\n const icons = [];\n if ((this.type !== 'file' && this.handleIcon !== false) || (this.type === 'file' && this.handleIcon)) {\n icons.push(this.makeHandleIcon(val, index));\n }\n if (this.allowRemove) {\n icons.push(this.makeRemoveIcon(val, index));\n }\n return
{icons}
\n }\n },\n makeHandleIcon(val, index) {\n return this.handleClick(val)} key={this.key('hi' + index)}/>\n },\n\n makeRemoveIcon(val, index) {\n return this.handleRemove(val)} key={this.key('ri' + index)}/>\n },\n\n makeFiles() {\n return this.makeGroup(this.fileList.map((src, index) => {\n return this.makeItem(index, [ this.handleClick(src)}/>, this.makeIcons(src, index)])\n }))\n },\n makeImages() {\n return this.makeGroup(this.fileList.map((src, index) => {\n return this.makeItem(index, [, this.makeIcons(src, index)])\n }))\n },\n makeBtn() {\n return
this.showModel()} key={this.key('btn')}>\n \n
\n },\n handleClick(src) {\n if (this.disabled) {\n return;\n }\n return this.onHandle(src);\n },\n handleRemove(src) {\n if (this.disabled) {\n return;\n }\n if (false !== this.onBeforeRemove(src)) {\n this.fileList.splice(this.fileList.indexOf(src), 1);\n this.onRemove(src);\n }\n },\n getSrc(src) {\n return !this.srcKey ? src : src[this.srcKey];\n },\n frameLoad(iframe) {\n this.onLoad(iframe);\n try {\n if (this.helper === true) {\n iframe['form_create_helper'] = {\n close: (field) => {\n this.valid(field);\n this.closeModel();\n },\n set: (field, value) => {\n this.valid(field);\n if (!this.disabled)\n this.$emit('input', value);\n\n },\n get: (field) => {\n this.valid(field);\n return this.value;\n },\n onOk: fn => this.$on('$ok', fn),\n onClose: fn => this.$on('$close', fn)\n };\n\n }\n } catch (e) {\n console.log(e);\n }\n },\n makeFooter() {\n const {okBtnText, closeBtnText, closeBtn, okBtn, footer} = this.$props;\n\n if (!footer) {\n return;\n }\n return
\n {closeBtn ? (this.onCancel() !== false && (this.frameVisible = false))}>{closeBtnText} : null}\n {okBtn ? (this.onOk() !== false && this.closeModel())}>{okBtnText} : null}\n
\n }\n },\n render() {\n const type = this.type;\n\n let node;\n if (type === 'input') {\n node = this.makeInput();\n } else if (type === 'image') {\n node = this.makeImages();\n } else {\n node = this.makeFiles();\n }\n\n const {width = '30%', height, src, title, modalTitle} = this.$props;\n this.$nextTick(() => {\n if (this.$refs.frame) {\n this.frameLoad(this.$refs.frame.contentWindow || {});\n }\n });\n return
{node}\n \n \"example\"\n \n (this.closeModel(true))}>\n {(this.frameVisible || !this.reload) ?