import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","size","form","disabled","view","status","leftSide","rightSide","children","style","focused","leftSlotsRefs","rightSlotsRefs"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import React,{forwardRef}from"react";import{useFlag}from"../../../hooks/useFlag";import{cnFieldControlLayout}from"./cnFieldControlLayout";import{formGuard,getBgColor,getBorderColor,getBorderRadius,getBorderStyle,getPadding,getSlots}from"./helpers";var renderContentSlot=function(a,b,c){return React.createElement("div",{key:b,ref:null===c||void 0===c?void 0:c[b],className:cnFieldControlLayout("Slot")},a)};export var FieldControlLayout=forwardRef(function(a,b){var c,d=a.className,e=a.size,f=void 0===e?"m":e,g=a.form,h=void 0===g?"default":g,i=a.disabled,j=void 0!==i&&i,k=a.view,l=void 0===k?"default":k,m=a.status,n=a.leftSide,o=a.rightSide,p=a.children,q=a.style,r=a.focused,s=a.leftSlotsRefs,t=a.rightSlotsRefs,u=_objectWithoutProperties(a,_excluded),v=getSlots(n),w=getSlots(o),x=formGuard(h),y=useFlag(),z=_slicedToArray(y,2),A=z[0],B=z[1];return React.createElement("div",Object.assign({},u,{ref:b,className:cnFieldControlLayout({form:x,disabled:j,view:l},[d]),style:_objectSpread(_objectSpread({},q),{},(c={},_defineProperty(c,"--field-control-layout-border-color",getBorderColor(r,A,m,j)),_defineProperty(c,"--field-control-layout-height","var(--control-height-".concat(f,")")),_defineProperty(c,"--field-control-layout-space","calc(var(--control-space-".concat(f,") * 0.5)")),_defineProperty(c,"--field-control-layout-text-size","var(--control-text-size-".concat(f,")")),_defineProperty(c,"--field-control-layout-text-line-height","var(--line-height-text-".concat(f,")")),_defineProperty(c,"--field-control-layout-border-radius",getBorderRadius(x,l)),_defineProperty(c,"--field-control-layout-border-style",getBorderStyle(x,l)),_defineProperty(c,"--field-control-layout-padding",getPadding(x,l)),_defineProperty(c,"--field-control-layout-bg-color",getBgColor(l,j)),_defineProperty(c,"--field-control-layout-border-width","default"===l?"var(--control-border-width)":"0px"),c)),onMouseEnter:B.on,onMouseLeave:B.off}),React.createElement("div",{className:cnFieldControlLayout("Container")},!!v.length&&v.map(function(a,b){return renderContentSlot(a,b,s)}),React.createElement("div",{className:cnFieldControlLayout("\u0421hildren")},p),!!w.length&&w.map(function(a,b){return renderContentSlot(a,b,t)})))});
//# sourceMappingURL=FieldControlLayout.js.map