@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
@@ -1 +1 @@
1
- @charset "UTF-8";.paraui-v4-radio-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-radio-group>.radio-group-label{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content{line-height:0}.paraui-v4-radio-group>.radio-group-content .radio-item-box{margin-bottom:4px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item:last-child{margin-bottom:0}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content{display:flex;flex-direction:column}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span{margin-bottom:10px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span:last-child{margin-bottom:0}
1
+ @charset "UTF-8";.paraui-v4-radio-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-radio-group>.radio-group-label{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content{line-height:0}.paraui-v4-radio-group>.radio-group-content .radio-item-box{margin-bottom:4px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item:last-child{margin-bottom:0}.paraui-v4-radio-group:not(.paraui-v4-radio-group-column)>.radio-group-content{margin-bottom:-4px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content{display:flex;flex-direction:column}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span{margin-bottom:10px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span:last-child{margin-bottom:0}
@@ -1 +1 @@
1
- .paraui-v4-radio-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-radio-group>.radio-group-label{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content{line-height:0}.paraui-v4-radio-group>.radio-group-content .radio-item-box{margin-bottom:4px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item:last-child{margin-bottom:0}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content{display:flex;flex-direction:column}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span{margin-bottom:10px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span:last-child{margin-bottom:0}
1
+ .paraui-v4-radio-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-radio-group>.radio-group-label{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content{line-height:0}.paraui-v4-radio-group>.radio-group-content .radio-item-box{margin-bottom:4px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item:last-child{margin-bottom:0}.paraui-v4-radio-group:not(.paraui-v4-radio-group-column)>.radio-group-content{margin-bottom:-4px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content{display:flex;flex-direction:column}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span{margin-bottom:10px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span:last-child{margin-bottom:0}
@@ -1,43 +1,43 @@
1
1
  import { j as n } from "../_virtual/jsx-runtime.js";
2
- import { useState as b, useRef as q, useEffect as v } from "react";
2
+ import { useState as b, useRef as P, useEffect as v } from "react";
3
3
  import { $prefixCls as u } from "../GlobalContext/constant.js";
4
4
  import ee from "../Label/index.js";
5
- import { InputNumber as H } from "../InputNumber/index.js";
6
- import P from "../HelperText/index.js";
5
+ import { InputNumber as S } from "../InputNumber/index.js";
6
+ import z from "../HelperText/index.js";
7
7
  import re from "clsx";
8
8
  import { Tooltip as ne } from "../Tooltip/index.js";
9
9
  import { DeepClone as te } from "@snack-kit/lib";
10
10
  import './index.css';/* empty css */
11
11
  function ge(o) {
12
12
  const {
13
- className: S,
14
- style: z,
15
- label: L,
16
- labelTooltip: k,
17
- size: G = "large",
18
- required: J = !1,
13
+ className: L,
14
+ style: k,
15
+ label: w,
16
+ labelTooltip: G,
17
+ size: J = "large",
18
+ required: C = !1,
19
19
  disabled: l = !1,
20
20
  disabledTooltip: s,
21
- warningMessage: w,
21
+ warningMessage: R,
22
22
  warnTime: K = 2e3,
23
23
  defaultValue: ae,
24
24
  value: h,
25
- error: C = !1,
26
- hideErrorDom: R,
25
+ error: j = !1,
26
+ hideErrorDom: T,
27
27
  helperText: O = "",
28
28
  separator: Q = "~",
29
- unit: j,
29
+ unit: E,
30
30
  placeholder: i,
31
31
  clearable: oe = !1,
32
- onFocus: T,
33
- onBlur: E,
34
- onEnter: I,
32
+ onFocus: I,
33
+ onBlur: F,
34
+ onEnter: N,
35
35
  onChange: c,
36
36
  otherProps: d
37
- } = o, [f, m] = b([null, null]), [U, F] = b(!1), [X, N] = b(!1), e = q({
37
+ } = o, [f, m] = b([null, null]), [U, $] = b(!1), [X, A] = b(!1), e = P({
38
38
  timer: null,
39
39
  swapRafId: null
40
- }), $ = q(null);
40
+ }), D = P(null);
41
41
  v(() => {
42
42
  o.defaultValue !== void 0 && m(o.defaultValue);
43
43
  }, []), v(() => {
@@ -45,106 +45,106 @@ function ge(o) {
45
45
  }, [h]), v(() => () => {
46
46
  e.current.swapRafId !== null && (cancelAnimationFrame(e.current.swapRafId), e.current.swapRafId = null), e.current.timer !== null && (clearTimeout(e.current.timer), e.current.timer = null);
47
47
  }, []);
48
- const A = (r) => i && i instanceof Array ? i[r] : i, p = (r) => l && l instanceof Array ? l[r] : l, D = (r) => (t) => {
49
- F(!0), T && T(t, r);
50
- }, y = (r) => (t) => {
51
- F(!1), E && E(t, r), e.current.swapRafId !== null && cancelAnimationFrame(e.current.swapRafId), e.current.swapRafId = requestAnimationFrame(() => {
48
+ const y = (r) => i && i instanceof Array ? i[r] : i, p = (r) => l && l instanceof Array ? l[r] : l, B = (r) => (t) => {
49
+ $(!0), I && I(t, r);
50
+ }, V = (r) => (t) => {
51
+ $(!1), F && F(t, r), e.current.swapRafId !== null && cancelAnimationFrame(e.current.swapRafId), e.current.swapRafId = requestAnimationFrame(() => {
52
52
  e.current.swapRafId = null;
53
- const a = $.current;
53
+ const a = D.current;
54
54
  if (a && a.contains(document.activeElement))
55
55
  return;
56
56
  const [g, x] = f;
57
57
  if (g !== null && x !== null && g > x) {
58
- const W = [x, g];
59
- o.value === void 0 && m(W), c && c(W, -1), w && Y();
58
+ const H = [x, g];
59
+ o.value === void 0 && m(H), c && c(H, -1), R && Y();
60
60
  }
61
61
  });
62
62
  }, Y = () => {
63
- clearTimeout(e.current.timer ?? void 0), N(!0), e.current.timer = setTimeout(() => {
64
- N(!1);
63
+ clearTimeout(e.current.timer ?? void 0), A(!0), e.current.timer = setTimeout(() => {
64
+ A(!1);
65
65
  }, K);
66
- }, B = (r) => (t) => {
67
- I && I(t, r);
68
- }, V = (r) => (t) => {
66
+ }, M = (r) => (t) => {
67
+ N && N(t, r);
68
+ }, W = (r) => (t) => {
69
69
  const a = te(f);
70
70
  a[r] = t, o.value === void 0 && m(a), c && c(a, r);
71
- }, M = () => /* @__PURE__ */ n.jsxs("div", { className: "range-input-content", children: [
71
+ }, q = () => /* @__PURE__ */ n.jsxs("div", { className: "range-input-content", children: [
72
72
  /* @__PURE__ */ n.jsx(
73
- H,
73
+ S,
74
74
  {
75
75
  ...d && d[0],
76
76
  clearable: !0,
77
77
  btnMode: "none",
78
78
  hideErrorDom: !0,
79
- placeholder: A(0),
79
+ placeholder: y(0),
80
80
  disabled: p(0),
81
81
  disabledTooltip: s?.[0],
82
82
  value: f[0],
83
- onFocus: D(0),
84
- onBlur: y(0),
85
- onEnter: B(0),
86
- onChange: V(0)
83
+ onFocus: B(0),
84
+ onBlur: V(0),
85
+ onEnter: M(0),
86
+ onChange: W(0)
87
87
  }
88
88
  ),
89
89
  /* @__PURE__ */ n.jsx("span", { className: "separator", children: Q }),
90
90
  /* @__PURE__ */ n.jsx(
91
- H,
91
+ S,
92
92
  {
93
93
  ...d && d[1],
94
94
  clearable: !0,
95
95
  btnMode: "none",
96
96
  hideErrorDom: !0,
97
- placeholder: A(1),
97
+ placeholder: y(1),
98
98
  disabled: p(1),
99
99
  disabledTooltip: s?.[1],
100
100
  value: f[1],
101
- onFocus: D(1),
102
- onBlur: y(1),
103
- onEnter: B(1),
104
- onChange: V(1)
101
+ onFocus: B(1),
102
+ onBlur: V(1),
103
+ onEnter: M(1),
104
+ onChange: W(1)
105
105
  }
106
106
  ),
107
- j && /* @__PURE__ */ n.jsx("span", { className: "unit", children: j })
107
+ E && /* @__PURE__ */ n.jsx("span", { className: "unit", children: E })
108
108
  ] }), Z = () => s && !(s instanceof Array) ? /* @__PURE__ */ n.jsx(
109
109
  ne,
110
110
  {
111
111
  disabled: !0,
112
112
  ...s,
113
- children: M()
113
+ children: q()
114
114
  }
115
- ) : M(), _ = () => X ? /* @__PURE__ */ n.jsx(
116
- P,
115
+ ) : q(), _ = () => X ? /* @__PURE__ */ n.jsx(
116
+ z,
117
117
  {
118
118
  className: "range-input-warning-text",
119
- helperText: w,
120
- hideErrorDom: R
119
+ helperText: R,
120
+ hideErrorDom: T
121
121
  }
122
122
  ) : /* @__PURE__ */ n.jsx(
123
- P,
123
+ z,
124
124
  {
125
125
  className: "range-input-error-text",
126
- error: C,
126
+ error: j,
127
127
  helperText: O,
128
- hideErrorDom: R
128
+ hideErrorDom: T
129
129
  }
130
130
  );
131
131
  return /* @__PURE__ */ n.jsxs(
132
132
  "div",
133
133
  {
134
- ref: $,
135
- className: re(S, `${u}-range-input`, `${u}-range-input-${G}`, {
134
+ ref: D,
135
+ className: re(L, `${u}-range-input`, `${u}-range-input-${J}`, {
136
136
  [`${u}-range-input-focus`]: U,
137
137
  [`${u}-range-input-disabled`]: l === !0 || p(0) && p(1),
138
- [`${u}-range-input-error`]: C
138
+ [`${u}-range-input-error`]: j
139
139
  }),
140
- style: z,
140
+ style: k,
141
141
  children: [
142
- /* @__PURE__ */ n.jsx(
142
+ (w || C) && /* @__PURE__ */ n.jsx(
143
143
  ee,
144
144
  {
145
- label: L,
146
- required: J,
147
- ...k
145
+ label: w,
146
+ required: C,
147
+ ...G
148
148
  }
149
149
  ),
150
150
  Z(),
@@ -1,32 +1,33 @@
1
1
  import { j as s } from "../_virtual/jsx-runtime.js";
2
- import { LoadingF as F } from "../para-ui-core/node_modules/@para-ui/icons/LoadingF/index.js";
2
+ import { LoadingF as A } from "../para-ui-core/node_modules/@para-ui/icons/LoadingF/index.js";
3
3
  import x from "rc-switch";
4
- import j from "clsx";
4
+ import f from "clsx";
5
5
  import { $prefixCls as l, $rcPrefixCls as e } from "../GlobalContext/constant.js";
6
- import f from "../Label/index.js";
7
- import { Tooltip as w } from "../Tooltip/index.js";
8
- import L from "../GlobalContext/useFormatMessage.js";
9
- import R from "./lang/index.js";
6
+ import j from "../Label/index.js";
7
+ import { Tooltip as u } from "../Tooltip/index.js";
8
+ import S from "../GlobalContext/useFormatMessage.js";
9
+ import { PARA_UI_COMPACT_CONTROL_MARKER as _ } from "../FieldForm/compactControlMarker.js";
10
+ import F from "./lang/index.js";
10
11
  import './index.css';/* empty css */
11
- const G = (u) => {
12
- const N = L("Switch", R), {
12
+ const L = (w) => {
13
+ const N = S("Switch", F), {
13
14
  size: c = "default",
14
15
  loading: i,
15
16
  disabled: a,
16
17
  className: g,
17
18
  label: r,
18
- required: h = !1,
19
+ required: p = !1,
19
20
  desc: d,
20
21
  labelTooltip: C,
21
22
  descTooltip: T,
22
- disabledTooltip: p,
23
+ disabledTooltip: h,
23
24
  loadingTitle: $ = N({ id: "ing" }),
24
- labelPlacement: v = "top",
25
- descPlacement: P = "start",
25
+ labelPlacement: P = "top",
26
+ descPlacement: R = "start",
26
27
  supText: t,
27
- error: q,
28
+ error: M,
28
29
  ...o
29
- } = u, m = j(
30
+ } = w, m = f(
30
31
  `${l}-switch`,
31
32
  {
32
33
  [`${l}-switch-small`]: c === "small",
@@ -35,15 +36,15 @@ const G = (u) => {
35
36
  [`${l}-switch-disabled`]: a
36
37
  },
37
38
  g
38
- ), S = j(
39
+ ), v = f(
39
40
  `${l}-switch-label`,
40
- `${l}-switch-label-${v}`,
41
- `${l}-switch-desc-${P}`
42
- ), n = /* @__PURE__ */ s.jsx("div", { className: `${e}-switch-handle`, children: i && /* @__PURE__ */ s.jsx(F, { className: `${e}-switch-loading-icon` }) }), b = () => a && p ? /* @__PURE__ */ s.jsx(
43
- w,
41
+ `${l}-switch-label-${P}`,
42
+ `${l}-switch-desc-${R}`
43
+ ), n = /* @__PURE__ */ s.jsx("div", { className: `${e}-switch-handle`, children: i && /* @__PURE__ */ s.jsx(A, { className: `${e}-switch-loading-icon` }) }), b = () => a && h ? /* @__PURE__ */ s.jsx(
44
+ u,
44
45
  {
45
46
  disabled: !0,
46
- ...p,
47
+ ...h,
47
48
  children: /* @__PURE__ */ s.jsxs("div", { className: `${e}-label-box`, children: [
48
49
  /* @__PURE__ */ s.jsx(
49
50
  x,
@@ -59,7 +60,7 @@ const G = (u) => {
59
60
  ] })
60
61
  }
61
62
  ) : /* @__PURE__ */ s.jsx(s.Fragment, { children: $ && i ? /* @__PURE__ */ s.jsx(
62
- w,
63
+ u,
63
64
  {
64
65
  disabled: !0,
65
66
  title: $,
@@ -90,22 +91,22 @@ const G = (u) => {
90
91
  ),
91
92
  t && /* @__PURE__ */ s.jsx("span", { className: "sup-text", children: t })
92
93
  ] }) });
93
- return r || d ? /* @__PURE__ */ s.jsxs("span", { className: S, children: [
94
+ return r || d ? /* @__PURE__ */ s.jsxs("span", { className: v, children: [
94
95
  d && /* @__PURE__ */ s.jsx(
95
- f,
96
+ j,
96
97
  {
97
98
  label: d,
98
- required: h,
99
+ required: p,
99
100
  ...T,
100
101
  className: `${e}-desc-text ${a ? `${e}-disabled-text` : ""}`
101
102
  }
102
103
  ),
103
104
  /* @__PURE__ */ s.jsxs("span", { className: `${l}-label-text-container`, children: [
104
105
  r && /* @__PURE__ */ s.jsx(
105
- f,
106
+ j,
106
107
  {
107
108
  label: r,
108
- required: h,
109
+ required: p,
109
110
  ...C,
110
111
  className: `${e}-switch-text ${a ? `${e}-disabled-text` : ""}`
111
112
  }
@@ -114,8 +115,9 @@ const G = (u) => {
114
115
  ] })
115
116
  ] }) : b();
116
117
  };
118
+ L[_] = !0;
117
119
  export {
118
- G as Switch,
119
- G as default
120
+ L as Switch,
121
+ L as default
120
122
  };
121
123
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,9 @@
1
1
  import { j as o } from "../_virtual/jsx-runtime.js";
2
2
  import { useState as u, useRef as z, useEffect as A } from "react";
3
- import { Tag as T } from "./index.js";
3
+ import { Tag as v } from "./index.js";
4
4
  import d from "clsx";
5
5
  import "../para-ui-core/node_modules/@para-ui/icons/SvgIcon/index.js";
6
- import { Plus as j } from "../para-ui-core/node_modules/@para-ui/icons/Plus/index.js";
6
+ import { Plus as T } from "../para-ui-core/node_modules/@para-ui/icons/Plus/index.js";
7
7
  import { $prefixCls as K } from "../GlobalContext/constant.js";
8
8
  import q from "../Hooks/useGlobalProps.js";
9
9
  import './index.css';/* empty css */
@@ -11,16 +11,16 @@ const Z = (l) => {
11
11
  const {
12
12
  className: w,
13
13
  size: i = "large",
14
- style: y,
14
+ style: j,
15
15
  defaultInputValue: f,
16
- increased: N = !1,
17
- increasedTag: c,
18
- inputClassName: V,
16
+ increased: y = !1,
17
+ increasedTag: p,
18
+ inputClassName: N,
19
19
  inputWidth: G,
20
- marginBottom: m = "8px",
20
+ marginBottom: V = "8px",
21
21
  marginRight: W = "8px",
22
- onChange: p
23
- } = q(l, "TagGroup"), [e, r] = u([]), [h, x] = u(f ?? ""), [E, C] = u(!1), I = z(), [b, R] = u();
22
+ onChange: c
23
+ } = q(l, "TagGroup"), [e, r] = u([]), [m, h] = u(f ?? ""), [E, x] = u(!1), C = z(), [I, R] = u();
24
24
  A(() => {
25
25
  if (l.data) {
26
26
  const t = l.data;
@@ -35,26 +35,24 @@ const Z = (l) => {
35
35
  }
36
36
  }, [l.data]);
37
37
  const g = (t) => t.map((n) => n.value), D = () => {
38
- C(!0), setTimeout(() => {
39
- I.current?.focus();
38
+ x(!0), setTimeout(() => {
39
+ C.current?.focus();
40
40
  });
41
41
  }, S = (t, n) => {
42
- e[n].value = t, r([...e]), p?.(e, g(e));
42
+ e[n].value = t, r([...e]), c?.(e, g(e));
43
43
  }, k = (t) => {
44
- x(t.target.value);
45
- }, v = () => {
46
- const t = h.trim();
47
- t !== "" && (e.push({ value: t, label: t, closable: !0 }), r([...e]), p?.(e, g(e))), x(f ?? ""), C(!1);
44
+ h(t.target.value);
45
+ }, b = () => {
46
+ const t = m.trim();
47
+ t !== "" && (e.push({ value: t, label: t, closable: !0 }), r([...e]), c?.(e, g(e))), h(f ?? ""), x(!1);
48
48
  }, B = (t) => {
49
- (t.keyCode === 13 || t.which === 13) && v();
49
+ (t.keyCode === 13 || t.which === 13) && b();
50
50
  }, O = (t) => (n) => {
51
51
  const a = e.findIndex((s) => s.value === t.value);
52
- a > -1 && (e.splice(a, 1), r([...e])), t.onClose && t.onClose(n), p?.(e, g(e));
52
+ a > -1 && (e.splice(a, 1), r([...e])), t.onClose && t.onClose(n), c?.(e, g(e));
53
53
  }, P = () => e?.length ? e.map((t, n) => /* @__PURE__ */ o.jsx(
54
- T,
54
+ v,
55
55
  {
56
- marginBottom: m,
57
- marginRight: W,
58
56
  ...t,
59
57
  size: i,
60
58
  visible: !0,
@@ -70,24 +68,24 @@ const Z = (l) => {
70
68
  {
71
69
  "tag-group-input-large": i === "large"
72
70
  },
73
- V
71
+ N
74
72
  );
75
73
  return /* @__PURE__ */ o.jsx(
76
74
  "input",
77
75
  {
78
- style: { width: G || b, minWidth: b },
76
+ style: { width: G || I, minWidth: I },
79
77
  type: "text",
80
- ref: I,
78
+ ref: C,
81
79
  className: s,
82
- value: h,
80
+ value: m,
83
81
  onChange: k,
84
- onBlur: v,
82
+ onBlur: b,
85
83
  onKeyDown: B
86
84
  }
87
85
  );
88
86
  }
89
- let t = /* @__PURE__ */ o.jsx(j, {}), n = "New Tag";
90
- c && (t = c.icon || /* @__PURE__ */ o.jsx(j, {}), n = c.text ?? "New Tag");
87
+ let t = /* @__PURE__ */ o.jsx(T, {}), n = "New Tag";
88
+ p && (t = p.icon || /* @__PURE__ */ o.jsx(T, {}), n = p.text ?? "New Tag");
91
89
  const a = d(
92
90
  "tag-group-new",
93
91
  {
@@ -96,14 +94,13 @@ const Z = (l) => {
96
94
  "tag-group-add-btn"
97
95
  );
98
96
  return /* @__PURE__ */ o.jsx(
99
- T,
97
+ v,
100
98
  {
101
99
  getWidth: (s) => R(s),
102
100
  className: a,
103
101
  size: i,
104
102
  icon: t,
105
103
  onClick: D,
106
- marginBottom: m,
107
104
  children: n
108
105
  }
109
106
  );
@@ -112,10 +109,10 @@ const Z = (l) => {
112
109
  "div",
113
110
  {
114
111
  className: d(`${K}-tag-group`, w),
115
- style: y,
112
+ style: { rowGap: V, columnGap: W, ...j },
116
113
  children: [
117
114
  P(),
118
- N && $()
115
+ y && $()
119
116
  ]
120
117
  }
121
118
  );
package/es/Tag/index.js CHANGED
@@ -13,11 +13,11 @@ import './index.css';/* empty css */
13
13
  const pe = ["blue", "green", "yellow", "red"], fe = (a) => {
14
14
  const {
15
15
  type: g = "normal",
16
- className: G,
16
+ className: B,
17
17
  children: s,
18
18
  icon: c,
19
19
  color: t,
20
- onClose: B,
20
+ onClose: G,
21
21
  onEdit: m,
22
22
  getWidth: h,
23
23
  tagChange: C,
@@ -34,7 +34,7 @@ const pe = ["blue", "green", "yellow", "red"], fe = (a) => {
34
34
  marginBottom: I,
35
35
  marginRight: y,
36
36
  ...J
37
- } = de(a, "TagGroup"), [Q, j] = r(!0), [$, N] = r(!1), [R, k] = r(""), [M, U] = r(0), [X, u] = r(!1), [Y, d] = r(!1), Z = A(), i = A(null);
37
+ } = de(a, "Tag"), [Q, j] = r(!0), [$, N] = r(!1), [R, k] = r(""), [M, U] = r(0), [X, u] = r(!1), [Y, d] = r(!1), Z = A(), i = A(null);
38
38
  p(() => {
39
39
  "visible" in a && j(!!E);
40
40
  }, [E]), p(() => {
@@ -63,14 +63,14 @@ const pe = ["blue", "green", "yellow", "red"], fe = (a) => {
63
63
  `${n}-tag`,
64
64
  `${n}-tag-${g}`,
65
65
  `${n}-tag-${b}`,
66
- G,
66
+ B,
67
67
  {
68
68
  [`${n}-tag-has-color`]: t,
69
69
  [`${n}-tag-hidden`]: !Q,
70
70
  [`${n}-tag-${t}`]: l()
71
71
  }
72
72
  ), W = (e) => {
73
- e.stopPropagation(), B?.(e), u(!1), !e.defaultPrevented && ("visible" in a || j(!1));
73
+ e.stopPropagation(), G?.(e), u(!1), !e.defaultPrevented && ("visible" in a || j(!1));
74
74
  }, S = () => {
75
75
  u(!0);
76
76
  }, L = () => {
package/es/index.d.ts CHANGED
@@ -72,6 +72,8 @@ export { default as Form } from './Form';
72
72
  export * from './Form';
73
73
  export { default as FormItem } from './FormItem';
74
74
  export * from './FormItem';
75
+ export { default as FormItemGroup } from './FormItemGroup';
76
+ export * from './FormItemGroup';
75
77
  export { default as FunctionModal } from './FunctionModal';
76
78
  export * from './FunctionModal';
77
79
  export { default as GlobalContext } from './GlobalContext';