@para-ui/core 5.0.0-beta.10 → 5.0.0-beta.12

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 (138) hide show
  1. package/es/Anchor/index.js +15 -15
  2. package/es/Argv/dataGenerator/index.js +1 -1
  3. package/es/Argv/index.js +1 -1
  4. package/es/AutoBox/protal.js +1 -1
  5. package/es/AutoTips/index.js +1 -1
  6. package/es/Cascader/Cascader.js +1 -1
  7. package/es/Cascader/OptionList/Column.js +1 -1
  8. package/es/Cascader/OptionList/index.js +1 -1
  9. package/es/CheckboxGroup/index.js +1 -1
  10. package/es/CodeEditor/index.d.ts +1 -1
  11. package/es/CodeEditor/index.js +19 -19
  12. package/es/ComboSelect/index.js +53 -52
  13. package/es/DatePicker/generatePicker/generateRangePicker.js +1 -1
  14. package/es/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  15. package/es/Desktop/index.js +1 -1
  16. package/es/Drawer/index.js +1 -1
  17. package/es/Dropdown/index.js +1 -1
  18. package/es/DynamicMultiBox/index.js +1 -1
  19. package/es/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  20. package/es/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  21. package/es/FieldForm/Form.js +1 -1
  22. package/es/FieldForm/FormItemInput.js +1 -1
  23. package/es/FieldForm/FormItemLabel.js +1 -1
  24. package/es/Form/index.js +1 -1
  25. package/es/GlobalContext/confirmLocale.js +1 -1
  26. package/es/GlobalContext/index.js +1 -1
  27. package/es/Image/PreviewGroup.js +1 -1
  28. package/es/Image/index.js +1 -1
  29. package/es/InputLang/index.js +1 -1
  30. package/es/Menu/verticalMenuList.js +1 -1
  31. package/es/Modal/Confirm/index.js +1 -1
  32. package/es/PageHeader/horizontalMeun.js +1 -1
  33. package/es/PageHeader/horizontalMeunRight.js +1 -1
  34. package/es/ParauiProvider/index.js +1 -1
  35. package/es/QuickReply/QuickReplyCode/index.js +1 -1
  36. package/es/RangeInput/index.js +19 -19
  37. package/es/Select/index.d.ts +11 -8
  38. package/es/Select/index.js +421 -418
  39. package/es/SelectInput/index.d.ts +4 -4
  40. package/es/SelectInput/index.js +8 -8
  41. package/es/Selector/index.js +52 -47
  42. package/es/Selector/interface.d.ts +1 -1
  43. package/es/Selector/selectorData/index.js +1 -1
  44. package/es/Selector/selectorMain/index.js +1 -1
  45. package/es/Selector/util.d.ts +1 -1
  46. package/es/Selector/util.js +6 -12
  47. package/es/Table/index.js +256 -253
  48. package/es/Table/interface.d.ts +24 -0
  49. package/es/Table/tableHead.js +1 -1
  50. package/es/Table/util.d.ts +1 -1
  51. package/es/Table/util.js +3 -12
  52. package/es/TextEditor/index.js +1 -1
  53. package/es/TextField/index.js +1 -1
  54. package/es/ToggleButton/index.js +1 -1
  55. package/es/Tree/OperateBar/index.js +1 -1
  56. package/es/Tree/Tree.js +3 -3
  57. package/es/Tree/interface.d.ts +1 -1
  58. package/es/Upload/util.js +1 -1
  59. package/es/Utils/snack-kit-shims.d.ts +18 -0
  60. package/es/Utils/snack-kit-shims.js +19 -0
  61. package/es/Utils/type.d.ts +0 -4
  62. package/es/_virtual/index.js +5 -3
  63. package/es/_virtual/index2.js +2 -5
  64. package/es/node_modules/classnames/index.js +1 -1
  65. package/lib/Anchor/index.js +1 -1
  66. package/lib/Argv/batchEdit/index.js +1 -1
  67. package/lib/Argv/dataGenerator/index.js +1 -1
  68. package/lib/Argv/index.js +1 -1
  69. package/lib/AutoBox/protal.js +1 -1
  70. package/lib/AutoTips/index.js +1 -1
  71. package/lib/Cascader/Cascader.js +1 -1
  72. package/lib/Cascader/OptionList/Column.js +1 -1
  73. package/lib/Cascader/OptionList/index.js +1 -1
  74. package/lib/CheckboxGroup/index.js +1 -1
  75. package/lib/CodeEditor/index.d.ts +1 -1
  76. package/lib/CodeEditor/index.js +1 -1
  77. package/lib/ComboSelect/index.js +1 -1
  78. package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
  79. package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  80. package/lib/Desktop/index.js +1 -1
  81. package/lib/Drawer/index.js +1 -1
  82. package/lib/Dropdown/index.js +1 -1
  83. package/lib/DynamicMultiBox/index.js +1 -1
  84. package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  85. package/lib/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  86. package/lib/FieldForm/Form.js +1 -1
  87. package/lib/FieldForm/FormItemInput.js +1 -1
  88. package/lib/FieldForm/FormItemLabel.js +1 -1
  89. package/lib/Form/index.js +1 -1
  90. package/lib/GlobalContext/confirmLocale.js +1 -1
  91. package/lib/GlobalContext/index.js +1 -1
  92. package/lib/Image/PreviewGroup.js +1 -1
  93. package/lib/Image/index.js +1 -1
  94. package/lib/InputCode/index.js +1 -1
  95. package/lib/InputLang/index.js +1 -1
  96. package/lib/Menu/verticalMenuList.js +1 -1
  97. package/lib/Modal/Confirm/index.js +1 -1
  98. package/lib/PageHeader/horizontalMeun.js +1 -1
  99. package/lib/PageHeader/horizontalMeunRight.js +1 -1
  100. package/lib/ParauiProvider/index.js +1 -1
  101. package/lib/QuickReply/QuickReplyCode/index.js +1 -1
  102. package/lib/RangeInput/index.js +1 -1
  103. package/lib/Select/index.d.ts +11 -8
  104. package/lib/Select/index.js +1 -1
  105. package/lib/SelectInput/index.d.ts +4 -4
  106. package/lib/SelectInput/index.js +1 -1
  107. package/lib/Selector/index.js +1 -1
  108. package/lib/Selector/interface.d.ts +1 -1
  109. package/lib/Selector/selectorData/index.js +1 -1
  110. package/lib/Selector/selectorMain/index.js +1 -1
  111. package/lib/Selector/util.d.ts +1 -1
  112. package/lib/Selector/util.js +1 -1
  113. package/lib/Table/index.js +1 -1
  114. package/lib/Table/interface.d.ts +24 -0
  115. package/lib/Table/tableHead.js +1 -1
  116. package/lib/Table/util.d.ts +1 -1
  117. package/lib/Table/util.js +1 -1
  118. package/lib/TextEditor/index.js +1 -1
  119. package/lib/TextField/index.js +1 -1
  120. package/lib/ToggleButton/index.js +1 -1
  121. package/lib/Tree/OperateBar/index.js +2 -2
  122. package/lib/Tree/Tree.js +1 -1
  123. package/lib/Tree/interface.d.ts +1 -1
  124. package/lib/Upload/util.js +1 -1
  125. package/lib/Utils/snack-kit-shims.d.ts +18 -0
  126. package/lib/Utils/snack-kit-shims.js +2 -0
  127. package/lib/Utils/type.d.ts +0 -4
  128. package/lib/_virtual/index.js +1 -1
  129. package/lib/_virtual/index2.js +1 -1
  130. package/lib/node_modules/classnames/index.js +1 -1
  131. package/package.json +3 -2
  132. package/es/_virtual/index3.js +0 -5
  133. package/es/_virtual/index4.js +0 -5
  134. package/es/node_modules/@para-snack/core/dist/index.js +0 -5231
  135. package/lib/_virtual/index3.js +0 -2
  136. package/lib/_virtual/index4.js +0 -2
  137. package/lib/node_modules/@para-snack/core/dist/index.js +0 -20
  138. /package/lib/{InputCode → CodeEditor}/index.css +0 -0
@@ -5,7 +5,7 @@ import { $rcPrefixCls as l, $prefixCls as m } from "../GlobalContext/constant.js
5
5
  import p from "../GlobalContext/usePopupContainer.js";
6
6
  import u from "clsx";
7
7
  import { isolationPopupPollution as c } from "../DatePicker/util.js";
8
- import { UUID as d } from "@paraview/lib";
8
+ import { UUID as d } from "@snack-kit/lib";
9
9
  import './index.css';/* empty css */
10
10
  const g = (o) => ({
11
11
  top: {
@@ -8,7 +8,7 @@ import { PlusCircleF as Fe } from "../node_modules/@para-ui/icons/PlusCircleF/in
8
8
  import { Delete as $e } from "../node_modules/@para-ui/icons/Delete/index.js";
9
9
  import { Drag as Re } from "../node_modules/@para-ui/icons/Drag/index.js";
10
10
  import we from "./rowForm.js";
11
- import { UUID as Le } from "@paraview/lib";
11
+ import { UUID as Le } from "@snack-kit/lib";
12
12
  import { ReactSortable as Te } from "react-sortablejs";
13
13
  import { $prefixCls as ce } from "../GlobalContext/constant.js";
14
14
  import He from "../GlobalContext/useFormatMessage.js";
@@ -1,6 +1,6 @@
1
1
  import { j as t } from "../../_virtual/jsx-runtime.js";
2
2
  import { useContext as M, useMemo as N, useRef as R, useState as V } from "react";
3
- import W from "../../_virtual/index2.js";
3
+ import W from "../../_virtual/index.js";
4
4
  import _ from "rc-util/lib/Dom/isVisible";
5
5
  import q from "rc-util/lib/hooks/useLayoutEffect";
6
6
  import { FormContext as A, NoStyleItemContext as O } from "../context.js";
@@ -4,7 +4,7 @@ import { Loading as g } from "../../node_modules/@para-ui/icons/Loading/index.js
4
4
  import { CheckCircleF as j } from "../../node_modules/@para-ui/icons/CheckCircleF/index.js";
5
5
  import { CloseCircleF as v } from "../../node_modules/@para-ui/icons/CloseCircleF/index.js";
6
6
  import { WarningCircleF as S } from "../../node_modules/@para-ui/icons/WarningCircleF/index.js";
7
- import $ from "../../_virtual/index2.js";
7
+ import $ from "../../_virtual/index.js";
8
8
  import { FormItemInputContext as f } from "../context.js";
9
9
  import { getStatus as M } from "../util.js";
10
10
  const N = {
@@ -1,6 +1,6 @@
1
1
  import { j as i } from "../_virtual/jsx-runtime.js";
2
2
  import { forwardRef as P, useState as S, useContext as T, useMemo as F, useRef as q, useImperativeHandle as w, useEffect as z } from "react";
3
- import V from "../_virtual/index2.js";
3
+ import V from "../_virtual/index.js";
4
4
  import G from "rc-field-form";
5
5
  import { useWatch as ie } from "rc-field-form";
6
6
  import { $prefixCls as H } from "../GlobalContext/constant.js";
@@ -1,6 +1,6 @@
1
1
  import { j as r } from "../_virtual/jsx-runtime.js";
2
2
  import { useContext as p } from "react";
3
- import x from "../_virtual/index2.js";
3
+ import x from "../_virtual/index.js";
4
4
  import g from "./ErrorList.js";
5
5
  import { FormContext as u } from "./context.js";
6
6
  const w = (h) => {
@@ -1,6 +1,6 @@
1
1
  import { j as s } from "../_virtual/jsx-runtime.js";
2
2
  import { useContext as u, useRef as F, useMemo as x, useLayoutEffect as N } from "react";
3
- import R from "../_virtual/index2.js";
3
+ import R from "../_virtual/index.js";
4
4
  import w from "../GlobalContext/index.js";
5
5
  import { FormContext as E } from "./context.js";
6
6
  import S from "../Label/index.js";
package/es/Form/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { j as p } from "../_virtual/jsx-runtime.js";
2
- import { DeepClone as N } from "@paraview/lib";
2
+ import { DeepClone as N } from "@snack-kit/lib";
3
3
  import n from "react";
4
4
  import _ from "../FormItem/index.js";
5
5
  import w from "../FormItem/validateFunction.js";
@@ -1,5 +1,5 @@
1
1
  import c from "../Modal/lang/index.js";
2
- import { GetLanguage as t } from "@paraview/lib";
2
+ import { GetLanguage as t } from "../Utils/snack-kit-shims.js";
3
3
  let o = {
4
4
  ...c.zh
5
5
  };
@@ -1,6 +1,6 @@
1
1
  import r from "react";
2
2
  import { i18nIntl as m } from "./intl.js";
3
- import { GetLanguage as o } from "@paraview/lib";
3
+ import { GetLanguage as o } from "../Utils/snack-kit-shims.js";
4
4
  import { changeConfirmLocale as u, getConfirmLocale as x } from "./confirmLocale.js";
5
5
  const g = r.createContext({
6
6
  language: o(),
@@ -1,6 +1,6 @@
1
1
  import { j as r } from "../_virtual/jsx-runtime.js";
2
2
  import * as f from "react";
3
- import a from "../_virtual/index2.js";
3
+ import a from "../_virtual/index.js";
4
4
  import p from "rc-image";
5
5
  import { $prefixCls as c } from "../GlobalContext/constant.js";
6
6
  import { Sort as x } from "../node_modules/@para-ui/icons/Sort/index.js";
package/es/Image/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { j as r } from "../_virtual/jsx-runtime.js";
2
2
  import * as g from "react";
3
- import s from "../_virtual/index2.js";
3
+ import s from "../_virtual/index.js";
4
4
  import u from "rc-image";
5
5
  import v, { icons as P } from "./PreviewGroup.js";
6
6
  import { $prefixCls as w } from "../GlobalContext/constant.js";
@@ -6,7 +6,7 @@ import { MultiBox as xe } from "../MultiBox/index.js";
6
6
  import ye from "../AutoTips/index.js";
7
7
  import { Popover as je } from "../Popover/index.js";
8
8
  import { Internet as Le } from "../node_modules/@para-ui/icons/Internet/index.js";
9
- import { GetLanguage as Ce, ArrayToObject as Me } from "@paraview/lib";
9
+ import { GetLanguage as Ce, ArrayToObject as Me } from "../Utils/snack-kit-shims.js";
10
10
  import { $prefixCls as g } from "../GlobalContext/constant.js";
11
11
  import Ne from "../Hooks/useGlobalProps.js";
12
12
  import './index.css';/* empty css */
@@ -4,7 +4,7 @@ import { createPortal as Le } from "react-dom";
4
4
  import be from "../CollapseBox/index.js";
5
5
  import { Down as Y } from "../node_modules/@para-ui/icons/Down/index.js";
6
6
  import * as me from "../node_modules/@para-ui/icons/index.js";
7
- import { UUID as Ee, DeepClone as ye } from "@paraview/lib";
7
+ import { UUID as Ee, DeepClone as ye } from "@snack-kit/lib";
8
8
  import { $prefixCls as A } from "../GlobalContext/constant.js";
9
9
  import xe from "../AutoTips/index.js";
10
10
  const de = (d) => {
@@ -7,7 +7,7 @@ import { WarningCircleF as d } from "../../node_modules/@para-ui/icons/WarningCi
7
7
  import { CloseCircleF as R } from "../../node_modules/@para-ui/icons/CloseCircleF/index.js";
8
8
  import j from "clsx";
9
9
  import { Button as f } from "../../Button/index.js";
10
- import { UUID as $ } from "@paraview/lib";
10
+ import { UUID as $ } from "@snack-kit/lib";
11
11
  import "../../GlobalContext/index.js";
12
12
  import { $prefixCls as D } from "../../GlobalContext/constant.js";
13
13
  import './index.css';/* empty css */
@@ -4,7 +4,7 @@ import { Popover as U } from "../Popover/index.js";
4
4
  import { Down as Y } from "../node_modules/@para-ui/icons/Down/index.js";
5
5
  import * as Z from "../node_modules/@para-ui/icons/index.js";
6
6
  import { More as me } from "../node_modules/@para-ui/icons/More/index.js";
7
- import { DeepClone as de } from "@paraview/lib";
7
+ import { DeepClone as de } from "@snack-kit/lib";
8
8
  import { $prefixCls as W } from "../GlobalContext/constant.js";
9
9
  const ee = (p) => {
10
10
  let r = "div";
@@ -6,7 +6,7 @@ import X from "../AutoTips/index.js";
6
6
  import { Down as Y } from "../node_modules/@para-ui/icons/Down/index.js";
7
7
  import { Right as Z } from "../node_modules/@para-ui/icons/Right/index.js";
8
8
  import { $prefixCls as y } from "../GlobalContext/constant.js";
9
- import { UUID as ee, DeepClone as ne } from "@paraview/lib";
9
+ import { UUID as ee, DeepClone as ne } from "@snack-kit/lib";
10
10
  const se = (x) => {
11
11
  const { icon: n, label: d, render: a, onClick: m, className: l } = x, t = (s) => {
12
12
  m && m(s);
@@ -1,7 +1,7 @@
1
1
  import { j as m } from "../_virtual/jsx-runtime.js";
2
2
  import u from "react";
3
3
  import f from "../GlobalContext/index.js";
4
- import { GetLanguage as n } from "@paraview/lib";
4
+ import { GetLanguage as n } from "../Utils/snack-kit-shims.js";
5
5
  import { i18nIntl as s } from "../GlobalContext/intl.js";
6
6
  import '../Styles/index.css';/* empty css */
7
7
  import { changeConfirmLocale as d } from "../GlobalContext/confirmLocale.js";
@@ -13,7 +13,7 @@ import { Plus as me } from "../../node_modules/@para-ui/icons/Plus/index.js";
13
13
  import { Drag as pe } from "../../node_modules/@para-ui/icons/Drag/index.js";
14
14
  import { Delete as he } from "../../node_modules/@para-ui/icons/Delete/index.js";
15
15
  import { EditOutline as fe } from "../../node_modules/@para-ui/icons/EditOutline/index.js";
16
- import { UUID as w } from "@paraview/lib";
16
+ import { UUID as w } from "@snack-kit/lib";
17
17
  import xe from "../../GlobalContext/useFormatMessage.js";
18
18
  import ke from "../lang/index.js";
19
19
  import './index.css';/* empty css */
@@ -1,12 +1,12 @@
1
1
  import { j as n } from "../_virtual/jsx-runtime.js";
2
2
  import { useState as b, useRef as q, useEffect as v } from "react";
3
- import { $prefixCls as i } from "../GlobalContext/constant.js";
3
+ import { $prefixCls as u } from "../GlobalContext/constant.js";
4
4
  import ee from "../Label/index.js";
5
5
  import { InputNumber as H } from "../InputNumber/index.js";
6
6
  import P from "../HelperText/index.js";
7
7
  import re from "clsx";
8
8
  import { Tooltip as ne } from "../Tooltip/index.js";
9
- import { DeepClone as te } from "@paraview/lib";
9
+ import { DeepClone as te } from "@snack-kit/lib";
10
10
  import './index.css';/* empty css */
11
11
  function ge(o) {
12
12
  const {
@@ -27,14 +27,14 @@ function ge(o) {
27
27
  helperText: O = "",
28
28
  separator: Q = "~",
29
29
  unit: j,
30
- placeholder: c,
30
+ placeholder: i,
31
31
  clearable: oe = !1,
32
32
  onFocus: T,
33
33
  onBlur: E,
34
34
  onEnter: I,
35
- onChange: d,
36
- otherProps: f
37
- } = o, [u, m] = b([null, null]), [U, F] = b(!1), [X, N] = b(!1), e = q({
35
+ onChange: c,
36
+ otherProps: d
37
+ } = o, [f, m] = b([null, null]), [U, F] = b(!1), [X, N] = b(!1), e = q({
38
38
  timer: null,
39
39
  swapRafId: null
40
40
  }), $ = q(null);
@@ -45,7 +45,7 @@ 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) => c && c instanceof Array ? c[r] : c, p = (r) => l && l instanceof Array ? l[r] : l, D = (r) => (t) => {
48
+ const A = (r) => i && i instanceof Array ? i[r] : i, p = (r) => l && l instanceof Array ? l[r] : l, D = (r) => (t) => {
49
49
  F(!0), T && T(t, r);
50
50
  }, y = (r) => (t) => {
51
51
  F(!1), E && E(t, r), e.current.swapRafId !== null && cancelAnimationFrame(e.current.swapRafId), e.current.swapRafId = requestAnimationFrame(() => {
@@ -53,10 +53,10 @@ function ge(o) {
53
53
  const a = $.current;
54
54
  if (a && a.contains(document.activeElement))
55
55
  return;
56
- const [g, x] = u;
56
+ const [g, x] = f;
57
57
  if (g !== null && x !== null && g > x) {
58
58
  const W = [x, g];
59
- o.value === void 0 && m(W), d && d(W, -1), w && Y();
59
+ o.value === void 0 && m(W), c && c(W, -1), w && Y();
60
60
  }
61
61
  });
62
62
  }, Y = () => {
@@ -66,20 +66,20 @@ function ge(o) {
66
66
  }, B = (r) => (t) => {
67
67
  I && I(t, r);
68
68
  }, V = (r) => (t) => {
69
- const a = u ? te(u) : [];
70
- a[r] = t, o.value === void 0 && m(a), d && d(a, r);
69
+ const a = te(f);
70
+ a[r] = t, o.value === void 0 && m(a), c && c(a, r);
71
71
  }, M = () => /* @__PURE__ */ n.jsxs("div", { className: "range-input-content", children: [
72
72
  /* @__PURE__ */ n.jsx(
73
73
  H,
74
74
  {
75
- ...f && f[0],
75
+ ...d && d[0],
76
76
  clearable: !0,
77
77
  btnMode: "none",
78
78
  hideErrorDom: !0,
79
79
  placeholder: A(0),
80
80
  disabled: p(0),
81
81
  disabledTooltip: s?.[0],
82
- value: u[0],
82
+ value: f[0],
83
83
  onFocus: D(0),
84
84
  onBlur: y(0),
85
85
  onEnter: B(0),
@@ -90,14 +90,14 @@ function ge(o) {
90
90
  /* @__PURE__ */ n.jsx(
91
91
  H,
92
92
  {
93
- ...f && f[1],
93
+ ...d && d[1],
94
94
  clearable: !0,
95
95
  btnMode: "none",
96
96
  hideErrorDom: !0,
97
97
  placeholder: A(1),
98
98
  disabled: p(1),
99
99
  disabledTooltip: s?.[1],
100
- value: u[1],
100
+ value: f[1],
101
101
  onFocus: D(1),
102
102
  onBlur: y(1),
103
103
  onEnter: B(1),
@@ -132,10 +132,10 @@ function ge(o) {
132
132
  "div",
133
133
  {
134
134
  ref: $,
135
- className: re(S, `${i}-range-input`, `${i}-range-input-${G}`, {
136
- [`${i}-range-input-focus`]: U,
137
- [`${i}-range-input-disabled`]: l === !0 || p(0) && p(1),
138
- [`${i}-range-input-error`]: C
135
+ className: re(S, `${u}-range-input`, `${u}-range-input-${G}`, {
136
+ [`${u}-range-input-focus`]: U,
137
+ [`${u}-range-input-disabled`]: l === !0 || p(0) && p(1),
138
+ [`${u}-range-input-error`]: C
139
139
  }),
140
140
  style: z,
141
141
  children: [
@@ -10,7 +10,7 @@ export interface SelectOption extends SelectOptionBase {
10
10
  children?: SelectOption[];
11
11
  }
12
12
  /** Select 共享 props —— 不含随 multiple 变化的 value/defaultValue/onChange/onEnter/multiple */
13
- export interface SelectBaseProps<T extends SelectOptionValue = SelectOptionValue> extends HelperTextDetailProps {
13
+ export interface SelectBaseProps<T extends SelectOptionValue = SelectOptionValue, Item extends SelectOptionBase = SelectOptionBase> extends HelperTextDetailProps {
14
14
  /** 样式class */
15
15
  className?: string;
16
16
  /** style */
@@ -44,13 +44,13 @@ export interface SelectBaseProps<T extends SelectOptionValue = SelectOptionValue
44
44
  /** 是否必填 */
45
45
  required?: boolean;
46
46
  /** 下拉选项数组 */
47
- list: SelectOption[];
47
+ list: Item[];
48
48
  /**
49
49
  * 自定义渲染
50
50
  * item: 当前想数据
51
51
  * type: true 下拉选项 false 已选项 more: 更多选项
52
52
  * */
53
- renderContent?: (item: SelectOption, type: boolean | 'more') => ReactNode;
53
+ renderContent?: (item: Item, type: boolean | 'more') => ReactNode;
54
54
  /** 下拉选中是否有图标, 默认有 */
55
55
  selectCheckIcon?: boolean;
56
56
  /** 显示名字段 */
@@ -74,7 +74,7 @@ export interface SelectBaseProps<T extends SelectOptionValue = SelectOptionValue
74
74
  /** 更多className */
75
75
  morePopoverClassName?: string;
76
76
  /** 返回输入建议的方法 */
77
- fetchSuggestions?: (val: string, cb: (data: SelectOption[]) => void) => void;
77
+ fetchSuggestions?: (val: string, cb: (data: Item[]) => void) => void;
78
78
  /** 搜索框输入框回车事件 */
79
79
  onEnterInput?: (val: string) => void;
80
80
  /** 点击清空内容回调 */
@@ -85,7 +85,7 @@ export interface SelectBaseProps<T extends SelectOptionValue = SelectOptionValue
85
85
  blurChangeValueBol?: boolean;
86
86
  }
87
87
  /** 单选模式 */
88
- export interface SelectSingleProps<T extends SelectOptionValue = SelectOptionValue> extends SelectBaseProps<T> {
88
+ export interface SelectSingleProps<T extends SelectOptionValue = SelectOptionValue, Item extends SelectOptionBase = SelectOptionBase> extends SelectBaseProps<T, Item> {
89
89
  /** 是否多选(未传或 false 为单选) */
90
90
  multiple?: false;
91
91
  /** 默认值(单选) */
@@ -99,7 +99,7 @@ export interface SelectSingleProps<T extends SelectOptionValue = SelectOptionVal
99
99
  onEnter?: (val: T) => void;
100
100
  }
101
101
  /** 多选模式 */
102
- export interface SelectMultipleProps<T extends SelectOptionValue = SelectOptionValue> extends SelectBaseProps<T> {
102
+ export interface SelectMultipleProps<T extends SelectOptionValue = SelectOptionValue, Item extends SelectOptionBase = SelectOptionBase> extends SelectBaseProps<T, Item> {
103
103
  /** 是否多选 */
104
104
  multiple: true;
105
105
  /** 默认值(多选) */
@@ -115,7 +115,10 @@ export interface SelectMultipleProps<T extends SelectOptionValue = SelectOptionV
115
115
  * Select 的 props
116
116
  * - `multiple` 未传或为 `false`:value / defaultValue 为 `T`,onChange/onEnter 入参为 `T`(清空时 `undefined`)
117
117
  * - `multiple` 为 `true`:value / defaultValue 为 `T[]`,onChange/onEnter 入参为 `T[]`(清空时 `[]`)
118
+ * - 第二个泛型参数 `Item` 描述 `list` 行项的具体类型,默认 `SelectOptionBase`,
119
+ * 可传业务侧 DTO 接口(如 `{ label, value, id, time }`)以承载 `renderContent` /
120
+ * `fetchSuggestions` 的端到端类型推导。
118
121
  */
119
- export type SelectProps<T extends SelectOptionValue = SelectOptionValue> = SelectSingleProps<T> | SelectMultipleProps<T>;
120
- declare function Select<T extends SelectOptionValue = SelectOptionValue>(outerProps: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
122
+ export type SelectProps<T extends SelectOptionValue = SelectOptionValue, Item extends SelectOptionBase = SelectOptionBase> = SelectSingleProps<T, Item> | SelectMultipleProps<T, Item>;
123
+ declare function Select<T extends SelectOptionValue = SelectOptionValue, Item extends SelectOptionBase = SelectOptionBase>(outerProps: SelectProps<T, Item>): import("react/jsx-runtime").JSX.Element;
121
124
  export default Select;