@daoyi/nmtl-ui 2.0.0 → 2.0.1-alpha.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/lib/components/Autocomplete.js +1 -1
- package/lib/components/Avatar.js +1 -1
- package/lib/components/BackTop.js +1 -1
- package/lib/components/Backdrop-7fa25324.js +1 -0
- package/lib/components/{Backdrop-005c8b4c.js → Backdrop-aa6dd5b1.js} +1 -1
- package/lib/components/Breadcrumbs.js +1 -1
- package/lib/components/{Button-1656598a.js → Button-b51ee702.js} +1 -1
- package/lib/components/Button.js +1 -1
- package/lib/components/{ButtonBase-7f6b4926.js → ButtonBase-1d6d8acc.js} +1 -1
- package/lib/components/Checkbox.js +1 -1
- package/lib/components/CircularProgress-57f085c6.js +1 -0
- package/lib/components/CircularProgress-c639c5c5.js +1 -0
- package/lib/components/CollapseContent.js +1 -1
- package/lib/components/ContactModal.js +3 -3
- package/lib/components/{DialogActions-8f4f67a8.js → DialogActions-2bf616dd.js} +1 -1
- package/lib/components/Drawer.js +1 -1
- package/lib/components/Dropdown.js +1 -1
- package/lib/components/Empty-9a684667.js +1 -0
- package/lib/components/ExportButton.js +1 -1
- package/lib/components/ExtraTools.js +4 -4
- package/lib/components/{Fade-08d01ea1.js → Fade-9b890a95.js} +1 -1
- package/lib/components/Footer.js +1 -1
- package/lib/components/{FormControlLabel-d2f22510.js → FormControlLabel-9e4df6b1.js} +1 -1
- package/lib/components/{Grow-f47353ab.js → Grow-2e420949.js} +1 -1
- package/lib/components/Header.js +1 -1
- package/lib/components/{IconButton-08afdd5f.js → IconButton-0ca9ebf6.js} +1 -1
- package/lib/components/Input.js +1 -1
- package/lib/components/InputMethod.js +1 -1
- package/lib/components/KeywordSearch-9bcf8700.js +1 -0
- package/lib/components/KeywordSearch.js +1 -1
- package/lib/components/Keywords.js +1 -1
- package/lib/components/{ListItemText-fe52df1d.js → ListItemText-ea6a8c15.js} +1 -1
- package/lib/components/Loading.js +1 -1
- package/lib/components/MUITheme.js +1 -1
- package/lib/components/{Menu-a90b43a8.js → Menu-00ae7ef5.js} +1 -1
- package/lib/components/Menu-2fe8bd98.js +1 -0
- package/lib/components/{MenuItem-ea8605c4.js → MenuItem-008b7b8e.js} +1 -1
- package/lib/components/MenuItem-e598c6d1.js +1 -0
- package/lib/components/Modal-aee6ecb9.js +1 -0
- package/lib/components/Modal.js +1 -1
- package/lib/components/MoreButton.js +1 -1
- package/lib/components/{OutlinedInput-8ef374c1.js → OutlinedInput-41d5059c.js} +1 -1
- package/lib/components/{Paper-a2f8e11c.js → Paper-e55505f6.js} +1 -1
- package/lib/components/Popper-38783f40.js +25 -0
- package/lib/components/Popper-64735bbf.js +25 -0
- package/lib/components/Radio.js +1 -1
- package/lib/components/SNA.js +2 -2
- package/lib/components/Select-67722f3b.js +1 -0
- package/lib/components/{Select-bc85bfb7.js → Select-ff8c195b.js} +1 -1
- package/lib/components/Select.js +1 -1
- package/lib/components/Spin.js +1 -1
- package/lib/components/Table.js +1 -1
- package/lib/components/Tooltip-426efe3f.js +1 -0
- package/lib/components/Tooltip.js +1 -1
- package/lib/components/{Typography-2fd882d6.js → Typography-935acbcd.js} +1 -1
- package/lib/components/Typography-e92912a6.js +1 -0
- package/lib/components/{capitalize-ac294e48.js → capitalize-3fe59c84.js} +1 -1
- package/lib/components/capitalize-c17a778e.js +1 -0
- package/lib/components/createSvgIcon-18c57aba.js +1 -0
- package/lib/components/{createSvgIcon-9c22e3b7.js → createSvgIcon-18f01cfd.js} +1 -1
- package/lib/components/createSvgIcon-387310de.js +1 -0
- package/lib/components/{createSvgIcon-948e69fa.js → createSvgIcon-52768de7.js} +1 -1
- package/lib/components/createTheme-27772c33.js +1 -0
- package/lib/components/unstable_useId-3679dddb.js +1 -0
- package/lib/components/{useEventCallback-73d2efad.js → useEventCallback-5a112a33.js} +1 -1
- package/lib/components/{useTheme-3559986f.js → useTheme-138c96b6.js} +1 -1
- package/lib/components/{utils-afcd6661.js → utils-9165823e.js} +1 -1
- package/lib/utils/exportXlsx.js +1 -1
- package/package.json +1 -1
- package/lib/components/CircularProgress-52d2e115.js +0 -1
- package/lib/components/CircularProgress-8ff2afa1.js +0 -1
- package/lib/components/Empty-af83536b.js +0 -1
- package/lib/components/IconButton-8da5408c.js +0 -1
- package/lib/components/KeywordSearch-bbd7a5e4.js +0 -1
- package/lib/components/Menu-ab5072ad.js +0 -1
- package/lib/components/MenuItem-5d97ec63.js +0 -1
- package/lib/components/Modal-18e46255.js +0 -1
- package/lib/components/Select-91687b49.js +0 -1
- package/lib/components/Tooltip-32370ac1.js +0 -25
- package/lib/components/Typography-2b9bb6fe.js +0 -1
- package/lib/components/capitalize-30c6d564.js +0 -1
- package/lib/components/createSvgIcon-5711bb0d.js +0 -1
- package/lib/components/createSvgIcon-8e472edc.js +0 -1
- package/lib/components/useControlled-9bf012cb.js +0 -1
- package/lib/components/withStyles-49f09a2e.js +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{_ as e,a as t}from"./capitalize-3fe59c84.js";import*as n from"react";import"prop-types";import{useTheme as r}from"@material-ui/styles";import{c as o}from"./createChainedFunction-8d6683d4.js";import{u as i,s as a}from"./useForkRef-4ff8cc89.js";import{P as s}from"./Portal-411c252b.js";
|
|
2
|
+
/**!
|
|
3
|
+
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
4
|
+
* @version 1.16.1-lts
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright (c) 2016 Federico Zivolo and contributors
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/var f="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,p=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(f&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var l=f&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),p))}};function u(e){return e&&"[object Function]"==={}.toString.call(e)}function c(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function h(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=c(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:h(d(e))}function m(e){return e&&e.referenceNode?e.referenceNode:e}var v=f&&!(!window.MSInputMethodContext||!document.documentMode),g=f&&/MSIE 10/.test(navigator.userAgent);function b(e){return 11===e?v:10===e?g:v||g}function w(e){if(!e)return document.documentElement;for(var t=b(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===c(n,"position")?w(n):n:e?e.ownerDocument.documentElement:document.documentElement}function y(e){return null!==e.parentNode?y(e.parentNode):e}function E(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a,s,f=i.commonAncestorContainer;if(e!==f&&t!==f||r.contains(o))return"BODY"===(s=(a=f).nodeName)||"HTML"!==s&&w(a.firstElementChild)!==a?w(f):f;var p=y(e);return p.host?E(p.host,t):E(e,y(t).host)}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=x(t,"top"),o=x(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function L(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function T(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],b(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function M(e){var t=e.body,n=e.documentElement,r=b(10)&&getComputedStyle(n);return{height:T("Height",t,n,r),width:T("Width",t,n,r)}}var D=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},N=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),F=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function C(e){return k({},e,{right:e.left+e.width,bottom:e.top+e.height})}function P(e){var t={};try{if(b(10)){t=e.getBoundingClientRect();var n=x(e,"top"),r=x(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(e){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?M(e.ownerDocument):{},a=i.width||e.clientWidth||o.width,s=i.height||e.clientHeight||o.height,f=e.offsetWidth-a,p=e.offsetHeight-s;if(f||p){var l=c(e);f-=L(l,"x"),p-=L(l,"y"),o.width-=f,o.height-=p}return C(o)}function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=b(10),o="HTML"===t.nodeName,i=P(e),a=P(t),s=h(e),f=c(t),p=parseFloat(f.borderTopWidth),l=parseFloat(f.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var u=C({top:i.top-a.top-p,left:i.left-a.left-l,width:i.width,height:i.height});if(u.marginTop=0,u.marginLeft=0,!r&&o){var d=parseFloat(f.marginTop),m=parseFloat(f.marginLeft);u.top-=p-d,u.bottom-=p-d,u.left-=l-m,u.right-=l-m,u.marginTop=d,u.marginLeft=m}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(u=O(u,t)),u}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=H(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:x(n),s=t?0:x(n,"left"),f={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:o,height:i};return C(f)}function B(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===c(e,"position"))return!0;var n=d(e);return!!n&&B(n)}function A(e){if(!e||!e.parentElement||b())return document.documentElement;for(var t=e.parentElement;t&&"none"===c(t,"transform");)t=t.parentElement;return t||document.documentElement}function W(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?A(e):E(e,m(t));if("viewport"===r)i=S(a,o);else{var s=void 0;"scrollParent"===r?"BODY"===(s=h(d(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var f=H(s,a,o);if("HTML"!==s.nodeName||B(a))i=f;else{var p=M(e.ownerDocument),l=p.height,u=p.width;i.top+=f.top-f.marginTop,i.bottom=l+f.top,i.left+=f.left-f.marginLeft,i.right=u+f.left}}var c="number"==typeof(n=n||0);return i.left+=c?n:n.left||0,i.top+=c?n:n.top||0,i.right-=c?n:n.right||0,i.bottom-=c?n:n.bottom||0,i}function j(e){return e.width*e.height}function R(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=W(n,r,i,o),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},f=Object.keys(s).map((function(e){return k({key:e},s[e],{area:j(s[e])})})).sort((function(e,t){return t.area-e.area})),p=f.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),l=p.length>0?p[0].key:f[0].key,u=e.split("-")[1];return l+(u?"-"+u:"")}function I(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=r?A(t):E(t,m(n));return H(n,o,r)}function U(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function Y(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function V(e,t,n){n=n.split("-")[0];var r=U(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",s=i?"left":"top",f=i?"height":"width",p=i?"width":"height";return o[a]=t[a]+t[f]/2-r[f]/2,o[s]=n===s?t[s]-r[p]:t[Y(s)],o}function q(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function z(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=q(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&u(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))})),t}function G(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=I(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=R(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=V(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=z(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function _(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function X(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var o=t[r],i=o?""+o+n:e;if(void 0!==document.body.style[i])return i}return null}function J(){return this.state.isDestroyed=!0,_(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[X("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function K(e){var t=e.ownerDocument;return t?t.defaultView:window}function Q(e,t,n,r){var o="BODY"===e.nodeName,i=o?e.ownerDocument.defaultView:e;i.addEventListener(t,n,{passive:!0}),o||Q(h(i.parentNode),t,n,r),r.push(i)}function Z(e,t,n,r){n.updateBound=r,K(e).addEventListener("resize",n.updateBound,{passive:!0});var o=h(e);return Q(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function $(){this.state.eventsEnabled||(this.state=Z(this.reference,this.options,this.state,this.scheduleUpdate))}function ee(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,K(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function te(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function ne(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&te(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var re=f&&/Firefox/i.test(navigator.userAgent);function oe(e,t,n){var r=q(e,(function(e){return e.name===t})),o=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!o){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return o}var ie=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],ae=ie.slice(3);function se(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ae.indexOf(e),r=ae.slice(n+1).concat(ae.slice(0,n));return t?r.reverse():r}var fe="flip",pe="clockwise",le="counterclockwise";function ue(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(q(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var f=/\s*,\s*|\s+/,p=-1!==s?[a.slice(0,s).concat([a[s].split(f)[0]]),[a[s].split(f)[1]].concat(a.slice(s+1))]:[a];return p=p.map((function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){return C("%p"===a?n:r)[t]/100*i}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;return i}(e,o,t,n)}))})),p.forEach((function(e,t){e.forEach((function(n,r){te(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))}))})),o}var ce={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=-1!==["bottom","top"].indexOf(n),f=s?"left":"top",p=s?"width":"height",l={start:F({},f,i[f]),end:F({},f,i[f]+i[p]-a[p])};e.offsets.popper=k({},a,l[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],f=void 0;return f=te(+n)?[+n,0]:ue(n,i,a,s),"left"===s?(i.top+=f[0],i.left-=f[1]):"right"===s?(i.top+=f[0],i.left+=f[1]):"top"===s?(i.left+=f[0],i.top-=f[1]):"bottom"===s&&(i.left+=f[0],i.top+=f[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||w(e.instance.popper);e.instance.reference===n&&(n=w(n));var r=X("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[r];o.top="",o.left="",o[r]="";var f=W(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=s,t.boundaries=f;var p=t.priority,l=e.offsets.popper,u={primary:function(e){var n=l[e];return l[e]<f[e]&&!t.escapeWithReference&&(n=Math.max(l[e],f[e])),F({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=l[n];return l[e]>f[e]&&!t.escapeWithReference&&(r=Math.min(l[n],f[e]-("right"===e?l.width:l.height))),F({},n,r)}};return p.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";l=k({},l,u[t](e))})),e.offsets.popper=l,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),s=a?"right":"bottom",f=a?"left":"top",p=a?"width":"height";return n[s]<i(r[f])&&(e.offsets.popper[f]=i(r[f])-n[p]),n[f]>i(r[s])&&(e.offsets.popper[f]=i(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!oe(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,a=i.popper,s=i.reference,f=-1!==["left","right"].indexOf(o),p=f?"height":"width",l=f?"Top":"Left",u=l.toLowerCase(),d=f?"left":"top",h=f?"bottom":"right",m=U(r)[p];s[h]-m<a[u]&&(e.offsets.popper[u]-=a[u]-(s[h]-m)),s[u]+m>a[h]&&(e.offsets.popper[u]+=s[u]+m-a[h]),e.offsets.popper=C(e.offsets.popper);var v=s[u]+s[p]/2-m/2,g=c(e.instance.popper),b=parseFloat(g["margin"+l]),w=parseFloat(g["border"+l+"Width"]),y=v-e.offsets.popper[u]-b-w;return y=Math.max(Math.min(a[p]-m,y),0),e.arrowElement=r,e.offsets.arrow=(F(n={},u,Math.round(y)),F(n,d,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(_(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=W(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=Y(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case fe:a=[r,o];break;case pe:a=se(r);break;case le:a=se(r,!0);break;default:a=t.behavior}return a.forEach((function(s,f){if(r!==s||a.length===f+1)return e;r=e.placement.split("-")[0],o=Y(r);var p=e.offsets.popper,l=e.offsets.reference,u=Math.floor,c="left"===r&&u(p.right)>u(l.left)||"right"===r&&u(p.left)<u(l.right)||"top"===r&&u(p.bottom)>u(l.top)||"bottom"===r&&u(p.top)<u(l.bottom),d=u(p.left)<u(n.left),h=u(p.right)>u(n.right),m=u(p.top)<u(n.top),v=u(p.bottom)>u(n.bottom),g="left"===r&&d||"right"===r&&h||"top"===r&&m||"bottom"===r&&v,b=-1!==["top","bottom"].indexOf(r),w=!!t.flipVariations&&(b&&"start"===i&&d||b&&"end"===i&&h||!b&&"start"===i&&m||!b&&"end"===i&&v),y=!!t.flipVariationsByContent&&(b&&"start"===i&&h||b&&"end"===i&&d||!b&&"start"===i&&v||!b&&"end"===i&&m),E=w||y;(c||g||E)&&(e.flipped=!0,(c||g)&&(r=a[f+1]),E&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=k({},e.offsets.popper,V(e.instance.popper,e.offsets.reference,e.placement)),e=z(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(s?o[a?"width":"height"]:0),e.placement=Y(t),e.offsets.popper=C(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!oe(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=q(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,o=e.offsets.popper,i=q(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,s=w(e.instance.popper),f=P(s),p={position:o.position},l=function(e,t){var n=e.offsets,r=n.popper,o=n.reference,i=Math.round,a=Math.floor,s=function(e){return e},f=i(o.width),p=i(r.width),l=-1!==["left","right"].indexOf(e.placement),u=-1!==e.placement.indexOf("-"),c=t?l||u||f%2==p%2?i:a:s,d=t?i:s;return{left:c(f%2==1&&p%2==1&&!u&&t?r.left-1:r.left),top:d(r.top),bottom:d(r.bottom),right:c(r.right)}}(e,window.devicePixelRatio<2||!re),u="bottom"===n?"top":"bottom",c="right"===r?"left":"right",d=X("transform"),h=void 0,m=void 0;if(m="bottom"===u?"HTML"===s.nodeName?-s.clientHeight+l.bottom:-f.height+l.bottom:l.top,h="right"===c?"HTML"===s.nodeName?-s.clientWidth+l.right:-f.width+l.right:l.left,a&&d)p[d]="translate3d("+h+"px, "+m+"px, 0)",p[u]=0,p[c]=0,p.willChange="transform";else{var v="bottom"===u?-1:1,g="right"===c?-1:1;p[u]=m*v,p[c]=h*g,p.willChange=u+", "+c}var b={"x-placement":e.placement};return e.attributes=k({},b,e.attributes),e.styles=k({},p,e.styles),e.arrowStyles=k({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return ne(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&ne(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,o){var i=I(o,t,e,n.positionFixed),a=R(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),ne(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}},de={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:ce},he=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};D(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=l(this.update.bind(this)),this.options=k({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(k({},e.Defaults.modifiers,o.modifiers)).forEach((function(t){r.options.modifiers[t]=k({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return k({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&u(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return N(e,[{key:"update",value:function(){return G.call(this)}},{key:"destroy",value:function(){return J.call(this)}},{key:"enableEventListeners",value:function(){return $.call(this)}},{key:"disableEventListeners",value:function(){return ee.call(this)}}]),e}();he.Utils=("undefined"!=typeof window?window:global).PopperUtils,he.placements=ie,he.Defaults=de;var me=he;function ve(e){return"function"==typeof e?e():e}var ge="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,be={},we=n.forwardRef((function(f,p){var l=f.anchorEl,u=f.children,c=f.container,d=f.disablePortal,h=void 0!==d&&d,m=f.keepMounted,v=void 0!==m&&m,g=f.modifiers,b=f.open,w=f.placement,y=void 0===w?"bottom":w,E=f.popperOptions,x=void 0===E?be:E,O=f.popperRef,L=f.style,T=f.transition,M=void 0!==T&&T,D=e(f,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),N=n.useRef(null),F=i(N,p),k=n.useRef(null),C=i(k,O),P=n.useRef(C);ge((function(){P.current=C}),[C]),n.useImperativeHandle(O,(function(){return k.current}),[]);var H=n.useState(!0),S=H[0],B=H[1],A=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(y,r()),W=n.useState(A),j=W[0],R=W[1];n.useEffect((function(){k.current&&k.current.update()}));var I=n.useCallback((function(){if(N.current&&l&&b){k.current&&(k.current.destroy(),P.current(null));var e=function(e){R(e.placement)};ve(l);var n=new me(ve(l),N.current,t({placement:A},x,{modifiers:t({},h?{}:{preventOverflow:{boundariesElement:"window"}},g,x.modifiers),onCreate:o(e,x.onCreate),onUpdate:o(e,x.onUpdate)}));P.current(n)}}),[l,h,g,b,A,x]),U=n.useCallback((function(e){a(F,e),I()}),[F,I]),Y=function(){k.current&&(k.current.destroy(),P.current(null))};if(n.useEffect((function(){return function(){Y()}}),[]),n.useEffect((function(){b||M||Y()}),[b,M]),!v&&!b&&(!M||S))return null;var V={placement:j};return M&&(V.TransitionProps={in:b,onEnter:function(){B(!1)},onExited:function(){B(!0),Y()}}),n.createElement(s,{disablePortal:h,container:c},n.createElement("div",t({ref:U,role:"tooltip"},D,{style:t({position:"fixed",top:0,left:0,display:b||!v||M?null:"none"},L)}),"function"==typeof u?u(V):u))})),ye=we;export{ye as P};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{b as e,a as t}from"./createTheme-27772c33.js";import*as n from"react";import"prop-types";import{useTheme as r}from"@material-ui/styles";import{a as o,c as i,s as a,l as s}from"./unstable_useId-3679dddb.js";
|
|
2
|
+
/**!
|
|
3
|
+
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
|
4
|
+
* @version 1.16.1-lts
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright (c) 2016 Federico Zivolo and contributors
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/var f="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,p=function(){for(var e=["Edge","Trident","Firefox"],t=0;t<e.length;t+=1)if(f&&navigator.userAgent.indexOf(e[t])>=0)return 1;return 0}();var l=f&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),p))}};function u(e){return e&&"[object Function]"==={}.toString.call(e)}function c(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function h(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=c(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:h(d(e))}function m(e){return e&&e.referenceNode?e.referenceNode:e}var v=f&&!(!window.MSInputMethodContext||!document.documentMode),g=f&&/MSIE 10/.test(navigator.userAgent);function b(e){return 11===e?v:10===e?g:v||g}function w(e){if(!e)return document.documentElement;for(var t=b(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===c(n,"position")?w(n):n:e?e.ownerDocument.documentElement:document.documentElement}function y(e){return null!==e.parentNode?y(e.parentNode):e}function E(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a,s,f=i.commonAncestorContainer;if(e!==f&&t!==f||r.contains(o))return"BODY"===(s=(a=f).nodeName)||"HTML"!==s&&w(a.firstElementChild)!==a?w(f):f;var p=y(e);return p.host?E(p.host,t):E(e,y(t).host)}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function O(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=x(t,"top"),o=x(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function L(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function T(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],b(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function M(e){var t=e.body,n=e.documentElement,r=b(10)&&getComputedStyle(n);return{height:T("Height",t,n,r),width:T("Width",t,n,r)}}var D=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},N=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),F=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function C(e){return k({},e,{right:e.left+e.width,bottom:e.top+e.height})}function H(e){var t={};try{if(b(10)){t=e.getBoundingClientRect();var n=x(e,"top"),r=x(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(e){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?M(e.ownerDocument):{},a=i.width||e.clientWidth||o.width,s=i.height||e.clientHeight||o.height,f=e.offsetWidth-a,p=e.offsetHeight-s;if(f||p){var l=c(e);f-=L(l,"x"),p-=L(l,"y"),o.width-=f,o.height-=p}return C(o)}function P(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=b(10),o="HTML"===t.nodeName,i=H(e),a=H(t),s=h(e),f=c(t),p=parseFloat(f.borderTopWidth),l=parseFloat(f.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var u=C({top:i.top-a.top-p,left:i.left-a.left-l,width:i.width,height:i.height});if(u.marginTop=0,u.marginLeft=0,!r&&o){var d=parseFloat(f.marginTop),m=parseFloat(f.marginLeft);u.top-=p-d,u.bottom-=p-d,u.left-=l-m,u.right-=l-m,u.marginTop=d,u.marginLeft=m}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(u=O(u,t)),u}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=P(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:x(n),s=t?0:x(n,"left"),f={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:o,height:i};return C(f)}function B(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===c(e,"position"))return!0;var n=d(e);return!!n&&B(n)}function A(e){if(!e||!e.parentElement||b())return document.documentElement;for(var t=e.parentElement;t&&"none"===c(t,"transform");)t=t.parentElement;return t||document.documentElement}function W(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?A(e):E(e,m(t));if("viewport"===r)i=S(a,o);else{var s=void 0;"scrollParent"===r?"BODY"===(s=h(d(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var f=P(s,a,o);if("HTML"!==s.nodeName||B(a))i=f;else{var p=M(e.ownerDocument),l=p.height,u=p.width;i.top+=f.top-f.marginTop,i.bottom=l+f.top,i.left+=f.left-f.marginLeft,i.right=u+f.left}}var c="number"==typeof(n=n||0);return i.left+=c?n:n.left||0,i.top+=c?n:n.top||0,i.right-=c?n:n.right||0,i.bottom-=c?n:n.bottom||0,i}function R(e){return e.width*e.height}function j(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=W(n,r,i,o),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},f=Object.keys(s).map((function(e){return k({key:e},s[e],{area:R(s[e])})})).sort((function(e,t){return t.area-e.area})),p=f.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),l=p.length>0?p[0].key:f[0].key,u=e.split("-")[1];return l+(u?"-"+u:"")}function I(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=r?A(t):E(t,m(n));return P(n,o,r)}function U(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function Y(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function V(e,t,n){n=n.split("-")[0];var r=U(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",s=i?"left":"top",f=i?"height":"width",p=i?"width":"height";return o[a]=t[a]+t[f]/2-r[f]/2,o[s]=n===s?t[s]-r[p]:t[Y(s)],o}function q(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function z(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=q(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&u(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))})),t}function G(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=I(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=j(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=V(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=z(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function _(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function X(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var o=t[r],i=o?""+o+n:e;if(void 0!==document.body.style[i])return i}return null}function J(){return this.state.isDestroyed=!0,_(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[X("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function K(e){var t=e.ownerDocument;return t?t.defaultView:window}function Q(e,t,n,r){var o="BODY"===e.nodeName,i=o?e.ownerDocument.defaultView:e;i.addEventListener(t,n,{passive:!0}),o||Q(h(i.parentNode),t,n,r),r.push(i)}function Z(e,t,n,r){n.updateBound=r,K(e).addEventListener("resize",n.updateBound,{passive:!0});var o=h(e);return Q(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function $(){this.state.eventsEnabled||(this.state=Z(this.reference,this.options,this.state,this.scheduleUpdate))}function ee(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,K(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function te(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function ne(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&te(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var re=f&&/Firefox/i.test(navigator.userAgent);function oe(e,t,n){var r=q(e,(function(e){return e.name===t})),o=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!o){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return o}var ie=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],ae=ie.slice(3);function se(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ae.indexOf(e),r=ae.slice(n+1).concat(ae.slice(0,n));return t?r.reverse():r}var fe="flip",pe="clockwise",le="counterclockwise";function ue(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(q(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var f=/\s*,\s*|\s+/,p=-1!==s?[a.slice(0,s).concat([a[s].split(f)[0]]),[a[s].split(f)[1]].concat(a.slice(s+1))]:[a];return p=p.map((function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){return C("%p"===a?n:r)[t]/100*i}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;return i}(e,o,t,n)}))})),p.forEach((function(e,t){e.forEach((function(n,r){te(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))}))})),o}var ce={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=-1!==["bottom","top"].indexOf(n),f=s?"left":"top",p=s?"width":"height",l={start:F({},f,i[f]),end:F({},f,i[f]+i[p]-a[p])};e.offsets.popper=k({},a,l[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],f=void 0;return f=te(+n)?[+n,0]:ue(n,i,a,s),"left"===s?(i.top+=f[0],i.left-=f[1]):"right"===s?(i.top+=f[0],i.left+=f[1]):"top"===s?(i.left+=f[0],i.top-=f[1]):"bottom"===s&&(i.left+=f[0],i.top+=f[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||w(e.instance.popper);e.instance.reference===n&&(n=w(n));var r=X("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[r];o.top="",o.left="",o[r]="";var f=W(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=s,t.boundaries=f;var p=t.priority,l=e.offsets.popper,u={primary:function(e){var n=l[e];return l[e]<f[e]&&!t.escapeWithReference&&(n=Math.max(l[e],f[e])),F({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=l[n];return l[e]>f[e]&&!t.escapeWithReference&&(r=Math.min(l[n],f[e]-("right"===e?l.width:l.height))),F({},n,r)}};return p.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";l=k({},l,u[t](e))})),e.offsets.popper=l,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),s=a?"right":"bottom",f=a?"left":"top",p=a?"width":"height";return n[s]<i(r[f])&&(e.offsets.popper[f]=i(r[f])-n[p]),n[f]>i(r[s])&&(e.offsets.popper[f]=i(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!oe(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,a=i.popper,s=i.reference,f=-1!==["left","right"].indexOf(o),p=f?"height":"width",l=f?"Top":"Left",u=l.toLowerCase(),d=f?"left":"top",h=f?"bottom":"right",m=U(r)[p];s[h]-m<a[u]&&(e.offsets.popper[u]-=a[u]-(s[h]-m)),s[u]+m>a[h]&&(e.offsets.popper[u]+=s[u]+m-a[h]),e.offsets.popper=C(e.offsets.popper);var v=s[u]+s[p]/2-m/2,g=c(e.instance.popper),b=parseFloat(g["margin"+l]),w=parseFloat(g["border"+l+"Width"]),y=v-e.offsets.popper[u]-b-w;return y=Math.max(Math.min(a[p]-m,y),0),e.arrowElement=r,e.offsets.arrow=(F(n={},u,Math.round(y)),F(n,d,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(_(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=W(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=Y(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case fe:a=[r,o];break;case pe:a=se(r);break;case le:a=se(r,!0);break;default:a=t.behavior}return a.forEach((function(s,f){if(r!==s||a.length===f+1)return e;r=e.placement.split("-")[0],o=Y(r);var p=e.offsets.popper,l=e.offsets.reference,u=Math.floor,c="left"===r&&u(p.right)>u(l.left)||"right"===r&&u(p.left)<u(l.right)||"top"===r&&u(p.bottom)>u(l.top)||"bottom"===r&&u(p.top)<u(l.bottom),d=u(p.left)<u(n.left),h=u(p.right)>u(n.right),m=u(p.top)<u(n.top),v=u(p.bottom)>u(n.bottom),g="left"===r&&d||"right"===r&&h||"top"===r&&m||"bottom"===r&&v,b=-1!==["top","bottom"].indexOf(r),w=!!t.flipVariations&&(b&&"start"===i&&d||b&&"end"===i&&h||!b&&"start"===i&&m||!b&&"end"===i&&v),y=!!t.flipVariationsByContent&&(b&&"start"===i&&h||b&&"end"===i&&d||!b&&"start"===i&&v||!b&&"end"===i&&m),E=w||y;(c||g||E)&&(e.flipped=!0,(c||g)&&(r=a[f+1]),E&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=k({},e.offsets.popper,V(e.instance.popper,e.offsets.reference,e.placement)),e=z(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(s?o[a?"width":"height"]:0),e.placement=Y(t),e.offsets.popper=C(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!oe(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=q(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,o=e.offsets.popper,i=q(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,s=w(e.instance.popper),f=H(s),p={position:o.position},l=function(e,t){var n=e.offsets,r=n.popper,o=n.reference,i=Math.round,a=Math.floor,s=function(e){return e},f=i(o.width),p=i(r.width),l=-1!==["left","right"].indexOf(e.placement),u=-1!==e.placement.indexOf("-"),c=t?l||u||f%2==p%2?i:a:s,d=t?i:s;return{left:c(f%2==1&&p%2==1&&!u&&t?r.left-1:r.left),top:d(r.top),bottom:d(r.bottom),right:c(r.right)}}(e,window.devicePixelRatio<2||!re),u="bottom"===n?"top":"bottom",c="right"===r?"left":"right",d=X("transform"),h=void 0,m=void 0;if(m="bottom"===u?"HTML"===s.nodeName?-s.clientHeight+l.bottom:-f.height+l.bottom:l.top,h="right"===c?"HTML"===s.nodeName?-s.clientWidth+l.right:-f.width+l.right:l.left,a&&d)p[d]="translate3d("+h+"px, "+m+"px, 0)",p[u]=0,p[c]=0,p.willChange="transform";else{var v="bottom"===u?-1:1,g="right"===c?-1:1;p[u]=m*v,p[c]=h*g,p.willChange=u+", "+c}var b={"x-placement":e.placement};return e.attributes=k({},b,e.attributes),e.styles=k({},p,e.styles),e.arrowStyles=k({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return ne(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&ne(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,o){var i=I(o,t,e,n.positionFixed),a=j(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),ne(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}},de={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:ce},he=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};D(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=l(this.update.bind(this)),this.options=k({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(k({},e.Defaults.modifiers,o.modifiers)).forEach((function(t){r.options.modifiers[t]=k({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return k({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&u(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return N(e,[{key:"update",value:function(){return G.call(this)}},{key:"destroy",value:function(){return J.call(this)}},{key:"enableEventListeners",value:function(){return $.call(this)}},{key:"disableEventListeners",value:function(){return ee.call(this)}}]),e}();he.Utils=("undefined"!=typeof window?window:global).PopperUtils,he.placements=ie,he.Defaults=de;var me=he;function ve(e){return"function"==typeof e?e():e}var ge="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,be={},we=n.forwardRef((function(f,p){var l=f.anchorEl,u=f.children,c=f.container,d=f.disablePortal,h=void 0!==d&&d,m=f.keepMounted,v=void 0!==m&&m,g=f.modifiers,b=f.open,w=f.placement,y=void 0===w?"bottom":w,E=f.popperOptions,x=void 0===E?be:E,O=f.popperRef,L=f.style,T=f.transition,M=void 0!==T&&T,D=e(f,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),N=n.useRef(null),F=o(N,p),k=n.useRef(null),C=o(k,O),H=n.useRef(C);ge((function(){H.current=C}),[C]),n.useImperativeHandle(O,(function(){return k.current}),[]);var P=n.useState(!0),S=P[0],B=P[1],A=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(y,r()),W=n.useState(A),R=W[0],j=W[1];n.useEffect((function(){k.current&&k.current.update()}));var I=n.useCallback((function(){if(N.current&&l&&b){k.current&&(k.current.destroy(),H.current(null));var e=function(e){j(e.placement)};ve(l);var n=new me(ve(l),N.current,t({placement:A},x,{modifiers:t({},h?{}:{preventOverflow:{boundariesElement:"window"}},g,x.modifiers),onCreate:i(e,x.onCreate),onUpdate:i(e,x.onUpdate)}));H.current(n)}}),[l,h,g,b,A,x]),U=n.useCallback((function(e){a(F,e),I()}),[F,I]),Y=function(){k.current&&(k.current.destroy(),H.current(null))};if(n.useEffect((function(){return function(){Y()}}),[]),n.useEffect((function(){b||M||Y()}),[b,M]),!v&&!b&&(!M||S))return null;var V={placement:R};return M&&(V.TransitionProps={in:b,onEnter:function(){B(!1)},onExited:function(){B(!0),Y()}}),n.createElement(s,{disablePortal:h,container:c},n.createElement("div",t({ref:U,role:"tooltip"},D,{style:t({position:"fixed",top:0,left:0,display:b||!v||M?null:"none"},L)}),"function"==typeof u?u(V):u))})),ye=we;export{ye as P};
|
package/lib/components/Radio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./_rollupPluginBabelHelpers-b18bba19.js";import*as a from"react";import o from"react";import r from"prop-types";import{s as t}from"./style-inject.es-1f59c1d0.js";import{w as n,c as s,d as i,_ as l,a as c,b as
|
|
1
|
+
import{b as e}from"./_rollupPluginBabelHelpers-b18bba19.js";import*as a from"react";import o from"react";import r from"prop-types";import{s as t}from"./style-inject.es-1f59c1d0.js";import{w as n,c as s,d as i,_ as l,a as c,b as m,f as d}from"./capitalize-3fe59c84.js";import{u}from"./useForkRef-4ff8cc89.js";import{u as f}from"./useControlled-b5d6fb94.js";import{u as p}from"./unstable_useId-45c5b1e4.js";import{S as v,F as h}from"./FormControlLabel-9e4df6b1.js";import{c as b}from"./createSvgIcon-52768de7.js";import{c as y}from"./createChainedFunction-8d6683d4.js";import"@material-ui/styles";import"./useFormControl-607a2e33.js";import"./FormControlContext-90b149a2.js";import"./IconButton-0ca9ebf6.js";import"./ButtonBase-1d6d8acc.js";import"react-dom";import"./useEventCallback-5a112a33.js";import"./useIsFocusVisible-217260c3.js";import"./TransitionGroupContext-981f4b66.js";import"./Typography-935acbcd.js";var C=b(a.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),g=b(a.createElement("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}));var k=n((function(e){return{root:{position:"relative",display:"flex","&$checked $layer":{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}},layer:{left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},checked:{}}}),{name:"PrivateRadioButtonIcon"})((function(e){var o=e.checked,r=e.classes,t=e.fontSize;return a.createElement("div",{className:s(r.root,o&&r.checked)},a.createElement(C,{fontSize:t}),a.createElement(g,{fontSize:t,className:r.layer}))})),j=a.createContext();var E=a.createElement(k,{checked:!0}),z=a.createElement(k,null),w=a.forwardRef((function(e,o){var r=e.checked,t=e.classes,n=e.color,i=void 0===n?"secondary":n,d=e.name,u=e.onChange,f=e.size,p=void 0===f?"medium":f,h=l(e,["checked","classes","color","name","onChange","size"]),b=a.useContext(j),C=r,g=y(u,b&&b.onChange),k=d;return b&&(void 0===C&&(C=b.value===e.value),void 0===k&&(k=b.name)),a.createElement(v,c({color:i,type:"radio",icon:a.cloneElement(z,{fontSize:"small"===p?"small":"medium"}),checkedIcon:a.cloneElement(E,{fontSize:"small"===p?"small":"medium"}),classes:{root:s(t.root,t["color".concat(m(i))]),checked:t.checked,disabled:t.disabled},name:k,checked:C,onChange:g,ref:o},h))})),x=n((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:i(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:i(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiRadio"})(w),S=a.forwardRef((function(e,o){var r=e.classes,t=e.className,n=e.row,i=void 0!==n&&n,m=l(e,["classes","className","row"]);return a.createElement("div",c({className:s(r.root,t,i&&r.row),ref:o},m))})),N=n({root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},{name:"MuiFormGroup"})(S),O=a.forwardRef((function(e,o){var r=e.actions,t=e.children,n=e.name,s=e.value,i=e.onChange,m=l(e,["actions","children","name","value","onChange"]),v=a.useRef(null),h=f({controlled:s,default:e.defaultValue,name:"RadioGroup"}),b=d(h,2),y=b[0],C=b[1];a.useImperativeHandle(r,(function(){return{focus:function(){var e=v.current.querySelector("input:not(:disabled):checked");e||(e=v.current.querySelector("input:not(:disabled)")),e&&e.focus()}}}),[]);var g=u(o,v),k=p(n);return a.createElement(j.Provider,{value:{name:k,onChange:function(e){C(e.target.value),i&&i(e,e.target.value)},value:y}},a.createElement(N,c({role:"radiogroup",ref:g},m),t))}));t("");var F=function(a){var r=a.className,t=a.name,n=a.defaultValue,s=a.value,i=a.size,l=a.style,c=a.direction,m=a.options,d=a.onChange;return o.createElement(O,{className:"radioGroup",style:e({flexDirection:c},l),name:t,defaultValue:n||void 0,value:s||void 0,onChange:function(e){d&&d(e.target.value)}},Array.isArray(m)&&m.map((function(e){return o.createElement(h,{value:e.value,key:e.value,control:o.createElement(x,{disabled:e.disabled||!1,size:i,className:r}),label:e.label})})))};F.defaultProps={className:void 0,name:void 0,defaultValue:void 0,value:void 0,size:"small",style:void 0,direction:"row",options:void 0,onChange:function(){}},F.propTypes={className:r.string,name:r.string,defaultValue:r.oneOfType([r.string,r.number]),value:r.oneOfType([r.string,r.number]),size:r.oneOf(["small","medium"]),style:r.objectOf(r.any),direction:r.oneOf(["row","column"]),options:r.arrayOf(r.any),onChange:r.func};export{F as default};
|