@para-ui/core 5.0.1 → 5.0.3-beta.8

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.
Files changed (94) hide show
  1. package/FieldForm/component.json +22 -1
  2. package/FormItemGroup/component.json +72 -0
  3. package/Menu/component.json +9 -2
  4. package/es/Checkbox/index.js +26 -24
  5. package/es/CheckboxGroup/index.css +1 -1
  6. package/es/CheckboxGroup/style/index.css +1 -1
  7. package/es/ExpressionInput/Popup.js +11 -4
  8. package/es/ExpressionInput/useExpressionInput.js +40 -37
  9. package/es/FieldForm/ErrorList.js +9 -8
  10. package/es/FieldForm/FieldFormItem/ItemHolder.d.ts +2 -0
  11. package/es/FieldForm/FieldFormItem/ItemHolder.js +78 -68
  12. package/es/FieldForm/FieldFormItem/index.d.ts +3 -0
  13. package/es/FieldForm/FieldFormItem/index.js +131 -120
  14. package/es/FieldForm/Form.d.ts +3 -1
  15. package/es/FieldForm/Form.js +54 -50
  16. package/es/FieldForm/compactControlMarker.d.ts +18 -0
  17. package/es/FieldForm/compactControlMarker.js +5 -0
  18. package/es/FieldForm/component.json +22 -1
  19. package/es/FieldForm/context.d.ts +3 -1
  20. package/es/FieldForm/context.js +6 -5
  21. package/es/FieldForm/index.css +1 -1
  22. package/es/FieldForm/index.d.ts +2 -0
  23. package/es/FieldForm/index.js +13 -9
  24. package/es/FieldForm/interface.d.ts +9 -0
  25. package/es/FieldForm/style/index.css +1 -1
  26. package/es/FieldForm/util.d.ts +14 -0
  27. package/es/FieldForm/util.js +41 -17
  28. package/es/FormItemGroup/component.json +72 -0
  29. package/es/FormItemGroup/index.css +1 -0
  30. package/es/FormItemGroup/index.d.ts +14 -0
  31. package/es/FormItemGroup/index.js +27 -0
  32. package/es/FormItemGroup/style/css.js +1 -0
  33. package/es/FormItemGroup/style/index.css +1 -0
  34. package/es/FormItemGroup/style/index.js +1 -0
  35. package/es/HelperText/index.js +15 -13
  36. package/es/Menu/component.json +9 -2
  37. package/es/Menu/index.css +1 -1
  38. package/es/Menu/interface.d.ts +2 -0
  39. package/es/Menu/style/index.css +1 -1
  40. package/es/Menu/verticalMenuList.js +378 -361
  41. package/es/RadioGroup/index.css +1 -1
  42. package/es/RadioGroup/style/index.css +1 -1
  43. package/es/RangeInput/index.js +60 -60
  44. package/es/Switch/index.js +30 -28
  45. package/es/Tag/TagGroup.js +29 -32
  46. package/es/Tag/index.js +5 -5
  47. package/es/index.d.ts +2 -0
  48. package/es/index.js +175 -169
  49. package/lib/Checkbox/index.js +1 -1
  50. package/lib/CheckboxGroup/index.css +1 -1
  51. package/lib/CheckboxGroup/style/index.css +1 -1
  52. package/lib/ExpressionInput/Popup.js +1 -1
  53. package/lib/ExpressionInput/useExpressionInput.js +1 -1
  54. package/lib/FieldForm/ErrorList.js +1 -1
  55. package/lib/FieldForm/FieldFormItem/ItemHolder.d.ts +2 -0
  56. package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  57. package/lib/FieldForm/FieldFormItem/index.d.ts +3 -0
  58. package/lib/FieldForm/FieldFormItem/index.js +1 -1
  59. package/lib/FieldForm/Form.d.ts +3 -1
  60. package/lib/FieldForm/Form.js +1 -1
  61. package/lib/FieldForm/compactControlMarker.d.ts +18 -0
  62. package/lib/FieldForm/compactControlMarker.js +2 -0
  63. package/lib/FieldForm/component.json +22 -1
  64. package/lib/FieldForm/context.d.ts +3 -1
  65. package/lib/FieldForm/context.js +1 -1
  66. package/lib/FieldForm/index.css +1 -1
  67. package/lib/FieldForm/index.d.ts +2 -0
  68. package/lib/FieldForm/index.js +1 -1
  69. package/lib/FieldForm/interface.d.ts +9 -0
  70. package/lib/FieldForm/style/index.css +1 -1
  71. package/lib/FieldForm/util.d.ts +14 -0
  72. package/lib/FieldForm/util.js +1 -1
  73. package/lib/FormItemGroup/component.json +72 -0
  74. package/lib/FormItemGroup/index.css +1 -0
  75. package/lib/FormItemGroup/index.d.ts +14 -0
  76. package/lib/FormItemGroup/index.js +2 -0
  77. package/lib/FormItemGroup/style/css.js +1 -0
  78. package/lib/FormItemGroup/style/index.css +1 -0
  79. package/lib/FormItemGroup/style/index.js +1 -0
  80. package/lib/HelperText/index.js +1 -1
  81. package/lib/Menu/component.json +9 -2
  82. package/lib/Menu/index.css +1 -1
  83. package/lib/Menu/interface.d.ts +2 -0
  84. package/lib/Menu/style/index.css +1 -1
  85. package/lib/Menu/verticalMenuList.js +1 -1
  86. package/lib/RadioGroup/index.css +1 -1
  87. package/lib/RadioGroup/style/index.css +1 -1
  88. package/lib/RangeInput/index.js +1 -1
  89. package/lib/Switch/index.js +1 -1
  90. package/lib/Tag/TagGroup.js +1 -1
  91. package/lib/Tag/index.js +1 -1
  92. package/lib/index.d.ts +2 -0
  93. package/lib/index.js +1 -1
  94. package/package.json +14 -1
@@ -61,6 +61,20 @@
61
61
  "children": {
62
62
  "type": "ReactNode",
63
63
  "description": "FieldForm 接收任意 ReactNode(包括 FieldForm.Item / Button type=submit / 自定义包装);**但每个 Item 的 child 必须是支持 value/onChange/error/disabled 的自定义组件**(TextField / Select / Checkbox / Switch / DatePicker / InputNumber 等);**不可用原生 input/textarea/select/button — 会触发 React non-boolean-attribute warning**(因 cloneElement 注入 error={false} 给原生 DOM 元素时,React 视 error 为 DOM attr → 报错);见 childrenContract.FormItem"
64
+ },
65
+ "itemDecorator": {
66
+ "type": "ItemDecorator",
67
+ "objectShape": {
68
+ "getItemClassName": {
69
+ "type": "(meta: ItemDecoratorMeta) => string | undefined | false",
70
+ "description": "按字段 namePath/path 返回要合并到该 FieldForm.Item 根节点的 className;返回 undefined/''/false 时不追加,不影响其他状态 class(is-error/is-success 等)"
71
+ },
72
+ "renderItemExtra": {
73
+ "type": "(meta: ItemDecoratorMeta) => ReactNode",
74
+ "description": "按字段 namePath/path 在该 FieldForm.Item 根节点内追加渲染内容(如 diff 命中原因说明);渲染在根节点内、内部间距容器之外,不影响 has-spacing/has-helper-text 的 20px 间距机制"
75
+ }
76
+ },
77
+ "description": "Form 级一次注册、所有子孙 FieldForm.Item 自动生效的字段装饰扩展点;meta.namePath 来自 rc-field-form 的 renderMeta.name(真实的、经过 List 等上下文处理后的最终路径),meta.path 是预拼接字符串(数组下标用方括号,如 'ubr.list[0].x');未传 name 的 Item 固定拿到 { namePath: [], path: '' };典型用法:`<FieldForm itemDecorator={{ getItemClassName: (meta) => isHit(meta.path) ? 'is-hit' : undefined, renderItemExtra: (meta) => isHit(meta.path) ? <span>命中原因</span> : null }}>`"
64
78
  }
65
79
  },
66
80
  "childrenContract": {
@@ -137,7 +151,9 @@
137
151
  "把'仅使用 FieldForm 本身'解读为'整个文件不能 import TextField/Button'(见 interpretivePriority.resolution)",
138
152
  "字段过多不分组",
139
153
  "忽略异步校验",
140
- "在 mount 后修改 initialValues prop(应用 form.setFieldsValue;initialValues 仅 mount 时灌入)"
154
+ "在 mount 后修改 initialValues prop(应用 form.setFieldsValue;initialValues 仅 mount 时灌入)",
155
+ "在 itemDecorator.getItemClassName/renderItemExtra 回调体内调用 useContext/useXxx 等 Hook(回调运行在 ItemHolder 渲染过程中,不在业务组件自身的渲染调用栈里,会违反 Hooks 规则;应在业务组件顶层用 Hook 取数后,用 useMemo 包成闭包再传入 itemDecorator)",
156
+ "期望 itemDecorator 对 noStyle 的 FieldForm.Item 生效(noStyle 不渲染独立 wrapper 节点,没有可挂载 className/额外内容的位置)"
141
157
  ],
142
158
  "events": {
143
159
  "onFinish": {
@@ -187,6 +203,11 @@
187
203
  "issue": "rules 中的 validator 函数签名必须返回 Promise(rc-field-form 约定),不是同步返回",
188
204
  "wrong": "rules={[{ validator: (_, val) => val > 0 ? true : false }]} // 同步返回 boolean 不被识别",
189
205
  "right": "rules={[{ validator: (_, val) => val > 0 ? Promise.resolve() : Promise.reject('必须大于 0') }]}"
206
+ },
207
+ {
208
+ "issue": "itemDecorator 的 getItemClassName/renderItemExtra 回调不能在函数体内调用 React Hook",
209
+ "wrong": "itemDecorator={{ getItemClassName: (meta) => { const hit = useFieldHighlight(meta.path); return hit ? 'is-hit' : undefined; } }} // 在回调体内调用 Hook,违反 Hooks 规则",
210
+ "right": "const highlightMap = useFieldHighlightMap();\nconst itemDecorator = useMemo(() => ({ getItemClassName: (meta) => (highlightMap[meta.path] ? 'is-hit' : undefined) }), [highlightMap]);\n<FieldForm itemDecorator={itemDecorator}>"
190
211
  }
191
212
  ],
192
213
  "mapping": {
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "FormItemGroup",
3
+ "category": "Layout",
4
+ "description": "表单项堆叠容器:官方推荐的字段间纵向/横向间距方案。字段自带的 20px 间距基线(helper-text 占位)原本要外层手动挂 `.paraui-v4-form` 类名才会生效,容易被忘记导致字段在 flex 布局下零间距;FormItemGroup 把这条基线内置在自己身上,不用再记类名。同时内部 gap 只认自身 CSS 变量(!important),裸写 style.gap 不会生效,用来替代业务/AI 随手在字段外层加 gap 导致的间距叠加问题(基线已经占了 20px,外层再加 gap 会翻倍)。一个组件同时兜住「漏挂基线类→零间距」和「叠加 gap→翻倍」两个方向。",
5
+ "semantic": {
6
+ "intent": ["表单字段堆叠", "受控间距容器", "间距基线兜底"],
7
+ "useCases": [
8
+ "多个 TextField/Select/Switch 等字段手写堆叠(最常见场景,不依赖 Form/FieldForm)",
9
+ "多个 FormItem/FieldFormItem 纵向堆叠(direction='vertical',默认)",
10
+ "少量字段并排展示(direction='horizontal')",
11
+ "需要在字段之间加统一间距的场景(gap 属性)"
12
+ ],
13
+ "riskLevel": "low"
14
+ },
15
+ "variants": {
16
+ "vertical": {
17
+ "meaning": "默认值。`display:flex; flex-direction:column`,字段自上而下堆叠。"
18
+ },
19
+ "horizontal": {
20
+ "meaning": "`display:flex; flex-direction:row`,字段并排展示。"
21
+ }
22
+ },
23
+ "states": ["default"],
24
+ "idealProps": {
25
+ "direction": {
26
+ "type": "enum",
27
+ "values": ["vertical", "horizontal"],
28
+ "default": "vertical",
29
+ "description": "排列方向。表单场景基本用默认的 'vertical'。"
30
+ },
31
+ "gap": {
32
+ "type": "number",
33
+ "default": 0,
34
+ "description": "字段间距(px),默认 0——不额外加间距,完全依赖字段自身已有的间距(如 helper-text 占位)。真正需要更大间距时才传这个值,例如 gap={32}。"
35
+ },
36
+ "children": {
37
+ "type": "ReactNode",
38
+ "description": "子元素,通常是若干个 FormItem / FieldFormItem。"
39
+ },
40
+ "className": {
41
+ "type": "string",
42
+ "description": "外层根 div 的类名。"
43
+ },
44
+ "style": {
45
+ "type": "React.CSSProperties",
46
+ "description": "外层根 div 的内联样式。注意其中的 gap 不会生效(会被组件内部 !important 规则覆盖),间距请用 gap 属性。"
47
+ }
48
+ },
49
+ "do": [
50
+ "字段纵向堆叠用 <FormItemGroup> 替代手写 <div style={{ display:'flex', flexDirection:'column', gap: 16 }}>",
51
+ "用 <FormItemGroup> 包住字段就自动拿到 20px 间距基线,不需要再额外记着给外层容器挂 `.paraui-v4-form` 类名",
52
+ "确实需要比字段自带间距更大的间距时,用 gap 属性:<FormItemGroup gap={32}>",
53
+ "字段并排展示用 direction='horizontal'"
54
+ ],
55
+ "dont": [
56
+ "不要在 style 里直接写 gap,例如 <FormItemGroup style={{ gap: 16 }}>——会被内部规则忽略,且不会有任何视觉效果,请改用 gap 属性",
57
+ "不要在没有堆叠需求的单个字段外面套一层 FormItemGroup,纯粹是多余包裹",
58
+ "确实需要密集布局下零间距(如表格内联编辑),仍可以用更具体的选择器覆盖 min-height(这条基线规则没有 !important),不需要绕开 FormItemGroup"
59
+ ],
60
+ "events": {},
61
+ "typescriptPitfalls": [
62
+ {
63
+ "issue": "style.gap 不会生效,是设计上的行为而不是 bug",
64
+ "wrong": "<FormItemGroup style={{ gap: 16 }}>...</FormItemGroup> // 不生效,且不会报 TS 错误,容易被误以为生效了",
65
+ "right": "<FormItemGroup gap={16}>...</FormItemGroup> // 通过 gap 属性设置,实际生效"
66
+ }
67
+ ],
68
+ "mapping": {
69
+ "realComponent": "FormItemGroup",
70
+ "adapter": null
71
+ }
72
+ }
@@ -116,12 +116,14 @@
116
116
  "配置 shrinkOthers 以提升用户查找效率",
117
117
  "使用 icon 辅助识别菜单项",
118
118
  "**菜单数据通过 menuListProps.list 传入**(不是顶层 list prop):`<Menu menuListProps={{ list: menuData }} />`,menuData 是 MenuChildrenProps[] 数组",
119
- "MenuChildrenProps 核心字段(src/Menu/interface.ts:25-63):`label: ReactNode`(菜单名),`path: string`(路径,与 selectMenu 比对高亮),`icon: ReactNode`(图标),`children: MenuChildrenProps[]`(子菜单),`type: 'redirect'|'router'|'iframe'|'snack'|'snackPage'`(菜单类型),`href: string`(a 标签地址),`badge: ReactNode`(标记)"
119
+ "MenuChildrenProps 核心字段(src/Menu/interface.ts:25-63):`label: ReactNode`(菜单名),`path: string`(路径,与 selectMenu 比对高亮),`icon: ReactNode`(图标),`children: MenuChildrenProps[]`(子菜单),`type: 'redirect'|'router'|'iframe'|'snack'|'snackPage'`(菜单类型),`href: string`(a 标签地址),`badge: ReactNode`(标记)",
120
+ "`group: boolean`(仅一级生效,需同时有 children):把该项渲染成不可点击的纯文本分组小标题,children 常驻展开且按顶层菜单项样式渲染(不缩进,可配 icon)。示例:`{ label: '路由管理', group: true, children: [{ label: '路由规则', path: '/router/rule' }, { label: '静态资源', path: '/router/static' }] }`"
120
121
  ],
121
122
  "dont": [
122
123
  "在菜单项中放置非导航类的复杂交互组件",
123
124
  "过度使用动态生成的菜单导致性能问题",
124
- "把菜单数据传给顶层 list prop——Menu 没有顶层 list prop,数据必须通过 menuListProps.list 传入"
125
+ "把菜单数据传给顶层 list prop——Menu 没有顶层 list prop,数据必须通过 menuListProps.list 传入",
126
+ "不要在非一级菜单项或没有 children 的项上设置 group: true——不满足条件会被忽略,自动退化为原有渲染(普通叶子节点 / 普通折叠子菜单),不会报错但也不会生效"
125
127
  ],
126
128
  "events": {
127
129
  "onClickMenu": {
@@ -171,6 +173,11 @@
171
173
  "issue": "color prop 只有 'deep' 和 'light' 两个有效值(ColorType),传其他字符串 TS 报错",
172
174
  "wrong": "color='dark' // TS2322: Type '\"dark\"' is not assignable to type 'ColorType'",
173
175
  "right": "color='deep' // 合法值: 'deep'(深色主题) | 'light'(浅色主题)"
176
+ },
177
+ {
178
+ "issue": "group 生效需同时满足两个前提:该项是一级菜单(level 1)且自身有 children;在二级菜单项或没有 children 的项上设置 group: true 会被静默忽略,自动退化为原渲染,容易被误以为是 bug",
179
+ "wrong": "// 二级菜单项上设置 group,不会生效\n{ label: '一级', children: [{ label: '二级', group: true, children: [...] }] }",
180
+ "right": "// group 只能设在一级菜单项上\n{ label: '路由管理', group: true, children: [{ label: '路由规则', path: '/router/rule' }] }"
174
181
  }
175
182
  ],
176
183
  "mapping": {
@@ -1,10 +1,11 @@
1
1
  import { j as s } from "../_virtual/jsx-runtime.js";
2
- import { useState as g, useEffect as x } from "react";
3
- import y from "../Label/index.js";
2
+ import { useState as R, useEffect as x } from "react";
3
+ import T from "../Label/index.js";
4
4
  import { $prefixCls as a } from "../GlobalContext/constant.js";
5
- import { Tooltip as T } from "../Tooltip/index.js";
5
+ import { Tooltip as g } from "../Tooltip/index.js";
6
+ import { PARA_UI_COMPACT_CONTROL_MARKER as y } from "../FieldForm/compactControlMarker.js";
6
7
  import './index.css';/* empty css */
7
- const H = (c) => {
8
+ const A = (c) => {
8
9
  const {
9
10
  className: r = "",
10
11
  label: n,
@@ -13,28 +14,28 @@ const H = (c) => {
13
14
  disabled: h = !1,
14
15
  disabledTooltip: f,
15
16
  indeterminate: m = !1,
16
- width: k,
17
- onChange: i,
17
+ width: u,
18
+ onChange: o,
18
19
  style: C
19
- } = c, [l, o] = g(!1);
20
+ } = c, [l, i] = R(!1);
20
21
  x(() => {
21
- c.defaultChecked !== void 0 && o(c.defaultChecked);
22
+ c.defaultChecked !== void 0 && i(c.defaultChecked);
22
23
  }, []), x(() => {
23
- c.checked !== void 0 && o(c.checked);
24
+ c.checked !== void 0 && i(c.checked);
24
25
  }, [c.checked]);
25
26
  const p = (e) => {
26
27
  if (e.preventDefault(), h) return;
27
28
  if (m) {
28
- c.checked === void 0 && o(!0), i && i(e, !0);
29
+ c.checked === void 0 && i(!0), o && o(e, !0);
29
30
  return;
30
31
  }
31
- c.checked === void 0 && o(!l);
32
+ c.checked === void 0 && i(!l);
32
33
  const b = e.target;
33
- b.checked = !l, b.value = String(!l), i && i(e, !l);
34
- }, $ = () => {
34
+ b.checked = !l, b.value = String(!l), o && o(e, !l);
35
+ }, N = () => {
35
36
  let e = `${a}-checkbox`;
36
37
  return r && (e += ` ${r}`), d && (e += ` ${a}-checkbox-${d}`), h && (e += ` ${a}-checkbox-disabled`), m ? e += ` ${a}-checkbox-indeterminate` : l && (e += ` ${a}-checkbox-checked`), t && t.tooltipType && (e += ` ${a}-checkbox-${t.tooltipType}`), e;
37
- }, N = () => {
38
+ }, $ = () => {
38
39
  let e = "checkbox-label";
39
40
  return t && t.className && (e += ` ${t.className}`), e;
40
41
  }, j = () => {
@@ -42,11 +43,11 @@ const H = (c) => {
42
43
  return t && t.helpClassName && (e += ` ${t.helpClassName}`), e;
43
44
  }, v = () => {
44
45
  const e = { ...C };
45
- return k && (e.width = k), e;
46
- }, u = () => /* @__PURE__ */ s.jsxs(
46
+ return u && (e.width = u), e;
47
+ }, k = () => /* @__PURE__ */ s.jsxs(
47
48
  "label",
48
49
  {
49
- className: $(),
50
+ className: N(),
50
51
  onClick: p,
51
52
  style: v(),
52
53
  children: [
@@ -62,28 +63,29 @@ const H = (c) => {
62
63
  /* @__PURE__ */ s.jsx("span", { className: "checkbox-box-inner" })
63
64
  ] }),
64
65
  n !== void 0 && n !== "" && n !== null ? /* @__PURE__ */ s.jsx(
65
- y,
66
+ T,
66
67
  {
67
68
  label: n,
68
69
  ...t,
69
70
  helpClassName: j(),
70
- className: N()
71
+ className: $()
71
72
  }
72
73
  ) : null
73
74
  ]
74
75
  }
75
76
  );
76
77
  return f ? /* @__PURE__ */ s.jsx(
77
- T,
78
+ g,
78
79
  {
79
80
  disabled: !0,
80
81
  ...f,
81
- children: u()
82
+ children: k()
82
83
  }
83
- ) : u();
84
+ ) : k();
84
85
  };
86
+ A[y] = !0;
85
87
  export {
86
- H as Checkbox,
87
- H as default
88
+ A as Checkbox,
89
+ A as default
88
90
  };
89
91
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- @charset "UTF-8";.paraui-v4-checkbox-group{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400;width:100%}.paraui-v4-checkbox-group>.checkbox-group-label{margin-bottom:6px}.paraui-v4-checkbox-group>.checkbox-group-content{line-height:0}.paraui-v4-checkbox-group>.checkbox-group-content .checkbox-item-box{margin-bottom:4px}.paraui-v4-checkbox-group>.checkbox-group-content>.checkbox-group-content-item{margin-bottom:6px}.paraui-v4-checkbox-group>.checkbox-group-content>.checkbox-group-content-item:last-child{margin-bottom:0}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content{display:flex;flex-direction:column}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content>span{margin-bottom:10px}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content>span:last-child{margin-bottom:0}
1
+ @charset "UTF-8";.paraui-v4-checkbox-group{width:100%;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400}.paraui-v4-checkbox-group>.checkbox-group-label{margin-bottom:6px}.paraui-v4-checkbox-group>.checkbox-group-content{line-height:0}.paraui-v4-checkbox-group>.checkbox-group-content .checkbox-item-box{margin-bottom:4px}.paraui-v4-checkbox-group>.checkbox-group-content>.checkbox-group-content-item{margin-bottom:6px}.paraui-v4-checkbox-group>.checkbox-group-content>.checkbox-group-content-item:last-child{margin-bottom:0}.paraui-v4-checkbox-group:not(.paraui-v4-checkbox-group-column)>.checkbox-group-content{margin-bottom:-4px}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content{display:flex;flex-direction:column}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content>span{margin-bottom:10px}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content>span:last-child{margin-bottom:0}
@@ -1 +1 @@
1
- .paraui-v4-checkbox-group{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400;width:100%}.paraui-v4-checkbox-group>.checkbox-group-label{margin-bottom:6px}.paraui-v4-checkbox-group>.checkbox-group-content{line-height:0}.paraui-v4-checkbox-group>.checkbox-group-content .checkbox-item-box{margin-bottom:4px}.paraui-v4-checkbox-group>.checkbox-group-content>.checkbox-group-content-item{margin-bottom:6px}.paraui-v4-checkbox-group>.checkbox-group-content>.checkbox-group-content-item:last-child{margin-bottom:0}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content{display:flex;flex-direction:column}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content>span{margin-bottom:10px}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content>span:last-child{margin-bottom:0}
1
+ .paraui-v4-checkbox-group{width:100%;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400}.paraui-v4-checkbox-group>.checkbox-group-label{margin-bottom:6px}.paraui-v4-checkbox-group>.checkbox-group-content{line-height:0}.paraui-v4-checkbox-group>.checkbox-group-content .checkbox-item-box{margin-bottom:4px}.paraui-v4-checkbox-group>.checkbox-group-content>.checkbox-group-content-item{margin-bottom:6px}.paraui-v4-checkbox-group>.checkbox-group-content>.checkbox-group-content-item:last-child{margin-bottom:0}.paraui-v4-checkbox-group:not(.paraui-v4-checkbox-group-column)>.checkbox-group-content{margin-bottom:-4px}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content{display:flex;flex-direction:column}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content>span{margin-bottom:10px}.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column>.checkbox-group-content>span:last-child{margin-bottom:0}
@@ -2,7 +2,7 @@ import { j as t } from "../_virtual/jsx-runtime.js";
2
2
  import * as p from "react";
3
3
  import { Lock as S } from "../para-ui-core/node_modules/@para-ui/icons/Lock/index.js";
4
4
  import { $prefixCls as o } from "../GlobalContext/constant.js";
5
- const i = 30, d = 240, m = 4, b = p.forwardRef((v, g) => {
5
+ const i = 30, m = 240, d = 4, b = p.forwardRef((v, g) => {
6
6
  const {
7
7
  instanceClass: T,
8
8
  visible: $,
@@ -24,7 +24,7 @@ const i = 30, d = 240, m = 4, b = p.forwardRef((v, g) => {
24
24
  n < r ? e.scrollTop = n : n + i > f && (e.scrollTop = n + i - e.clientHeight);
25
25
  }, [h]), !$ || s.length === 0)
26
26
  return null;
27
- const l = s.length > w, u = l ? Math.max(0, Math.floor(H / i) - m) : 0, M = l ? Math.ceil(d / i) + m * 2 : s.length, R = l ? Math.min(s.length, u + M) : s.length, y = s.slice(u, R), C = u * i;
27
+ const l = s.length > w, u = l ? Math.max(0, Math.floor(H / i) - d) : 0, M = l ? Math.ceil(m / i) + d * 2 : s.length, R = l ? Math.min(s.length, u + M) : s.length, y = s.slice(u, R), C = u * i;
28
28
  return /* @__PURE__ */ t.jsxs(
29
29
  "div",
30
30
  {
@@ -38,7 +38,7 @@ const i = 30, d = 240, m = 4, b = p.forwardRef((v, g) => {
38
38
  {
39
39
  ref: c,
40
40
  className: `${o}-expression-input-popup-list`,
41
- style: { maxHeight: d, overflowY: "auto" },
41
+ style: { maxHeight: m, overflowY: "auto" },
42
42
  onScroll: (e) => {
43
43
  l && x(e.currentTarget.scrollTop);
44
44
  },
@@ -65,7 +65,14 @@ const i = 30, d = 240, m = 4, b = p.forwardRef((v, g) => {
65
65
  },
66
66
  children: [
67
67
  /* @__PURE__ */ t.jsx("span", { className: `${o}-expression-input-popup-item-value`, children: e.label ?? e.value }),
68
- e.desc && /* @__PURE__ */ t.jsx("span", { className: `${o}-expression-input-popup-item-desc`, children: e.desc }),
68
+ e.desc && /* @__PURE__ */ t.jsx(
69
+ "span",
70
+ {
71
+ className: `${o}-expression-input-popup-item-desc`,
72
+ title: e.desc,
73
+ children: e.desc
74
+ }
75
+ ),
69
76
  e.sensitive && /* @__PURE__ */ t.jsx(
70
77
  S,
71
78
  {
@@ -1,59 +1,62 @@
1
- import * as s from "react";
2
- import { detectChainAtCursor as A } from "./detectChainAtCursor.js";
3
- import { filterCandidatesByPartial as E } from "./filterCandidatesByPartial.js";
4
- function B(x) {
5
- const { value: u, onChange: l, resolveCandidates: C, triggerMode: k, triggerPrefix: o, disabled: f, readOnly: h } = x, [t, r] = s.useState(null), [p, c] = s.useState(0), w = s.useRef(/* @__PURE__ */ new Map()), m = s.useRef(null), y = s.useMemo(() => {
1
+ import * as r from "react";
2
+ import { detectChainAtCursor as $ } from "./detectChainAtCursor.js";
3
+ import { filterCandidatesByPartial as B } from "./filterCandidatesByPartial.js";
4
+ function H(M) {
5
+ const { value: h, onChange: i, resolveCandidates: a, triggerMode: u, triggerPrefix: l, disabled: p, readOnly: d } = M, [t, c] = r.useState(null), [g, o] = r.useState(0), y = r.useRef(/* @__PURE__ */ new Map()), x = r.useRef(a), C = r.useRef(null), b = r.useMemo(() => {
6
6
  if (!t)
7
7
  return [];
8
- const e = t.parts.join("."), n = w.current;
9
- return n.has(e) || n.set(e, C(t.parts)), n.get(e);
10
- }, [t, C]), a = s.useMemo(
11
- () => t ? E(y, t.partial) : [],
12
- [y, t]
13
- ), d = !f && !h && !!t && a.length > 0, D = s.useCallback(
8
+ x.current !== a && (y.current.clear(), x.current = a);
9
+ const e = t.parts.join("."), n = y.current;
10
+ return n.has(e) || n.set(e, a(t.parts)), n.get(e);
11
+ }, [t, a]), s = r.useMemo(
12
+ () => t ? B(b, t.partial) : [],
13
+ [b, t]
14
+ ), k = !p && !d && !!t && s.length > 0, S = r.useCallback(
14
15
  (e, n) => {
15
- if (f || h) {
16
- r(null);
16
+ if (p || d) {
17
+ c(null);
17
18
  return;
18
19
  }
19
- l?.(e);
20
- const g = A(e, n, { triggerPrefix: o, triggerMode: k });
21
- r(g), c(0);
20
+ C.current = n, i?.(e);
21
+ const m = $(e, n, { triggerPrefix: l, triggerMode: u });
22
+ c(m), o(0);
22
23
  },
23
- [l, f, h, o, k]
24
- ), $ = s.useCallback(() => r(null), []), i = s.useCallback(
24
+ [i, p, d, l, u]
25
+ ), A = r.useCallback(() => c(null), []), f = r.useCallback(
25
26
  (e) => {
26
27
  if (!t)
27
28
  return;
28
- const n = u.slice(0, t.startIdx), g = u.slice(t.endIdx), S = [...t.parts, e.value].join("."), b = `${o}.${S}${e.chain ? "." : ""}`;
29
- m.current = n.length + b.length, l?.(`${n}${b}${g}`), r(null);
29
+ const n = h.slice(0, t.startIdx), m = h.slice(t.endIdx), j = [...t.parts, e.value].join("."), R = `${l}.${j}${e.chain ? "." : ""}`, w = `${n}${R}${m}`, D = n.length + R.length;
30
+ C.current = D, i?.(w), c(
31
+ e.chain ? $(w, D, { triggerPrefix: l, triggerMode: u }) : null
32
+ ), o(0);
30
33
  },
31
- [t, u, l, o]
32
- ), R = s.useCallback(
34
+ [t, h, i, l, u]
35
+ ), E = r.useCallback(
33
36
  (e) => {
34
- d && (e.key === "ArrowDown" ? (e.preventDefault(), c((n) => (n + 1) % a.length)) : e.key === "ArrowUp" ? (e.preventDefault(), c((n) => (n - 1 + a.length) % a.length)) : e.key === "Enter" || e.key === "Tab" ? (e.preventDefault(), i(a[p])) : e.key === "Escape" && (e.preventDefault(), r(null)));
37
+ k && (e.key === "ArrowDown" ? (e.preventDefault(), o((n) => (n + 1) % s.length)) : e.key === "ArrowUp" ? (e.preventDefault(), o((n) => (n - 1 + s.length) % s.length)) : e.key === "Enter" || e.key === "Tab" ? (e.preventDefault(), f(s[g])) : e.key === "Escape" && (e.preventDefault(), c(null)));
35
38
  },
36
- [d, a, p, i]
37
- ), M = s.useCallback(
39
+ [k, s, g, f]
40
+ ), I = r.useCallback(
38
41
  (e) => {
39
- i(e);
42
+ f(e);
40
43
  },
41
- [i]
44
+ [f]
42
45
  );
43
46
  return {
44
- open: d,
47
+ open: k,
45
48
  ctx: t ? { parts: t.parts, partial: t.partial } : null,
46
- candidates: a,
47
- highlight: p,
48
- setHighlight: c,
49
- pendingCursorRef: m,
50
- handleValueChange: D,
51
- handleKeyDown: R,
52
- handleSelect: M,
53
- close: $
49
+ candidates: s,
50
+ highlight: g,
51
+ setHighlight: o,
52
+ pendingCursorRef: C,
53
+ handleValueChange: S,
54
+ handleKeyDown: E,
55
+ handleSelect: I,
56
+ close: A
54
57
  };
55
58
  }
56
59
  export {
57
- B as useExpressionInput
60
+ H as useExpressionInput
58
61
  };
59
62
  //# sourceMappingURL=useExpressionInput.js.map
@@ -1,18 +1,18 @@
1
1
  import { j as i } from "../_virtual/jsx-runtime.js";
2
2
  import { useMemo as u } from "react";
3
3
  import l from "../HelperText/index.js";
4
- function a(r, t, n, e = 0) {
4
+ function a(r, t, e, n = 0) {
5
5
  return {
6
- key: typeof r == "string" ? r : `${t}-${e}`,
6
+ key: typeof r == "string" ? r : `${t}-${n}`,
7
7
  error: r,
8
- errorStatus: n
8
+ errorStatus: e
9
9
  };
10
10
  }
11
- const d = ({ helperText: r, helpStatus: t, errors: n = [], warnings: e = [] }) => {
11
+ const d = ({ helperText: r, helpStatus: t, errors: e = [], warnings: n = [] }) => {
12
12
  const s = u(() => r != null ? [a(r, "help", t)] : [
13
- ...n.map((o, m) => a(o, "error", "error", m)),
14
- ...e.map((o, m) => a(o, "warning", "warning", m))
15
- ], [r, n, e, t]);
13
+ ...e.map((o, m) => a(o, "error", "error", m)),
14
+ ...n.map((o, m) => a(o, "warning", "warning", m))
15
+ ], [r, e, n, t]);
16
16
  return /* @__PURE__ */ i.jsx(i.Fragment, { children: Array.isArray(s) && s.length ? s.map((o) => /* @__PURE__ */ i.jsx(
17
17
  "div",
18
18
  {
@@ -21,7 +21,8 @@ const d = ({ helperText: r, helpStatus: t, errors: n = [], warnings: e = [] }) =
21
21
  l,
22
22
  {
23
23
  error: !0,
24
- helperText: o.error
24
+ helperText: o.error,
25
+ hideErrorDom: !1
25
26
  }
26
27
  )
27
28
  },
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Meta } from 'rc-field-form/lib/interface';
3
+ import { ItemDecoratorMeta } from '../interface';
3
4
  import { ReportMetaChange } from '../context';
4
5
  import { FormItemProps } from './index';
5
6
  export interface ItemHolderProps extends FormItemProps {
@@ -7,6 +8,7 @@ export interface ItemHolderProps extends FormItemProps {
7
8
  errors: ReactNode[];
8
9
  warnings: ReactNode[];
9
10
  meta: Meta;
11
+ identityMeta: ItemDecoratorMeta;
10
12
  onSubItemMetaChange: ReportMetaChange;
11
13
  }
12
14
  declare function ItemHolder(props: ItemHolderProps): import("react/jsx-runtime").JSX.Element;