@para-ui/core 5.0.0-beta.6 → 5.0.0-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.
@@ -1,13 +1,13 @@
1
1
  import { j as n } from "../_virtual/jsx-runtime.js";
2
- import { useState as A, useRef as C, useEffect as S, Fragment as u } from "react";
2
+ import { useState as w, useRef as y, useEffect as S, Fragment as u } from "react";
3
3
  import { Button as i } from "../Button/index.js";
4
4
  import z from "../AutoTips/index.js";
5
5
  import { PopConfirm as E } from "../PopConfirm/index.js";
6
6
  import { MoreVert as F } from "../node_modules/@para-ui/icons/MoreVert/index.js";
7
- import { $prefixCls as v } from "../GlobalContext/constant.js";
7
+ import { $prefixCls as C } from "../GlobalContext/constant.js";
8
8
  import { Dropdown as O } from "../Dropdown/index.js";
9
9
  import { Tooltip as J } from "../Tooltip/index.js";
10
- import y from "clsx";
10
+ import v from "clsx";
11
11
  import L from "../GlobalContext/useFormatMessage.js";
12
12
  import V from "./lang/index.js";
13
13
  import q from "../Utils/Hooks/useResizeObserver.js";
@@ -17,12 +17,12 @@ const lt = (P) => {
17
17
  className: M,
18
18
  style: T,
19
19
  list: e,
20
- marginRight: d = "16px",
20
+ marginRight: f = "16px",
21
21
  moreProps: B,
22
22
  morePlacement: N = "bottomLeft",
23
23
  moreMaxWidth: R = "500px",
24
24
  trigger: k = ["hover"]
25
- } = P, D = L("AutoButton", V), [l, f] = A(null), c = C(null), a = C({
25
+ } = P, A = L("AutoButton", V), [l, d] = w(null), c = y(null), a = y({
26
26
  timer: null
27
27
  });
28
28
  q({
@@ -33,7 +33,7 @@ const lt = (P) => {
33
33
  }, [e]);
34
34
  const h = () => {
35
35
  a.current.timer && clearTimeout(a.current.timer), a.current.timer = setTimeout(() => {
36
- f(e.length), e.length > 1 && b();
36
+ d(e.length), e.length > 1 && b();
37
37
  }, 100);
38
38
  }, b = (t) => {
39
39
  if (t === null || t === 0) return;
@@ -41,9 +41,9 @@ const lt = (P) => {
41
41
  const o = c.current;
42
42
  if (o && o.scrollWidth > o.clientWidth) {
43
43
  const r = Number(t) - 1;
44
- f(r), b(r);
44
+ d(r), b(r);
45
45
  }
46
- }, $ = (t, o, r) => {
46
+ }, D = (t, o, r) => {
47
47
  if (r) {
48
48
  r.onClick && r.onClick(o);
49
49
  return;
@@ -55,11 +55,11 @@ const lt = (P) => {
55
55
  variant: "text",
56
56
  disabled: t.disabled,
57
57
  loading: t.loading,
58
- className: y("item-btn", {
58
+ className: v("item-btn", {
59
59
  "item-btn-disabled": t.disabled
60
60
  }),
61
61
  onClick: (s) => {
62
- t.disabled || $(t, s, r);
62
+ t.disabled || D(t, s, r);
63
63
  },
64
64
  children: /* @__PURE__ */ n.jsx(z, { placement: "top-start", children: t[o] })
65
65
  }
@@ -70,16 +70,16 @@ const lt = (P) => {
70
70
  ...t.disabledTooltip,
71
71
  children: g(t, o, r)
72
72
  }
73
- ) : g(t, o, r), I = () => /* @__PURE__ */ n.jsx(
73
+ ) : g(t, o, r), $ = () => /* @__PURE__ */ n.jsx(
74
74
  "div",
75
75
  {
76
76
  className: "auto-button-dropdown-content",
77
77
  style: { maxWidth: R },
78
- children: e && e.map((t, o) => l !== null && l > o ? null : t.buttonType !== "split" ? /* @__PURE__ */ n.jsx(u, { children: m(t, j(t, "children")) }, o) : /* @__PURE__ */ n.jsx(u, { children: t.options?.map((r, s) => /* @__PURE__ */ n.jsx(u, { children: m(r, j(r, "label", t)) }, `${o}-${s}`)) }, o))
78
+ children: e && e.map((t, o) => l !== null && l > o ? null : t.buttonType !== "split" ? /* @__PURE__ */ n.jsx(u, { children: m(t, j(t, "children")) }, o) : /* @__PURE__ */ n.jsx(u, { children: t.options?.map((r, s) => Array.isArray(r) ? null : /* @__PURE__ */ n.jsx(u, { children: m(r, j(r, "label", t)) }, `${o}-${s}`)) }, o))
79
79
  }
80
- ), W = () => {
80
+ ), I = () => {
81
81
  if (!(l !== null && e.length > l)) return null;
82
- const { buttonType: t, icon: o = /* @__PURE__ */ n.jsx(F, {}), children: r = D({ id: "more" }) } = B || {};
82
+ const { buttonType: t, icon: o = /* @__PURE__ */ n.jsx(F, {}), children: r = A({ id: "more" }) } = B || {};
83
83
  let s = /* @__PURE__ */ n.jsx(
84
84
  i,
85
85
  {
@@ -99,8 +99,8 @@ const lt = (P) => {
99
99
  )), /* @__PURE__ */ n.jsx(
100
100
  O,
101
101
  {
102
- overlayClassName: `${v}-auto-button-dropdown`,
103
- overlay: I(),
102
+ overlayClassName: `${C}-auto-button-dropdown`,
103
+ overlay: $(),
104
104
  placement: N,
105
105
  trigger: k,
106
106
  children: s
@@ -110,29 +110,29 @@ const lt = (P) => {
110
110
  return /* @__PURE__ */ n.jsxs(
111
111
  "div",
112
112
  {
113
- className: y(M, `${v}-auto-button`),
113
+ className: v(M, `${C}-auto-button`),
114
114
  style: T,
115
115
  ref: c,
116
116
  children: [
117
117
  e.map((t, o) => {
118
118
  if (l !== null && l <= o) return null;
119
- const { buttonType: r, popConfirmProps: s, ...w } = t;
119
+ const { buttonType: r, popConfirmProps: s, ...W } = t;
120
120
  let p = i;
121
121
  const x = {
122
- marginRight: l === o + 1 ? 0 : d
122
+ marginRight: l === o + 1 ? 0 : f
123
123
  };
124
- return l !== null && e.length > l && (x.marginRight = d), r === "icon" && (p = i.IconButton), r === "split" && (p = i.SplitButton), /* @__PURE__ */ n.jsx(u, { children: m(
124
+ return l !== null && e.length > l && (x.marginRight = f), r === "icon" && (p = i.IconButton), r === "split" && (p = i.SplitButton), /* @__PURE__ */ n.jsx(u, { children: m(
125
125
  t,
126
126
  /* @__PURE__ */ n.jsx(
127
127
  p,
128
128
  {
129
- ...w,
129
+ ...W,
130
130
  style: x
131
131
  }
132
132
  )
133
133
  ) }, o);
134
134
  }),
135
- W()
135
+ I()
136
136
  ]
137
137
  }
138
138
  );
@@ -1,7 +1,10 @@
1
1
  import { default as React, FunctionComponent } from 'react';
2
2
  import { TooltipProps } from '../Tooltip';
3
3
  import { default as SplitButton } from './SplitButton';
4
- export interface ButtonProps extends React.ButtonHTMLAttributes<any> {
4
+ type ButtonOrAnchorAttributes = Omit<React.ButtonHTMLAttributes<HTMLElement> & React.AnchorHTMLAttributes<HTMLElement>, 'type'>;
5
+ export interface ButtonProps extends ButtonOrAnchorAttributes {
6
+ /** 原生 button type */
7
+ type?: 'button' | 'submit' | 'reset';
5
8
  variant?: 'contained' | 'outlined' | 'text';
6
9
  /** 设置按钮载入状态 */
7
10
  loading?: boolean | {
@@ -35,9 +38,10 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<any> {
35
38
  target?: string;
36
39
  /** 禁用提示 */
37
40
  disabledTooltip?: TooltipProps;
38
- [name: string]: any;
39
41
  }
40
- export interface IconButtonProps extends React.ButtonHTMLAttributes<any> {
42
+ export interface IconButtonProps extends ButtonOrAnchorAttributes {
43
+ /** 原生 button type */
44
+ type?: 'button' | 'submit' | 'reset';
41
45
  /** 按钮形状 */
42
46
  variant?: 'contained' | 'outlined' | 'text' | 'activate';
43
47
  size?: 'small' | 'medium' | 'large';
@@ -65,7 +69,6 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<any> {
65
69
  target?: string;
66
70
  /** 禁用提示 */
67
71
  disabledTooltip?: TooltipProps;
68
- [name: string]: any;
69
72
  }
70
73
  declare const InternalButton: FunctionComponent<ButtonProps>;
71
74
  declare const IconButton: FunctionComponent<IconButtonProps>;
@@ -7,7 +7,7 @@ import { $prefixCls as tr } from "../GlobalContext/constant.js";
7
7
  import { d as gr } from "../_virtual/index.js";
8
8
  import { Loading as fr } from "../Loading/index.js";
9
9
  import hr from "./lang/index.js";
10
- import './index.css';/* empty css */
10
+ import '../InputCode/index.css';/* empty css */
11
11
  var kr = /* @__PURE__ */ ((r) => (r[r.Method = 0] = "Method", r[r.Function = 1] = "Function", r[r.Constructor = 2] = "Constructor", r[r.Field = 3] = "Field", r[r.Variable = 4] = "Variable", r[r.Class = 5] = "Class", r[r.Struct = 6] = "Struct", r[r.Interface = 7] = "Interface", r[r.Module = 8] = "Module", r[r.Property = 9] = "Property", r[r.Event = 10] = "Event", r[r.Operator = 11] = "Operator", r[r.Unit = 12] = "Unit", r[r.Value = 13] = "Value", r[r.Constant = 14] = "Constant", r[r.Enum = 15] = "Enum", r[r.EnumMember = 16] = "EnumMember", r[r.Keyword = 17] = "Keyword", r[r.Text = 18] = "Text", r[r.Color = 19] = "Color", r[r.File = 20] = "File", r[r.Reference = 21] = "Reference", r[r.Customcolor = 22] = "Customcolor", r[r.Folder = 23] = "Folder", r[r.TypeParameter = 24] = "TypeParameter", r[r.User = 25] = "User", r[r.Issue = 26] = "Issue", r[r.Snippet = 27] = "Snippet", r))(kr || {});
12
12
  const wr = (r) => {
13
13
  const {
@@ -1,6 +1,6 @@
1
1
  import { InputCodeCard as t } from "./inputCodeCard/index.js";
2
2
  import { InputCodeInput as o } from "./inputCodeInput/index.js";
3
- import '../CodeEditor/index.css';/* empty css */
3
+ import './index.css';/* empty css */
4
4
  const n = {
5
5
  Card: t,
6
6
  Input: o
@@ -21,7 +21,6 @@ export interface FilterEnumsProps {
21
21
  displayName?: ReactNode;
22
22
  /** 值 */
23
23
  value?: unknown;
24
- [name: string]: unknown;
25
24
  }
26
25
  /** 渲染数据参数 */
27
26
  export interface HeadDataProps<T = unknown> {
@@ -78,7 +77,6 @@ export interface HeadDataProps<T = unknown> {
78
77
  tipMaxWidth?: number | string;
79
78
  /** 排序,请求才有 */
80
79
  orderNum?: number;
81
- [name: string]: unknown;
82
80
  }
83
81
  /** 远程数据的表头显示列 */
84
82
  export interface HeadDataReqProps {
@@ -94,7 +92,6 @@ export interface HeadDataReqProps {
94
92
  orderFlag?: boolean;
95
93
  /** 表头是否显示该字段 */
96
94
  selectedFlag?: boolean;
97
- [name: string]: unknown;
98
95
  }
99
96
  /** 固定列/拖拽 位置信息 */
100
97
  export interface PosFixedProps {
@@ -118,7 +115,7 @@ export interface TableHeadBodyPublicProps<T = unknown> {
118
115
  /** 对齐方式 */
119
116
  align?: AlignType;
120
117
  /** 操作栏 */
121
- operate?: HeadDataProps;
118
+ operate?: HeadDataProps<T>;
122
119
  /** 是否显示列 里面 不显示 */
123
120
  showColumns?: 'inside' | false;
124
121
  /** 是否等分表格,出滚动条 */
@@ -163,7 +160,7 @@ export interface TableProps<T = unknown> extends TableHeadBodyPublicProps<T> {
163
160
  /** 请求方式 */
164
161
  method?: MethodType;
165
162
  /** 本地数据源 */
166
- data?: Anyjson[];
163
+ data?: T[];
167
164
  /** 页数 */
168
165
  page?: number;
169
166
  /** 一页条数 */
@@ -186,12 +183,15 @@ export interface TableProps<T = unknown> extends TableHeadBodyPublicProps<T> {
186
183
  tableCell?: (row: T, params: unknown) => ReactNode;
187
184
  /** 请求回调参数 requestCallback(data, cb) cb(data) 需要回调数据回来 */
188
185
  requestCallback?: (data: Record<string, unknown>, cb: (data: Record<string, unknown>) => void) => void;
189
- /** 默认复选框选中值 */
190
- checkDefaultValue?: T[];
186
+ /** 默认复选框选中值(选中行的 rowKey 数组,始终为 string[];若业务主键为 number,需自行 String 转换) */
187
+ checkDefaultValue?: string[];
191
188
  /** 显示已选条数 */
192
189
  checkCount?: boolean;
193
- /** 设置复选框选中值 */
194
- setCheck?: (arr: T[], data: T) => void;
190
+ /** 设置复选框选中值
191
+ * @param keys 选中行的 rowKey 数组(JS 对象键,始终为 string[];若业务主键为 number,需自行 Number 转换)
192
+ * @param data 选中行的数据数组
193
+ */
194
+ setCheck?: (keys: string[], data: T[]) => void;
195
195
  /** 默认单选选中值 */
196
196
  radioDefaultValue?: string | number;
197
197
  /** 设置单选框选中值 */
@@ -302,7 +302,6 @@ export interface TableProps<T = unknown> extends TableHeadBodyPublicProps<T> {
302
302
  * 内部刷新事件回调
303
303
  * */
304
304
  onRefreshCallback?: (type: 'empty' | 'refresh') => void;
305
- [key: string]: unknown;
306
305
  }
307
306
  export interface ExpandableRowItem {
308
307
  /** 当前嵌套行id */
@@ -324,7 +323,6 @@ export interface ReqProps {
324
323
  ctx?: string;
325
324
  /** 请求参数 */
326
325
  data?: Record<string, unknown> | Anyjson;
327
- [name: string]: unknown;
328
326
  }
329
327
  /** 显示列LocalStorage item */
330
328
  export interface HeadLocalStorageItem {
@@ -1,30 +1,25 @@
1
- import { default as React, FC, ReactNode } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { TabPane, TabsProps as RcTabsProps, TabPaneProps } from 'rc-tabs';
3
3
  import { PopConfirmProps } from '../PopConfirm';
4
4
  import { HelpProps } from '../Help';
5
5
  import { TooltipProps } from '../Tooltip';
6
6
  export type TabsType = 'line' | 'card' | 'editable-card' | 'track' | 'card-container';
7
7
  export type { TabPaneProps };
8
- export interface TabProps {
8
+ export interface TabProps<K extends React.Key = string> extends Omit<TabPaneProps, 'tabKey' | 'tab' | 'children' | 'prefixCls'> {
9
9
  /** tab text */
10
10
  label?: ReactNode;
11
11
  /** tab panel */
12
12
  content?: ReactNode;
13
13
  /** tab key */
14
- value?: React.Key;
15
- /** 禁用 */
16
- disabled?: boolean;
14
+ value: K;
17
15
  /** 禁用文案提示 */
18
16
  disabledTooltip?: TooltipProps;
19
- /** 可关闭标签 */
20
- closable?: boolean;
21
17
  /** 显示帮助提示 Help */
22
18
  showHelp?: boolean;
23
19
  /** help props */
24
20
  helpProps?: HelpProps;
25
- [name: string]: unknown;
26
21
  }
27
- export interface TabsProps extends Omit<RcTabsProps, 'editable'> {
22
+ export interface TabsProps<K extends React.Key = string> extends Omit<RcTabsProps, 'editable' | 'onChange'> {
28
23
  /** tabs 类型 */
29
24
  type?: TabsType;
30
25
  /** 模式:线性、卡片*/
@@ -46,30 +41,29 @@ export interface TabsProps extends Omit<RcTabsProps, 'editable'> {
46
41
  /** popConfirm props*/
47
42
  popConfirmProps?: PopConfirmProps;
48
43
  /** 数据列表*/
49
- data?: TabProps[];
44
+ data?: TabProps<K>[];
50
45
  /** 选中的 value*/
51
- value?: React.Key;
46
+ value?: K;
52
47
  /** 是否开启单选 */
53
48
  radio?: boolean;
54
49
  /** 单选值 */
55
- radioValue?: React.Key;
50
+ radioValue?: K;
56
51
  /** 默认单选值 */
57
- defaultRadioValue?: React.Key;
52
+ defaultRadioValue?: K;
58
53
  /** 线性选项卡导航栏主轴是否具有间距,开启为20px间距,关闭为0间距,默认开启 */
59
54
  navWithPadding?: boolean;
60
55
  /** 单选值切换的回调 */
61
- onRadioChange?: (radioValue: React.Key) => void;
56
+ onRadioChange?: (radioValue: K) => void;
62
57
  /** 新增按钮回调 showAdd 为 true 时有效*/
63
58
  onAdd?: (e?: React.MouseEvent) => void;
64
59
  /** 切换标签页的回调 */
65
- onChange?: (activeKey: React.Key, item?: TabProps) => void;
60
+ onChange?: (activeKey: K, item?: TabProps<K>) => void;
66
61
  /** 新增和删除页签的回调 */
67
- onEdit?: (item: TabProps, e?: React.MouseEvent | React.KeyboardEvent | string | React.Key, action?: 'add' | 'remove') => void;
68
- [name: string]: unknown;
62
+ onEdit?: (item: TabProps<K>, e?: React.MouseEvent | React.KeyboardEvent | string | React.Key, action?: 'add' | 'remove') => void;
69
63
  }
70
- export declare const Tabs: FC<TabsProps>;
71
- type mergedTabs = typeof Tabs & {
64
+ declare const TabsBase: <K extends React.Key = string>(props: TabsProps<K>) => import("react/jsx-runtime").JSX.Element;
65
+ type MergedTabs = typeof TabsBase & {
72
66
  TabPane: typeof TabPane;
73
67
  };
74
- declare const _default: mergedTabs;
75
- export default _default;
68
+ export declare const Tabs: MergedTabs;
69
+ export default Tabs;
package/es/Tabs/index.js CHANGED
@@ -1,170 +1,168 @@
1
- import { j as a } from "../_virtual/jsx-runtime.js";
2
- import R, { useState as ee, useEffect as te, createElement as oe } from "react";
3
- import re, { TabPane as T } from "rc-tabs";
1
+ import { j as r } from "../_virtual/jsx-runtime.js";
2
+ import T, { useState as oe, useEffect as te, createElement as re } from "react";
3
+ import ae, { TabPane as R } from "rc-tabs";
4
4
  import "../node_modules/@para-ui/icons/SvgIcon/index.js";
5
5
  import { Close as u } from "../node_modules/@para-ui/icons/Close/index.js";
6
- import { More as ae } from "../node_modules/@para-ui/icons/More/index.js";
7
- import { Plus as ne } from "../node_modules/@para-ui/icons/Plus/index.js";
6
+ import { More as ne } from "../node_modules/@para-ui/icons/More/index.js";
7
+ import { Plus as se } from "../node_modules/@para-ui/icons/Plus/index.js";
8
8
  import { PopConfirm as ie } from "../PopConfirm/index.js";
9
- import { Radio as se } from "../Radio/index.js";
10
- import le from "../Help/index.js";
11
- import de from "clsx";
12
- import ce from "../GlobalContext/useFormatMessage.js";
13
- import me from "./lang/index.js";
14
- import { $rcPrefixCls as c, $prefixCls as pe } from "../GlobalContext/constant.js";
15
- import { Tooltip as fe } from "../Tooltip/index.js";
9
+ import { Radio as le } from "../Radio/index.js";
10
+ import de from "../Help/index.js";
11
+ import ce from "clsx";
12
+ import me from "../GlobalContext/useFormatMessage.js";
13
+ import pe from "./lang/index.js";
14
+ import { $rcPrefixCls as d, $prefixCls as fe } from "../GlobalContext/constant.js";
15
+ import { Tooltip as ue } from "../Tooltip/index.js";
16
16
  import './index.css';/* empty css */
17
- const ue = (y) => {
17
+ const k = (E) => {
18
18
  const {
19
- type: k,
20
- className: A,
19
+ type: A,
20
+ className: N,
21
21
  size: h,
22
- onEdit: m,
23
- hideAdd: E,
24
- centered: K,
25
- addIcon: N,
26
- moreIcon: w = /* @__PURE__ */ a.jsx(ae, {}),
27
- editable: p,
22
+ onEdit: c,
23
+ hideAdd: y,
24
+ centered: V,
25
+ addIcon: w,
26
+ moreIcon: K = /* @__PURE__ */ r.jsx(ne, {}),
27
+ editable: m,
28
28
  mode: b,
29
29
  showAdd: S,
30
- showPopConfirm: V,
31
- popConfirmProps: H,
32
- data: s,
33
- onChange: M,
30
+ showPopConfirm: H,
31
+ popConfirmProps: M,
32
+ data: i,
33
+ onChange: z,
34
34
  onAdd: C,
35
35
  children: x,
36
- value: z,
36
+ value: B,
37
37
  activeKey: D,
38
38
  radio: F,
39
- radioValue: d,
39
+ radioValue: l,
40
40
  defaultRadioValue: J,
41
41
  navWithPadding: O = !0,
42
42
  onRadioChange: W,
43
43
  ..._
44
- } = y, q = ce("Tabs", me), r = `${pe}-tabs`, n = k ?? b, [B, $] = ee(J);
44
+ } = E, q = me("Tabs", pe), t = `${fe}-tabs`, a = A ?? b, [G, $] = oe(J);
45
45
  te(() => {
46
- d !== void 0 && $(d);
47
- }, [d]);
48
- const G = (e) => {
49
- d === void 0 && $(e), W?.(e);
50
- }, g = (e) => {
51
- let t = {}, o = e;
52
- return s && (t = s.find((i) => String(i.value) === e) || {}, t?.value !== void 0 && (o = String(t.value))), { currItem: t, tKey: o };
53
- };
46
+ l !== void 0 && $(l);
47
+ }, [l]);
48
+ const L = (e) => {
49
+ l === void 0 && $(e), W?.(e);
50
+ }, g = (e) => i?.find((o) => String(o.value) === e);
54
51
  let v;
55
- (n === "editable-card" || p) && (v = {
56
- onEdit: (e, { key: t, event: o }) => {
52
+ (a === "editable-card" || m) && (v = {
53
+ onEdit: (e, { key: o, event: n }) => {
57
54
  if (e === "add")
58
- C ? C(o) : m?.({}, o, e);
55
+ C ? C(n) : c?.({}, n, e);
59
56
  else {
60
- const { currItem: i, tKey: l } = g(t);
61
- m?.(i, String(l), e);
57
+ const s = g(o);
58
+ s && c?.(s, s.value, e);
62
59
  }
63
60
  },
64
- removeIcon: /* @__PURE__ */ a.jsx(u, {}),
65
- addIcon: N || /* @__PURE__ */ a.jsx(ne, {}),
66
- showAdd: E !== !0 && S !== !1
61
+ removeIcon: /* @__PURE__ */ r.jsx(u, {}),
62
+ addIcon: w || /* @__PURE__ */ r.jsx(se, {}),
63
+ showAdd: y !== !0 && S !== !1
67
64
  });
68
- const L = (e) => {
69
- const { currItem: t, tKey: o } = g(e);
70
- M?.(o, t);
71
- }, Q = (e) => {
72
- const { closable: t, closeIcon: o } = e;
73
- return t === !1 ? null : V ? /* @__PURE__ */ a.jsx("span", { onClick: (i) => i.stopPropagation(), children: /* @__PURE__ */ a.jsx(
65
+ const Q = (e) => {
66
+ const o = g(e);
67
+ z?.(o?.value ?? e, o);
68
+ }, U = (e) => {
69
+ const { closable: o, closeIcon: n } = e;
70
+ return o === !1 ? null : H ? /* @__PURE__ */ r.jsx("span", { onClick: (s) => s.stopPropagation(), children: /* @__PURE__ */ r.jsx(
74
71
  ie,
75
72
  {
76
73
  content: q({ id: "confirmDelete" }),
77
74
  placement: "top",
78
- ...H,
79
- onOk: () => m?.(e, e.value, "remove"),
80
- children: o || /* @__PURE__ */ a.jsx(u, {})
75
+ ...M,
76
+ onOk: () => c?.(e, e.value, "remove"),
77
+ children: n || /* @__PURE__ */ r.jsx(u, {})
81
78
  }
82
- ) }) : o || /* @__PURE__ */ a.jsx(u, {});
83
- }, U = () => {
84
- if (!s?.length) return x;
79
+ ) }) : n || /* @__PURE__ */ r.jsx(u, {});
80
+ }, X = () => {
81
+ if (!i?.length) return x;
85
82
  const e = b === "card-container" && F;
86
- return s.map((t) => {
87
- const { label: o, content: i, value: l, showHelp: j, helpProps: P, disabledTooltip: I, ...Z } = t;
88
- let f = j || e ? /* @__PURE__ */ a.jsxs("span", { className: `${c}-tabs-tab-help`, children: [
89
- e && /* @__PURE__ */ a.jsx(
90
- se,
83
+ return i.map((o) => {
84
+ const { label: n, content: s, value: p, showHelp: j, helpProps: P, disabledTooltip: I, ...ee } = o;
85
+ let f = j || e ? /* @__PURE__ */ r.jsxs("span", { className: `${d}-tabs-tab-help`, children: [
86
+ e && /* @__PURE__ */ r.jsx(
87
+ le,
91
88
  {
92
- checked: B === l,
93
- onChange: () => G(l)
89
+ checked: G === p,
90
+ onChange: () => L(p)
94
91
  }
95
92
  ),
96
- o,
97
- j && /* @__PURE__ */ a.jsx(
98
- le,
93
+ n,
94
+ j && /* @__PURE__ */ r.jsx(
95
+ de,
99
96
  {
100
97
  placement: "bottom-start",
101
98
  ...P,
102
99
  title: P?.title ?? ""
103
100
  }
104
101
  )
105
- ] }) : o;
106
- return I && (f = /* @__PURE__ */ a.jsx(
107
- fe,
102
+ ] }) : n;
103
+ return I && (f = /* @__PURE__ */ r.jsx(
104
+ ue,
108
105
  {
109
106
  disabled: !0,
110
107
  placement: "bottom-start",
111
108
  ...I,
112
109
  children: f
113
110
  }
114
- )), /* @__PURE__ */ oe(
115
- T,
111
+ )), /* @__PURE__ */ re(
112
+ R,
116
113
  {
117
- ...Z,
114
+ ...ee,
118
115
  tab: f,
119
- key: l,
120
- closeIcon: Q(t)
116
+ key: p,
117
+ closeIcon: U(o)
121
118
  },
122
- i
119
+ s
123
120
  );
124
121
  });
125
- }, X = () => {
126
- const e = D ?? z;
127
- if (e !== void 0) return String(e);
128
122
  }, Y = () => {
123
+ const e = D ?? B;
124
+ if (e !== void 0) return String(e);
125
+ }, Z = () => {
129
126
  let e;
130
- return s?.length ? e = s.some((t) => t.content) : e = R.Children.toArray(x).some(
131
- (t) => R.isValidElement(t) && t.props.children
127
+ return i?.length ? e = i.some((o) => o.content) : e = T.Children.toArray(x).some(
128
+ (o) => T.isValidElement(o) && o.props.children
132
129
  ), !e;
133
130
  };
134
- return /* @__PURE__ */ a.jsx(
135
- re,
131
+ return /* @__PURE__ */ r.jsx(
132
+ ae,
136
133
  {
137
- activeKey: X(),
138
- moreTransitionName: `${c}-tabs-slide-up`,
134
+ activeKey: Y(),
135
+ moreTransitionName: `${d}-tabs-slide-up`,
139
136
  ..._,
140
- className: de(
141
- r,
137
+ className: ce(
138
+ t,
142
139
  {
143
- [`${r}-${h}`]: h,
144
- [`${r}-line`]: !n || n === "line",
145
- [`${r}-editable-line`]: (!n || n === "line") && p,
146
- [`${r}-card`]: ["card", "editable-card"].includes(n),
147
- [`${r}-editable-card`]: n === "editable-card",
148
- [`${r}-track`]: n === "track",
149
- [`${r}-editable-track`]: n === "track" && p,
150
- [`${r}-card-container ${r}-card`]: n === "card-container",
151
- [`${r}-centered`]: K,
152
- [`${r}-no-child`]: Y(),
153
- [`${c}-nav-padding`]: O
140
+ [`${t}-${h}`]: h,
141
+ [`${t}-line`]: !a || a === "line",
142
+ [`${t}-editable-line`]: (!a || a === "line") && m,
143
+ [`${t}-card`]: ["card", "editable-card"].includes(a),
144
+ [`${t}-editable-card`]: a === "editable-card",
145
+ [`${t}-track`]: a === "track",
146
+ [`${t}-editable-track`]: a === "track" && m,
147
+ [`${t}-card-container ${t}-card`]: a === "card-container",
148
+ [`${t}-centered`]: V,
149
+ [`${t}-no-child`]: Z(),
150
+ [`${d}-nav-padding`]: O
154
151
  },
155
- A
152
+ N
156
153
  ),
157
154
  editable: v,
158
- moreIcon: w,
159
- prefixCls: `${c}-tabs`,
160
- onChange: L,
161
- children: U()
155
+ moreIcon: K,
156
+ prefixCls: `${d}-tabs`,
157
+ onChange: Q,
158
+ children: X()
162
159
  }
163
160
  );
164
161
  };
165
- ue.TabPane = T;
162
+ k.TabPane = R;
163
+ const ye = k;
166
164
  export {
167
- ue as Tabs,
168
- ue as default
165
+ ye as Tabs,
166
+ ye as default
169
167
  };
170
168
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('../../InputCode/index.css');const c=require("../../_virtual/jsx-runtime.js"),m=require("react"),E=require("../../Button/index.js"),k=require("../../TextField/index.js"),y=require("../../Modal/index.js"),h=require("../../Message/index.js"),p=require("../../GlobalContext/useFormatMessage.js"),S=require("../../GlobalContext/constant.js"),g=require("../lang/index.js");;/* empty css */const b=l=>{const i=p.default("Argv",g.default),{className:f,sourceData:s,onFinish:u,dataToJson:o,jsonToData:n}=l,[t,r]=m.useState({open:!1,json:""}),d=()=>{let e="";if(!Array.isArray(s))e="";else try{o?e=o(s):e=JSON.stringify(s,null,4)}catch(a){console.error(a)}r({...t,json:e,open:!t.open})},x=()=>{r({...t,open:!1})},j=e=>{let a=[];try{n?a=n(e):a=JSON.parse(e)}catch{return h.Message.error(i("formatErrorJson"),5e3),!1}r({...t,open:!1}),u&&u(a)};return c.jsxRuntimeExports.jsxs("div",{className:`argv-batch-edit-content ${f}`,children:[c.jsxRuntimeExports.jsx(E.Button,{variant:"outlined",size:"small",className:"btn-edit",onClick:d,children:i("batchEdit")}),c.jsxRuntimeExports.jsx(q,{open:t.open,onCancel:x,onOk:j,json:t.json,checkData:l.checkData})]})},q=l=>{const{open:i,disabled:f,onCancel:s,onOk:u,json:o,checkData:n}=l,t=p.default("Argv",g.default),[r,d]=m.useState("");m.useEffect(()=>{d(o||"")},[o]);const x=()=>{try{const e=JSON.parse(r);return Array.isArray(e)?!(n&&!n(e)):(h.Message.error(t("formatErrorArrayJson")),!1)}catch{return h.Message.error(t("formatErrorJson")),!1}},j=()=>{if(x())try{u(r)}catch(e){console.error(e)}};return c.jsxRuntimeExports.jsx(y.Modal,{className:`${S.$prefixCls}-form`,open:i,title:t("batchEdit"),onCancel:s,onOk:j,maskClosable:!0,showCancel:!1,okText:t("ok"),children:c.jsxRuntimeExports.jsx(k.TextField,{label:"API JSON",placeholder:"请输入",disabled:f,multiline:!0,rows:12,value:r||"",onChange:e=>d(e.target.value)})})};exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('../../CodeEditor/index.css');const c=require("../../_virtual/jsx-runtime.js"),m=require("react"),E=require("../../Button/index.js"),k=require("../../TextField/index.js"),y=require("../../Modal/index.js"),h=require("../../Message/index.js"),p=require("../../GlobalContext/useFormatMessage.js"),S=require("../../GlobalContext/constant.js"),g=require("../lang/index.js");;/* empty css */const b=l=>{const i=p.default("Argv",g.default),{className:f,sourceData:s,onFinish:u,dataToJson:o,jsonToData:n}=l,[t,r]=m.useState({open:!1,json:""}),d=()=>{let e="";if(!Array.isArray(s))e="";else try{o?e=o(s):e=JSON.stringify(s,null,4)}catch(a){console.error(a)}r({...t,json:e,open:!t.open})},x=()=>{r({...t,open:!1})},j=e=>{let a=[];try{n?a=n(e):a=JSON.parse(e)}catch{return h.Message.error(i("formatErrorJson"),5e3),!1}r({...t,open:!1}),u&&u(a)};return c.jsxRuntimeExports.jsxs("div",{className:`argv-batch-edit-content ${f}`,children:[c.jsxRuntimeExports.jsx(E.Button,{variant:"outlined",size:"small",className:"btn-edit",onClick:d,children:i("batchEdit")}),c.jsxRuntimeExports.jsx(q,{open:t.open,onCancel:x,onOk:j,json:t.json,checkData:l.checkData})]})},q=l=>{const{open:i,disabled:f,onCancel:s,onOk:u,json:o,checkData:n}=l,t=p.default("Argv",g.default),[r,d]=m.useState("");m.useEffect(()=>{d(o||"")},[o]);const x=()=>{try{const e=JSON.parse(r);return Array.isArray(e)?!(n&&!n(e)):(h.Message.error(t("formatErrorArrayJson")),!1)}catch{return h.Message.error(t("formatErrorJson")),!1}},j=()=>{if(x())try{u(r)}catch(e){console.error(e)}};return c.jsxRuntimeExports.jsx(y.Modal,{className:`${S.$prefixCls}-form`,open:i,title:t("batchEdit"),onCancel:s,onOk:j,maskClosable:!0,showCancel:!1,okText:t("ok"),children:c.jsxRuntimeExports.jsx(k.TextField,{label:"API JSON",placeholder:"请输入",disabled:f,multiline:!0,rows:12,value:r||"",onChange:e=>d(e.target.value)})})};exports.default=b;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),u=require("react"),l=require("../Button/index.js"),F=require("../AutoTips/index.js"),S=require("../PopConfirm/index.js"),w=require("../node_modules/@para-ui/icons/MoreVert/index.js"),g=require("../GlobalContext/constant.js"),A=require("../Dropdown/index.js"),I=require("../Tooltip/index.js"),E=require("clsx"),W=require("../GlobalContext/useFormatMessage.js"),O=require("./lang/index.js"),z=require("../Utils/Hooks/useResizeObserver.js");;/* empty css */const B=q=>{const{className:C,style:v,list:o,marginRight:x="16px",moreProps:P,morePlacement:y="bottomLeft",moreMaxWidth:M="500px",trigger:T=["hover"]}=q,N=W.default("AutoButton",O.default),[s,m]=u.useState(null),c=u.useRef(null),a=u.useRef({timer:null});z.default({dom:c.current,cb:()=>f()}),u.useEffect(()=>{f()},[o]);const f=()=>{a.current.timer&&clearTimeout(a.current.timer),a.current.timer=setTimeout(()=>{m(o.length),o.length>1&&j()},100)},j=t=>{if(t===null||t===0)return;t===void 0&&(t=o.length);const e=c.current;if(e&&e.scrollWidth>e.clientWidth){const n=Number(t)-1;m(n),j(n)}},_=(t,e,n)=>{if(n){n.onClick&&n.onClick(e);return}t.onClick&&t.onClick(e)},h=(t,e,n)=>r.jsxRuntimeExports.jsx(l.Button,{variant:"text",disabled:t.disabled,loading:t.loading,className:E("item-btn",{"item-btn-disabled":t.disabled}),onClick:i=>{t.disabled||_(t,i,n)},children:r.jsxRuntimeExports.jsx(F.default,{placement:"top-start",children:t[e]})}),b=(t,e,n)=>t.disabled&&t.disabledTooltip?r.jsxRuntimeExports.jsx(I.Tooltip,{disabled:!0,...t.disabledTooltip,children:h(t,e,n)}):h(t,e,n),$=()=>r.jsxRuntimeExports.jsx("div",{className:"auto-button-dropdown-content",style:{maxWidth:M},children:o&&o.map((t,e)=>s!==null&&s>e?null:t.buttonType!=="split"?r.jsxRuntimeExports.jsx(u.Fragment,{children:d(t,b(t,"children"))},e):r.jsxRuntimeExports.jsx(u.Fragment,{children:t.options?.map((n,i)=>r.jsxRuntimeExports.jsx(u.Fragment,{children:d(n,b(n,"label",t))},`${e}-${i}`))},e))}),k=()=>{if(!(s!==null&&o.length>s))return null;const{buttonType:t,icon:e=r.jsxRuntimeExports.jsx(w.MoreVert,{}),children:n=N({id:"more"})}=P||{};let i=r.jsxRuntimeExports.jsx(l.Button,{variant:"outlined",startIcon:e,className:"auto-button-more",children:n});return t==="icon"&&(i=r.jsxRuntimeExports.jsx(l.Button.IconButton,{variant:"outlined",className:"auto-button-more",children:e})),r.jsxRuntimeExports.jsx(A.Dropdown,{overlayClassName:`${g.$prefixCls}-auto-button-dropdown`,overlay:$(),placement:y,trigger:T,children:i})},d=(t,e)=>t.popConfirmProps?r.jsxRuntimeExports.jsx(S.PopConfirm,{...t.popConfirmProps,children:e}):e;return r.jsxRuntimeExports.jsxs("div",{className:E(C,`${g.$prefixCls}-auto-button`),style:v,ref:c,children:[o.map((t,e)=>{if(s!==null&&s<=e)return null;const{buttonType:n,popConfirmProps:i,...D}=t;let p=l.Button;const R={marginRight:s===e+1?0:x};return s!==null&&o.length>s&&(R.marginRight=x),n==="icon"&&(p=l.Button.IconButton),n==="split"&&(p=l.Button.SplitButton),r.jsxRuntimeExports.jsx(u.Fragment,{children:d(t,r.jsxRuntimeExports.jsx(p,{...D,style:R}))},e)}),k()]})};exports.AutoButton=B;exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),u=require("react"),l=require("../Button/index.js"),D=require("../AutoTips/index.js"),F=require("../PopConfirm/index.js"),S=require("../node_modules/@para-ui/icons/MoreVert/index.js"),g=require("../GlobalContext/constant.js"),w=require("../Dropdown/index.js"),I=require("../Tooltip/index.js"),E=require("clsx"),W=require("../GlobalContext/useFormatMessage.js"),O=require("./lang/index.js"),z=require("../Utils/Hooks/useResizeObserver.js");;/* empty css */const B=q=>{const{className:y,style:C,list:o,marginRight:x="16px",moreProps:v,morePlacement:P="bottomLeft",moreMaxWidth:M="500px",trigger:T=["hover"]}=q,N=W.default("AutoButton",O.default),[s,m]=u.useState(null),c=u.useRef(null),a=u.useRef({timer:null});z.default({dom:c.current,cb:()=>f()}),u.useEffect(()=>{f()},[o]);const f=()=>{a.current.timer&&clearTimeout(a.current.timer),a.current.timer=setTimeout(()=>{m(o.length),o.length>1&&j()},100)},j=t=>{if(t===null||t===0)return;t===void 0&&(t=o.length);const e=c.current;if(e&&e.scrollWidth>e.clientWidth){const n=Number(t)-1;m(n),j(n)}},_=(t,e,n)=>{if(n){n.onClick&&n.onClick(e);return}t.onClick&&t.onClick(e)},h=(t,e,n)=>r.jsxRuntimeExports.jsx(l.Button,{variant:"text",disabled:t.disabled,loading:t.loading,className:E("item-btn",{"item-btn-disabled":t.disabled}),onClick:i=>{t.disabled||_(t,i,n)},children:r.jsxRuntimeExports.jsx(D.default,{placement:"top-start",children:t[e]})}),b=(t,e,n)=>t.disabled&&t.disabledTooltip?r.jsxRuntimeExports.jsx(I.Tooltip,{disabled:!0,...t.disabledTooltip,children:h(t,e,n)}):h(t,e,n),$=()=>r.jsxRuntimeExports.jsx("div",{className:"auto-button-dropdown-content",style:{maxWidth:M},children:o&&o.map((t,e)=>s!==null&&s>e?null:t.buttonType!=="split"?r.jsxRuntimeExports.jsx(u.Fragment,{children:d(t,b(t,"children"))},e):r.jsxRuntimeExports.jsx(u.Fragment,{children:t.options?.map((n,i)=>Array.isArray(n)?null:r.jsxRuntimeExports.jsx(u.Fragment,{children:d(n,b(n,"label",t))},`${e}-${i}`))},e))}),k=()=>{if(!(s!==null&&o.length>s))return null;const{buttonType:t,icon:e=r.jsxRuntimeExports.jsx(S.MoreVert,{}),children:n=N({id:"more"})}=v||{};let i=r.jsxRuntimeExports.jsx(l.Button,{variant:"outlined",startIcon:e,className:"auto-button-more",children:n});return t==="icon"&&(i=r.jsxRuntimeExports.jsx(l.Button.IconButton,{variant:"outlined",className:"auto-button-more",children:e})),r.jsxRuntimeExports.jsx(w.Dropdown,{overlayClassName:`${g.$prefixCls}-auto-button-dropdown`,overlay:$(),placement:P,trigger:T,children:i})},d=(t,e)=>t.popConfirmProps?r.jsxRuntimeExports.jsx(F.PopConfirm,{...t.popConfirmProps,children:e}):e;return r.jsxRuntimeExports.jsxs("div",{className:E(y,`${g.$prefixCls}-auto-button`),style:C,ref:c,children:[o.map((t,e)=>{if(s!==null&&s<=e)return null;const{buttonType:n,popConfirmProps:i,...A}=t;let p=l.Button;const R={marginRight:s===e+1?0:x};return s!==null&&o.length>s&&(R.marginRight=x),n==="icon"&&(p=l.Button.IconButton),n==="split"&&(p=l.Button.SplitButton),r.jsxRuntimeExports.jsx(u.Fragment,{children:d(t,r.jsxRuntimeExports.jsx(p,{...A,style:R}))},e)}),k()]})};exports.AutoButton=B;exports.default=B;
2
2
  //# sourceMappingURL=index.js.map