@longhongguo/form-create-ant-design-vue 3.2.75 → 3.2.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longhongguo/form-create-ant-design-vue",
3
- "version": "3.2.75",
3
+ "version": "3.2.77",
4
4
  "description": "AntDesignVue版本低代码表单|FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。支持6个UI框架,适配移动端,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。",
5
5
  "main": "./dist/form-create.min.js",
6
6
  "module": "./dist/form-create.esm.js",
@@ -51,11 +51,12 @@
51
51
  "dependencies": {
52
52
  "@form-create/component-antdv-frame": "^3.2.31",
53
53
  "@form-create/component-antdv-group": "^3.2.31",
54
- "@longhongguo/component-antdv-upload": "^3.2.41",
55
54
  "@form-create/component-subform": "^3.1.34",
56
- "@longhongguo/form-create-core": "latest",
57
55
  "@form-create/core": "^3.2.33",
58
- "@form-create/utils": "^3.2.31"
56
+ "@form-create/utils": "^3.2.31",
57
+ "@longhongguo/component-antdv-upload": "^3.2.41",
58
+ "@longhongguo/form-create-core": "latest",
59
+ "moment": "^2.30.1"
59
60
  },
60
61
  "publishConfig": {
61
62
  "registry": "https://registry.npmjs.org/",
@@ -70,8 +71,8 @@
70
71
  "@vue/cli-plugin-babel": "~4.5.0",
71
72
  "@vue/cli-service": "^4.5.3",
72
73
  "ant-design-vue": "^4.0",
73
- "v-jsoneditor": "^1.4.2",
74
- "bili": "^5.0.5"
74
+ "bili": "^5.0.5",
75
+ "v-jsoneditor": "^1.4.2"
75
76
  },
76
77
  "buildFormCreateOptions": {
77
78
  "name": "@longhongguo/form-create-ant-design-vue",
package/src/core/api.js CHANGED
@@ -3,6 +3,7 @@ import is from '@form-create/utils/lib/type'
3
3
  import { invoke } from '@longhongguo/form-create-core/src/frame/util'
4
4
  import toArray from '@form-create/utils/lib/toarray'
5
5
  import validator from './test'
6
+ import moment from 'moment'
6
7
 
7
8
  function tidyBtnProp(btn, def) {
8
9
  if (is.Boolean(btn)) btn = { show: btn }
@@ -258,6 +259,7 @@ export default function extendApi(api, h) {
258
259
  * }
259
260
  * }
260
261
  */
261
- validator
262
+ $validator: validator,
263
+ $moment: moment
262
264
  }
263
265
  }
@@ -133,6 +133,28 @@ export default {
133
133
  }
134
134
  })
135
135
  }
136
+
137
+ // 读取 resetMarginBottom 配置,用于重置包裹 flex 的 ant-form-item 的 margin-bottom
138
+ const resetMarginBottom =
139
+ props.resetMarginBottom ?? ctx.rule.resetMarginBottom ?? false
140
+ if (resetMarginBottom) {
141
+ // 将 class 添加到 wrap 配置中,使其应用到包裹 flex 的 ant-form-item 上
142
+ if (!ctx.rule.wrap) {
143
+ ctx.rule.wrap = {}
144
+ }
145
+ if (typeof ctx.rule.wrap === 'object' && !ctx.rule.wrap.class) {
146
+ ctx.rule.wrap.class = ''
147
+ }
148
+ const wrapClass = typeof ctx.rule.wrap === 'object'
149
+ ? (ctx.rule.wrap.class || '').split(' ').filter(Boolean)
150
+ : []
151
+ if (!wrapClass.includes('_fc-reset-margin-bottom')) {
152
+ wrapClass.push('_fc-reset-margin-bottom')
153
+ if (typeof ctx.rule.wrap === 'object') {
154
+ ctx.rule.wrap.class = wrapClass.join(' ')
155
+ }
156
+ }
157
+ }
136
158
  },
137
159
  render(children, ctx) {
138
160
  // 使用 Ant Design Vue 的 Flex 组件
@@ -67,6 +67,28 @@ export default {
67
67
  }
68
68
  })
69
69
  }
70
+
71
+ // 读取 resetMarginBottom 配置,用于重置包裹 space 的 ant-form-item 的 margin-bottom
72
+ const resetMarginBottom =
73
+ props.resetMarginBottom ?? ctx.rule.resetMarginBottom ?? false
74
+ if (resetMarginBottom) {
75
+ // 将 class 添加到 wrap 配置中,使其应用到包裹 space 的 ant-form-item 上
76
+ if (!ctx.rule.wrap) {
77
+ ctx.rule.wrap = {}
78
+ }
79
+ if (typeof ctx.rule.wrap === 'object' && !ctx.rule.wrap.class) {
80
+ ctx.rule.wrap.class = ''
81
+ }
82
+ const wrapClass = typeof ctx.rule.wrap === 'object'
83
+ ? (ctx.rule.wrap.class || '').split(' ').filter(Boolean)
84
+ : []
85
+ if (!wrapClass.includes('_fc-reset-margin-bottom')) {
86
+ wrapClass.push('_fc-reset-margin-bottom')
87
+ if (typeof ctx.rule.wrap === 'object') {
88
+ ctx.rule.wrap.class = wrapClass.join(' ')
89
+ }
90
+ }
91
+ }
70
92
  },
71
93
  render(children, ctx) {
72
94
  // 使用 Ant Design Vue 的 Space 组件
@@ -471,6 +471,38 @@
471
471
  line-height: 32px;
472
472
  }
473
473
 
474
+ /* 仅在设计器中展示红色星号(不参与校验) */
475
+ /* 设计器特定场景 */
476
+ ._fc-designer
477
+ ._fc-m-drag
478
+ ._fc-fake-required
479
+ .ant-form-item-label
480
+ > label::before,
481
+ ._fc-designer
482
+ ._fc-m-drag
483
+ ._fc-fake-required
484
+ label.ant-form-item-no-colon::before,
485
+ /* 通用场景 - 带 label 容器 */
486
+ ._fc-fake-required
487
+ .ant-form-item-label
488
+ > label::before,
489
+ ._fc-fake-required
490
+ .ant-form-item-label
491
+ > label.ant-form-item-required::before,
492
+ /* 通用场景 - 无 label 容器(直接 label) */
493
+ ._fc-fake-required
494
+ label.ant-form-item-no-colon::before,
495
+ ._fc-fake-required
496
+ label::before {
497
+ display: inline-block;
498
+ margin-inline-end: 4px;
499
+ color: #ff4d4f;
500
+ font-size: 14px;
501
+ font-family: SimSun, sans-serif;
502
+ line-height: 1;
503
+ content: '*';
504
+ }
505
+
474
506
  ._fd-tf-required {
475
507
  color: #f56c6c;
476
508
  margin-right: 4px;
@@ -501,3 +533,8 @@
501
533
  .ant-flex._fc-flex-vertical > .ant-form-item {
502
534
  width: var(--fc-child-width, 100%) !important;
503
535
  }
536
+
537
+ /* Flex 和 Space 组件重置包裹它们的 ant-form-item 的 margin-bottom 的样式 */
538
+ .ant-form-item._fc-reset-margin-bottom {
539
+ margin-bottom: 0 !important;
540
+ }