@para-ui/core 3.0.28 → 3.0.30

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 (140) hide show
  1. package/AutoBox/index.js +48 -88
  2. package/AutoTips/index.js +25 -32
  3. package/Breadcrumbs/index.js +43 -63
  4. package/Button/SplitButton.d.ts +1 -1
  5. package/Button/index.d.ts +1 -1
  6. package/Button/index.js +88 -118
  7. package/ButtonGroup/index.js +27 -36
  8. package/Carousel/index.d.ts +2 -2
  9. package/Carousel/index.js +27 -28
  10. package/Cascader/index.js +52 -64
  11. package/Checkbox/index.js +23 -39
  12. package/CheckboxGroup/index.js +31 -48
  13. package/Collapse/collapsePanel.d.ts +1 -1
  14. package/Collapse/index.d.ts +1 -1
  15. package/Collapse/index.js +9 -29
  16. package/Collapse/util.d.ts +2 -2
  17. package/CollapseBox/index.js +45 -56
  18. package/CollapseLayout/index.js +35 -54
  19. package/ComboSelect/index.js +222 -349
  20. package/ComboSelect/interface.d.ts +3 -3
  21. package/Container/index.js +17 -20
  22. package/DatePicker/generatePicker/index.d.ts +17 -17
  23. package/DatePicker/index.d.ts +4 -4
  24. package/DatePicker/index.js +111 -167
  25. package/Desktop/index.js +62 -173
  26. package/Drawer/index.js +65 -58
  27. package/Drawer/interface.d.ts +7 -3
  28. package/Dropdown/index.d.ts +1 -1
  29. package/Dropdown/index.js +3 -3
  30. package/Empty/index.js +17 -22
  31. package/Form/index.d.ts +1 -1
  32. package/Form/index.js +38 -80
  33. package/FormItem/index.d.ts +1 -1
  34. package/FormItem/index.js +11 -11
  35. package/FormItem/validateFunction.d.ts +1 -1
  36. package/FunctionModal/index.js +11 -11
  37. package/GlobalContext/index.js +3 -3
  38. package/GlobalContext/usePopupContainer.d.ts +1 -1
  39. package/Help/index.js +11 -11
  40. package/HelperText/index.js +11 -12
  41. package/InputLang/index.js +47 -80
  42. package/InputNumber/index.js +65 -100
  43. package/Label/index.js +15 -16
  44. package/Loading/index.js +6 -7
  45. package/Menu/index.js +148 -328
  46. package/Menu/interface.d.ts +2 -2
  47. package/Menu/verticalMenuList.d.ts +1 -1
  48. package/Message/index.d.ts +1 -1
  49. package/Message/index.js +45 -64
  50. package/Modal/Confirm/index.d.ts +2 -2
  51. package/Modal/index.d.ts +1 -1
  52. package/Modal/index.js +119 -152
  53. package/MultiBox/index.js +44 -76
  54. package/Notification/index.d.ts +2 -2
  55. package/Notification/index.js +51 -72
  56. package/OperateBtn/index.js +42 -70
  57. package/PageHeader/index.js +120 -286
  58. package/PageHeader/interface.d.ts +1 -1
  59. package/Pagination/index.d.ts +2 -2
  60. package/Pagination/index.js +79 -131
  61. package/ParauiProvider/index.js +2 -3
  62. package/PasswordRules/index.js +12 -30
  63. package/PopConfirm/index.d.ts +1 -1
  64. package/PopConfirm/index.js +52 -59
  65. package/Popover/index.js +8 -9
  66. package/Progress/index.d.ts +6 -6
  67. package/Progress/index.js +50 -89
  68. package/Querying/index.js +14 -17
  69. package/README.md +813 -800
  70. package/Radio/index.js +21 -33
  71. package/RadioGroup/index.js +32 -47
  72. package/Search/index.js +44 -66
  73. package/Select/index.js +176 -343
  74. package/SelectInput/index.js +8 -9
  75. package/Selector/index.js +285 -681
  76. package/SelectorPicker/index.js +62 -97
  77. package/SingleBox/index.js +30 -55
  78. package/Slider/index.d.ts +1 -1
  79. package/Slider/index.js +29 -41
  80. package/Slider/interface.d.ts +2 -2
  81. package/Split/index.js +10 -23
  82. package/Status/index.js +8 -7
  83. package/Stepper/index.d.ts +1 -1
  84. package/Stepper/index.js +20 -25
  85. package/Styles/form.scss +5 -5
  86. package/Styles/index.scss +37 -37
  87. package/Styles/normalize.scss +348 -348
  88. package/Styles/scrollbar.scss +223 -223
  89. package/Styles/theme.scss +74 -74
  90. package/Switch/index.d.ts +2 -2
  91. package/Switch/index.js +19 -20
  92. package/Table/index.js +568 -1019
  93. package/Table/interface.d.ts +5 -5
  94. package/Tabs/index.d.ts +3 -3
  95. package/Tabs/index.js +47 -65
  96. package/Tag/TagGroup.d.ts +1 -1
  97. package/Tag/index.d.ts +2 -2
  98. package/Tag/index.js +72 -107
  99. package/TextEditor/index.d.ts +2 -2
  100. package/TextEditor/index.js +81 -105
  101. package/TextField/index.js +141 -220
  102. package/TimePicker/index.d.ts +1 -1
  103. package/TimePicker/index.js +12 -15
  104. package/Timeline/index.js +42 -52
  105. package/Title/index.js +10 -9
  106. package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
  107. package/ToggleButton/index.js +50 -70
  108. package/Tooltip/index.js +64 -98
  109. package/Tooltip/interface.d.ts +1 -1
  110. package/Transfer/index.d.ts +1 -1
  111. package/Transfer/index.js +114 -137
  112. package/Transfer/useClick.d.ts +1 -1
  113. package/Tree/index.js +10 -10
  114. package/Tree/interface.d.ts +6 -6
  115. package/Upload/Dragger/index.d.ts +1 -1
  116. package/Upload/ImageUpload/index.d.ts +1 -1
  117. package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
  118. package/Upload/index.d.ts +1 -1
  119. package/Upload/index.js +283 -475
  120. package/Upload/interface.d.ts +2 -2
  121. package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
  122. package/_verture/defineProperty-62acccfc.js +34 -0
  123. package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
  124. package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
  125. package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
  126. package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
  127. package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
  128. package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
  129. package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
  130. package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
  131. package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
  132. package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
  133. package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
  134. package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
  135. package/index.d.ts +2 -4
  136. package/index.js +15 -16
  137. package/package.json +167 -168
  138. package/Test/index.d.ts +0 -3
  139. package/Test/index.js +0 -9
  140. package/_verture/defineProperty-0590dc61.js +0 -16
@@ -1,5 +1,5 @@
1
1
  import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
2
- import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
2
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
3
3
  import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
4
4
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
5
5
  import { useState, useRef, useEffect, useMemo } from 'react';
@@ -11,9 +11,9 @@ import CloseCircle from '@para-ui/icons/CloseCircle';
11
11
  import AutoTips from '../AutoTips/index.js';
12
12
  import { Loading } from '../Loading/index.js';
13
13
  import HelperText from '../HelperText/index.js';
14
- import { u as useGlobalProps } from '../_verture/useGlobalProps-af9a2af6.js';
15
- import { D as Dropdown } from '../_verture/index-bbed73a3.js';
16
- import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
14
+ import { u as useGlobalProps } from '../_verture/useGlobalProps-1b846a65.js';
15
+ import { D as Dropdown } from '../_verture/index-be4faaee.js';
16
+ import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
17
17
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
18
18
  import '../Help/index.js';
19
19
  import '../Tooltip/index.js';
@@ -24,149 +24,133 @@ import '@para-ui/icons/Help';
24
24
  import '@para-ui/icons/LoadingF';
25
25
  import '@para-ui/core/GlobalContext';
26
26
  import 'rc-dropdown';
27
- import '../_verture/usePopupContainer-b8ab7cab.js';
27
+ import '../_verture/usePopupContainer-87febeb9.js';
28
28
  import 'dayjs';
29
29
 
30
30
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-text-field {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n display: inline-block;\n width: 100%;\n}\n.paraui-v3-text-field > .text-field-content {\n border: 1px solid;\n border-radius: 4px;\n border-color: rgba(171, 176, 185, 0.4);\n display: flex;\n width: 100%;\n position: relative;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v3-text-field > .text-field-content:hover {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-before {\n color: rgb(46, 55, 67);\n padding: 0 12px;\n border-right: 1px solid rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-bottom-left-radius: 4px;\n border-top-left-radius: 4px;\n white-space: nowrap;\n display: flex;\n align-items: center;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-before svg {\n font-size: 20px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within {\n position: relative;\n display: flex;\n flex-grow: 1;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n cursor: pointer;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 16px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .clean-up-icon:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n cursor: pointer;\n color: rgba(46, 55, 67, 0.7);\n position: relative;\n z-index: 1;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon.right-icon-password:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .right-icon svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 20px;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .length-limit {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n width: 100%;\n line-height: 0;\n position: relative;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input::-webkit-outer-spin-button,\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input[type=number] {\n -moz-appearance: textfield;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n width: 100%;\n height: 100%;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n width: 100% !important;\n padding: 12px;\n resize: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n font-size: 14px;\n color: rgb(46, 55, 67);\n border: 0;\n border-radius: 4px;\n background: transparent;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input::-ms-clear, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea::-ms-clear {\n display: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input::-ms-reveal, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea::-ms-reveal {\n display: none;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input:disabled, .paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea:disabled {\n background-color: transparent;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n padding: 0 12px;\n color: rgba(46, 55, 67, 0.4);\n cursor: text;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder > .text-field-required {\n margin-left: 2px;\n color: rgb(235, 96, 84);\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-after {\n color: rgb(46, 55, 67);\n padding: 0 12px;\n border-left: 1px solid rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-bottom-right-radius: 4px;\n border-top-right-radius: 4px;\n white-space: nowrap;\n display: flex;\n align-items: center;\n}\n.paraui-v3-text-field > .text-field-content > .text-field-content-after svg {\n font-size: 20px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .clean-up-icon {\n display: none;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .length-limit {\n position: absolute;\n height: 22px;\n bottom: 0;\n border-radius: 4px;\n width: calc(100% - 12px);\n background: white;\n justify-content: flex-end;\n padding-bottom: 8px;\n margin-right: 0;\n}\n.paraui-v3-text-field.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n padding-top: 12px;\n line-height: 1;\n height: calc(100% - 24px);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content:hover {\n border-color: rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-before {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n cursor: not-allowed;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > input, .paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n cursor: not-allowed;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled > .text-field-content > .text-field-content-after {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-disabled.paraui-v3-text-field-multiline > .text-field-content .text-field-content-within > .length-limit {\n background-color: transparent;\n}\n.paraui-v3-text-field.paraui-v3-text-field-error > .text-field-content {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-error > .text-field-content:hover {\n border-color: rgb(235, 96, 84);\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit > .text-field-content {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit > .text-field-content:hover {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-v3-text-field.paraui-v3-text-field-limit-length > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n padding-bottom: 25px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-focus > .text-field-content {\n border-color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content {\n height: 28px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-before {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 6px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-small > .text-field-content .text-field-content-after {\n line-height: 26px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content {\n height: 32px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-before {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 8px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-medium > .text-field-content .text-field-content-after {\n line-height: 30px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content {\n height: 36px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-before {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 10px 12px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-large > .text-field-content .text-field-content-after {\n line-height: 34px;\n}\n.paraui-v3-text-field.paraui-v3-text-field-resize > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n resize: both;\n}\n\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content {\n max-height: 300px;\n overflow: auto;\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item {\n display: flex;\n cursor: pointer;\n color: rgb(46, 55, 67);\n padding: 0 12px;\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item:hover {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content > .text-field-select-content-item.text-field-select-content-item-keydown {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-text-field-select.component-dropdown > .text-field-select-content.text-field-select-content-loading {\n height: 100px;\n position: relative;\n overflow: hidden;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-small > .text-field-select-content > .text-field-select-content-item {\n line-height: 28px;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-medium > .text-field-select-content > .text-field-select-content-item {\n line-height: 32px;\n}\n.paraui-v3-text-field-select.component-dropdown.paraui-v3-text-field-select-large > .text-field-select-content > .text-field-select-content-item {\n line-height: 36px;\n}\n.paraui-v3-text-field-select.paraui-v3-text-field-select-data.component-tooltip {\n padding: 8px 0;\n}";
31
31
  styleInject(css_248z);
32
32
 
33
+ // true:数值型的,false:非数值型
33
34
  var IsNaN = function IsNaN(value) {
34
35
  return typeof value === 'number' && !isNaN(value);
35
36
  };
36
-
37
37
  var TextField = function TextField(props) {
38
38
  var _a = useGlobalProps(props, 'TextField'),
39
- className = _a.className,
40
- style = _a.style,
41
- _a$size = _a.size,
42
- size = _a$size === void 0 ? 'large' : _a$size,
43
- _a$labelMode = _a.labelMode,
44
- labelMode = _a$labelMode === void 0 ? 'outside' : _a$labelMode,
45
- _a$placeholder = _a.placeholder,
46
- placeholder = _a$placeholder === void 0 ? '' : _a$placeholder,
47
- _a$label = _a.label,
48
- label = _a$label === void 0 ? '' : _a$label,
49
- labelTooltip = _a.labelTooltip,
50
- _a$disabled = _a.disabled,
51
- disabled = _a$disabled === void 0 ? false : _a$disabled,
52
- _a$multiline = _a.multiline,
53
- multiline = _a$multiline === void 0 ? false : _a$multiline,
54
- _a$required = _a.required,
55
- required = _a$required === void 0 ? false : _a$required,
56
- labelSign = _a.labelSign,
57
- _a$rows = _a.rows,
58
- rows = _a$rows === void 0 ? 2 : _a$rows,
59
- _a$error = _a.error,
60
- error = _a$error === void 0 ? false : _a$error,
61
- hideErrorDom = _a.hideErrorDom,
62
- _a$helperText = _a.helperText,
63
- helperText = _a$helperText === void 0 ? '' : _a$helperText,
64
- _a$addonBefore = _a.addonBefore,
65
- addonBefore = _a$addonBefore === void 0 ? '' : _a$addonBefore,
66
- _a$addonAfter = _a.addonAfter,
67
- addonAfter = _a$addonAfter === void 0 ? '' : _a$addonAfter;
68
- _a.defaultValue;
69
- var value = _a.value,
70
- _a$autoFocus = _a.autoFocus,
71
- autoFocus = _a$autoFocus === void 0 ? false : _a$autoFocus,
72
- _a$type = _a.type,
73
- type = _a$type === void 0 ? 'text' : _a$type,
74
- onClickIcon = _a.onClickIcon,
75
- rightIcon = _a.rightIcon,
76
- _a$showRightIcon = _a.showRightIcon,
77
- showRightIcon = _a$showRightIcon === void 0 ? true : _a$showRightIcon,
78
- _a$allowClear = _a.allowClear,
79
- allowClear = _a$allowClear === void 0 ? false : _a$allowClear,
80
- limitLength = _a.limitLength,
81
- fetchSuggestions = _a.fetchSuggestions,
82
- selectPopoverClass = _a.selectPopoverClass,
83
- renderSelectItem = _a.renderSelectItem,
84
- _a$showSelectName = _a.showSelectName,
85
- showSelectName = _a$showSelectName === void 0 ? 'value' : _a$showSelectName,
86
- _a$resize = _a.resize,
87
- resize = _a$resize === void 0 ? true : _a$resize,
88
- searchEmpty = _a.searchEmpty,
89
- onBlur = _a.onBlur,
90
- onFocus = _a.onFocus,
91
- onChange = _a.onChange,
92
- onKeydown = _a.onKeydown,
93
- onKeyUp = _a.onKeyUp,
94
- onEnter = _a.onEnter,
95
- onClickAddonBefore = _a.onClickAddonBefore,
96
- onClickAddonAfter = _a.onClickAddonAfter,
97
- onSelect = _a.onSelect,
98
- onClear = _a.onClear,
99
- otherProps = __rest(_a, ["className", "style", "size", "labelMode", "placeholder", "label", "labelTooltip", "disabled", "multiline", "required", "labelSign", "rows", "error", "hideErrorDom", "helperText", "addonBefore", "addonAfter", "defaultValue", "value", "autoFocus", "type", "onClickIcon", "rightIcon", "showRightIcon", "allowClear", "limitLength", "fetchSuggestions", "selectPopoverClass", "renderSelectItem", "showSelectName", "resize", "searchEmpty", "onBlur", "onFocus", "onChange", "onKeydown", "onKeyUp", "onEnter", "onClickAddonBefore", "onClickAddonAfter", "onSelect", "onClear"]);
100
-
39
+ className = _a.className,
40
+ style = _a.style,
41
+ _a$size = _a.size,
42
+ size = _a$size === void 0 ? 'large' : _a$size,
43
+ _a$labelMode = _a.labelMode,
44
+ labelMode = _a$labelMode === void 0 ? 'outside' : _a$labelMode,
45
+ _a$placeholder = _a.placeholder,
46
+ placeholder = _a$placeholder === void 0 ? '' : _a$placeholder,
47
+ _a$label = _a.label,
48
+ label = _a$label === void 0 ? '' : _a$label,
49
+ labelTooltip = _a.labelTooltip,
50
+ _a$disabled = _a.disabled,
51
+ disabled = _a$disabled === void 0 ? false : _a$disabled,
52
+ _a$multiline = _a.multiline,
53
+ multiline = _a$multiline === void 0 ? false : _a$multiline,
54
+ _a$required = _a.required,
55
+ required = _a$required === void 0 ? false : _a$required,
56
+ labelSign = _a.labelSign,
57
+ _a$rows = _a.rows,
58
+ rows = _a$rows === void 0 ? 2 : _a$rows,
59
+ _a$error = _a.error,
60
+ error = _a$error === void 0 ? false : _a$error,
61
+ hideErrorDom = _a.hideErrorDom,
62
+ _a$helperText = _a.helperText,
63
+ helperText = _a$helperText === void 0 ? '' : _a$helperText,
64
+ _a$addonBefore = _a.addonBefore,
65
+ addonBefore = _a$addonBefore === void 0 ? '' : _a$addonBefore,
66
+ _a$addonAfter = _a.addonAfter,
67
+ addonAfter = _a$addonAfter === void 0 ? '' : _a$addonAfter;
68
+ _a.defaultValue;
69
+ var value = _a.value,
70
+ _a$autoFocus = _a.autoFocus,
71
+ autoFocus = _a$autoFocus === void 0 ? false : _a$autoFocus,
72
+ _a$type = _a.type,
73
+ type = _a$type === void 0 ? 'text' : _a$type,
74
+ onClickIcon = _a.onClickIcon,
75
+ rightIcon = _a.rightIcon,
76
+ _a$showRightIcon = _a.showRightIcon,
77
+ showRightIcon = _a$showRightIcon === void 0 ? true : _a$showRightIcon,
78
+ _a$allowClear = _a.allowClear,
79
+ allowClear = _a$allowClear === void 0 ? false : _a$allowClear,
80
+ limitLength = _a.limitLength,
81
+ fetchSuggestions = _a.fetchSuggestions,
82
+ selectPopoverClass = _a.selectPopoverClass,
83
+ renderSelectItem = _a.renderSelectItem,
84
+ _a$showSelectName = _a.showSelectName,
85
+ showSelectName = _a$showSelectName === void 0 ? 'value' : _a$showSelectName,
86
+ _a$resize = _a.resize,
87
+ resize = _a$resize === void 0 ? true : _a$resize,
88
+ searchEmpty = _a.searchEmpty,
89
+ onBlur = _a.onBlur,
90
+ onFocus = _a.onFocus,
91
+ onChange = _a.onChange,
92
+ onKeydown = _a.onKeydown,
93
+ onKeyUp = _a.onKeyUp,
94
+ onEnter = _a.onEnter,
95
+ onClickAddonBefore = _a.onClickAddonBefore,
96
+ onClickAddonAfter = _a.onClickAddonAfter,
97
+ onSelect = _a.onSelect,
98
+ onClear = _a.onClear,
99
+ otherProps = __rest(_a, ["className", "style", "size", "labelMode", "placeholder", "label", "labelTooltip", "disabled", "multiline", "required", "labelSign", "rows", "error", "hideErrorDom", "helperText", "addonBefore", "addonAfter", "defaultValue", "value", "autoFocus", "type", "onClickIcon", "rightIcon", "showRightIcon", "allowClear", "limitLength", "fetchSuggestions", "selectPopoverClass", "renderSelectItem", "showSelectName", "resize", "searchEmpty", "onBlur", "onFocus", "onChange", "onKeydown", "onKeyUp", "onEnter", "onClickAddonBefore", "onClickAddonAfter", "onSelect", "onClear"]);
101
100
  var _useState = useState('text-field-select-content-' + UUID()),
102
- _useState2 = _slicedToArray(_useState, 1),
103
- classSearchOne = _useState2[0]; // 唯一class
104
-
105
-
101
+ _useState2 = _slicedToArray(_useState, 1),
102
+ classSearchOne = _useState2[0]; // 唯一class
106
103
  var _useState3 = useState(true),
107
- _useState4 = _slicedToArray(_useState3, 2),
108
- showText = _useState4[0],
109
- setShowText = _useState4[1]; // 是否显示输入框lable,placeholder true显示
110
-
111
-
104
+ _useState4 = _slicedToArray(_useState3, 2),
105
+ showText = _useState4[0],
106
+ setShowText = _useState4[1]; // 是否显示输入框lable,placeholder true显示
112
107
  var _useState5 = useState(''),
113
- _useState6 = _slicedToArray(_useState5, 2),
114
- valueCom = _useState6[0],
115
- setValueCom = _useState6[1]; // 组件值
116
-
117
-
108
+ _useState6 = _slicedToArray(_useState5, 2),
109
+ valueCom = _useState6[0],
110
+ setValueCom = _useState6[1]; // 组件值
118
111
  var _useState7 = useState(false),
119
- _useState8 = _slicedToArray(_useState7, 2),
120
- isFocus = _useState8[0],
121
- setIsFocus = _useState8[1]; // 是否得到焦点
122
-
123
-
112
+ _useState8 = _slicedToArray(_useState7, 2),
113
+ isFocus = _useState8[0],
114
+ setIsFocus = _useState8[1]; // 是否得到焦点
124
115
  var _useState9 = useState('text'),
125
- _useState10 = _slicedToArray(_useState9, 2),
126
- typeCom = _useState10[0],
127
- setTypeCom = _useState10[1];
128
-
116
+ _useState10 = _slicedToArray(_useState9, 2),
117
+ typeCom = _useState10[0],
118
+ setTypeCom = _useState10[1];
129
119
  var _useState11 = useState(false),
130
- _useState12 = _slicedToArray(_useState11, 2),
131
- open = _useState12[0],
132
- setOpen = _useState12[1]; // 是否打开下拉框
133
-
134
-
120
+ _useState12 = _slicedToArray(_useState11, 2),
121
+ open = _useState12[0],
122
+ setOpen = _useState12[1]; // 是否打开下拉框
135
123
  var _useState13 = useState(false),
136
- _useState14 = _slicedToArray(_useState13, 2),
137
- selectLoading = _useState14[0],
138
- setSelectLoading = _useState14[1]; // 下拉loading
139
-
140
-
124
+ _useState14 = _slicedToArray(_useState13, 2),
125
+ selectLoading = _useState14[0],
126
+ setSelectLoading = _useState14[1]; // 下拉loading
141
127
  var _useState15 = useState([]),
142
- _useState16 = _slicedToArray(_useState15, 2),
143
- selectData = _useState16[0],
144
- setSelectData = _useState16[1]; //const [constData] = useState<ConstDataProps>({});
145
-
146
-
128
+ _useState16 = _slicedToArray(_useState15, 2),
129
+ selectData = _useState16[0],
130
+ setSelectData = _useState16[1];
131
+ //const [constData] = useState<ConstDataProps>({});
147
132
  var inputDom = useRef(null);
148
133
  var selectPosDom = useRef(null); // 下拉框定位元素
149
-
150
134
  useEffect(function () {
151
135
  if (props.defaultValue !== undefined) {
152
136
  setValueCom(props.defaultValue);
153
137
  }
154
- }, []); // 组件类型
155
-
138
+ }, []);
139
+ // 组件类型
156
140
  useEffect(function () {
157
141
  if (type !== typeCom) setTypeCom(type);
158
- }, [type]); // 监听value
159
-
142
+ }, [type]);
143
+ // 监听value
160
144
  useEffect(function () {
161
145
  if (value !== undefined) {
162
146
  setValueCom(value);
163
147
  }
164
- }, [value]); // 监听组件值,判断是否显示placehold,label
165
-
148
+ }, [value]);
149
+ // 监听组件值,判断是否显示placehold,label
166
150
  useEffect(function () {
167
151
  if (valueCom !== '' && valueCom !== undefined) setShowText(false);else setShowText(true);
168
- }, [valueCom]); // 判断是否显示下拉
169
-
152
+ }, [valueCom]);
153
+ // 判断是否显示下拉
170
154
  useEffect(function () {
171
155
  if (!fetchSuggestions) return;
172
156
  setOpen(isFocus);
@@ -177,7 +161,6 @@ var TextField = function TextField(props) {
177
161
  } else {
178
162
  window.removeEventListener("keydown", keydownCom);
179
163
  }
180
-
181
164
  return function () {
182
165
  window.removeEventListener("keydown", keydownCom);
183
166
  };
@@ -186,16 +169,13 @@ var TextField = function TextField(props) {
186
169
  // 失去焦点
187
170
  if (!isFocus && valueCom) {
188
171
  var val = handValueLimit(valueCom);
189
-
190
172
  if (val !== valueCom) {
191
173
  var e = {};
192
174
  e.target = inputDom.current;
193
175
  e.target.value = val;
194
-
195
176
  if (props.value === undefined) {
196
177
  setValueCom(val);
197
178
  }
198
-
199
179
  props.onChange && props.onChange(e);
200
180
  }
201
181
  }
@@ -204,18 +184,14 @@ var TextField = function TextField(props) {
204
184
  * 处理value值
205
185
  * 超出字符长度限制,截取符合长度内容,并且触发onchange事件
206
186
  * */
207
-
208
187
  var handValueLimit = function handValueLimit(val) {
209
188
  var valHand = val;
210
-
211
189
  if (IsNaN(props.limitLength) && val.toString().length > Number(props.limitLength)) {
212
190
  valHand = valHand.toString().substr(0, props.limitLength);
213
191
  }
214
-
215
192
  return valHand;
216
- }; // 点击内标题 / placeholder
217
-
218
-
193
+ };
194
+ // 点击内标题 / placeholder
219
195
  var clickPlaceholder = function clickPlaceholder() {
220
196
  if (disabled) return;
221
197
  setShowText(false);
@@ -232,32 +208,27 @@ var TextField = function TextField(props) {
232
208
  * currentDom: 当前元素
233
209
  * }
234
210
  */
235
-
236
-
237
211
  var handKeydown = function handKeydown(config) {
238
212
  var selectDom = config.selectDom,
239
- keyCode = config.keyCode,
240
- currentDom = config.currentDom;
213
+ keyCode = config.keyCode,
214
+ currentDom = config.currentDom;
241
215
  var brotherDom = currentDom;
242
216
  var type = 'nextSibling';
243
217
  var classSelectStr = '.text-field-select-content-item';
244
-
245
218
  if (keyCode === 38) {
246
219
  // 上
247
220
  type = 'previousSibling';
248
221
  classSelectStr = '.text-field-select-content-item:last-child';
249
222
  }
250
-
251
223
  if (brotherDom) {
252
224
  // 存在键盘上下的元素
253
- brotherDom = brotherDom[type]; // 没有兄弟节点,去最后跟第一的节点
254
-
225
+ brotherDom = brotherDom[type];
226
+ // 没有兄弟节点,去最后跟第一的节点
255
227
  if (!brotherDom) brotherDom = selectDom.querySelector(classSelectStr);
256
228
  } else {
257
229
  // 不存在,默认情况
258
230
  brotherDom = selectDom.querySelector('.text-field-select-content-item');
259
231
  }
260
-
261
232
  if (brotherDom) {
262
233
  brotherDom.classList.add("text-field-select-content-item-keydown");
263
234
  domClientTop(brotherDom, selectDom);
@@ -268,14 +239,10 @@ var TextField = function TextField(props) {
268
239
  * @param currentDom 当前元素
269
240
  * @param selectDom 外容器
270
241
  */
271
-
272
-
273
242
  var domClientTop = function domClientTop(currentDom, selectDom) {
274
243
  var clientHeight = selectDom.clientHeight; // 可见区域的高度
275
-
276
244
  var top = currentDom.offsetTop + currentDom.clientHeight;
277
245
  var difference = top - clientHeight;
278
-
279
246
  if (difference > 0) {
280
247
  selectDom.scrollTop = difference;
281
248
  } else {
@@ -286,13 +253,11 @@ var TextField = function TextField(props) {
286
253
  * 键盘事件
287
254
  * @param e 键盘信息
288
255
  */
289
-
290
-
291
256
  var keydownCom = function keydownCom(e) {
292
257
  var selectDom = document.querySelector('.' + classSearchOne);
293
258
  var currentDom = null;
294
- var keydownDom = selectDom.querySelector('.text-field-select-content-item-keydown'); // 回车
295
-
259
+ var keydownDom = selectDom.querySelector('.text-field-select-content-item-keydown');
260
+ // 回车
296
261
  if (e.keyCode === 13) {
297
262
  if (keydownDom) {
298
263
  var val = keydownDom.dataset.val;
@@ -301,22 +266,19 @@ var TextField = function TextField(props) {
301
266
  dom.blur();
302
267
  }
303
268
  }
304
-
305
269
  if (keydownDom) {
306
270
  currentDom = keydownDom;
307
271
  keydownDom.classList.remove("text-field-select-content-item-keydown");
308
- } // 下
309
-
310
-
272
+ }
273
+ // 下
311
274
  if (e.keyCode === 40) {
312
275
  handKeydown({
313
276
  selectDom: selectDom,
314
277
  keyCode: e.keyCode,
315
278
  currentDom: currentDom
316
279
  });
317
- } // 上
318
-
319
-
280
+ }
281
+ // 上
320
282
  if (e.keyCode === 38) {
321
283
  handKeydown({
322
284
  selectDom: selectDom,
@@ -329,8 +291,6 @@ var TextField = function TextField(props) {
329
291
  * 失去焦点
330
292
  * @param event 失去焦点元素对象
331
293
  */
332
-
333
-
334
294
  var onBlurCom = function onBlurCom(event) {
335
295
  setIsFocus(false);
336
296
  if (event.target.value === '') setShowText(true);
@@ -340,8 +300,6 @@ var TextField = function TextField(props) {
340
300
  * 下拉搜索
341
301
  * @param val 搜索值
342
302
  */
343
-
344
-
345
303
  var fetchSuggestionsCom = function fetchSuggestionsCom(val) {
346
304
  if (fetchSuggestions) {
347
305
  setSelectLoading(true);
@@ -355,8 +313,6 @@ var TextField = function TextField(props) {
355
313
  * 得到焦点
356
314
  * @param event 得到焦点元素
357
315
  */
358
-
359
-
360
316
  var onFocusCom = function onFocusCom(event) {
361
317
  setIsFocus(true);
362
318
  onFocus && onFocus(event);
@@ -366,20 +322,15 @@ var TextField = function TextField(props) {
366
322
  * 改变输入框
367
323
  * @param event 输入框元素
368
324
  */
369
-
370
-
371
325
  var onChangeCom = function onChangeCom(event) {
372
326
  var val = event.target.value;
373
327
  if (val) setShowText(false); // 有值不显示placehold,防止浏览器默认填充
374
-
375
328
  /*if (limitLength && val !== undefined && val !== '' && val.toString().length > limitLength) {
376
329
  return;
377
330
  }*/
378
-
379
331
  if (props.value === undefined) {
380
332
  setValueCom(val);
381
333
  }
382
-
383
334
  onChange && onChange(event);
384
335
  fetchSuggestionsCom(event.target.value);
385
336
  };
@@ -387,8 +338,6 @@ var TextField = function TextField(props) {
387
338
  * 键盘按下事件
388
339
  * @param event 输入框元素
389
340
  */
390
-
391
-
392
341
  var onKeyDownCom = function onKeyDownCom(event) {
393
342
  if (event.keyCode === 13) onEnter && onEnter(event);
394
343
  onKeydown && onKeydown(event);
@@ -397,8 +346,6 @@ var TextField = function TextField(props) {
397
346
  * 键盘抬起事件
398
347
  * @param event 输入框元素
399
348
  */
400
-
401
-
402
349
  var onKeyUpCom = function onKeyUpCom(event) {
403
350
  onKeyUp && onKeyUp(event);
404
351
  };
@@ -406,44 +353,36 @@ var TextField = function TextField(props) {
406
353
  * 点击图标
407
354
  * @param event 图标元素
408
355
  */
409
-
410
-
411
356
  var onClickRightIcon = function onClickRightIcon(event) {
412
357
  if (type === 'password') {
413
358
  if (typeCom === 'text') {
414
359
  setTypeCom('password');
415
360
  }
416
-
417
361
  if (typeCom === 'password') {
418
362
  setTypeCom('text');
419
363
  }
420
364
  }
421
-
422
365
  onClickIcon && onClickIcon(event);
423
366
  };
424
-
425
367
  var handValue = function handValue() {
426
368
  if (props.value === undefined) return valueCom;
427
369
  return value;
428
- }; // 处理下拉框样式
429
-
430
-
370
+ };
371
+ // 处理下拉框样式
431
372
  var handleClassPopover = function handleClassPopover() {
432
373
  var str = "".concat($prefixCls, "-text-field-select ").concat($prefixCls, "-scrollbar-small");
433
374
  if (size) str += " ".concat($prefixCls, "-text-field-select-").concat(size);
434
375
  if (selectPopoverClass) str += ' ' + selectPopoverClass;
435
376
  if (selectData.length > 0) str += " ".concat($prefixCls, "-text-field-select-data");
436
377
  return str;
437
- }; // 点击下拉
438
-
439
-
378
+ };
379
+ // 点击下拉
440
380
  var clickSelectItem = function clickSelectItem(item) {
441
381
  return function (e) {
442
382
  onSelect && onSelect(item);
443
383
  };
444
- }; // 限制长度
445
-
446
-
384
+ };
385
+ // 限制长度
447
386
  var limitMemo = useMemo(function () {
448
387
  return jsx(Fragment, {
449
388
  children: IsNaN(limitLength) && jsx("span", Object.assign({
@@ -452,14 +391,14 @@ var TextField = function TextField(props) {
452
391
  children: (valueCom ? valueCom.toString().length : 0) + '/' + limitLength
453
392
  }))
454
393
  });
455
- }, [limitLength, valueCom]); // 图标
456
-
394
+ }, [limitLength, valueCom]);
395
+ // 图标
457
396
  var rightIconMemo = useMemo(function () {
458
397
  var rightIconFunc = function rightIconFunc() {
459
- return rightIcon ? rightIcon : // 只有密码模式有默认图标
398
+ return rightIcon ? rightIcon :
399
+ // 只有密码模式有默认图标
460
400
  type === 'password' ? typeCom === 'password' ? jsx(VisibilityOff, {}) : jsx(Visibility, {}) : null;
461
401
  };
462
-
463
402
  var rightIconContent = rightIconFunc();
464
403
  return jsx(Fragment, {
465
404
  children: showRightIcon && rightIconContent && jsx("span", Object.assign({
@@ -469,8 +408,8 @@ var TextField = function TextField(props) {
469
408
  children: rightIconContent
470
409
  }))
471
410
  });
472
- }, [showRightIcon, rightIcon, type, typeCom, onClickIcon]); // 输入框
473
-
411
+ }, [showRightIcon, rightIcon, type, typeCom, onClickIcon]);
412
+ // 输入框
474
413
  var renderInputDom = function renderInputDom() {
475
414
  if (multiline) {
476
415
  return jsx("textarea", Object.assign({
@@ -485,7 +424,6 @@ var TextField = function TextField(props) {
485
424
  disabled: disabled
486
425
  }, otherProps));
487
426
  }
488
-
489
427
  return jsx("input", Object.assign({
490
428
  ref: inputDom,
491
429
  type: typeCom,
@@ -497,25 +435,21 @@ var TextField = function TextField(props) {
497
435
  onKeyUp: onKeyUpCom,
498
436
  disabled: disabled
499
437
  }, otherProps));
500
- }; // 点击清楚按钮
501
-
502
-
438
+ };
439
+ // 点击清楚按钮
503
440
  var clickClean = function clickClean() {
504
441
  var target = inputDom.current;
505
442
  target.value = '';
506
-
507
443
  if (props.value === undefined) {
508
444
  setValueCom('');
509
445
  }
510
-
511
446
  onChange && onChange({
512
447
  target: target
513
448
  });
514
449
  fetchSuggestionsCom('');
515
450
  onClear && onClear();
516
- }; // 清空内容
517
-
518
-
451
+ };
452
+ // 清空内容
519
453
  var clearRender = function clearRender() {
520
454
  if (handValue() && !disabled && allowClear) {
521
455
  return jsx("span", Object.assign({
@@ -525,9 +459,8 @@ var TextField = function TextField(props) {
525
459
  children: jsx(CloseCircle, {})
526
460
  }));
527
461
  }
528
- }; // 中间主体
529
-
530
-
462
+ };
463
+ // 中间主体
531
464
  var contentMemo = useMemo(function () {
532
465
  var handPlaceholderCon = function handPlaceholderCon() {
533
466
  if (labelMode === 'outside') return placeholder;
@@ -541,7 +474,6 @@ var TextField = function TextField(props) {
541
474
  })]
542
475
  });
543
476
  };
544
-
545
477
  return jsxs("div", Object.assign({
546
478
  className: "text-field-content-within",
547
479
  ref: selectPosDom
@@ -557,8 +489,8 @@ var TextField = function TextField(props) {
557
489
  }))]
558
490
  })), clearRender(), limitMemo, rightIconMemo]
559
491
  }));
560
- }, [showText, isFocus, autoFocus, typeCom, valueCom, limitMemo, rightIconMemo, labelMode, placeholder, label, disabled, multiline, rows, otherProps, onChange, fetchSuggestions, onClickIcon, allowClear, onClear]); // 搜索下拉内容
561
-
492
+ }, [showText, isFocus, autoFocus, typeCom, valueCom, limitMemo, rightIconMemo, labelMode, placeholder, label, disabled, multiline, rows, otherProps, onChange, fetchSuggestions, onClickIcon, allowClear, onClear]);
493
+ // 搜索下拉内容
562
494
  var selectContentMemo = useMemo(function () {
563
495
  var handSelectContentClass = function handSelectContentClass() {
564
496
  var str = 'text-field-select-content';
@@ -566,15 +498,12 @@ var TextField = function TextField(props) {
566
498
  if (classSearchOne) str += ' ' + classSearchOne;
567
499
  return str;
568
500
  };
569
-
570
501
  var handText = function handText(item) {
571
502
  if (_typeof(item) === 'object' && item !== null) {
572
503
  return item[showSelectName];
573
504
  }
574
-
575
505
  return item;
576
506
  };
577
-
578
507
  return jsxs("div", Object.assign({
579
508
  className: handSelectContentClass(),
580
509
  style: {
@@ -593,8 +522,8 @@ var TextField = function TextField(props) {
593
522
  }), index);
594
523
  }), selectData.length === 0 && searchEmpty, selectLoading && jsx(Loading, {})]
595
524
  }));
596
- }, [selectPosDom, open, selectData, renderSelectItem, showSelectName, onSelect, selectLoading, classSearchOne, searchEmpty]); // 带有搜索的中间主体
597
-
525
+ }, [selectPosDom, open, selectData, renderSelectItem, showSelectName, onSelect, selectLoading, classSearchOne, searchEmpty]);
526
+ // 带有搜索的中间主体
598
527
  var searchContentMemo = useMemo(function () {
599
528
  return jsx(Dropdown, Object.assign({
600
529
  visible: open,
@@ -607,22 +536,18 @@ var TextField = function TextField(props) {
607
536
  }, {
608
537
  children: contentMemo
609
538
  }));
610
- }, [showText, isFocus, autoFocus, typeCom, valueCom, limitMemo, rightIconMemo, labelMode, placeholder, label, disabled, multiline, rows, otherProps, onChange, fetchSuggestions, onSelect, selectPosDom, open, selectPopoverClass, size, onClickIcon, selectData, allowClear, onClear]); // 外标题
611
-
539
+ }, [showText, isFocus, autoFocus, typeCom, valueCom, limitMemo, rightIconMemo, labelMode, placeholder, label, disabled, multiline, rows, otherProps, onChange, fetchSuggestions, onSelect, selectPosDom, open, selectPopoverClass, size, onClickIcon, selectData, allowClear, onClear]);
540
+ // 外标题
612
541
  var outSideMemo = useMemo(function () {
613
542
  var showTag = Boolean(required || labelSign || label);
614
-
615
543
  if (labelMode === 'outside' && showTag) {
616
544
  var handLabelClass = function handLabelClass() {
617
545
  var str = 'text-field-label';
618
-
619
546
  if (labelTooltip && labelTooltip.className) {
620
547
  str += ' ' + labelTooltip.className;
621
548
  }
622
-
623
549
  return str;
624
550
  };
625
-
626
551
  return jsx(Label, Object.assign({
627
552
  label: label,
628
553
  required: required,
@@ -631,10 +556,9 @@ var TextField = function TextField(props) {
631
556
  className: handLabelClass()
632
557
  }));
633
558
  }
634
-
635
559
  return null;
636
- }, [labelMode, label, labelSign, required, labelTooltip]); // 处理class
637
-
560
+ }, [labelMode, label, labelSign, required, labelTooltip]);
561
+ // 处理class
638
562
  var handClass = function handClass() {
639
563
  var str = "".concat($prefixCls, "-text-field");
640
564
  if (className) str += ' ' + className;
@@ -649,18 +573,15 @@ var TextField = function TextField(props) {
649
573
  if (handValue()) str += " ".concat($prefixCls, "-text-field-value");
650
574
  if (allowClear) str += " ".concat($prefixCls, "-text-field-allow-clear");
651
575
  return str;
652
- }; // 点击前缀
653
-
654
-
576
+ };
577
+ // 点击前缀
655
578
  var clickBefore = function clickBefore(event) {
656
579
  onClickAddonBefore && onClickAddonBefore(event);
657
- }; // 点击后缀
658
-
659
-
580
+ };
581
+ // 点击后缀
660
582
  var clickAfter = function clickAfter(event) {
661
583
  onClickAddonAfter && onClickAddonAfter(event);
662
584
  };
663
-
664
585
  return jsxs("div", Object.assign({
665
586
  className: handClass(),
666
587
  style: style