UNPKG

@form-create/vant

Version:

Vant 版本(移动端)低代码表单 | FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。

496 lines (428 loc) 10.9 kB
.form-create-m { width: 100%; } .form-create-m.is-preview .fc-clock, .form-create-m .fc-none { display: none !important; } .form-create-m .fc-form-item:after { content: ' ' !important; display: block !important; } .form-create-m .fc-form-item .van-cell:not(.fc-form-item):after { display: none !important; } .form-create-m .fc-form-item .van-cell:not(.fc-form-item) { padding: 0; } .form-create-m .fc-form-item .fc-form-item { padding-left: 0; padding-right: 0; --van-padding-md: 0; } .form-create-m .fc-reset-btn { margin-top: 12px; } .form-create-m .fc-form-title { display: inline-flex; align-items: center; } .form-create-m.is-preview .van-field__label--required:before { display: none; } ._fc-m-group{ display: flex; align-items: flex-end; min-height: 38px; justify-content: center; flex-direction: column; width: 100%; } ._fc-m-group-disabled ._fc-m-group-btn, ._fc-m-group-disabled ._fc-m-group-add{ cursor: not-allowed; } ._fc-m-group-handle { display: flex; flex-direction: row; position: absolute; bottom: -15px; right: 30px; border-radius: 15px; border: 1px dashed #d9d9d9; padding: 3px 8px; background-color: #ffffff; transform: scale(1.1); } ._fc-m-group-btn{ cursor: pointer; } ._fc-m-group-idx { position: absolute; bottom: -15px; left: 10px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: #eee; border-radius: 15px; font-weight: 700; } ._fc-m-group-handle ._fc-m-group-btn + ._fc-m-group-btn { margin-left: 7px; } ._fc-m-group-container{ position: relative; display: flex; flex-direction: column; border: 1px dashed #d9d9d9; border-radius: 5px; margin-bottom: 25px; padding: 5px 5px 25px; width: 100%; box-sizing: border-box; } ._fc-m-group-arrow { position: relative; width: 20px; height: 20px; } ._fc-m-group-arrow::before { content: ""; position: absolute; top: 8px; left: 5px; width: 9px; height: 9px; border-left: 2px solid #999; border-top: 2px solid #999; } ._fc-m-group-arrow::before { transform: rotate(45deg); } ._fc-m-group-arrow._fc-m-group-down { transform: rotate(180deg); } ._fc-m-group-plus-minus { width: 20px; height: 20px; position: relative; cursor: pointer; } ._fc-m-group-plus-minus::before, ._fc-m-group-plus-minus::after { content: ""; position: absolute; top: 50%; left: 50%; width: 60%; height: 2px; background-color: #409eff; transform: translate(-50%, -50%); } ._fc-m-group-plus-minus::before { transform: translate(-50%, -50%) rotate(90deg); } ._fc-m-group-plus-minus._fc-m-group-minus::before { display: none; } ._fc-m-group-plus-minus._fc-m-group-minus::after { background-color: #f56c6c; } ._fc-m-group-add{ cursor: pointer; width: 25px; height: 25px; border: 1px solid rgb(64 158 255 / 50%); border-radius: 15px; transform: scale(1.1); } ._fc-m-group-add._fc-m-group-plus-minus::before, ._fc-m-group-add._fc-m-group-plus-minus::after { width: 50%; } /* ===== Card 类型样式 ===== */ /* 主容器 */ ._fc-m-group._fc-m-group-card { display: flex; flex-direction: column; width: 100%; gap: 16px; } /* 禁用状态 */ ._fc-m-group._fc-m-group-card._fc-m-group-disabled ._fc-m-group-btn, ._fc-m-group._fc-m-group-card._fc-m-group-disabled ._fc-m-group-add { cursor: not-allowed; opacity: 0.5; } /* 卡片容器 */ ._fc-m-group._fc-m-group-card ._fc-m-group-container { position: relative; background: #ffffff; border: 1px solid #f0f0f0; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; padding: 0; margin: 0; } /* 卡片头部 */ ._fc-m-group._fc-m-group-card ._fc-m-group-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid #f0f0f0; background: #fafafa; } /* 序号标签 */ ._fc-m-group._fc-m-group-card ._fc-m-group-idx { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: #f0f0f0; color: #666666; border-radius: 6px; font-size: 12px; font-weight: 500; margin-right: 12px; flex-shrink: 0; position: static; border: 1px solid #e0e0e0; } /* 标题区域 */ ._fc-m-group._fc-m-group-card ._fc-m-group-title { flex: 1; font-size: 14px; font-weight: 500; color: rgba(0, 0, 0, 0.85); line-height: 1.5715; text-align: left; } /* 操作按钮组 - 头部右侧 */ ._fc-m-group._fc-m-group-card ._fc-m-group-handle { display: flex; align-items: center; gap: 4px; margin-left: 12px; flex-shrink: 0; position: static; bottom: auto; right: auto; border-radius: 0; border: none; padding: 0; background-color: transparent; flex-direction: row; transform: none; } /* 按钮基础样式 */ ._fc-m-group._fc-m-group-card ._fc-m-group-btn { cursor: pointer; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 4px; border: 1px solid #d9d9d9; background: #ffffff; color: rgba(0, 0, 0, 0.45); position: relative; } ._fc-m-group._fc-m-group-card ._fc-m-group-btn:hover { color: #1890ff; border-color: #1890ff; background: #f0f8ff; } ._fc-m-group._fc-m-group-card ._fc-m-group-btn:active { color: #096dd9; border-color: #096dd9; } /* 箭头按钮 */ ._fc-m-group._fc-m-group-card ._fc-m-group-arrow { position: relative; } ._fc-m-group._fc-m-group-card ._fc-m-group-arrow::before { content: ""; position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; border-left: 1px solid currentColor; border-top: 1px solid currentColor; transform: translate(-50%, -50%) rotate(45deg); } ._fc-m-group._fc-m-group-card ._fc-m-group-arrow._fc-m-group-down { transform: rotate(180deg); } /* 合并的上下箭头按钮 */ ._fc-m-group._fc-m-group-card ._fc-m-group-sort { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 24px; } ._fc-m-group._fc-m-group-card ._fc-m-group-sort::before, ._fc-m-group._fc-m-group-card ._fc-m-group-sort::after { content: ""; position: absolute; left: 50%; width: 4px; height: 4px; border-left: 1px solid currentColor; border-top: 1px solid currentColor; transform: translateX(-50%); } ._fc-m-group._fc-m-group-card ._fc-m-group-sort::before { top: 6px; transform: translateX(-50%) rotate(45deg); } ._fc-m-group._fc-m-group-card ._fc-m-group-sort::after { bottom: 6px; transform: translateX(-50%) rotate(225deg); } /* 合并按钮的上下点击区域 */ ._fc-m-group._fc-m-group-card ._fc-m-group-sort-up, ._fc-m-group._fc-m-group-card ._fc-m-group-sort-down { position: absolute; left: 0; right: 0; height: 12px; cursor: pointer; z-index: 1; } ._fc-m-group._fc-m-group-card ._fc-m-group-sort-up { top: 0; } ._fc-m-group._fc-m-group-card ._fc-m-group-sort-down { bottom: 0; } ._fc-m-group._fc-m-group-card ._fc-m-group-sort-up:hover, ._fc-m-group._fc-m-group-card ._fc-m-group-sort-down:hover { background: rgba(24, 144, 255, 0.1); } /* 加减按钮 */ ._fc-m-group._fc-m-group-card ._fc-m-group-plus-minus { position: relative; background: #409eff; border-color: #409eff; color: white; width: 24px; height: 24px; border-radius: 4px; } ._fc-m-group._fc-m-group-card ._fc-m-group-plus-minus:hover { background: #66b1ff; border-color: #66b1ff; color: white; } ._fc-m-group._fc-m-group-card ._fc-m-group-plus-minus::before, ._fc-m-group._fc-m-group-card ._fc-m-group-plus-minus::after { content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 1px; background-color: currentColor; transform: translate(-50%, -50%); } ._fc-m-group._fc-m-group-card ._fc-m-group-plus-minus::before { transform: translate(-50%, -50%) rotate(90deg); } ._fc-m-group._fc-m-group-card ._fc-m-group-plus-minus._fc-m-group-minus { background: #f56c6c; border-color: #f56c6c; } ._fc-m-group._fc-m-group-card ._fc-m-group-plus-minus._fc-m-group-minus:hover { background: #f78989; border-color: #f78989; } ._fc-m-group._fc-m-group-card ._fc-m-group-plus-minus._fc-m-group-minus::before { display: none; } /* 表单内容区域 */ ._fc-m-group._fc-m-group-card ._fc-m-group-content { padding: 20px; } /* 添加按钮 - 与加号按钮风格一致 */ ._fc-m-group._fc-m-group-card ._fc-m-group-add { cursor: pointer; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 4px; border: 1px solid #d9d9d9; background: #ffffff; color: rgba(0, 0, 0, 0.45); position: relative; transform: none; } ._fc-m-group._fc-m-group-card ._fc-m-group-add:hover { color: #409eff; border-color: #409eff; background: #f0f8ff; } ._fc-m-group._fc-m-group-card ._fc-m-group-add._fc-m-group-plus-minus { width: 24px; height: 24px; background: #409eff; border-color: #409eff; color: white; } ._fc-m-group._fc-m-group-card ._fc-m-group-add._fc-m-group-plus-minus:hover { background: #66b1ff; border-color: #66b1ff; color: white; } ._fc-m-group._fc-m-group-card ._fc-m-group-add._fc-m-group-plus-minus::before, ._fc-m-group._fc-m-group-card ._fc-m-group-add._fc-m-group-plus-minus::after { content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 1px; background-color: currentColor; transform: translate(-50%, -50%); } ._fc-m-group._fc-m-group-card ._fc-m-group-add._fc-m-group-plus-minus::before { transform: translate(-50%, -50%) rotate(90deg); } /* 空状态样式 */ ._fc-m-group._fc-m-group-card ._fc-m-group-empty { text-align: center; padding: 40px 20px; color: rgba(0, 0, 0, 0.45); font-size: 14px; } /* 响应式设计 */ @media (max-width: 768px) { ._fc-m-group._fc-m-group-card ._fc-m-group-container { margin: 0 -8px; border-radius: 0; border-left: none; border-right: none; } ._fc-m-group._fc-m-group-card ._fc-m-group-header { padding: 12px 16px 8px; } ._fc-m-group._fc-m-group-card ._fc-m-group-content { padding: 16px; } ._fc-m-group._fc-m-group-card ._fc-m-group-handle { gap: 2px; } ._fc-m-group._fc-m-group-card ._fc-m-group-btn { width: 22px; height: 22px; } }