@para-ui/core 5.0.0-beta.11 → 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 (127) 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.js +1 -1
  38. package/es/Selector/index.js +52 -47
  39. package/es/Selector/interface.d.ts +1 -1
  40. package/es/Selector/selectorData/index.js +1 -1
  41. package/es/Selector/selectorMain/index.js +1 -1
  42. package/es/Selector/util.d.ts +1 -1
  43. package/es/Selector/util.js +6 -12
  44. package/es/Table/index.js +256 -253
  45. package/es/Table/interface.d.ts +24 -0
  46. package/es/Table/tableHead.js +1 -1
  47. package/es/Table/util.d.ts +1 -1
  48. package/es/Table/util.js +3 -12
  49. package/es/TextEditor/index.js +1 -1
  50. package/es/TextField/index.js +1 -1
  51. package/es/ToggleButton/index.js +1 -1
  52. package/es/Tree/OperateBar/index.js +1 -1
  53. package/es/Tree/Tree.js +3 -3
  54. package/es/Tree/interface.d.ts +1 -1
  55. package/es/Upload/util.js +1 -1
  56. package/es/Utils/snack-kit-shims.d.ts +18 -0
  57. package/es/Utils/snack-kit-shims.js +19 -0
  58. package/es/_virtual/index.js +5 -3
  59. package/es/_virtual/index2.js +2 -5
  60. package/es/node_modules/classnames/index.js +1 -1
  61. package/lib/Anchor/index.js +1 -1
  62. package/lib/Argv/dataGenerator/index.js +1 -1
  63. package/lib/Argv/index.js +1 -1
  64. package/lib/AutoBox/protal.js +1 -1
  65. package/lib/AutoTips/index.js +1 -1
  66. package/lib/Cascader/Cascader.js +1 -1
  67. package/lib/Cascader/OptionList/Column.js +1 -1
  68. package/lib/Cascader/OptionList/index.js +1 -1
  69. package/lib/CheckboxGroup/index.js +1 -1
  70. package/lib/CodeEditor/index.d.ts +1 -1
  71. package/lib/CodeEditor/index.js +1 -1
  72. package/lib/ComboSelect/index.js +1 -1
  73. package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
  74. package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  75. package/lib/Desktop/index.js +1 -1
  76. package/lib/Drawer/index.js +1 -1
  77. package/lib/Dropdown/index.js +1 -1
  78. package/lib/DynamicMultiBox/index.js +1 -1
  79. package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  80. package/lib/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  81. package/lib/FieldForm/Form.js +1 -1
  82. package/lib/FieldForm/FormItemInput.js +1 -1
  83. package/lib/FieldForm/FormItemLabel.js +1 -1
  84. package/lib/Form/index.js +1 -1
  85. package/lib/GlobalContext/confirmLocale.js +1 -1
  86. package/lib/GlobalContext/index.js +1 -1
  87. package/lib/Image/PreviewGroup.js +1 -1
  88. package/lib/Image/index.js +1 -1
  89. package/lib/InputLang/index.js +1 -1
  90. package/lib/Menu/verticalMenuList.js +1 -1
  91. package/lib/Modal/Confirm/index.js +1 -1
  92. package/lib/PageHeader/horizontalMeun.js +1 -1
  93. package/lib/PageHeader/horizontalMeunRight.js +1 -1
  94. package/lib/ParauiProvider/index.js +1 -1
  95. package/lib/QuickReply/QuickReplyCode/index.js +1 -1
  96. package/lib/RangeInput/index.js +1 -1
  97. package/lib/Select/index.js +1 -1
  98. package/lib/Selector/index.js +1 -1
  99. package/lib/Selector/interface.d.ts +1 -1
  100. package/lib/Selector/selectorData/index.js +1 -1
  101. package/lib/Selector/selectorMain/index.js +1 -1
  102. package/lib/Selector/util.d.ts +1 -1
  103. package/lib/Selector/util.js +1 -1
  104. package/lib/Table/index.js +1 -1
  105. package/lib/Table/interface.d.ts +24 -0
  106. package/lib/Table/tableHead.js +1 -1
  107. package/lib/Table/util.d.ts +1 -1
  108. package/lib/Table/util.js +1 -1
  109. package/lib/TextEditor/index.js +1 -1
  110. package/lib/TextField/index.js +1 -1
  111. package/lib/ToggleButton/index.js +1 -1
  112. package/lib/Tree/OperateBar/index.js +2 -2
  113. package/lib/Tree/Tree.js +1 -1
  114. package/lib/Tree/interface.d.ts +1 -1
  115. package/lib/Upload/util.js +1 -1
  116. package/lib/Utils/snack-kit-shims.d.ts +18 -0
  117. package/lib/Utils/snack-kit-shims.js +2 -0
  118. package/lib/_virtual/index.js +1 -1
  119. package/lib/_virtual/index2.js +1 -1
  120. package/lib/node_modules/classnames/index.js +1 -1
  121. package/package.json +3 -2
  122. package/es/_virtual/index3.js +0 -5
  123. package/es/_virtual/index4.js +0 -5
  124. package/es/node_modules/@para-snack/core/dist/index.js +0 -5231
  125. package/lib/_virtual/index3.js +0 -2
  126. package/lib/_virtual/index4.js +0 -2
  127. package/lib/node_modules/@para-snack/core/dist/index.js +0 -20
@@ -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: [
@@ -3,7 +3,7 @@ import Se, { useRef as Ze, useState as S, useEffect as P, useMemo as B } from "r
3
3
  import Lt from "../Empty/index.js";
4
4
  import Mt from "../Label/index.js";
5
5
  import { Dropdown as Et } from "../Dropdown/index.js";
6
- import { UUID as et, DeepClone as je } from "@paraview/lib";
6
+ import { UUID as et, DeepClone as je } from "@snack-kit/lib";
7
7
  import Ot from "../GlobalContext/index.js";
8
8
  import { Close as tt } from "../node_modules/@para-ui/icons/Close/index.js";
9
9
  import { CloseCircleF as Ft } from "../node_modules/@para-ui/icons/CloseCircleF/index.js";
@@ -3,7 +3,8 @@ import { useState as g, useRef as ur, useEffect as L } from "react";
3
3
  import ir from "./selectorMain/index.js";
4
4
  import lr from "./selectorData/index.js";
5
5
  import { reqFunc as ke } from "./util.js";
6
- import { Cancel as fr, ArrayToObject as dr } from "@paraview/lib";
6
+ import { Cancel as fr } from "@snack-kit/lib";
7
+ import { ArrayToObject as dr } from "../Utils/snack-kit-shims.js";
7
8
  import hr from "../Hooks/useGlobalProps.js";
8
9
  import mr from "../GlobalContext/useFormatMessage.js";
9
10
  import { $prefixCls as B } from "../GlobalContext/constant.js";
@@ -17,7 +18,7 @@ const Cr = (c, x) => ({
17
18
  key: x,
18
19
  type: "type",
19
20
  ...c
20
- }), zr = (c) => {
21
+ }), Vr = (c) => {
21
22
  const {
22
23
  className: x,
23
24
  style: X,
@@ -33,15 +34,15 @@ const Cr = (c, x) => ({
33
34
  defaultValue: re,
34
35
  data: J,
35
36
  pagination: je = !1,
36
- size: M = 10,
37
+ size: w = 10,
37
38
  isLazy: ae = !1,
38
39
  isAllCheck: ve = !0,
39
40
  disabled: y,
40
- disabledChild: Pe,
41
+ disabledChild: Ie,
41
42
  detail: F,
42
43
  detailRender: te,
43
- backDataFieldConfig: Te,
44
- search: Ie,
44
+ backDataFieldConfig: Pe,
45
+ search: Te,
45
46
  searchPlaceholder: ze,
46
47
  searchTrigger: Ve = "onChange",
47
48
  breadcrumbs: Re = !0,
@@ -52,16 +53,16 @@ const Cr = (c, x) => ({
52
53
  groupRange: xe = "search",
53
54
  emptyProps: se,
54
55
  selectRenderItem: He,
55
- selectRender: Me,
56
+ selectRender: we,
56
57
  onChange: oe,
57
- onSelect: w,
58
+ onSelect: A,
58
59
  onSearch: ue,
59
60
  onRefresh: O,
60
61
  error: ie = !1,
61
- hideErrorDom: we = !0,
62
- helperText: Ae = "",
62
+ hideErrorDom: Ae = !0,
63
+ helperText: Me = "",
63
64
  mainHeader: _e
64
- } = hr(c, "Selector"), le = mr("Selector", gr), C = Cr(c.fieldConfig, k), D = { ...C, ...Te }, [fe, A] = g([]), [Ne, _] = g(!1), [v, $e] = g([]), [de, Je] = g({}), [P, S] = g([]), [Fe, T] = g(!1), [Ee, he] = g({ val: "" }), [Oe, K] = g([]), [Ke, me] = g(!1), [Ge, I] = g(!0), [Qe, ge] = g(), e = ur({
65
+ } = hr(c, "Selector"), le = mr("Selector", gr), C = Cr(c.fieldConfig, k), D = { ...C, ...Pe }, [fe, M] = g([]), [Ne, _] = g(!1), [v, $e] = g([]), [de, Je] = g({}), [I, S] = g([]), [Fe, P] = g(!1), [Ee, he] = g({ val: "" }), [Oe, K] = g([]), [Ke, me] = g(!1), [Ge, T] = g(!0), [Qe, ge] = g(), e = ur({
65
66
  /** 对象集合 所有的 */
66
67
  jsonData: {},
67
68
  /** 浅拷贝对象 所有的 */
@@ -75,10 +76,10 @@ const Cr = (c, x) => ({
75
76
  /** 面包屑数据 带根/搜索 */
76
77
  breadcrumbsList: [],
77
78
  /** 接口id */
78
- reqId: Math.random().toString(),
79
+ reqId: "",
79
80
  /** 请求数据 */
80
81
  reqParams: {
81
- size: M,
82
+ size: w,
82
83
  pagination: !1,
83
84
  isLazy: !1
84
85
  },
@@ -95,13 +96,13 @@ const Cr = (c, x) => ({
95
96
  /** 搜索配置 */
96
97
  searchConfig: {
97
98
  page: 1,
98
- size: M,
99
- reqId: Math.random().toString(),
99
+ size: w,
100
+ reqId: "",
100
101
  /** 当前页数据源 本地数据为当前页所有的数据,请求数据为当前展示的数据 */
101
102
  currentSourceData: []
102
103
  }
103
104
  });
104
- e.current.searchConfig.size = M, e.current.reqParams.size = M, e.current.reqParams.pagination = je, e.current.reqParams.isLazy = ae;
105
+ e.current.searchConfig.size = w, e.current.reqParams.size = w, e.current.reqParams.pagination = je, e.current.reqParams.isLazy = ae;
105
106
  const z = c.data || !e.current.reqParams.isLazy && e.current.noLazyReq;
106
107
  L(() => (re !== void 0 && Q(re), () => {
107
108
  e.current.reqTimer && clearTimeout(e.current.reqTimer);
@@ -123,17 +124,19 @@ const Cr = (c, x) => ({
123
124
  0,
124
125
  e.current.page * e.current.reqParams.size
125
126
  );
126
- A(t), e.current.page * e.current.reqParams.size >= r.length ? _(!1) : _(!0);
127
+ M(t), e.current.page * e.current.reqParams.size >= r.length ? _(!1) : _(!0);
127
128
  } else
128
- A(r);
129
- I(!1);
129
+ M(r);
130
+ T(!1);
130
131
  }
131
132
  if (c.url) {
132
133
  const r = {
133
134
  method: ee,
134
135
  url: c.url,
135
136
  ctx: Z,
136
- uuid: e.current.reqId,
137
+ onCancelId: (t) => {
138
+ e.current.reqId = t;
139
+ },
137
140
  data: {
138
141
  parentId: be(),
139
142
  ...c.params
@@ -190,27 +193,27 @@ const Cr = (c, x) => ({
190
193
  let r;
191
194
  return e.current.breadcrumbsList.length > 0 ? r = e.current.breadcrumbsList[e.current.breadcrumbsList.length - 1].value : c.breadcrumbsHead && (r = c.breadcrumbsHead.value), ne && e.current.breadcrumbsList.length === 1 && (r = void 0, c.breadcrumbsHead && (r = c.breadcrumbsHead.value)), r;
192
195
  }, Ce = async (r) => {
193
- I(!0);
194
- const { data: t, err: a } = await ke(r);
196
+ T(!0);
197
+ const { data: t, error: a } = await ke(r);
195
198
  if (a) {
196
- I(!1), e.current.reqParams.isLazy && e.current.reqParams.pagination && e.current.page !== 1 && (e.current.page = e.current.page - 1);
199
+ T(!1), e.current.reqParams.isLazy && e.current.reqParams.pagination && e.current.page !== 1 && (e.current.page = e.current.page - 1);
197
200
  return;
198
201
  }
199
202
  if (c.requestCallback) {
200
203
  c.requestCallback(t, (n) => {
201
- I(!1), ye(n);
204
+ T(!1), ye(n);
202
205
  });
203
206
  return;
204
207
  }
205
- I(!1), ye(t);
208
+ T(!1), ye(t);
206
209
  }, ye = (r) => {
207
210
  if (e.current.reqParams.isLazy)
208
211
  if (e.current.reqParams.pagination) {
209
212
  const t = r.data || {}, a = t.list || [], n = t.total, s = q(a, !0), o = [...e.current.currentSourceData, ...s];
210
- e.current.currentSourceData = o, A(o), e.current.page * e.current.reqParams.size >= n ? _(!1) : _(!0);
213
+ e.current.currentSourceData = o, M(o), e.current.page * e.current.reqParams.size >= n ? _(!1) : _(!0);
211
214
  } else {
212
215
  const t = r.data || [], a = q(t, !0);
213
- e.current.currentSourceData = a, A(a);
216
+ e.current.currentSourceData = a, M(a);
214
217
  }
215
218
  else {
216
219
  e.current.noLazyReq = !0;
@@ -225,8 +228,8 @@ const Cr = (c, x) => ({
225
228
  const a = dr(D.key, t);
226
229
  e.current.selectValueJson = a, Je(a), $e([...t]);
227
230
  }, We = (r, t) => {
228
- let a = [...P];
229
- t && (a = [], e.current.beforeSearchBreadcrumbs === null && (e.current.beforeSearchBreadcrumbs = [...P])), a.push({
231
+ let a = [...I];
232
+ t && (a = [], e.current.beforeSearchBreadcrumbs === null && (e.current.beforeSearchBreadcrumbs = [...I])), a.push({
230
233
  label: r.mainTitle,
231
234
  value: r.key || ""
232
235
  }), S(a);
@@ -247,7 +250,7 @@ const Cr = (c, x) => ({
247
250
  const t = r.key || "";
248
251
  if (b === "radio" && de[t]) return;
249
252
  const a = e.current.selectValueJson[t];
250
- if (!(w && await w(r, b === "radio" ? !0 : !a, !1))) {
253
+ if (!(A && await A(r, b === "radio" ? !0 : !a, !1))) {
251
254
  if (b === "radio") {
252
255
  const n = U(r);
253
256
  V(n, [n], e.current.jsonData[t], e.current.jsonDataCopy[t]);
@@ -279,7 +282,7 @@ const Cr = (c, x) => ({
279
282
  r ? (s[h] = e.current.jsonData[h], o[h] = e.current.jsonDataCopy[h]) : u.indexOf(h) === -1 && (s[h] = e.current.jsonData[h], o[h] = e.current.jsonDataCopy[h], n.push(f));
280
283
  }
281
284
  const l = r ? a : n;
282
- w && await w(d, !!r, !1) || V(l, l, s, o);
285
+ A && await A(d, !!r, !1) || V(l, l, s, o);
283
286
  }, rr = (r) => {
284
287
  if (r) {
285
288
  e.current.searchConfig.page = e.current.searchConfig.page + 1, qe();
@@ -287,7 +290,7 @@ const Cr = (c, x) => ({
287
290
  }
288
291
  e.current.page = e.current.page + 1, ge(Math.random());
289
292
  }, De = () => {
290
- const r = [...P], t = E || {
293
+ const r = [...I], t = E || {
291
294
  label: le({ id: "root" }),
292
295
  // 根
293
296
  value: "_paraui_first_floor"
@@ -299,8 +302,8 @@ const Cr = (c, x) => ({
299
302
  }), ne && r.unshift(t), e.current.breadcrumbsList = r, r;
300
303
  }, ar = (r) => {
301
304
  const t = [];
302
- for (let a = 0, n = P.length; a < n; a++) {
303
- const s = P[a];
305
+ for (let a = 0, n = I.length; a < n; a++) {
306
+ const s = I[a];
304
307
  if (t.push(s), s.value === r.value)
305
308
  break;
306
309
  }
@@ -334,22 +337,22 @@ const Cr = (c, x) => ({
334
337
  e.current.searchConfig.currentSourceData = n, K(n);
335
338
  }
336
339
  }, pe = (r) => {
337
- const { data: t, err: a } = r;
340
+ const { data: t, error: a } = r;
338
341
  if (a) {
339
- T(!1), e.current.reqParams.pagination && e.current.searchConfig.page !== 1 && (e.current.searchConfig.page = e.current.searchConfig.page - 1);
342
+ P(!1), e.current.reqParams.pagination && e.current.searchConfig.page !== 1 && (e.current.searchConfig.page = e.current.searchConfig.page - 1);
340
343
  return;
341
344
  }
342
345
  if (c.requestCallback) {
343
346
  c.requestCallback(
344
347
  t,
345
348
  (n) => {
346
- T(!1), Se(n);
349
+ P(!1), Se(n);
347
350
  },
348
351
  !0
349
352
  );
350
353
  return;
351
354
  }
352
- T(!1), Se(t);
355
+ P(!1), Se(t);
353
356
  }, qe = async () => {
354
357
  if (ue) {
355
358
  const a = {};
@@ -362,7 +365,9 @@ const Cr = (c, x) => ({
362
365
  method: ee,
363
366
  url: c.url || "",
364
367
  ctx: Z,
365
- uuid: e.current.reqId,
368
+ onCancelId: (a) => {
369
+ e.current.reqId = a;
370
+ },
366
371
  data: {
367
372
  searchKey: e.current.searchVal?.trim(),
368
373
  ...c.params
@@ -385,8 +390,8 @@ const Cr = (c, x) => ({
385
390
  };
386
391
  return n(t), a;
387
392
  }, cr = async (r, t) => {
388
- if (T(!0), e.current.searchVal = r, r === "") {
389
- if (K([]), T(!1), e.current.beforeSearchBreadcrumbs) {
393
+ if (P(!0), e.current.searchVal = r, r === "") {
394
+ if (K([]), P(!1), e.current.beforeSearchBreadcrumbs) {
390
395
  if (e.current.breadcrumbsList = [...e.current.beforeSearchBreadcrumbs], S([...e.current.beforeSearchBreadcrumbs]), e.current.beforeSearchBreadcrumbs = null, z) {
391
396
  const a = be(), n = nr(a, e.current.oneDataList);
392
397
  e.current.currentSourceData = n;
@@ -423,7 +428,7 @@ const Cr = (c, x) => ({
423
428
  onClose: sr,
424
429
  selectDataTitleRender: c.selectDataTitleRender,
425
430
  selectRenderItem: He,
426
- selectRender: Me,
431
+ selectRender: we,
427
432
  disabled: y
428
433
  }
429
434
  ), or = () => {
@@ -455,13 +460,13 @@ const Cr = (c, x) => ({
455
460
  isLazy: ae,
456
461
  detail: F,
457
462
  detailRender: te,
458
- search: Ie,
463
+ search: Te,
459
464
  searchTrigger: Ve,
460
465
  searchPlaceholder: ze,
461
466
  searchLoading: Fe,
462
467
  searchVal: Ee,
463
468
  disabled: y,
464
- disabledChild: Pe,
469
+ disabledChild: Ie,
465
470
  loading: Ge,
466
471
  searchLoadMore: Ke,
467
472
  searchList: Oe,
@@ -485,8 +490,8 @@ const Cr = (c, x) => ({
485
490
  br,
486
491
  {
487
492
  error: ie,
488
- helperText: Ae,
489
- hideErrorDom: we
493
+ helperText: Me,
494
+ hideErrorDom: Ae
490
495
  }
491
496
  )
492
497
  ]
@@ -494,7 +499,7 @@ const Cr = (c, x) => ({
494
499
  );
495
500
  };
496
501
  export {
497
- zr as default,
502
+ Vr as default,
498
503
  Cr as handFieldConfig
499
504
  };
500
505
  //# sourceMappingURL=index.js.map
@@ -28,7 +28,7 @@ export interface SearchReqDataProps {
28
28
  * */
29
29
  isTree?: boolean;
30
30
  };
31
- err?: Error | string | null;
31
+ error?: Error | string | null;
32
32
  }
33
33
  /** 面包屑 */
34
34
  export interface BreadcrumbsListItem {
@@ -3,7 +3,7 @@ import { useState as z, useRef as B, useEffect as G } from "react";
3
3
  import H from "../selectorNode/index.js";
4
4
  import K from "../../AutoTips/index.js";
5
5
  import { Close as P } from "../../node_modules/@para-ui/icons/Close/index.js";
6
- import { ArrayToObject as Q } from "@paraview/lib";
6
+ import { ArrayToObject as Q } from "../../Utils/snack-kit-shims.js";
7
7
  import U from "../../GlobalContext/useFormatMessage.js";
8
8
  import { $prefixCls as x } from "../../GlobalContext/constant.js";
9
9
  import V from "../lang/index.js";
@@ -7,7 +7,7 @@ import { Loading as be } from "../../Loading/index.js";
7
7
  import ge from "../../Empty/index.js";
8
8
  import { Search as ke } from "../../node_modules/@para-ui/icons/Search/index.js";
9
9
  import { Refresh as Ce } from "../../node_modules/@para-ui/icons/Refresh/index.js";
10
- import { ArrayToObject as xe } from "@paraview/lib";
10
+ import { ArrayToObject as xe } from "../../Utils/snack-kit-shims.js";
11
11
  import ae from "../../GlobalContext/useFormatMessage.js";
12
12
  import ie from "../lang/index.js";
13
13
  import { $prefixCls as z } from "../../GlobalContext/constant.js";
@@ -12,4 +12,4 @@ export interface ReqFuncProps {
12
12
  * 发送请求
13
13
  * @param obj {ReqFuncProps} 请求信息
14
14
  */
15
- export declare const reqFunc: (obj: ReqFuncProps) => Promise<import('@paraview/lib').ParaResponse> | undefined;
15
+ export declare const reqFunc: (obj: ReqFuncProps) => Promise<import('@snack-kit/lib').HttpResult<unknown>> | undefined;