@para-ui/core 1.1.28 → 2.0.2
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.
- package/AutoBox/index.d.ts +1 -0
- package/AutoBox/index.js +3 -3
- package/AutoTips/index.d.ts +1 -0
- package/AutoTips/index.js +3 -3
- package/Breadcrumbs/index.d.ts +1 -0
- package/Breadcrumbs/index.js +2 -2
- package/Button/SplitButton.d.ts +42 -0
- package/Button/index.d.ts +28 -7
- package/Button/index.js +3 -3
- package/ButtonGroup/index.d.ts +13 -18
- package/ButtonGroup/index.js +3 -3
- package/Cascader/index.d.ts +52 -0
- package/Cascader/index.js +16 -0
- package/Checkbox/index.d.ts +23 -7
- package/Checkbox/index.js +3 -3
- package/CheckboxGroup/index.d.ts +5 -2
- package/CheckboxGroup/index.js +3 -3
- package/ColorPicker/index.js +1 -1
- package/ComboSelect/WithTabsCombo/index.d.ts +3 -2
- package/ComboSelect/WithTabsCombo/interface.d.ts +6 -1
- package/ComboSelect/index.d.ts +8 -7
- package/ComboSelect/index.js +5 -3
- package/ComboSelect/interface.d.ts +11 -3
- package/ComboSelect/utils.d.ts +4 -0
- package/Container/index.js +4 -3
- package/DatePicker/index.js +3 -3
- package/Desktop/index.js +5 -3
- package/Drawer/index.d.ts +10 -4
- package/Drawer/index.js +16 -1
- package/Drawer/interface.d.ts +63 -0
- package/Form/index.js +3 -3
- package/FormItem/compoments/formFile/index.d.ts +1 -0
- package/FormItem/index.d.ts +46 -45
- package/FormItem/index.js +3 -3
- package/FunctionModal/index.js +5 -3
- package/Help/index.js +2 -2
- package/IconList/index.js +4 -3
- package/InputLang/index.d.ts +3 -0
- package/InputLang/index.js +3 -3
- package/InputNumber/index.d.ts +12 -32
- package/InputNumber/index.js +3 -3
- package/Menu/footerExpansion.d.ts +4 -4
- package/Menu/index.d.ts +5 -4
- package/Menu/index.js +3 -3
- package/Menu/interface.d.ts +12 -125
- package/Menu/logo.d.ts +4 -4
- package/Menu/verticalMenuList.d.ts +4 -4
- package/Message/index.d.ts +8 -0
- package/Message/index.js +4 -3
- package/Modal/Confirm/index.d.ts +3 -4
- package/Modal/index.d.ts +9 -11
- package/Modal/index.js +3 -3
- package/MultiBox/index.d.ts +3 -0
- package/MultiBox/index.js +3 -3
- package/{Menu/horizontalMeunList.d.ts → PageHeader/horizontalMeun.d.ts} +2 -2
- package/{Menu → PageHeader}/horizontalMeunRight.d.ts +4 -4
- package/PageHeader/index.d.ts +10 -0
- package/PageHeader/index.js +16 -0
- package/PageHeader/interface.d.ts +165 -0
- package/Pagination/index.d.ts +6 -0
- package/Pagination/index.js +3 -3
- package/ParauiProvider/index.d.ts +1 -0
- package/ParauiProvider/index.js +3 -3
- package/PopConfirm/index.d.ts +8 -5
- package/PopConfirm/index.js +3 -3
- package/Popover/index.js +3 -3
- package/Radio/index.d.ts +24 -10
- package/Radio/index.js +3 -3
- package/RadioGroup/index.d.ts +8 -4
- package/RadioGroup/index.js +3 -3
- package/Search/index.d.ts +3 -0
- package/Search/index.js +3 -3
- package/Select/index.d.ts +5 -4
- package/Select/index.js +3 -3
- package/SingleBox/index.d.ts +6 -1
- package/SingleBox/index.js +3 -3
- package/Slider/index.d.ts +13 -2
- package/Slider/index.js +16 -1
- package/Slider/interface.d.ts +100 -0
- package/Split/index.js +4 -3
- package/Stepper/index.d.ts +1 -0
- package/Stepper/index.js +3 -3
- package/Styles/index.scss +3 -8
- package/Styles/normalize.scss +348 -0
- package/Styles/theme.scss +48 -0
- package/Switch/index.d.ts +52 -10
- package/Switch/index.js +3 -3
- package/Table/index.d.ts +1 -0
- package/Table/index.js +3 -3
- package/Table/tableBodyInterface.d.ts +1 -1
- package/Tabs/index.d.ts +9 -9
- package/Tabs/index.js +3 -3
- package/TextField/index.d.ts +4 -5
- package/TextField/index.js +3 -3
- package/TimePicker/index.js +3 -3
- package/Timeline/index.d.ts +8 -7
- package/Timeline/index.js +3 -3
- package/ToggleButton/ToggleButtonGroup.d.ts +44 -0
- package/ToggleButton/index.d.ts +44 -0
- package/ToggleButton/index.js +16 -0
- package/{ToolTip → Tooltip}/index.d.ts +4 -3
- package/Tooltip/index.js +16 -0
- package/Transfer/index.d.ts +17 -0
- package/Transfer/index.js +16 -0
- package/Tree/OperateBar/index.d.ts +11 -2
- package/Tree/index.d.ts +1 -0
- package/Tree/index.js +5 -3
- package/Tree/interface.d.ts +12 -10
- package/Tree/utils/closestPolyfill.d.ts +0 -0
- package/Upload/Dragger/index.d.ts +10 -0
- package/Upload/ErroTip/index.d.ts +13 -0
- package/Upload/ImageUpload/index.d.ts +3 -5
- package/Upload/UploadList/index.d.ts +1 -0
- package/Upload/index.d.ts +11 -9
- package/Upload/index.js +3 -3
- package/Upload/interface.d.ts +22 -14
- package/index.d.ts +5 -1
- package/index.js +3 -3
- package/package.json +8 -2
- package/style.css +100 -0
- package/Breadcrumbs/theme.d.ts +0 -42
- package/Button/theme.d.ts +0 -216
- package/ButtonGroup/SplitButton.d.ts +0 -17
- package/Checkbox/iconMapping.d.ts +0 -2
- package/ComboSelect/styles.d.ts +0 -6
- package/Menu/horizontalMenu.d.ts +0 -9
- package/Menu/verticalFooter.d.ts +0 -9
- package/Menu/verticalMenu.d.ts +0 -9
- package/ParauiProvider/theme/paraTheme.d.ts +0 -3
- package/ParauiProvider/theme/styleConfig.d.ts +0 -74
- package/Radio/iconMapping.d.ts +0 -2
- package/Stepper/theme.d.ts +0 -56
- package/Tabs/theme.d.ts +0 -53
- package/ToolTip/index.js +0 -16
package/RadioGroup/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(r
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.ParaUI=r(require("react")):e.ParaUI=r(e.react)}(self,(function(e){return function(){"use strict";var r,n={4126:function(e){
|
|
2
2
|
/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var
|
|
7
|
+
var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function t(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},n=0;n<10;n++)r["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var i,u,c=t(e),d=1;d<arguments.length;d++){for(var l in i=Object(arguments[d]))n.call(i,l)&&(c[l]=i[l]);if(r){u=r(i);for(var f=0;f<u.length;f++)o.call(i,u[f])&&(c[u[f]]=i[u[f]])}}return c}},9524:function(e,r,n){
|
|
8
8
|
/** @license React v17.0.2
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
10
10
|
*
|
|
@@ -13,4 +13,4 @@ var e=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,t=Object.pr
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
n(4126);var o=n(9297),t=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;t=a("react.element"),a("react.fragment")}var i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function d(e,r,n){var o,a={},d=null,l=null;for(o in void 0!==n&&(d=""+n),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(l=r.ref),r)u.call(r,o)&&!c.hasOwnProperty(o)&&(a[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===a[o]&&(a[o]=r[o]);return{$$typeof:t,type:e,key:d,ref:l,props:a,_owner:i.current}}r.jsx=d,r.jsxs=d},7712:function(e,r,n){e.exports=n(9524)},4296:function(e,r,n){var o=n(7712),t=n(9297),a=function(){return a=Object.assign||function(e){for(var r,n=1,o=arguments.length;n<o;n++)for(var t in r=arguments[n])Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e},a.apply(this,arguments)};r.default=function(e){var r=e.className,n=void 0===r?"":r,i=e.label,u=void 0===i?"":i,c=e.size,d=void 0===c?"large":c,l=e.disabled,f=void 0!==l&&l,s=e.onChange,p=(0,t.useState)(!1),v=p[0],b=p[1];(0,t.useEffect)((function(){void 0!==e.defaultChecked&&b(e.defaultChecked)}),[]),(0,t.useEffect)((function(){void 0!==e.checked&&b(e.checked)}),[e.checked]);var h;return(0,o.jsxs)("label",a({className:(h="paraui-radio",n&&(h+=" "+n),d&&(h+=" radio-"+d),f&&(h+=" radio-disabled"),v&&(h+=" radio-checked"),h),onClick:function(r){r.preventDefault(),f||(void 0===e.checked&&b(!v),r.target.checked=!v,s&&s(r,!v))}},{children:[(0,o.jsxs)("span",a({className:"paraui-radio-box"},{children:[(0,o.jsx)("input",a({type:"radio",value:v},e.inputProps),void 0),(0,o.jsx)("span",{className:"paraui-radio-box-inner"},void 0)]}),void 0),u&&(0,o.jsx)("span",a({className:"paraui-radio-label"},{children:u}),void 0)]}),void 0)}},1383:function(e,r,n){n.r(r),n.d(r,{RadioGroup:function(){return u}});var o=n(9297),t=n(7712),a=n(4296),i=function(){return i=Object.assign||function(e){for(var r,n=1,o=arguments.length;n<o;n++)for(var t in r=arguments[n])Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e},i.apply(this,arguments)},u=function(e){var r=e.className,n=void 0===r?"":r,u=e.label,c=void 0===u?"":u,d=e.size,l=void 0===d?"large":d,f=e.row,s=void 0===f||f,p=e.disabled,v=void 0!==p&&p,b=e.required,h=void 0!==b&&b,y=e.error,O=void 0!==y&&y,j=e.helperText,g=void 0===j?"":j,m=e.id,x=void 0===m?"name":m,k=e.value,_=e.list,w=e.onChange,P=(0,o.useState)(),N=P[0],S=P[1];(0,o.useEffect)((function(){void 0!==e.defaultValue&&S(e.defaultValue)}),[]),(0,o.useEffect)((function(){void 0!==k&&S(k)}),[k]);var E,C=function(r){return function(){var n=r[x];k!==n&&(void 0===e.value&&S(n),w&&w(n,r))}};return(0,t.jsxs)("div",i({className:(E="paraui-radio-group",n&&(E+=" "+n),l&&(E+=" radio-group-"+l),O&&(E+=" radio-group-error"),v&&(E+=" radio-group-disabled"),s&&(E+=" radio-group-row"),E)},{children:[(0,t.jsxs)("label",i({className:"radio-group-label"},{children:[c,h&&(0,t.jsx)("span",i({className:"required-char"},{children:"*"}),void 0)]}),void 0),(0,t.jsx)("div",i({className:"radio-group-content"},{children:_.map((function(e,r){return(0,o.createElement)(a.default,i({},e,{checked:N===e[x],size:l,disabled:Boolean(v||e.disabled),key:r,onChange:C(e)}))}))}),void 0),g&&(0,t.jsx)("p",i({className:"radio-group-error-text"},{children:g}),void 0)]}),void 0)};r.default=u},9297:function(r){r.exports=e}},o={};function t(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return n[e](a,a.exports,t),a.exports}t.m=n,r=[],t.O=function(e,n,o,a){if(!n){var i=1/0;for(d=0;d<r.length;d++){n=r[d][0],o=r[d][1],a=r[d][2];for(var u=!0,c=0;c<n.length;c++)(!1&a||i>=a)&&Object.keys(t.O).every((function(e){return t.O[e](n[c])}))?n.splice(c--,1):(u=!1,a<i&&(i=a));u&&(r.splice(d--,1),e=o())}return e}a=a||0;for(var d=r.length;d>0&&r[d-1][2]>a;d--)r[d]=r[d-1];r[d]=[n,o,a]},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,{a:r}),r},t.d=function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={3799:0,6573:0,9296:0};t.O.j=function(r){return 0===e[r]};var r=function(r,n){var o,a,i=n[0],u=n[1],c=n[2],d=0;for(o in u)t.o(u,o)&&(t.m[o]=u[o]);if(c)var l=c(t);for(r&&r(n);d<i.length;d++)a=i[d],t.o(e,a)&&e[a]&&e[a][0](),e[i[d]]=0;return t.O(l)},n=self.webpackChunkParaUI=self.webpackChunkParaUI||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))}();var a=t.O(void 0,[9296],(function(){return t(1383)}));return a=t.O(a)}()}));
|
package/Search/index.d.ts
CHANGED
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
* @description 搜索框
|
|
5
5
|
*/
|
|
6
6
|
import React, { FunctionComponent, ReactNode } from 'react';
|
|
7
|
+
import './index.scss';
|
|
7
8
|
export interface SearchProps {
|
|
8
9
|
className?: string;
|
|
9
10
|
/** 尺寸 小/中/大 */
|
|
10
11
|
size?: 'small' | 'medium' | 'large';
|
|
11
12
|
/** 输入框placeholder */
|
|
12
13
|
placeholder?: ReactNode;
|
|
14
|
+
/** 默认值 不受控 */
|
|
15
|
+
defaultValue?: string;
|
|
13
16
|
/** 输入框值 */
|
|
14
17
|
value?: string;
|
|
15
18
|
/** 是否显示按钮 */
|
package/Search/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@material-ui/core"),require("@para-ui/icons/CloseCircle"),require("@para-ui/icons/Down"),require("@para-ui/icons/Forbid"),require("@para-ui/icons/LoadingF"),require("@para-ui/icons/PreviewClose"),require("@para-ui/icons/PreviewOpen"),require("@para-ui/icons/Search"),require("para-lib"),require("react")):"function"==typeof define&&define.amd?define(["@material-ui/core","@para-ui/icons/CloseCircle","@para-ui/icons/Down","@para-ui/icons/Forbid","@para-ui/icons/LoadingF","@para-ui/icons/PreviewClose","@para-ui/icons/PreviewOpen","@para-ui/icons/Search","para-lib","react"],n):"object"==typeof exports?exports.ParaUI=n(require("@material-ui/core"),require("@para-ui/icons/CloseCircle"),require("@para-ui/icons/Down"),require("@para-ui/icons/Forbid"),require("@para-ui/icons/LoadingF"),require("@para-ui/icons/PreviewClose"),require("@para-ui/icons/PreviewOpen"),require("@para-ui/icons/Search"),require("para-lib"),require("react")):e.ParaUI=n(e["@material-ui/core"],e["@para-ui/icons/CloseCircle"],e["@para-ui/icons/Down"],e["@para-ui/icons/Forbid"],e["@para-ui/icons/LoadingF"],e["@para-ui/icons/PreviewClose"],e["@para-ui/icons/PreviewOpen"],e["@para-ui/icons/Search"],e["para-lib"],e.react)}(self,(function(e,n,t,o,i,r,a,c,l,s){return function(){"use strict";var u,d={4927:function(e,n,t){function o(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(t=o(e[n]))&&(i&&(i+=" "),i+=t);else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function i(){for(var e,n,t=0,i="";t<arguments.length;)(e=arguments[t++])&&(n=o(e))&&(i&&(i+=" "),i+=n);return i}t.d(n,{Z:function(){return i}})},4126:function(e){
|
|
2
2
|
/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var
|
|
7
|
+
var n=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map((function(e){return n[e]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var a,c,l=i(e),s=1;s<arguments.length;s++){for(var u in a=Object(arguments[s]))t.call(a,u)&&(l[u]=a[u]);if(n){c=n(a);for(var d=0;d<c.length;d++)o.call(a,c[d])&&(l[c[d]]=a[c[d]])}}return l}},9524:function(e,n,t){
|
|
8
8
|
/** @license React v17.0.2
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
10
10
|
*
|
|
@@ -13,4 +13,4 @@ var t=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.pr
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
o(4126);var i=o(9297),n=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;n=r("react.element"),t.Fragment=r("react.fragment")}var l=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,d={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,o){var i,r={},c=null,s=null;for(i in void 0!==o&&(c=""+o),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(s=t.ref),t)a.call(t,i)&&!d.hasOwnProperty(i)&&(r[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===r[i]&&(r[i]=t[i]);return{$$typeof:n,type:e,key:c,ref:s,props:r,_owner:l.current}}t.jsx=c,t.jsxs=c},7712:function(e,t,o){e.exports=o(9524)},115:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(8604),a=o(853),d=function(){return d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},d.apply(this,arguments)},c=((0,a.Z)(),(0,l.makeStyles)((function(e){return(0,l.createStyles)({"auto-tips":{maxWidth:"100%",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > .auto-tips-content":{display:"inline",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})})));t.default=function(e){var t=e.children,o=e.placement,l=void 0===o?"bottom-start":o,a=e.tips,s=void 0===a?"":a,u=e.className,p=void 0===u?"":u,f=(0,n.useRef)(),x=c(),h=(0,n.useState)(""),g=h[0],v=h[1];(0,n.useEffect)((function(){v(s)}),[s]);var b;return(0,i.jsx)("div",d({ref:function(e){e&&(f.current=e)},className:(b=x["auto-tips"],b+=" paraui-auto-tips",p&&(b+=" "+p),b),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?v(g||f.current.innerText):v("")}},{children:(0,i.jsx)(r.Tooltip,d({title:g,placement:l},{children:(0,i.jsx)("div",d({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},5794:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(8604),a=o(4927),d=o(1102),c=o.n(d),s=o(853),u=function(){return u=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},u.apply(this,arguments)},p=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o},f=(0,s.Z)(),x=(0,l.makeStyles)((function(e){return(0,l.createStyles)({"@keyframes loadingCircle":{"100%":{transform:"rotate(1turn)"}},radius:{borderRadius:15},btnIcon:{"& .btn-icon":{display:"inline-flex",alignItems:"center"},"& .btn-icon svg":{color:"currentColor"}},outlinedBtn:{"& .btn-icon svg":{color:f.thmemColor.primary},"&:disabled":{"& .btn-icon svg":{color:"currentColor"}}},iconButtonToolTip:{display:"inline-block",cursor:"not-allowed","& .iconButton-disabled":{cursor:"not-allowed",pointerEvents:"none"}},loadingBtn:{position:"relative",pointerEvents:"none","&:before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:1,transition:"opacity .2s",pointerEvents:"none"},"& .loading-icon":{animation:"$loadingCircle 1s infinite linear"}}})})),h=(0,l.withStyles)((function(e){return{tooltip:{margin:"6px 0",backgroundColor:f.bgBorderColor.bg4}}}))(r.Tooltip),g=function(e){var t=x(),o=e.radius,l=e.className,d=e.disabled,s=void 0!==d&&d,f=e.children,h=e.startIcon,g=e.endIcon,v=e.loading,b=void 0!==v&&v,m=p(e,["radius","className","disabled","children","startIcon","endIcon","loading"]);"text"===m.variant&&(m.disableRipple=!0);var y=(0,n.useState)(!1),w=y[0],C=y[1];return(0,n.useEffect)((function(){C(!!b)}),[b]),(0,i.jsx)(r.Button,u({disabled:s,className:(0,a.Z)("paraui-button",l,t.btnIcon,o&&t.radius,"outlined"===m.variant&&t.outlinedBtn,w&&t.loadingBtn),startIcon:function(){if(!w)return(0,i.jsx)("span",u({className:"btn-icon"},{children:h}),void 0);if("object"==typeof b){var e=b.delay||0;setTimeout((function(){return C(!1)}),e)}return(0,i.jsx)("span",u({className:"btn-icon loading-icon"},{children:(0,i.jsx)(c(),{},void 0)}),void 0)}(),endIcon:(0,i.jsx)("span",u({className:"btn-icon"},{children:g}),void 0)},m,{children:f}),void 0)};g.IconButton=function(e){var t=x(),o=e.showToolTip,l=void 0===o||o,d=e.toolTipTitle,s=void 0===d?"":d,f=e.children,g=e.className,v=e.disabled,b=void 0!==v&&v,m=e.loading,y=void 0!==m&&m,w=e.TooltipProps,C=p(e,["showToolTip","toolTipTitle","children","className","disabled","loading","TooltipProps"]),S=(0,n.useState)(!1),j=S[0],F=S[1],O=(0,i.jsx)(r.IconButton,u({},C,{disabled:b,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",g,l&&b&&"iconButton-disabled",j&&t.loadingBtn)},{children:function(){if(!j)return f;if("object"==typeof y){var e=y.delay||0;setTimeout((function(){return F(!1)}),e)}return(0,i.jsx)("span",u({className:"loading-icon"},{children:(0,i.jsx)(c(),{},void 0)}),void 0)}()}),void 0);return(0,n.useEffect)((function(){F(!!y)}),[y]),l?(0,i.jsx)(h,u({title:s},w,{children:(0,i.jsx)("span",u({className:(0,a.Z)(b&&t.iconButtonToolTip)},{children:O}),void 0)}),void 0):O},t.default=g},853:function(e,t){var o={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};t.Z=function(){return o}},4661:function(e,t,o){var i=o(7712),n=o(9297),r=o(1731),l=o(115),a=o(8528),d=o.n(a),c=o(6570),s=o.n(c),u=o(1102),p=o.n(u),f=o(8604),x=o(853),h=o(3475),g=function(){return g=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},g.apply(this,arguments)},v=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o},b=(0,x.Z)(),m=(0,f.makeStyles)((function(){return(0,f.createStyles)({"@keyframes rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"text-field":{fontFamily:b.fontFamily.zh,display:"inline-block",fontSize:b.standardFont.standardFont1.fontSize,width:"100%",paddingBottom:"20px","& fieldset":{border:0},"& .text-field-error-text":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"& .text-field-label":{color:b.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& .text-field-content":{border:"1px solid",borderColor:b.textColor.thirdary,borderRadius:b.borderRadius,position:"relative",display:"table",width:"100%",boxSizing:"border-box","&:hover":{borderColor:b.thmemColor.primary},"& > div":{display:"table-cell",height:"100%",verticalAlign:"top"},"& .text-field-content-before":{color:b.textColor.primary,padding:"0 10px",borderRight:"1px solid "+b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomLeftRadius:b.borderRadius,borderTopLeftRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}},"& .text-field-content-within":{position:"relative",width:"100%","& > *":{display:"table-cell",verticalAlign:"top"},"& svg":{fontSize:"20px",color:b.textColor.secondary,cursor:"pointer"},"& .right-icon":{zIndex:"1",position:"relative",whiteSpace:"nowrap","& > svg":{marginRight:"10px"}},"& .length-limit":{zIndex:"1",position:"relative",paddingRight:"10px",color:b.textColor.secondary},"& .text-field-content-within-input":{width:"100vw","& > div":{width:"100%"},"& input":{height:"100%"},"& input,textarea":{fontSize:b.standardFont.standardFont1.fontSize,color:b.textColor.primary,"&:-ms-clear":{display:"none"},"&:-ms-reveal":{display:"none"}},"& .text-field-label-placeholder":{width:"100%",position:"absolute",left:"0",height:"100%",padding:"0 10px",boxSizing:"border-box",color:b.textColor.thirdary,cursor:"text",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},"& .text-field-content-after":{color:b.textColor.primary,padding:"0 10px",borderLeft:"1px solid",borderColor:b.textColor.thirdary,backgroundColor:b.bgBorderColor.bg2,borderBottomRightRadius:b.borderRadius,borderTopRightRadius:b.borderRadius,whiteSpace:"nowrap","& svg":{fontSize:"20px",verticalAlign:"top",position:"relative"}}},"& .identification-label":{marginLeft:"3px"},"&.text-field-multiline":{"& .text-field-content":{"& .text-field-content-within":{"& > *":{display:"inline-block"},"& .length-limit":{width:"100%",boxSizing:"border-box",textAlign:"right",paddingBottom:"5px"},"& .text-field-content-within-input":{width:"100%","& > div:first-child":{width:"100%","& > div:first-child":{padding:"10px"}},"& .text-field-label-placeholder":{paddingTop:"10px"}}}}},"&.text-field-disabled":{"& .text-field-content":{backgroundColor:b.bgBorderColor.bg3,"&:hover":{borderColor:b.textColor.thirdary},"& .text-field-content-within":{"& .text-field-content-within-input":{"& .text-field-label-placeholder":{cursor:"not-allowed"},"& input":{cursor:"not-allowed",color:b.textColor.thirdary}}}}},"&.text-field-error":{"& .text-field-error-text":{color:b.stateColor.error},"& .text-field-content":{borderColor:b.stateColor.error,"&:hover":{borderColor:b.stateColor.error},"& .text-field-content-before":{borderColor:b.stateColor.error},"& .text-field-content-after":{borderColor:b.stateColor.error}}},"&.text-field-focus":{"& .text-field-content":{borderColor:b.thmemColor.primary,"& .text-field-content-before":{borderColor:b.thmemColor.primary},"& .text-field-content-after":{borderColor:b.thmemColor.primary}}},"&.text-field-small":{"& .text-field-content":{height:"28px","& .text-field-content-before":{lineHeight:"26px","& svg":{top:"3px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"26px","& > div":{height:"100%"}}},"& input":{padding:"5px 10px"},"& .text-field-label-placeholder":{lineHeight:"26px"},"& .right-icon":{paddingTop:"3px"},"& .length-limit":{lineHeight:"26px"}},"& .text-field-content-after":{lineHeight:"26px","& svg":{top:"3px"}}}},"&.text-field-medium":{"& .text-field-content":{height:"34px","& .text-field-content-before":{lineHeight:"32px","& svg":{top:"6px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"32px","& > div":{height:"100%"}}},"& input":{padding:"8px 10px"},"& .text-field-label-placeholder":{lineHeight:"32px"},"& .right-icon":{paddingTop:"7px"},"& .length-limit":{lineHeight:"32px","& svg":{top:"6px"}}},"& .text-field-content-after":{lineHeight:"32px","& svg":{top:"6px"}}}},"&.text-field-large":{"& .text-field-content":{height:"40px","& .text-field-content-before":{lineHeight:"38px","& svg":{top:"9px"}},"& .text-field-content-within":{"& .text-field-content-within-input":{"& > div":{height:"38px","& > div":{height:"100%"}}},"& input":{padding:"11px 10px"},"& .text-field-label-placeholder":{lineHeight:"38px"},"& .right-icon":{paddingTop:"10px"},"& .length-limit":{lineHeight:"38px"}},"& .text-field-content-after":{lineHeight:"38px","& svg":{top:"9px"}}}}},"text-field-select":{"& > div":{maxWidth:"none",padding:"0",backgroundColor:b.textColor.white,boxShadow:b.boxShadow,borderRadius:b.borderRadius,"& > span":{color:b.textColor.white},"& .text-field-select-content":{maxHeight:"300px",overflow:"auto","& > .text-field-select-content-item":{display:"flex",padding:"7px 10px",cursor:"pointer",lineHeight:"16px",color:b.textColor.secondary,"&:hover":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary},"&.text-field-select-content-item-keydown":{backgroundColor:b.bgBorderColor.bg2,color:b.thmemColor.primary}},"&.text-field-select-content-loading":{height:"100px",position:"relative",overflow:"hidden","& > .loading-box":{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",backgroundColor:"white",display:"flex",justifyContent:"center",alignItems:"center","& > svg":{transition:"all .3s ease-in-out",animation:"$rotate 1s infinite linear",fontSzie:"20px"}}}}}}})}));t.default=function(e){var t=e.className,o=e.size,a=void 0===o?"small":o,c=e.labelMode,u=void 0===c?"outside":c,f=e.placeholder,x=void 0===f?"":f,b=e.label,y=void 0===b?"":b,w=e.disabled,C=void 0!==w&&w,S=e.multiline,j=void 0!==S&&S,F=e.required,O=void 0!==F&&F,k=e.showLabelSign,B=void 0===k||k,E=e.labelSign,N=e.rows,R=void 0===N?2:N,T=e.error,I=void 0!==T&&T,P=e.helperText,L=void 0===P?"":P,z=e.addonBefore,q=void 0===z?"":z,D=e.addonAfter,H=void 0===D?"":D,_=e.value,A=e.controlled,M=void 0!==A&&A,W=e.autoFocus,U=void 0!==W&&W,K=e.type,Z=void 0===K?"text":K,$=e.onClickIcon,Y=e.rightIcon,J=e.showRightIcon,G=void 0===J||J,Q=e.limitLength,V=e.fetchSuggestions,X=e.selectPopoverClass,ee=e.renderSelectItem,te=e.showSelectName,oe=void 0===te?"value":te,ie=e.onBlur,ne=e.onFocus,re=e.onChange,le=e.onKeydown,ae=e.onKeyUp,de=e.onEnter,ce=e.onClickAddonBefore,se=e.onClickAddonAfter,ue=e.onSelect,pe=v(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","showLabelSign","labelSign","rows","error","helperText","addonBefore","addonAfter","value","controlled","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),fe=m(e),xe=(0,n.useState)("text-field-select-content-"+(0,h.UUID)())[0],he=(0,n.useState)(!0),ge=he[0],ve=he[1],be=(0,n.useState)(),me=be[0],ye=be[1],we=(0,n.useState)(!1),Ce=we[0],Se=we[1],je=(0,n.useState)(0),Fe=je[0],Oe=je[1],ke=(0,n.useState)("text"),Be=ke[0],Ee=ke[1],Ne=(0,n.useState)(!1),Re=Ne[0],Te=Ne[1],Ie=(0,n.useState)(!1),Pe=Ie[0],Le=Ie[1],ze=(0,n.useState)([]),qe=ze[0],De=ze[1],He=((0,n.useState)({})[0],(0,n.useRef)(null)),_e=(0,n.useRef)(null),Ae=(0,n.useRef)(null);(0,n.useEffect)((function(){He&&He.current&&Oe(He.current.offsetWidth)}),[]),(0,n.useEffect)((function(){Z!==Be&&Ee(Z)}),[Z]),(0,n.useEffect)((function(){ye(_)}),[_]),(0,n.useEffect)((function(){ve(""===me||void 0===me)}),[me]),(0,n.useEffect)((function(){V&&Te(Ce)}),[Ce,V]),(0,n.useEffect)((function(){return Re?window.addEventListener("keydown",Ze):window.removeEventListener("keydown",Ze),function(){window.removeEventListener("keydown",Ze)}}),[Re]);var Me,We=function(){C||(ve(!1),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).focus())},Ue=function(e){var t=e.selectDom,o=e.keyCode,i=e.currentDom,n="nextSibling",r=".text-field-select-content-item";38===o&&(n="previousSibling",r=".text-field-select-content-item:last-child"),i?(i=i[n])||(i=t.querySelector(r)):i=t.querySelector(".text-field-select-content-item"),i&&(i.classList.add("text-field-select-content-item-keydown"),Ke(i,t))},Ke=function(e,t){var o=t.clientHeight,i=e.offsetTop+e.clientHeight-o;t.scrollTop=i>0?i:0},Ze=function(e){var t=document.querySelector("."+xe),o=null,i=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&i){var n=i.dataset.val;tt(JSON.parse(n))(e),(_e&&_e.current&&_e.current.querySelector(j?"textarea":"input")).blur()}i&&(o=i,i.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o}),38===e.keyCode&&Ue({selectDom:t,keyCode:e.keyCode,currentDom:o})},$e=function(e){Se(!1),""===e.target.value&&ve(!0),ie&&ie(e)},Ye=function(e){Le(!0),V&&V(e,(function(e){De(e||[]),Le(!1)}))},Je=function(e){Se(!0),ne&&ne(e),Ye(e.target.value)},Ge=function(e){var t=e.target.value;Q&&void 0!==t&&""!==t&&t.toString().length>Q||(M||ye(t),re&&re(e),Ye(e.target.value))},Qe=function(e){13===e.keyCode&&de&&de(e),le&&le(e)},Ve=function(e){ae&&ae(e)},Xe=function(e){"password"===Z&&("text"===Be&&Ee("password"),"password"===Be&&Ee("text")),$&&$(e)},et=function(){Te(!1)},tt=function(e){return function(t){ue&&ue(e)}},ot=(0,n.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:void 0!==Q&&(0,i.jsx)("span",g({className:"length-limit"},{children:(me?me.toString().length:0)+"/"+Q}),void 0)},void 0)}),[Q,me]),it=(0,n.useMemo)((function(){return(0,i.jsx)(i.Fragment,{children:G&&(0,i.jsx)("span",g({className:"right-icon",onClick:Xe},{children:Y||("password"===Z?"password"===Be?(0,i.jsx)(s(),{},void 0):(0,i.jsx)(d(),{},void 0):null)}),void 0)},void 0)}),[G,Y,Z,Be]),nt=(0,n.useMemo)((function(){return(0,i.jsxs)("div",g({className:"text-field-content-within",ref:Ae},{children:[(0,i.jsxs)("div",g({className:"text-field-content-within-input"},{children:[(0,i.jsx)(r.TextField,g({size:"small",variant:"outlined",autoFocus:U,ref:_e,type:Be,value:me||"",disabled:C,multiline:j,rows:R,onBlur:$e,onFocus:Je,onChange:Ge,onKeyDown:Qe,onKeyUp:Ve},pe),void 0),ge&&(0,i.jsx)("span",g({className:"text-field-label-placeholder",onClick:We},{children:"outside"===u?x:(0,i.jsxs)(i.Fragment,{children:[y||x,B&&(0,i.jsx)("span",g({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]},void 0)}),void 0)]}),void 0),ot,it]}),void 0)}),[ge,U,Be,me,ot,it,u,x,y,C,j,R,pe,re,V]),rt=(0,n.useMemo)((function(){var e;return(0,i.jsxs)("div",g({className:(e="text-field-select-content",Pe&&(e+=" text-field-select-content-loading"),xe&&(e+=" "+xe),e),style:{width:(Ae&&Ae.current?Ae.current.offsetWidth:0)+"px"}},{children:[qe&&qe.map((function(e,t){return(0,i.jsx)("div",g({className:"text-field-select-content-item",onMouseDown:tt(e),"data-val":JSON.stringify(e)},{children:ee?ee(e):(0,i.jsx)(l.default,{children:e[oe]},void 0)}),t)})),Pe&&(0,i.jsx)("div",g({className:"loading-box"},{children:(0,i.jsx)(p(),{},void 0)}),void 0)]}),void 0)}),[Ae,Re,qe,ee,oe,ue,Pe,xe]),lt=(0,n.useMemo)((function(){return(0,i.jsx)(r.Tooltip,g({open:Re,title:rt,onClose:et,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e=fe["text-field-select"],X&&(e+=" "+X),e)}},{children:nt}),void 0);var e}),[ge,U,Be,me,ot,it,u,x,y,C,j,R,pe,re,V,ue,Ae,Re,X]),at=(0,n.useMemo)((function(){var e=Boolean(B&&(E||O));if("outside"===u&&(y||e))return(0,i.jsxs)("label",g({className:"text-field-label"},{children:[y,B&&(0,i.jsx)("span",g({className:"identification-label"},{children:E||(0,i.jsx)(i.Fragment,{children:O?"(必填)":""},void 0)}),void 0)]}),void 0)}),[u,y,B,E,O]);return(0,i.jsxs)("div",g({className:(Me=fe["text-field"],Me+=" text-field",a&&!j&&(Me+=" text-field-"+a),t&&(Me+=" "+t),I&&(Me+=" text-field-error"),Ce&&(Me+=" text-field-focus"),C&&(Me+=" text-field-disabled"),j&&(Me+=" text-field-multiline"),Me)},{children:[at,(0,i.jsxs)("div",g({className:"text-field-content"},{children:[q&&(0,i.jsx)("div",g({className:"text-field-content-before",ref:He,onClick:function(e){ce&&ce(e)}},{children:q}),void 0),V?lt:nt,H&&(0,i.jsx)("div",g({className:"text-field-content-after",onClick:function(e){se&&se(e)}},{children:H}),void 0)]}),void 0),L&&(0,i.jsx)("p",g({className:"text-field-error-text",style:{marginLeft:Fe+"px"}},{children:L}),void 0)]}),void 0)}},1731:function(e){e.exports=t},8604:function(e){e.exports=o},6088:function(e){e.exports=a},1102:function(e){e.exports=r},6570:function(e){e.exports=n},8528:function(e){e.exports=i},4115:function(e){e.exports=d},3475:function(e){e.exports=l},9297:function(t){t.exports=e}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return c[e](o,o.exports,u),o.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var o in t)u.o(t,o)&&!u.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return function(){u.r(p),u.d(p,{Search:function(){return h}});var e=u(7712),t=u(9297),o=u(4661),i=u(5794),n=u(6088),r=u.n(n),l=u(4115),a=u.n(l),d=u(8604),c=u(853),s=function(){return s=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)},f=(0,c.Z)(),x=(0,d.makeStyles)((function(){return(0,d.createStyles)({search:{display:"flex","& > .text-field":{padding:0,"& > .text-field-content":{"& > .text-field-content-within":{"& > .right-icon":{"& > svg":{fontSize:"16px",position:"relative",top:"2px",color:f.textColor.thirdary},"&:hover":{"& > svg":{color:f.thmemColor.primary}}}}}},"& > button":{minWidth:"auto",whiteSpace:"nowrap",boxShadow:"none",padding:"0 7px",lineHeight:"0","&:hover":{backgroundColor:f.thmemColor.secondary,boxShadow:"none"},"& > span:first-child":{"& > span":{marginRight:"0px",marginLeft:"0px","& > svg":{color:"white"}}}},"&.search-outside":{"& > button":{marginLeft:"10px"}},"&.search-inside":{"& > .text-field":{"& > .text-field-content":{}},"& > button":{borderTopLeftRadius:"0",borderBottomLeftRadius:"0"}},"&.search-showbtn":{"&.search-inside":{"& > .text-field":{"& > .text-field-content":{borderTopRightRadius:"0",borderBottomRightRadius:"0",borderRight:"0"}}}},"&.search-btntext":{"& > button":{"& > span:first-child":{"& > span":{marginRight:"5px"}}}},"&.search-small":{"& > button":{height:"28px"}},"&.search-medium":{"& > button":{height:"34px"}},"&.search-large":{"& > button":{height:"40px"}}}})})),h=function(n){var l=n.className,d=void 0===l?"":l,c=n.size,u=void 0===c?"small":c,p=n.btnType,f=void 0===p?"outside":p,h=n.showBtn,g=void 0===h||h,v=n.btnIcon,b=n.btnText,m=void 0===b?"":b,y=n.placeholder,w=void 0===y?"":y,C=n.value,S=void 0===C?"":C,j=n.rightIcon,F=n.showRightIcon,O=void 0===F||F,k=n.onChange,B=n.onBlur,E=n.onFocus,N=n.onKeydown,R=n.onKeyUp,T=n.onClickBtn,I=n.onClickRightIcon,P=n.onEnter,L=x(n),z=(0,t.useState)(""),q=z[0],D=z[1];(0,t.useEffect)((function(){q!==S&&D(S)}),[S]);var H;return(0,e.jsxs)("div",s({className:(H=L.search,H+=" paraui-search",d&&(H+=" "+d),u&&(H+=" search-"+u),f&&(H+=" search-"+f),g&&(H+=" search-showbtn"),m&&(H+=" search-btntext"),H)},{children:[(0,e.jsx)(o.default,{size:u,placeholder:w,value:q,rightIcon:O?j||(0,e.jsx)(r(),{},void 0):"",onClickIcon:function(){I&&I(q)},onChange:function(e){var t=e.target.value;D(t),k&&k(t,e)},onBlur:B,onFocus:E,onKeydown:N,onKeyUp:R,onEnter:P},void 0),g&&(0,e.jsx)(i.default,s({startIcon:v||(0,e.jsx)(a(),{},void 0),variant:"contained",onClick:function(){T&&T(q)}},{children:m}),void 0)]}),void 0)};p.default=h}(),p}()}));
|
|
16
|
+
t(4126);var o=t(9297),i=60103;if(n.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;i=r("react.element"),n.Fragment=r("react.fragment")}var a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,t){var o,r={},s=null,u=null;for(o in void 0!==t&&(s=""+t),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(u=n.ref),n)c.call(n,o)&&!l.hasOwnProperty(o)&&(r[o]=n[o]);if(e&&e.defaultProps)for(o in n=e.defaultProps)void 0===r[o]&&(r[o]=n[o]);return{$$typeof:i,type:e,key:s,ref:u,props:r,_owner:a.current}}n.jsx=s,n.jsxs=s},7712:function(e,n,t){e.exports=t(9524)},3094:function(e,n,t){var o=t(7712),i=t(9297),r=t(1731),a=function(){return a=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},a.apply(this,arguments)};n.default=function(e){var n=e.children,t=e.placement,c=void 0===t?"bottom-start":t,l=e.tips,s=void 0===l?"":l,u=e.className,d=void 0===u?"":u,f=(0,i.useRef)(),p=(0,i.useState)(""),v=p[0],h=p[1];(0,i.useEffect)((function(){h(s)}),[s]);var b;return(0,o.jsx)("div",a({ref:function(e){e&&(f.current=e)},className:(b="paraui-auto-tips",d&&(b+=" "+d),b),onMouseOver:function(){f.current.scrollWidth>f.current.offsetWidth?h(v||f.current.innerText):h("")}},{children:(0,o.jsx)(r.Tooltip,a({title:v,placement:c},{children:(0,o.jsx)("div",a({className:"auto-tips-content"},{children:n}),void 0)}),void 0)}),void 0)}},2990:function(e,n,t){t.d(n,{default:function(){return m}});var o=t(7712),i=t(9297),r=t(1731),a=t(4927),c=t(1102),l=t.n(c),s=t(2749),u=t.n(s),d=t(6885),f=t(6028),p=t.n(f),v=function(){return v=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},v.apply(this,arguments)};var h=function(){return h=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},h.apply(this,arguments)},b=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t},x=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,s=void 0===c?"large":c,f=e.className,p=e.disabled,v=void 0!==p&&p,x=e.children,m=e.startIcon,y=e.endIcon,g=e.loading,j=void 0!==g&&g,w=e.toolTipTitle,O=void 0===w?"":w,S=e.danger,C=void 0!==S&&S,N=b(e,["variant","size","className","disabled","children","startIcon","endIcon","loading","toolTipTitle","danger"]),k=(0,i.useState)(!1),P=k[0],I=k[1],E=function(e){if(!P)return"start"===e&&m?(0,o.jsx)("span",h({className:(0,a.Z)("btn-icon","start-icon")},{children:m}),void 0):"end"===e&&y?(0,o.jsx)("span",h({className:(0,a.Z)("btn-icon","end-icon")},{children:y}),void 0):null;if("object"==typeof j){var n=j.delay||0;setTimeout((function(){return I(!1)}),n)}return"start"===e?(0,o.jsx)("span",h({className:"btn-icon loading-icon"},{children:(0,o.jsx)(l(),{},void 0)}),void 0):null},T=(0,o.jsx)(r.Button,h({},N,{color:"default",variant:"outlined",disabled:v,disableRipple:!0,disableElevation:!0,className:(0,a.Z)("paraui-button",f,"paraui-button-".concat(t),"paraui-button-".concat(s),P&&"paraui-button-loading",C&&!v&&"paraui-button-dangerous"),startIcon:E("start"),endIcon:E("end")},{children:x}),void 0);return(0,i.useEffect)((function(){I(!!j)}),[j]),v&&O?(0,o.jsx)(d.default,h({title:function(){if(v&&O){return(0,o.jsxs)("span",{children:[(0,o.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),O]},void 0)}return O}()},{children:(0,o.jsx)("span",h({className:"paraui-button--disabled"},{children:T}),void 0)}),void 0):T};x.IconButton=function(e){var n=e.variant,t=void 0===n?"contained":n,c=e.size,s=void 0===c?"large":c,f=e.toolTipTitle,p=void 0===f?"":f,v=e.children,x=e.className,m=e.disabled,y=void 0!==m&&m,g=e.loading,j=void 0!==g&&g,w=e.TooltipProps,O=e.danger,S=void 0!==O&&O,C=b(e,["variant","size","toolTipTitle","children","className","disabled","loading","TooltipProps","danger"]),N=(0,i.useState)(!1),k=N[0],P=N[1],I=(0,o.jsx)(r.IconButton,h({},C,{disabled:y,disableRipple:!0,className:(0,a.Z)("paraui-icon-button",x,"paraui-icon-button-".concat(t),"paraui-icon-button-".concat(s),k&&"paraui-icon-button-loading",S&&!y&&"paraui-icon-button-dangerous")},{children:function(){if(!k)return v;if("object"==typeof j){var e=j.delay||0;setTimeout((function(){return P(!1)}),e)}return(0,o.jsx)("span",h({className:"loading-icon"},{children:(0,o.jsx)(l(),{},void 0)}),void 0)}()}),void 0);return(0,i.useEffect)((function(){P(!!j)}),[j]),p?(0,o.jsx)(d.default,h({},w,{title:function(){if(y&&p){return(0,o.jsxs)("span",{children:[(0,o.jsx)(u(),{style:{marginRight:"4px",fontSize:"11px",color:"inherit"}},void 0),p]},void 0)}return p}()},{children:y?(0,o.jsx)("span",h({className:"paraui-button--disabled"},{children:I}),void 0):I}),void 0):I},x.SplitButton=function(e){var n=e.buttonText,t=e.options,c=void 0===t?[]:t,l=e.className,s=e.disabled,u=void 0!==s&&s,d=e.onClick,f=e.optionRender,h=(0,i.useState)(!1),b=h[0],x=h[1],y=(0,i.useRef)(null),g=(0,i.useRef)(),j=(0,i.useState)(0),w=j[0],O=j[1],S=function(e,n,t){var o;O(n),x(!1),null===(o=g.current)||void 0===o||o.classList.remove("paraui-button-split--active"),null==d||d(e,t)},C=function(e){var n,t;(null===(n=y.current)||void 0===n?void 0:n.contains(e.target))||(x(!1),null===(t=g.current)||void 0===t||t.classList.remove("paraui-button-split--active"))},N=function(){return(0,o.jsx)("div",v({className:"paraui-button-split-list"},{children:(0,o.jsx)("ul",{children:c.map((function(e,n){return Array.isArray(e)?function(e,n){return(0,o.jsx)("li",v({className:"split-li-group"},{children:e.map((function(e,t){var i="".concat(n,"-").concat(t);return(0,o.jsx)("div",v({className:(0,a.Z)("split-li",i===w&&"split-li--active"),onClick:function(n){return S(e,i,n)}},{children:(null==f?void 0:f(e))||e.label}),i)}))}),n)}(e,n):(0,o.jsx)("li",v({className:(0,a.Z)("split-li",n===w&&"split-li--active"),onClick:function(t){return S(e,n,t)}},{children:(null==f?void 0:f(e))||e.label}),n)}))},void 0)}),void 0)};return(0,o.jsxs)("div",v({className:(0,a.Z)("paraui-button-split",l),ref:y,onMouseLeave:function(e){var n;e.stopPropagation(),null===(n=e.currentTarget.firstElementChild)||void 0===n||n.classList.remove("paraui-button-split--active"),x(!1)}},{children:[(0,o.jsx)(m,v({variant:"outlined",onMouseEnter:function(e){e.stopPropagation();var n=e.currentTarget;g.current=n,n.classList.add("paraui-button-split--active"),x(!0)},startIcon:(0,o.jsx)(p(),{},void 0),disabled:u},{children:null!=n?n:"更多操作"}),void 0),(0,o.jsx)(r.Popper,v({open:b,anchorEl:y.current,transition:!0,placement:"bottom-end"},{children:function(e){var n=e.TransitionProps;e.placement;return(0,o.jsx)(r.Grow,v({},n,{children:(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(r.ClickAwayListener,v({onClickAway:C},{children:N()}),void 0)},void 0)}),void 0)}}),void 0)]}),void 0)};var m=x},7785:function(e,n,t){t.r(n),t.d(n,{Search:function(){return f}});var o=t(7712),i=t(9297),r=t(3672),a=t(2990),c=t(6088),l=t.n(c),s=t(4115),u=t.n(s),d=function(){return d=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},d.apply(this,arguments)},f=function(e){var n=e.className,t=void 0===n?"":n,c=e.size,s=void 0===c?"large":c,f=e.btnType,p=void 0===f?"outside":f,v=e.showBtn,h=void 0===v||v,b=e.btnIcon,x=e.btnText,m=void 0===x?"":x,y=e.placeholder,g=void 0===y?"":y,j=(e.defaultValue,e.value),w=e.rightIcon,O=e.showRightIcon,S=void 0===O||O,C=e.onChange,N=e.onBlur,k=e.onFocus,P=e.onKeydown,I=e.onKeyUp,E=e.onClickBtn,T=e.onClickRightIcon,q=e.onEnter,F=(0,i.useState)(""),L=F[0],_=F[1];(0,i.useEffect)((function(){void 0!==e.defaultValue&&_(e.defaultValue)}),[]),(0,i.useEffect)((function(){void 0!==j&&_(j)}),[j]);var R,B=function(){return b||(0,o.jsx)(u(),{},void 0)},A=function(){E&&E(L)};return(0,o.jsxs)("div",d({className:(R="paraui-search",t&&(R+=" "+t),s&&(R+=" search-"+s),p&&(R+=" search-"+p),h&&(R+=" search-showbtn"),m&&(R+=" search-btntext"),R)},{children:[(0,o.jsx)(r.default,{size:s,placeholder:g,value:L,rightIcon:S?w||(0,o.jsx)(l(),{},void 0):"",onClickIcon:function(){T&&T(L)},onChange:function(n){var t=n.target.value;void 0===e.value&&_(t),C&&C(t,n)},onBlur:N,onFocus:k,onKeydown:P,onKeyUp:I,onEnter:q,addonAfter:function(){if(h&&"inside"===p)return(0,o.jsx)(a.default,d({size:s,startIcon:B(),variant:"outlined",onClick:A},{children:m}),void 0)}()},void 0),h&&"outside"===p&&(0,o.jsx)(a.default,d({size:s,startIcon:B(),variant:"contained",onClick:A},{children:m}),void 0)]}),void 0)};n.default=f},3672:function(e,n,t){var o=t(7712),i=t(9297),r=t(1731),a=t(3094),c=t(8528),l=t.n(c),s=t(6570),u=t.n(s),d=t(1102),f=t.n(d),p=t(3475),v=function(){return v=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},v.apply(this,arguments)},h=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t};n.default=function(e){var n=e.className,t=e.size,c=void 0===t?"large":t,s=e.labelMode,d=void 0===s?"outside":s,b=e.placeholder,x=void 0===b?"":b,m=e.label,y=void 0===m?"":m,g=e.disabled,j=void 0!==g&&g,w=e.multiline,O=void 0!==w&&w,S=e.required,C=void 0!==S&&S,N=e.labelSign,k=e.rows,P=void 0===k?2:k,I=e.error,E=void 0!==I&&I,T=e.helperText,q=void 0===T?"":T,F=e.addonBefore,L=void 0===F?"":F,_=e.addonAfter,R=void 0===_?"":_,B=(e.defaultValue,e.value),A=e.autoFocus,D=void 0!==A&&A,M=e.type,U=void 0===M?"text":M,z=e.onClickIcon,K=e.rightIcon,Z=e.showRightIcon,V=void 0===Z||Z,W=e.limitLength,H=e.fetchSuggestions,J=e.selectPopoverClass,$=e.renderSelectItem,G=e.showSelectName,Y=void 0===G?"value":G,Q=e.onBlur,X=e.onFocus,ee=e.onChange,ne=e.onKeydown,te=e.onKeyUp,oe=e.onEnter,ie=e.onClickAddonBefore,re=e.onClickAddonAfter,ae=e.onSelect,ce=h(e,["className","size","labelMode","placeholder","label","disabled","multiline","required","labelSign","rows","error","helperText","addonBefore","addonAfter","defaultValue","value","autoFocus","type","onClickIcon","rightIcon","showRightIcon","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect"]),le=(0,i.useState)("text-field-select-content-"+(0,p.UUID)())[0],se=(0,i.useState)(!0),ue=se[0],de=se[1],fe=(0,i.useState)(""),pe=fe[0],ve=fe[1],he=(0,i.useState)(!1),be=he[0],xe=he[1],me=(0,i.useState)("text"),ye=me[0],ge=me[1],je=(0,i.useState)(!1),we=je[0],Oe=je[1],Se=(0,i.useState)(!1),Ce=Se[0],Ne=Se[1],ke=(0,i.useState)([]),Pe=ke[0],Ie=ke[1],Ee=(0,i.useRef)(null),Te=(0,i.useRef)(null);(0,i.useEffect)((function(){void 0!==e.defaultValue&&(ve(e.defaultValue),Fe(e.defaultValue))}),[]),(0,i.useEffect)((function(){U!==ye&&ge(U)}),[U]),(0,i.useEffect)((function(){void 0!==B&&(ve(B),Fe(B))}),[B]),(0,i.useEffect)((function(){de(""===pe||void 0===pe)}),[pe]),(0,i.useEffect)((function(){H&&Oe(be)}),[be,H]),(0,i.useEffect)((function(){return we?window.addEventListener("keydown",Be):window.removeEventListener("keydown",Be),function(){window.removeEventListener("keydown",Be)}}),[we]);var qe,Fe=function(e){Ee&&Ee.current&&(Ee.current.value=e,Ee.current.setAttribute("value",e))},Le=function(){j||(de(!1),(Ee&&Ee.current).focus())},_e=function(e){var n=e.selectDom,t=e.keyCode,o=e.currentDom,i="nextSibling",r=".text-field-select-content-item";38===t&&(i="previousSibling",r=".text-field-select-content-item:last-child"),o?(o=o[i])||(o=n.querySelector(r)):o=n.querySelector(".text-field-select-content-item"),o&&(o.classList.add("text-field-select-content-item-keydown"),Re(o,n))},Re=function(e,n){var t=n.clientHeight,o=e.offsetTop+e.clientHeight-t;n.scrollTop=o>0?o:0},Be=function(e){var n=document.querySelector("."+le),t=null,o=n.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&o){var i=o.dataset.val;We(JSON.parse(i))(e),(Ee&&Ee.current).blur()}o&&(t=o,o.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&_e({selectDom:n,keyCode:e.keyCode,currentDom:t}),38===e.keyCode&&_e({selectDom:n,keyCode:e.keyCode,currentDom:t})},Ae=function(e){xe(!1),""===e.target.value&&de(!0),Q&&Q(e)},De=function(e){Ne(!0),H&&H(e,(function(e){Ie(e||[]),Ne(!1)}))},Me=function(e){xe(!0),X&&X(e),De(e.target.value)},Ue=function(n){var t=n.target.value;t&&de(!1),W&&void 0!==t&&""!==t&&t.toString().length>W||(void 0===e.value&&(ve(t),Fe(t)),ee&&ee(n),De(n.target.value))},ze=function(e){13===e.keyCode&&oe&&oe(e),ne&&ne(e)},Ke=function(e){te&&te(e)},Ze=function(e){"password"===U&&("text"===ye&&ge("password"),"password"===ye&&ge("text")),z&&z(e)},Ve=function(){Oe(!1)},We=function(e){return function(n){ae&&ae(e)}},He=(0,i.useMemo)((function(){return(0,o.jsx)(o.Fragment,{children:void 0!==W&&(0,o.jsx)("span",v({className:"length-limit"},{children:(pe?pe.toString().length:0)+"/"+W}),void 0)},void 0)}),[W,pe]),Je=(0,i.useMemo)((function(){var e=K||("password"===U?"password"===ye?(0,o.jsx)(u(),{},void 0):(0,o.jsx)(l(),{},void 0):null);return(0,o.jsx)(o.Fragment,{children:V&&e&&(0,o.jsx)("span",v({className:"right-icon",onClick:Ze},{children:e}),void 0)},void 0)}),[V,K,U,ye]),$e=(0,i.useMemo)((function(){return(0,o.jsxs)("div",v({className:"text-field-content-within",ref:Te},{children:[(0,o.jsxs)("div",v({className:"text-field-content-within-input"},{children:[O?(0,o.jsx)("textarea",v({ref:Ee,rows:P,onBlur:Ae,onFocus:Me,onChange:Ue,onKeyDown:ze,onKeyUp:Ke,disabled:j},ce),void 0):(0,o.jsx)("input",v({ref:Ee,type:ye,onBlur:Ae,onFocus:Me,onChange:Ue,onKeyDown:ze,onKeyUp:Ke,disabled:j},ce),void 0),ue&&(0,o.jsx)("span",v({className:"text-field-label-placeholder",onClick:Le},{children:"outside"===d?x:(0,o.jsxs)(o.Fragment,{children:[y||x,C&&(0,o.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,o.jsx)("span",{children:N},void 0)]},void 0)}),void 0)]}),void 0),He,Je]}),void 0)}),[ue,D,ye,pe,He,Je,d,x,y,j,O,P,ce,ee,H]),Ge=(0,i.useMemo)((function(){var e;return(0,o.jsxs)("div",v({className:(e="text-field-select-content",Ce&&(e+=" text-field-select-content-loading"),le&&(e+=" "+le),e),style:{width:(Te&&Te.current?Te.current.offsetWidth:0)+"px"}},{children:[Pe&&Pe.map((function(e,n){return(0,o.jsx)("div",v({className:"text-field-select-content-item",onMouseDown:We(e),"data-val":JSON.stringify(e)},{children:$?$(e):(0,o.jsx)(a.default,{children:e[Y]},void 0)}),n)})),Ce&&(0,o.jsx)("div",v({className:"loading-box"},{children:(0,o.jsx)(f(),{},void 0)}),void 0)]}),void 0)}),[Te,we,Pe,$,Y,ae,Ce,le]),Ye=(0,i.useMemo)((function(){return(0,o.jsx)(r.Tooltip,v({open:we,title:Ge,onClose:Ve,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:(e="paraui-text-field-select",c&&(e+=" paraui-text-field-select-"+c),J&&(e+=" "+J),e)}},{children:$e}),void 0);var e}),[ue,D,ye,pe,He,Je,d,x,y,j,O,P,ce,ee,H,ae,Te,we,J,c]),Qe=(0,i.useMemo)((function(){var e=Boolean(C||N||y);return(0,o.jsx)(o.Fragment,{children:"outside"===d&&e&&(0,o.jsxs)("label",v({className:"text-field-label"},{children:[y,C&&(0,o.jsx)("span",v({className:"text-field-required"},{children:"*"}),void 0),N&&(0,o.jsx)("span",{children:N},void 0)]}),void 0)},void 0)}),[d,y,N,C]);return(0,o.jsxs)("div",v({className:(qe="paraui-text-field",qe+=" text-field",c&&!O&&(qe+=" text-field-"+c),n&&(qe+=" "+n),E&&(qe+=" text-field-error"),be&&(qe+=" text-field-focus"),j&&(qe+=" text-field-disabled"),O&&(qe+=" text-field-multiline"),qe)},{children:[Qe,(0,o.jsxs)("div",v({className:"text-field-content"},{children:[L&&(0,o.jsx)("div",v({className:"text-field-content-before",onClick:function(e){ie&&ie(e)}},{children:L}),void 0),H?Ye:$e,R&&(0,o.jsx)("div",v({className:"text-field-content-after",onClick:function(e){re&&re(e)}},{children:R}),void 0)]}),void 0),q&&(0,o.jsx)("p",v({className:"text-field-error-text"},{children:q}),void 0)]}),void 0)}},6885:function(e,n,t){var o=t(7712),i=t(1731),r=t(4927),a=function(){return a=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},a.apply(this,arguments)};n.default=function(e){var n,t=a(a({},e.classes),{popper:(0,r.Z)("paraui-tooltip",null===(n=e.classes)||void 0===n?void 0:n.popper)});return(0,o.jsx)(i.Tooltip,a({},e,{classes:t},{children:e.children}),void 0)}},1731:function(n){n.exports=e},6088:function(e){e.exports=n},6028:function(e){e.exports=t},2749:function(e){e.exports=o},1102:function(e){e.exports=i},6570:function(e){e.exports=r},8528:function(e){e.exports=a},4115:function(e){e.exports=c},3475:function(e){e.exports=l},9297:function(e){e.exports=s}},f={};function p(e){var n=f[e];if(void 0!==n)return n.exports;var t=f[e]={exports:{}};return d[e](t,t.exports,p),t.exports}p.m=d,u=[],p.O=function(e,n,t,o){if(!n){var i=1/0;for(c=0;c<u.length;c++){n=u[c][0],t=u[c][1],o=u[c][2];for(var r=!0,a=0;a<n.length;a++)(!1&o||i>=o)&&Object.keys(p.O).every((function(e){return p.O[e](n[a])}))?n.splice(a--,1):(r=!1,o<i&&(i=o));r&&(u.splice(c--,1),e=t())}return e}o=o||0;for(var c=u.length;c>0&&u[c-1][2]>o;c--)u[c]=u[c-1];u[c]=[n,t,o]},p.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(n,{a:n}),n},p.d=function(e,n){for(var t in n)p.o(n,t)&&!p.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},p.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={3708:0,1465:0,6615:0,2996:0,2823:0,9296:0};p.O.j=function(n){return 0===e[n]};var n=function(n,t){var o,i,r=t[0],a=t[1],c=t[2],l=0;for(o in a)p.o(a,o)&&(p.m[o]=a[o]);if(c)var s=c(p);for(n&&n(t);l<r.length;l++)i=r[l],p.o(e,i)&&e[i]&&e[i][0](),e[r[l]]=0;return p.O(s)},t=self.webpackChunkParaUI=self.webpackChunkParaUI||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var v=p.O(void 0,[9296],(function(){return p(7785)}));return v=p.O(v)}()}));
|
package/Select/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @description 下拉框
|
|
5
5
|
*/
|
|
6
6
|
import { FunctionComponent, ReactNode } from 'react';
|
|
7
|
+
import './index.scss';
|
|
7
8
|
export interface SelectProps {
|
|
8
9
|
/** 样式class */
|
|
9
10
|
className?: string;
|
|
@@ -16,15 +17,13 @@ export interface SelectProps {
|
|
|
16
17
|
/** 提示语 */
|
|
17
18
|
placeholder?: string;
|
|
18
19
|
/** 是否禁用 */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
+
disabled?: boolean | any[];
|
|
20
21
|
/** 是否多选 */
|
|
21
22
|
multiple?: boolean;
|
|
22
23
|
/** 是否必填 */
|
|
23
24
|
required?: boolean;
|
|
24
25
|
/** 是否错误模式 */
|
|
25
26
|
error?: boolean;
|
|
26
|
-
/** 是否显示标题提示 */
|
|
27
|
-
showLabelSign?: boolean;
|
|
28
27
|
/** 错误文本 */
|
|
29
28
|
helperText?: ReactNode;
|
|
30
29
|
/** 标题提示 */
|
|
@@ -37,7 +36,9 @@ export interface SelectProps {
|
|
|
37
36
|
showValue?: string;
|
|
38
37
|
/** 下级字段 */
|
|
39
38
|
childrenName?: string;
|
|
40
|
-
/**
|
|
39
|
+
/** 默认值 不受控 */
|
|
40
|
+
defaultValue?: any;
|
|
41
|
+
/** 选中值 多选时为数组 单选单值 受控 */
|
|
41
42
|
value?: any;
|
|
42
43
|
/** 超出换行 */
|
|
43
44
|
overLine?: boolean;
|
package/Select/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@material-ui/core"),require("@para-ui/icons/Check"),require("@para-ui/icons/Close"),require("@para-ui/icons/Down"),require("@para-ui/icons/Search"),require("para-lib"),require("react")):"function"==typeof define&&define.amd?define(["@material-ui/core","@para-ui/icons/Check","@para-ui/icons/Close","@para-ui/icons/Down","@para-ui/icons/Search","para-lib","react"],t):"object"==typeof exports?exports.ParaUI=t(require("@material-ui/core"),require("@para-ui/icons/Check"),require("@para-ui/icons/Close"),require("@para-ui/icons/Down"),require("@para-ui/icons/Search"),require("para-lib"),require("react")):e.ParaUI=t(e["@material-ui/core"],e["@para-ui/icons/Check"],e["@para-ui/icons/Close"],e["@para-ui/icons/Down"],e["@para-ui/icons/Search"],e["para-lib"],e.react)}(self,(function(e,t,r,o,n,i,s){return function(){"use strict";var l,c={4126:function(e){
|
|
2
2
|
/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
6
|
*/
|
|
7
|
-
var t=Object.getOwnPropertySymbols,
|
|
7
|
+
var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var s,l,c=n(e),a=1;a<arguments.length;a++){for(var u in s=Object(arguments[a]))r.call(s,u)&&(c[u]=s[u]);if(t){l=t(s);for(var d=0;d<l.length;d++)o.call(s,l[d])&&(c[l[d]]=s[l[d]])}}return c}},9524:function(e,t,r){
|
|
8
8
|
/** @license React v17.0.2
|
|
9
9
|
* react-jsx-runtime.production.min.js
|
|
10
10
|
*
|
|
@@ -13,4 +13,4 @@ var t=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,r=Object.pr
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
o(4126);var r=o(9297),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var n=Symbol.for;i=n("react.element"),t.Fragment=n("react.fragment")}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,o){var r,n={},a=null,d=null;for(r in void 0!==o&&(a=""+o),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(n[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===n[r]&&(n[r]=t[r]);return{$$typeof:i,type:e,key:a,ref:d,props:n,_owner:l.current}}t.jsx=a,t.jsxs=a},7712:function(e,t,o){e.exports=o(9524)},115:function(e,t,o){var r=o(7712),i=o(9297),n=o(1731),l=o(8604),s=o(853),c=function(){return c=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)},a=((0,s.Z)(),(0,l.makeStyles)((function(e){return(0,l.createStyles)({"auto-tips":{maxWidth:"100%",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > .auto-tips-content":{display:"inline",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})})));t.default=function(e){var t=e.children,o=e.placement,l=void 0===o?"bottom-start":o,s=e.tips,d=void 0===s?"":s,p=e.className,u=void 0===p?"":p,h=(0,i.useRef)(),v=a(),f=(0,i.useState)(""),m=f[0],x=f[1];(0,i.useEffect)((function(){x(d)}),[d]);var g;return(0,r.jsx)("div",c({ref:function(e){e&&(h.current=e)},className:(g=v["auto-tips"],g+=" paraui-auto-tips",u&&(g+=" "+u),g),onMouseOver:function(){h.current.scrollWidth>h.current.offsetWidth?x(m||h.current.innerText):x("")}},{children:(0,r.jsx)(n.Tooltip,c({title:m,placement:l},{children:(0,r.jsx)("div",c({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},853:function(e,t){var o={thmemColor:{primary:"#3D66F8",secondary:"#7E98F5",thirdary:"#D6DFFD"},textColor:{primary:"#191919",secondary:"#6E7488",thirdary:"#BBBECB",white:"#FFFFFF"},bgBorderColor:{bg1:"#DCDDE3",bg2:"#F5F5F5",bg3:"#EDEDED",bg4:"#6E7488",line1:"#E5E9EF",universal:"#FFFFFF"},stateColor:{info:"#3D66F8",success:"#41D658",warning:"#FFA150",error:"#F46B53"},gradientColor:{gradient1:"linear-gradient(#3D66F8, #4F93F0)",gradient2:"linear-gradient(#0093FF, #4EB4FF)",gradient3:"linear-gradient(#844EFF, #A796FF)",gradient4:"linear-gradient(#FD7300, #FFBF69)",gradient5:"linear-gradient(#3D66F8, #D8DFFA)"},fontFamily:{zh:"Microsoft Yahei, Helvetica, sans-serif",en:"Microsoft Yahei, Helvetica, sans-serif"},fontSize:12,borderRadius:4,boxShadow:"4px 4px 6px rgba(70,75,105,0.2), -4px -4px 6px rgba(0,0,0,0.06)",buttonShadow:"4px 4px 6px rgba(70,75,105,0.1), -4px -4px 6px rgba(0,0,0,0.03)",standardFont:{standardFont1:{fontSize:"12px",fontWeight:"400"},standardFont2:{fontSize:"12px",fontWeight:"700"}},titleFont:{titleFont1:{fontSize:"14px",fontWeight:"400"},titleFont2:{fontSize:"14px",fontWeight:"700"}},visualLargeFont:{visualLargeFont1:{fontSize:"40px",fontWeight:"700"},visualLargeFont2:{fontSize:"40px",fontWeight:"700"}}};t.Z=function(){return o}},1731:function(e){e.exports=t},8604:function(e){e.exports=l},6110:function(e){e.exports=i},19:function(e){e.exports=n},6028:function(e){e.exports=o},4115:function(e){e.exports=r},3475:function(e){e.exports=s},9297:function(t){t.exports=e}},a={};function d(e){var t=a[e];if(void 0!==t)return t.exports;var o=a[e]={exports:{}};return c[e](o,o.exports,d),o.exports}d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var o in t)d.o(t,o)&&!d.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return function(){d.r(p),d.d(p,{Select:function(){return w}});var e=d(7712),t=d(9297),o=d(1731),r=d(6028),i=d.n(r),n=d(4115),l=d.n(n),s=d(6110),c=d.n(s),a=d(19),u=d.n(a),h=d(115),v=d(8604),f=d(853),m=d(3475),x=function(){return x=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},x.apply(this,arguments)},g=function(e,t,o){if(o||2===arguments.length)for(var r,i=0,n=t.length;i<n;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},y=(0,f.Z)(),b=(0,v.makeStyles)((function(){return(0,v.createStyles)({select:{"& *":{boxSizing:"border-box"},fontFamily:y.fontFamily.zh,display:"inline-block",fontSize:y.standardFont.standardFont1.fontSize,width:"100%",paddingBottom:"20px","& > .select-label":{color:y.textColor.secondary,marginBottom:"9px",display:"inline-block"},"& > .select-content":{lineHeight:"0",border:"1px solid",borderColor:y.textColor.thirdary,borderRadius:y.borderRadius,paddingRight:"30px",position:"relative",cursor:"pointer","&:hover":{borderColor:y.thmemColor.primary,"& > .select-svg":{"& > svg":{color:y.thmemColor.primary}}},"& > .select-label-placeholder":{width:"100%",height:"100%",padding:"0 10px",boxSizing:"border-box",color:y.textColor.thirdary,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",position:"absolute",left:"0",top:"0"},"& > .select-svg":{position:"absolute",right:"8px",top:"0","& > svg":{fontSize:"16px",transition:"all .3s",color:y.textColor.secondary}},"& > .radio-select-content":{paddingLeft:"10px",color:y.textColor.primary,fontSize:"12px",lineHeight:"16px"},"& > .radio-search-outside":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",padding:"0 30px 0 10px",fontSize:"12px",cursor:"pointer","& > div":{height:"100%",cursor:"pointer","& > input":{height:"100%",padding:"0",color:y.textColor.primary,fontSize:"12px",cursor:"pointer"},"& fieldset":{display:"none"}}},"& > .check-select-content":{paddingLeft:"10px",height:"100%",overflow:"hidden","& > .check-select-content-item":{display:"inline-block",backgroundColor:y.bgBorderColor.bg2,borderRadius:y.borderRadius,padding:"0 10px",color:y.textColor.primary,fontSize:"12px",marginRight:"10px",verticalAlign:"top",maxWidth:"100%",whiteSpace:"nowrap","&.check-select-content-item-more":{color:y.thmemColor.primary,cursor:"pointer","& > span":{maxWidth:"none"}},"& > span":{display:"inline-block",hieght:"100%",verticalAlign:"top",maxWidth:"calc(100% - 20px)",overflow:"hidden",textOverflow:"ellipsis"},"& > svg":{cursor:"pointer",marginLeft:"8px",color:y.textColor.secondary,fontSize:"16px",position:"relative",top:"2px","&:hover":{color:y.thmemColor.primary}}},"& > .check-search-outside":{width:"10px",maxWidth:"100% !important",display:"none","& > div":{width:"100%","& > input":{width:"100%",padding:"0",color:y.textColor.primary,fontSize:"12px",cursor:"pointer"},"& fieldset":{display:"none"}}}}},"& > .select-error-text":{margin:0,paddingLeft:"10px",height:"20px",lineHeight:"20px"},"&.select-disabled":{"& > .select-content":{backgroundColor:y.bgBorderColor.bg2,cursor:"not-allowed","&:hover":{borderColor:y.textColor.thirdary,"& > .select-svg":{"& > svg":{color:y.textColor.secondary}}},"& > .check-select-content":{"& > .check-select-content-item":{backgroundColor:y.bgBorderColor.bg3,"& > span":{maxWidth:"none"}}}}},"&.select-error":{"& > .select-content":{borderColor:y.stateColor.error+"!important"},"& > .select-error-text":{color:y.stateColor.error+"!important"}},"&.select-multiple":{},"&.select-open":{"& > .select-content":{borderColor:y.thmemColor.primary,"& > .select-svg":{"& > svg":{transform:"rotate(180deg)",color:y.thmemColor.primary}},"& > .check-select-content":{"& > .check-search-outside":{display:"inline-block"}}}},"&.select-small":{"& > .select-content":{height:"28px","& > .select-label-placeholder":{lineHeight:"26px"},"& > .select-svg":{top:"5px"},"& > .radio-select-content":{paddingTop:"5px",paddingBottom:"5px"},"& > .radio-search-outside":{"& > div":{paddingTop:"5px",paddingBottom:"5px"}},"& > .check-select-content":{paddingBottom:"3px","& > .check-select-content-item":{marginTop:"3px",height:"20px",lineHeight:"20px"},"& > .check-search-outside":{marginTop:"3px","& input":{height:"20px"}}}}},"&.select-medium":{"& > .select-content":{height:"34px","& > .select-label-placeholder":{lineHeight:"32px"},"& > .select-svg":{top:"8px"},"& > .radio-select-content":{paddingTop:"8px",paddingBottom:"8px"},"& > .radio-search-outside":{"& > div":{paddingTop:"8px",paddingBottom:"8px"}},"& > .check-select-content":{paddingBottom:"4px","& > .check-select-content-item":{marginTop:"4px",height:"24px",lineHeight:"24px"},"& > .check-search-outside":{marginTop:"4px","& input":{height:"24px"}}}}},"&.select-large":{"& > .select-content":{height:"40px","& > .select-label-placeholder":{lineHeight:"38px"},"& > .select-svg":{top:"11px"},"& > .radio-select-content":{paddingTop:"11px",paddingBottom:"11px"},"& > .radio-search-outside":{"& > div":{paddingTop:"11px",paddingBottom:"11px"}},"& > .check-select-content":{paddingBottom:"7px","& > .check-select-content-item":{marginTop:"7px",height:"24px",lineHeight:"24px"},"& > .check-search-outside":{marginTop:"7px","& input":{height:"24px"}}}}},"&.select-over-line":{"&.select-small":{"& > .select-content":{height:"inherit",minHeight:"28px","& > .radio-select-content":{}}},"&.select-medium":{"& > .select-content":{height:"inherit",minHeight:"34px","& > .radio-select-content":{}}},"&.select-large":{"& > .select-content":{height:"inherit",minHeight:"40px","& > .radio-select-content":{}}}}},"select-popover":{"& *":{boxSizing:"border-box"},"& > div":{maxWidth:"none",padding:"0",backgroundColor:y.textColor.white,boxShadow:y.boxShadow,borderRadius:y.borderRadius,"& > span":{color:y.textColor.white},"& .select-popover-content":{maxHeight:"300px",overflow:"auto","& > .select-popover-search":{height:"30px",borderBottom:"1px solid "+y.bgBorderColor.bg3,padding:"0 10px",display:"flex","& > div":{width:"100%","& input":{padding:"0",height:"28px",fontSize:"12px",color:y.textColor.primary,"&::placeholder":{fontSize:"12px",color:y.textColor.thirdary,opacity:1}},"& fieldset":{display:"none"}},"& > svg":{color:y.thmemColor.primary,fontSize:"16px",marginTop:"7px",cursor:"pointer"}},"& > .select-popover-list":{"& .select-popover-list-item":{display:"flex",padding:"7px 10px",cursor:"pointer",lineHeight:"16px","& > .select-popover-list-item-label":{width:"calc(100% - 25px)",color:y.textColor.secondary,fontSize:"12px"},"& > .select-popover-list-item-svg":{lineHeight:"0",display:"none","& > svg":{fontSize:"16px",color:y.thmemColor.primary}},"&.select-popover-list-item-select":{"& > .select-popover-list-item-label":{color:y.thmemColor.primary},"& > .select-popover-list-item-svg":{display:"inline-block"}},"&.select-popover-list-item-hover":{backgroundColor:y.bgBorderColor.bg2,"& > .select-popover-list-item-label":{color:y.thmemColor.primary}},"&.select-popover-list-item-keydown":{backgroundColor:y.bgBorderColor.bg2,"& > .select-popover-list-item-label":{color:y.thmemColor.primary}}},"& > .select-popover-list-group":{"& .select-popover-list-group-label":{display:"inline-block",width:"100%",padding:"7px 10px",color:y.textColor.thirdary,fontSize:"12px"},"& .select-popover-list-item":{padding:"7px 10px 7px 20px"}},"& > .select-nodata":{textAlign:"center",fontSize:"12px",color:y.textColor.primary,padding:"10px"}}}}},"select-more-popover":{"& *":{boxSizing:"border-box"},"& > div:nth-of-type(3),& > div:nth-of-type(2)":{marginLeft:"10px"},"& .select-more":{width:"200px",maxHeight:"300px",overflow:"auto","& > .select-more-title":{height:"30px",padding:"0 10px",color:y.textColor.secondary,borderBottom:"1px solid "+y.bgBorderColor.bg2,lineHeight:"30px",fontSize:"12px",display:"flex",justifyContent:"space-between"},"& > .select-more-content":{"& > .select-more-content-item":{padding:"7px 7px 7px 10px",display:"flex",justifyContent:"space-around","& > span":{width:"calc(100% - 25px)",display:"inline-block",fontSize:"12px"},"& > svg":{color:y.textColor.secondary,fontSize:"16px",position:"relative",top:"1px",cursor:"pointer","&:hover":{color:y.thmemColor.primary}}}}}}})})),w=function(r){var n=r.className,s=r.size,a=void 0===s?"small":s,d=r.labelMode,p=void 0===d?"outside":d,v=r.placeholder,f=void 0===v?"":v,y=r.label,w=void 0===y?"":y,C=r.disabled,S=void 0!==C&&C,j=r.multiple,k=void 0!==j&&j,F=r.required,N=void 0!==F&&F,O=r.showLabelSign,E=void 0===O||O,T=r.labelSign,z=r.error,D=void 0!==z&&z,q=r.helperText,L=void 0===q?"":q,B=r.list,H=r.showName,M=void 0===H?"label":H,P=r.showValue,_=void 0===P?"value":P,W=r.childrenName,R=void 0===W?"children":W,A=r.value,I=r.onChange,U=r.overLine,K=void 0!==U&&U,Y=r.search,Z=void 0!==Y&&Y,$=r.searchModel,V=void 0===$?"inside":$,G=r.selectPopoverClassName,J=r.morePopoverClassName,Q=r.onEnter,X=b(r),ee=(0,t.useRef)(null),te=(0,t.useState)("select-"+(0,m.UUID)())[0],oe=(0,t.useState)("select-popover-"+(0,m.UUID)())[0],re=(0,t.useState)(!1),ie=re[0],ne=re[1],le=(0,t.useState)(!1),se=le[0],ce=le[1],ae=(0,t.useState)([]),de=ae[0],pe=ae[1],ue=(0,t.useState)([]),he=ue[0],ve=ue[1],fe=(0,t.useState)({}),me=fe[0],xe=fe[1],ge=(0,t.useState)(null),ye=ge[0],be=ge[1],we=(0,t.useState)({})[0],Ce=(0,t.useState)(!1),Se=Ce[0],je=Ce[1],ke=(0,t.useState)(""),Fe=ke[0],Ne=ke[1],Oe=(0,t.useState)(!1),Ee=Oe[0],Te=Oe[1],ze=(0,t.useRef)(null);(0,t.useEffect)((function(){void 0!==A&&pe(k?(0,m.DeepClone)(A||[]):""===A?[]:[A])}),[A,k]),(0,t.useEffect)((function(){if(Z&&"outside"===V)return Te(!!k);Te(K)}),[K,Z,V,k]),(0,t.useEffect)((function(){for(var e={},t=0,o=B.length;t<o;t++){var r=B[t];if(r[R]&&r[R].length>0)for(var i=r[R],n=0,l=i.length;n<l;n++){var s=i[n];e[s[_]]=s}else e[r[_]]=r}xe(e)}),[B]),(0,t.useEffect)((function(){k&&(Ee||be(de.length))}),[Ee,k,de]),(0,t.useEffect)((function(){return Ee?be(de.length):(setTimeout((function(){Me(de.length)})),window.addEventListener("resize",Pe)),function(){window.removeEventListener("resize",Pe)}}),[de,Ee]),(0,t.useEffect)((function(){de&&de.length>0?ce(!0):(ce(!1),Z&&"outside"===V&&ce(""!==Fe))}),[Z,Fe,V,de]),(0,t.useEffect)((function(){clearTimeout(we.searchTimer),Z&&""!==Fe.trim()?we.searchTimer=setTimeout((function(){for(var e=[],t=(0,m.DeepClone)(B),o=0,r=t.length;o<r;o++){var i=t[o];if(i[R]&&i[R].length>0){for(var n=i[R],l=[],s=0,c=n.length;s<c;s++){var a=n[s];He(a)&&l.push(a)}l.length>0&&(i[R]=l,e.push(i))}else{He(i)&&e.push(i)}}ve(e)}),100):ve((0,m.DeepClone)(B))}),[Z,Fe,B]),(0,t.useEffect)((function(){return ie?setTimeout((function(){qe(),window.addEventListener("click",Be),window.addEventListener("keydown",Ve)})):(Ne(""),window.removeEventListener("click",Be),window.removeEventListener("keydown",Ve)),function(){window.removeEventListener("click",Be),window.removeEventListener("keydown",Ve)}}),[ie]),(0,t.useEffect)((function(){Fe&&ne(!0)}),[Fe]),(0,t.useEffect)((function(){k&&"outside"===V&&!S&&Ye(Fe)}),[Fe,k,S,V]);var De,qe=function(){var e=ze&&ze.current,t=e&&e.querySelector("input");t&&t.focus()},Le=function(e,t){for(var o=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;e&&!o.call(e,t);)e=e.parentElement;return e},Be=function(e){Le(e.target,"."+oe)||ne(!1)},He=function(e){var t=!1;return-1!==e[M].indexOf(Fe)&&(t=!0),t},Me=function(e){if(null!==e&&0!==e){void 0===e&&(e=de.length);var t=document.querySelector("."+te+" > .select-content > .check-select-content");if(t)if(t.scrollHeight>t.clientHeight){var o=Number(e)-1;be(o),Me(o)}else de.length<=e&&Ae()}},Pe=function(){clearTimeout(we.timer),we.timer=setTimeout((function(){be(de.length),Me()}),100)},_e=function(){S||ne(!0)},We=function(){ne(!1)},Re=function(e){je(!0),ne(!1),e.stopPropagation()},Ae=function(){je(!1)},Ie=function(e,t){return function(o){var r=e[_];if(k){var i=de.indexOf(r);-1!==i?de.splice(i,1):de.push(r),I&&I(g([],de,!0),o),t&&Q&&Q(g([],de,!0)),qe()}else I&&I(r,o),t&&Q&&Q(r),We(),Ne("")}},Ue=function(e,t){return function(o){var r;e||((r={})[_]=t,e=r),Ie(e)(o),o.stopPropagation()}},Ke=function(e){Ne(e.target.value)},Ye=function(e){var t=ze&&ze.current,o=t&&t.querySelector("input");if(!o)return null;var r=window.getComputedStyle(o),i=r.fontFamily,n=function(e,t,o){var r=document.createElement("span");r.id="referenceSpan";var i={};i.width=r.offsetWidth,i.height=r.offsetHeight,r.style.visibility="hidden",r.style.fontSize=e,r.style.fontFamily=t,r.style.display="inline-block";var n=document.getElementById("referenceSpan");return n&&document.body.removeChild(n),document.body.appendChild(r),void 0!==r.textContent?r.textContent=o:r.innerText=o,i.width=parseFloat(window.getComputedStyle(r).width)-i.width,i.height=parseFloat(window.getComputedStyle(r).height)-i.height,document.body.removeChild(r),i}(r.fontSize,i,e),l=n.width;l<10&&(l=10),t.style.width=l+"px"},Ze=function(e){var t=e.selectDom,o=e.keyCode,r=e.currentKeydownDom,i=null,n="nextSibling",l=".select-popover-list > div",s=".select-popover-list-item";if(38===o&&(n="previousSibling",l=".select-popover-list > div:last-child",s=".select-popover-list-item:last-child"),r)if(i=r[n])-1!==i.className.indexOf("select-popover-list-group-label")&&((i=(i=r.parentNode)[n])||(i=t.querySelector(l)));else{var c=r.parentNode;c&&c.className&&-1!==c.className.indexOf("select-popover-list-group")&&(i=(i=r.parentNode)[n])||(i=t.querySelector(l))}else i=t.querySelector(l);if(i)if(-1!==i.className.indexOf("select-popover-list-group")){var a=i.querySelector(s);a&&(a.classList.add("select-popover-list-item-keydown"),$e(a,t))}else i.classList.add("select-popover-list-item-keydown"),$e(i,t)},$e=function(e,t){clearTimeout(we.scrollTimer);var o=t.clientHeight,r=e.offsetTop+e.clientHeight-o;we.scroll=!0,t.scrollTop=r>0?r:0,we.scrollTimer=setTimeout((function(){we.scroll=!1}),100)},Ve=function(e){var t=document.querySelector("."+oe);if(t){var o=t.querySelector(".select-popover-list-item-select"),r=t.querySelector(".select-popover-list-item-hover"),i=t.querySelector(".select-popover-list-item-keydown"),n=o;if(r&&(n=r),13===e.keyCode){var l=i||r;if(l){var s=l.dataset.val;Ie(me[s],!0)({target:i})}else Q&&Q(A)}i&&(n=i,i.classList.remove("select-popover-list-item-keydown")),40===e.keyCode&&Ze({selectDom:t,keyCode:e.keyCode,currentKeydownDom:n}),38===e.keyCode&&Ze({selectDom:t,keyCode:e.keyCode,currentKeydownDom:n})}},Ge=function(e){if(!we.scroll){var t=Le(e.target,".select-popover-list-item");if(t){t.classList.add("select-popover-list-item-hover");var o=document.querySelector("."+oe).querySelector(".select-popover-list-item-keydown");o&&o.classList.remove("select-popover-list-item-keydown")}}},Je=function(e){var t=Le(e.target,".select-popover-list-item");t&&t.classList.remove("select-popover-list-item-hover")},Qe=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:"outside"===p&&(0,e.jsxs)("label",x({className:"select-label"},{children:[w,E&&(0,e.jsx)("span",x({className:"identification-label"},{children:T||(0,e.jsx)(e.Fragment,{children:N?"(必填)":""},void 0)}),void 0)]}),void 0)},void 0)}),[p,w,E,T,N]),Xe=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:!se&&(0,e.jsx)("span",x({className:"select-label-placeholder"},{children:"outside"===p?f:(0,e.jsxs)(e.Fragment,{children:[w||f,E&&(0,e.jsx)("span",x({className:"identification-label"},{children:T||(0,e.jsx)(e.Fragment,{children:N?"(必填)":""},void 0)}),void 0)]},void 0)}),void 0)},void 0)}),[se,p,f,w,E,T,N]),et=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:!k&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",x({className:"radio-select-content"},{children:function(){if(""!==Fe)return null;var t=me[de[0]]&&me[de[0]][M]||de[0];return Ee?t:(0,e.jsx)(h.default,{children:t},void 0)}()}),void 0),Z&&"outside"===V&&!S&&(0,e.jsx)(o.TextField,{variant:"outlined",className:"radio-search-outside",value:Fe,onChange:Ke,ref:ze},void 0)]},void 0)},void 0)}),[k,se,Ee,me,de,M,Z,V,Fe,S]),tt=(0,t.useMemo)((function(){var t=function(e){return me[de[e]]&&me[de[e]][M]||de[e]};return(0,e.jsx)(e.Fragment,{children:k&&(0,e.jsxs)("div",x({className:"check-select-content"},{children:[de&&de.map((function(o,r){return null!==ye&&ye<=r?null:(0,e.jsxs)("div",x({className:"check-select-content-item"},{children:[(0,e.jsx)("span",{children:t(r)},void 0),!S&&(0,e.jsx)(u(),{onClick:Ue(me[de[r]],de[r])},void 0)]}),r)})),function(){if(null!==ye&&de.length>ye)return(0,e.jsx)("div",x({className:"check-select-content-item check-select-content-item-more",onClick:Re},{children:(0,e.jsxs)("span",{children:["+",de.length-ye]},void 0)}),void 0)}(),Z&&"outside"===V&&!S&&(0,e.jsx)(o.TextField,{variant:"outlined",className:"check-search-outside",value:Fe,onChange:Ke,ref:ze},void 0)]}),void 0)},void 0)}),[k,se,de,ye,me,S,I,Fe,Z,V]),ot=(0,t.useMemo)((function(){return(0,e.jsxs)("div",x({className:"select-content",onClick:_e,ref:ee},{children:[Xe,(0,e.jsx)("span",x({className:"select-svg"},{children:(0,e.jsx)(i(),{},void 0)}),void 0),et,tt]}),void 0)}),[ee,se,p,f,w,E,T,N,Ee,me,de,M,k,ye,S,I,Fe,V]),rt=(0,t.useMemo)((function(){return(0,e.jsx)("div",x({className:"select-popover-list"},{children:he&&he.length>0?(0,e.jsx)(e.Fragment,{children:he.map((function(t,o){if(t[R]&&t[R].length>0){var r=t[R];return(0,e.jsxs)("div",x({className:"select-popover-list-group"},{children:[(0,e.jsx)("span",x({className:"select-popover-list-group-label"},{children:t[M]}),void 0),r.map((function(t,o){var r=t[_],i="select-popover-list-item";return-1!==de.indexOf(r)&&(i+=" select-popover-list-item-select"),(0,e.jsxs)("div",x({onClick:Ie(t),className:i,onMouseEnter:Ge,onMouseLeave:Je,"data-val":r},{children:[(0,e.jsx)("span",x({className:"select-popover-list-item-label"},{children:(0,e.jsx)(h.default,{children:t[M]},void 0)}),void 0),(0,e.jsx)("span",x({className:"select-popover-list-item-svg"},{children:(0,e.jsx)(c(),{},void 0)}),void 0)]}),o)}))]}),o)}var i=t[_],n="select-popover-list-item";return-1!==de.indexOf(i)&&(n+=" select-popover-list-item-select"),(0,e.jsxs)("div",x({onClick:Ie(t),className:n,onMouseEnter:Ge,onMouseLeave:Je,"data-val":i},{children:[(0,e.jsx)("span",x({className:"select-popover-list-item-label"},{children:(0,e.jsx)(h.default,{children:t[M]},void 0)}),void 0),(0,e.jsx)("span",x({className:"select-popover-list-item-svg"},{children:(0,e.jsx)(c(),{},void 0)}),void 0)]}),o)}))},void 0):(0,e.jsx)("div",x({className:"select-nodata"},{children:"暂无选项"}),void 0)}),void 0)}),[he,M,_,de,I]),it=(0,t.useMemo)((function(){var t="select-popover-content "+oe;return(0,e.jsxs)("div",x({style:{width:(ee&&ee.current?ee.current.offsetWidth:0)+"px"},className:t},{children:[Z&&"inside"===V&&(0,e.jsxs)("div",x({className:"select-popover-search"},{children:[(0,e.jsx)(o.TextField,{variant:"outlined",placeholder:"请输入搜索名",value:Fe,onChange:Ke,ref:ze},void 0),(0,e.jsx)(l(),{},void 0)]}),void 0),rt]}),void 0)}),[ie,ee,he,R,_,M,de,Fe,Z,oe,V]),nt=(0,t.useMemo)((function(){var t,r=function(e){return me[de[e]]&&me[de[e]][M]||de[e]};return(0,e.jsx)(o.Popover,x({open:Se,anchorEl:ee&&ee.current,onClose:Ae,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},className:(t=X["select-more-popover"],J&&(t+=" "+J),t)},{children:(0,e.jsxs)("div",x({className:"select-more"},{children:[(0,e.jsxs)("div",x({className:"select-more-title"},{children:[(0,e.jsx)("span",{children:"已选中"},void 0),(0,e.jsx)("span",{children:de.length-Number(ye)},void 0)]}),void 0),(0,e.jsx)("div",x({className:"select-more-content"},{children:de&&de.map((function(t,o){return null!==ye&&ye>o?null:(0,e.jsxs)("div",x({className:"select-more-content-item"},{children:[(0,e.jsx)("span",{children:(0,e.jsx)(h.default,{children:r(o)},void 0)},void 0),!S&&(0,e.jsx)(u(),{onClick:Ue(me[de[o]],de[o])},void 0)]}),o)}))}),void 0)]}),void 0)}),void 0)}),[Se,de,ye,me,S,M,J]);return(0,e.jsxs)("div",x({className:(De=X.select,De+=" select",k&&!Ee&&(De+=" "+te),n&&(De+=" "+n),a&&(De+=" select-"+a),D&&(De+=" select-error"),S&&(De+=" select-disabled"),ie&&(De+=" select-open"),k&&(De+=" select-multiple"),Ee&&(De+=" select-over-line"),De)},{children:[Qe,(0,e.jsx)(o.Tooltip,x({open:ie,title:it,onClose:We,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:function(){var e=X["select-popover"];return G&&(e+=" "+G),e}()},placement:"bottom-start"},{children:ot}),void 0),L&&(0,e.jsx)("p",x({className:"select-error-text"},{children:L}),void 0),nt]}),void 0)};p.default=w}(),p}()}));
|
|
16
|
+
r(4126);var o=r(9297),n=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;n=i("react.element"),t.Fragment=i("react.fragment")}var s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,r){var o,i={},a=null,u=null;for(o in void 0!==r&&(a=""+r),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,o)&&!c.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:a,ref:u,props:i,_owner:s.current}}t.jsx=a,t.jsxs=a},7712:function(e,t,r){e.exports=r(9524)},3094:function(e,t,r){var o=r(7712),n=r(9297),i=r(1731),s=function(){return s=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},s.apply(this,arguments)};t.default=function(e){var t=e.children,r=e.placement,l=void 0===r?"bottom-start":r,c=e.tips,a=void 0===c?"":c,u=e.className,d=void 0===u?"":u,p=(0,n.useRef)(),v=(0,n.useState)(""),f=v[0],m=v[1];(0,n.useEffect)((function(){m(a)}),[a]);var h;return(0,o.jsx)("div",s({ref:function(e){e&&(p.current=e)},className:(h="paraui-auto-tips",d&&(h+=" "+d),h),onMouseOver:function(){p.current.scrollWidth>p.current.offsetWidth?m(f||p.current.innerText):m("")}},{children:(0,o.jsx)(i.Tooltip,s({title:f,placement:l},{children:(0,o.jsx)("div",s({className:"auto-tips-content"},{children:t}),void 0)}),void 0)}),void 0)}},370:function(e,t,r){r.r(t),r.d(t,{Select:function(){return x}});var o=r(7712),n=r(9297),i=r(1731),s=r(6028),l=r.n(s),c=r(4115),a=r.n(c),u=r(6110),d=r.n(u),p=r(19),v=r.n(p),f=r(3094),m=r(3475),h=function(){return h=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},h.apply(this,arguments)},y=function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},x=function(e){var t=e.className,r=e.size,s=void 0===r?"large":r,c=e.labelMode,u=void 0===c?"outside":c,p=e.placeholder,x=void 0===p?"":p,j=e.label,g=void 0===j?"":j,b=e.disabled,w=void 0!==b&&b,O=e.multiple,S=void 0!==O&&O,N=e.required,k=void 0!==N&&N,C=e.labelSign,E=e.error,q=void 0!==E&&E,T=e.helperText,L=void 0===T?"":T,P=e.list,M=e.showName,_=void 0===M?"label":M,D=e.showValue,F=void 0===D?"value":D,I=e.childrenName,U=void 0===I?"children":I,z=e.value,R=e.onChange,H=e.overLine,V=void 0!==H&&H,W=e.search,A=void 0!==W&&W,B=e.searchModel,K=void 0===B?"inside":B,$=e.selectPopoverClassName,Y=e.morePopoverClassName,G=e.onEnter,J=(0,n.useRef)(null),Q=(0,n.useState)("select-"+(0,m.UUID)())[0],X=(0,n.useState)("select-popover-"+(0,m.UUID)())[0],Z=(0,n.useState)(!1),ee=Z[0],te=Z[1],re=(0,n.useState)(!1),oe=re[0],ne=re[1],ie=(0,n.useState)([]),se=ie[0],le=ie[1],ce=(0,n.useState)([]),ae=ce[0],ue=ce[1],de=(0,n.useState)({}),pe=de[0],ve=de[1],fe=(0,n.useState)(null),me=fe[0],he=fe[1],ye=(0,n.useState)({})[0],xe=(0,n.useState)(!1),je=xe[0],ge=xe[1],be=(0,n.useState)(""),we=be[0],Oe=be[1],Se=(0,n.useState)(!1),Ne=Se[0],ke=Se[1],Ce=(0,n.useRef)(null);(0,n.useEffect)((function(){void 0!==e.defaultValue&&(e.multiple?le((0,m.DeepClone)(e.defaultValue||[])):le(""===e.defaultValue?[]:[e.defaultValue]))}),[]),(0,n.useEffect)((function(){void 0!==z&&le(S?(0,m.DeepClone)(z||[]):""===z?[]:[z])}),[z,S]),(0,n.useEffect)((function(){if(A&&"outside"===K)return ke(!!S);ke(V)}),[V,A,K,S]),(0,n.useEffect)((function(){for(var e={},t=0,r=P.length;t<r;t++){var o=P[t];if(o[U]&&o[U].length>0)for(var n=o[U],i=0,s=n.length;i<s;i++){var l=n[i];e[l[F]]=l}else e[o[F]]=o}ve(e)}),[P]),(0,n.useEffect)((function(){S&&(Ne||he(se.length))}),[Ne,S,se]),(0,n.useEffect)((function(){return Ne?he(se.length):(setTimeout((function(){Me(se.length)})),window.addEventListener("resize",_e)),function(){window.removeEventListener("resize",_e)}}),[se,Ne]),(0,n.useEffect)((function(){se&&se.length>0?ne(!0):(ne(!1),A&&"outside"===K&&ne(""!==we))}),[A,we,K,se]),(0,n.useEffect)((function(){clearTimeout(ye.searchTimer),A&&""!==we.trim()?ye.searchTimer=setTimeout((function(){for(var e=[],t=(0,m.DeepClone)(P),r=0,o=t.length;r<o;r++){var n=t[r];if(n[U]&&n[U].length>0){for(var i=n[U],s=[],l=0,c=i.length;l<c;l++){var a=i[l];Pe(a)&&s.push(a)}s.length>0&&(n[U]=s,e.push(n))}else{Pe(n)&&e.push(n)}}ue(e)}),100):ue((0,m.DeepClone)(P))}),[A,we,P]),(0,n.useEffect)((function(){return ee?setTimeout((function(){qe(),window.addEventListener("click",Le),window.addEventListener("keydown",Be)})):(Oe(""),window.removeEventListener("click",Le),window.removeEventListener("keydown",Be)),function(){window.removeEventListener("click",Le),window.removeEventListener("keydown",Be)}}),[ee]),(0,n.useEffect)((function(){we&&te(!0)}),[we]),(0,n.useEffect)((function(){S&&"outside"===K&&!0!==w&&Ve(we)}),[we,S,w,K]);var Ee,qe=function(){var e=Ce&&Ce.current;e&&e.focus()},Te=function(e,t){for(var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;e&&!r.call(e,t);)e=e.parentElement;return e},Le=function(e){Te(e.target,"."+X)||te(!1)},Pe=function(e){var t=!1;return-1!==e[_].indexOf(we)&&(t=!0),t},Me=function(e){if(null!==e&&0!==e){void 0===e&&(e=se.length);var t=document.querySelector("."+Q+" > .select-content > .check-select-content");if(t)if(t.scrollHeight>t.clientHeight){var r=Number(e)-1;he(r),Me(r)}else se.length<=e&&Ue()}},_e=function(){clearTimeout(ye.timer),ye.timer=setTimeout((function(){he(se.length),Me()}),100)},De=function(){!0!==w&&te(!0)},Fe=function(){te(!1)},Ie=function(e){ge(!0),te(!1),e.stopPropagation()},Ue=function(){ge(!1)},ze=function(t,r){return function(o){var n=t[F];if("object"!=typeof w||-1===w.indexOf(n))if(S){var i=se.indexOf(n);-1!==i?se.splice(i,1):se.push(n),void 0===e.value&&le(y([],se,!0)),R&&R(y([],se,!0),o),r&&G&&G(y([],se,!0)),qe()}else void 0===e.value&&le([n]),R&&R(n,o),r&&G&&G(n),Fe(),Oe("")}},Re=function(e,t){return function(r){var o;e||((o={})[F]=t,e=o),ze(e)(r),r.stopPropagation()}},He=function(e){Oe(e.target.value)},Ve=function(e){var t=Ce&&Ce.current;if(!t)return null;var r=window.getComputedStyle(t),o=r.fontFamily,n=function(e,t,r){var o=document.createElement("span");o.id="referenceSpan";var n={};n.width=o.offsetWidth,n.height=o.offsetHeight,o.style.visibility="hidden",o.style.fontSize=e,o.style.fontFamily=t,o.style.display="inline-block";var i=document.getElementById("referenceSpan");return i&&document.body.removeChild(i),document.body.appendChild(o),void 0!==o.textContent?o.textContent=r:o.innerText=r,n.width=parseFloat(window.getComputedStyle(o).width)-n.width,n.height=parseFloat(window.getComputedStyle(o).height)-n.height,document.body.removeChild(o),n}(r.fontSize,o,e),i=n.width;i<10&&(i=10),t.style.width=i+"px"},We=function(e){var t=e.selectDom,r=e.keyCode,o=e.currentKeydownDom,n=null,i="nextSibling",s=".select-popover-list > div",l=".select-popover-list-item";if(38===r&&(i="previousSibling",s=".select-popover-list > div:last-child",l=".select-popover-list-item:last-child"),o)if(n=o[i])-1!==n.className.indexOf("select-popover-list-group-label")&&((n=(n=o.parentNode)[i])||(n=t.querySelector(s)));else{var c=o.parentNode;c&&c.className&&-1!==c.className.indexOf("select-popover-list-group")&&(n=(n=o.parentNode)[i])||(n=t.querySelector(s))}else n=t.querySelector(s);if(n)if(-1!==n.className.indexOf("select-popover-list-group")){var a=n.querySelector(l);a&&(a.classList.add("select-popover-list-item-keydown"),Ae(a,t))}else n.classList.add("select-popover-list-item-keydown"),Ae(n,t)},Ae=function(e,t){clearTimeout(ye.scrollTimer);var r=t.clientHeight,o=e.offsetTop+e.clientHeight-r;ye.scroll=!0,t.scrollTop=o>0?o:0,ye.scrollTimer=setTimeout((function(){ye.scroll=!1}),100)},Be=function(e){var t=document.querySelector("."+X+" .select-popover-list");if(t){var r=t.querySelector(".select-popover-list-item-select"),o=t.querySelector(".select-popover-list-item-hover"),n=t.querySelector(".select-popover-list-item-keydown"),i=r;if(o&&(i=o),13===e.keyCode){var s=n||o;if(s){var l=s.dataset.val;ze(pe[l],!0)({target:n})}else G&&G(z)}n&&(i=n,n.classList.remove("select-popover-list-item-keydown")),40===e.keyCode&&We({selectDom:t,keyCode:e.keyCode,currentKeydownDom:i}),38===e.keyCode&&We({selectDom:t,keyCode:e.keyCode,currentKeydownDom:i})}},Ke=function(e){if(!ye.scroll){var t=Te(e.target,".select-popover-list-item");if(t){t.classList.add("select-popover-list-item-hover");var r=document.querySelector("."+X).querySelector(".select-popover-list-item-keydown");r&&r.classList.remove("select-popover-list-item-keydown")}}},$e=function(e){var t=Te(e.target,".select-popover-list-item");t&&t.classList.remove("select-popover-list-item-hover")},Ye=(0,n.useMemo)((function(){var e=Boolean(g||k||C);return(0,o.jsx)(o.Fragment,{children:"outside"===u&&e&&(0,o.jsxs)("label",h({className:"select-label"},{children:[g,k&&(0,o.jsx)("span",h({className:"select-required"},{children:"*"}),void 0),C&&(0,o.jsx)("span",{children:C},void 0)]}),void 0)},void 0)}),[u,g,C,k]),Ge=(0,n.useMemo)((function(){return(0,o.jsx)(o.Fragment,{children:!oe&&(0,o.jsx)("span",h({className:"select-label-placeholder"},{children:"outside"===u?x:(0,o.jsxs)(o.Fragment,{children:[g||x,k&&(0,o.jsx)("span",h({className:"select-required"},{children:"*"}),void 0),C&&(0,o.jsx)("span",{children:C},void 0)]},void 0)}),void 0)},void 0)}),[oe,u,x,g,C,k]),Je=(0,n.useMemo)((function(){return(0,o.jsx)(o.Fragment,{children:!S&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",h({className:"radio-select-content"},{children:function(){if(""!==we)return null;var e=pe[se[0]]&&pe[se[0]][_]||se[0];return Ne?e:(0,o.jsx)(f.default,{children:e},void 0)}()}),void 0),A&&"outside"===K&&!0!==w&&(0,o.jsx)("input",{className:"radio-search-outside",value:we,onChange:He,ref:Ce},void 0)]},void 0)},void 0)}),[S,oe,Ne,pe,se,_,A,K,we,w]),Qe=(0,n.useMemo)((function(){var e=function(e){return pe[se[e]]&&pe[se[e]][_]||se[e]};return(0,o.jsx)(o.Fragment,{children:S&&(0,o.jsxs)("div",h({className:"check-select-content"},{children:[se&&se.map((function(t,r){if(null!==me&&me<=r)return null;var n=!0;return(!0===w||"object"==typeof w&&-1!==w.indexOf(se[r]))&&(n=!1),(0,o.jsxs)("div",h({className:n?"check-select-content-item":"check-select-content-item check-select-content-item-noclose"},{children:[(0,o.jsx)("span",{children:e(r)},void 0),n&&(0,o.jsx)(v(),{onClick:Re(pe[se[r]],se[r])},void 0)]}),r)})),function(){if(null!==me&&se.length>me)return(0,o.jsx)("div",h({className:"check-select-content-item check-select-content-item-more",onClick:Ie},{children:(0,o.jsxs)("span",{children:["+",se.length-me]},void 0)}),void 0)}(),A&&"outside"===K&&!0!==w&&(0,o.jsx)("input",{className:"check-search-outside",value:we,onChange:He,ref:Ce},void 0)]}),void 0)},void 0)}),[S,oe,se,me,pe,w,R,we,A,K]),Xe=(0,n.useMemo)((function(){return(0,o.jsxs)("div",h({className:"select-content",onClick:De,ref:J},{children:[Ge,(0,o.jsx)("span",h({className:"select-svg"},{children:(0,o.jsx)(l(),{},void 0)}),void 0),Je,Qe]}),void 0)}),[J,oe,u,x,g,C,k,Ne,pe,se,_,S,me,w,R,we,K]),Ze=(0,n.useMemo)((function(){return(0,o.jsx)("div",h({className:"select-popover-list"},{children:ae&&ae.length>0?(0,o.jsx)(o.Fragment,{children:ae.map((function(e,t){if(e[U]&&e[U].length>0){var r=e[U];return(0,o.jsxs)("div",h({className:"select-popover-list-group"},{children:[(0,o.jsx)("span",h({className:"select-popover-list-group-label"},{children:e[_]}),void 0),r.map((function(e,t){var r=e[F],n="select-popover-list-item";return-1!==se.indexOf(r)&&(n+=" select-popover-list-item-select"),"object"==typeof w&&-1!==w.indexOf(r)&&(n+=" select-popover-list-item-disabled"),(0,o.jsxs)("div",h({onClick:ze(e),className:n,onMouseEnter:Ke,onMouseLeave:$e,"data-val":r},{children:[(0,o.jsx)("span",h({className:"select-popover-list-item-label"},{children:(0,o.jsx)(f.default,{children:e[_]},void 0)}),void 0),S&&(0,o.jsx)("span",h({className:"select-popover-list-item-svg"},{children:(0,o.jsx)(d(),{},void 0)}),void 0)]}),t)}))]}),t)}var n=e[F],i="select-popover-list-item";return-1!==se.indexOf(n)&&(i+=" select-popover-list-item-select"),"object"==typeof w&&-1!==w.indexOf(n)&&(i+=" select-popover-list-item-disabled"),(0,o.jsxs)("div",h({onClick:ze(e),className:i,onMouseEnter:Ke,onMouseLeave:$e,"data-val":n},{children:[(0,o.jsx)("span",h({className:"select-popover-list-item-label"},{children:(0,o.jsx)(f.default,{children:e[_]},void 0)}),void 0),S&&(0,o.jsx)("span",h({className:"select-popover-list-item-svg"},{children:(0,o.jsx)(d(),{},void 0)}),void 0)]}),t)}))},void 0):(0,o.jsx)("div",h({className:"select-nodata"},{children:"暂无选项"}),void 0)}),void 0)}),[ae,_,F,se,R,S]),et=(0,n.useMemo)((function(){return(0,o.jsxs)("div",h({style:{width:(J&&J.current?J.current.offsetWidth:0)+"px"},className:"select-popover-content "+X},{children:[A&&"inside"===K&&(0,o.jsxs)("div",h({className:"select-popover-search"},{children:[(0,o.jsx)("input",{placeholder:"请输入搜索名",value:we,onChange:He,ref:Ce},void 0),(0,o.jsx)(a(),{},void 0)]}),void 0),Ze]}),void 0)}),[ee,J,ae,U,F,_,se,we,A,X,K,S]),tt=(0,n.useMemo)((function(){var e,t=function(e){return pe[se[e]]&&pe[se[e]][_]||se[e]};return(0,o.jsx)(i.Popover,h({open:je,anchorEl:J&&J.current,onClose:Ue,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},className:(e="paraui-select-more-popover",s&&(e+=" paraui-select-more-popover-"+s),Y&&(e+=" "+Y),e)},{children:(0,o.jsxs)("div",h({className:"select-more"},{children:[(0,o.jsxs)("div",h({className:"select-more-title"},{children:[(0,o.jsx)("span",{children:"已选中"},void 0),(0,o.jsxs)("span",{children:["(",se.length-Number(me),")"]},void 0)]}),void 0),(0,o.jsx)("div",h({className:"select-more-content"},{children:se&&se.map((function(e,r){if(null!==me&&me>r)return null;var n=!0;return(!0===w||"object"==typeof w&&-1!==w.indexOf(se[r]))&&(n=!1),(0,o.jsxs)("div",h({className:"select-more-content-item"},{children:[(0,o.jsx)("span",{children:(0,o.jsx)(f.default,{children:t(r)},void 0)},void 0),n&&(0,o.jsx)(v(),{onClick:Re(pe[se[r]],se[r])},void 0)]}),r)}))}),void 0)]}),void 0)}),void 0)}),[je,se,me,pe,w,_,Y,s]);return(0,o.jsxs)("div",h({className:(Ee="paraui-select select",S&&!Ne&&(Ee+=" "+Q),t&&(Ee+=" "+t),s&&(Ee+=" select-"+s),q&&(Ee+=" select-error"),!0===w&&(Ee+=" select-disabled"),ee&&(Ee+=" select-open"),S&&(Ee+=" select-multiple"),Ne&&(Ee+=" select-over-line"),Ee)},{children:[Ye,(0,o.jsx)(i.Tooltip,h({open:ee,title:et,onClose:Fe,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,classes:{popper:function(){var e="paraui-select-popover";return s&&(e+=" paraui-select-popover-"+s),e+=S?" paraui-select-popover-multiple":" paraui-select-popover-radio",$&&(e+=" "+$),e}()},placement:"bottom-start"},{children:Xe}),void 0),L&&(0,o.jsx)("p",h({className:"select-error-text"},{children:L}),void 0),tt]}),void 0)};t.default=x},1731:function(t){t.exports=e},6110:function(e){e.exports=t},19:function(e){e.exports=r},6028:function(e){e.exports=o},4115:function(e){e.exports=n},3475:function(e){e.exports=i},9297:function(e){e.exports=s}},a={};function u(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return c[e](r,r.exports,u),r.exports}u.m=c,l=[],u.O=function(e,t,r,o){if(!t){var n=1/0;for(c=0;c<l.length;c++){t=l[c][0],r=l[c][1],o=l[c][2];for(var i=!0,s=0;s<t.length;s++)(!1&o||n>=o)&&Object.keys(u.O).every((function(e){return u.O[e](t[s])}))?t.splice(s--,1):(i=!1,o<n&&(n=o));i&&(l.splice(c--,1),e=r())}return e}o=o||0;for(var c=l.length;c>0&&l[c-1][2]>o;c--)l[c]=l[c-1];l[c]=[t,r,o]},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={8306:0,1465:0,9296:0};u.O.j=function(t){return 0===e[t]};var t=function(t,r){var o,n,i=r[0],s=r[1],l=r[2],c=0;for(o in s)u.o(s,o)&&(u.m[o]=s[o]);if(l)var a=l(u);for(t&&t(r);c<i.length;c++)n=i[c],u.o(e,n)&&e[n]&&e[n][0](),e[i[c]]=0;return u.O(a)},r=self.webpackChunkParaUI=self.webpackChunkParaUI||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var d=u.O(void 0,[9296],(function(){return u(370)}));return d=u.O(d)}()}));
|
package/SingleBox/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @description 单值框
|
|
5
5
|
*/
|
|
6
6
|
import { FunctionComponent, ReactNode } from 'react';
|
|
7
|
+
import './index.scss';
|
|
7
8
|
export interface SingleBoxProps {
|
|
8
9
|
/** 样式class */
|
|
9
10
|
className?: string;
|
|
@@ -11,6 +12,8 @@ export interface SingleBoxProps {
|
|
|
11
12
|
size?: 'small' | 'medium' | 'large';
|
|
12
13
|
/** 标题 */
|
|
13
14
|
label?: ReactNode;
|
|
15
|
+
/** 标题提示 */
|
|
16
|
+
labelSign?: ReactNode;
|
|
14
17
|
/** 提示语 */
|
|
15
18
|
placeholder?: string;
|
|
16
19
|
/** 是否禁用 */
|
|
@@ -21,7 +24,9 @@ export interface SingleBoxProps {
|
|
|
21
24
|
error?: boolean;
|
|
22
25
|
/** 错误文本 */
|
|
23
26
|
helperText?: ReactNode;
|
|
24
|
-
/**
|
|
27
|
+
/** 默认值 不受控 */
|
|
28
|
+
defaultValue?: string[];
|
|
29
|
+
/** 默认值 多选时为数组 单选单值 受控 */
|
|
25
30
|
value?: string[];
|
|
26
31
|
/** 改变值 */
|
|
27
32
|
onChange?: (val: string[]) => void;
|