UNPKG

@aiui/ai-form

Version:
10 lines (9 loc) 23.2 kB
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react"));function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==r)return;var n,o,i=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e){var t={exports:{}};return e(t,t.exports),t.exports /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */}var s="function"==typeof Symbol&&Symbol.for,f=s?Symbol.for("react.element"):60103,p=s?Symbol.for("react.portal"):60106,y=s?Symbol.for("react.fragment"):60107,d=s?Symbol.for("react.strict_mode"):60108,m=s?Symbol.for("react.profiler"):60114,b=s?Symbol.for("react.provider"):60109,v=s?Symbol.for("react.context"):60110,h=s?Symbol.for("react.async_mode"):60111,g=s?Symbol.for("react.concurrent_mode"):60111,w=s?Symbol.for("react.forward_ref"):60112,O=s?Symbol.for("react.suspense"):60113,x=s?Symbol.for("react.suspense_list"):60120,S=s?Symbol.for("react.memo"):60115,E=s?Symbol.for("react.lazy"):60116,j=s?Symbol.for("react.block"):60121,P=s?Symbol.for("react.fundamental"):60117,k=s?Symbol.for("react.responder"):60118,T=s?Symbol.for("react.scope"):60119;function $(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case f:switch(e=e.type){case h:case g:case y:case m:case d:case O:return e;default:switch(e=e&&e.$$typeof){case v:case w:case E:case S:case b:return e;default:return t}}case p:return t}}}function _(e){return $(e)===g}var I={AsyncMode:h,ConcurrentMode:g,ContextConsumer:v,ContextProvider:b,Element:f,ForwardRef:w,Fragment:y,Lazy:E,Memo:S,Portal:p,Profiler:m,StrictMode:d,Suspense:O,isAsyncMode:function(e){return _(e)||$(e)===h},isConcurrentMode:_,isContextConsumer:function(e){return $(e)===v},isContextProvider:function(e){return $(e)===b},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===f},isForwardRef:function(e){return $(e)===w},isFragment:function(e){return $(e)===y},isLazy:function(e){return $(e)===E},isMemo:function(e){return $(e)===S},isPortal:function(e){return $(e)===p},isProfiler:function(e){return $(e)===m},isStrictMode:function(e){return $(e)===d},isSuspense:function(e){return $(e)===O},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===y||e===g||e===m||e===d||e===O||e===x||"object"==typeof e&&null!==e&&(e.$$typeof===E||e.$$typeof===S||e.$$typeof===b||e.$$typeof===v||e.$$typeof===w||e.$$typeof===P||e.$$typeof===k||e.$$typeof===T||e.$$typeof===j)},typeOf:$},C=u((function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var y=e.type;switch(y){case u:case s:case o:case a:case i:case p:return y;default:var b=y&&y.$$typeof;switch(b){case c:case f:case m:case d:case l:return b;default:return t}}case n:return t}}}var O=u,x=s,S=c,E=l,j=r,P=f,k=o,T=m,$=d,_=n,I=a,C=i,F=p,N=!1;function A(e){return w(e)===s}t.AsyncMode=O,t.ConcurrentMode=x,t.ContextConsumer=S,t.ContextProvider=E,t.Element=j,t.ForwardRef=P,t.Fragment=k,t.Lazy=T,t.Memo=$,t.Portal=_,t.Profiler=I,t.StrictMode=C,t.Suspense=F,t.isAsyncMode=function(e){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(e)||w(e)===u},t.isConcurrentMode=A,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===f},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===d},t.isPortal=function(e){return w(e)===n},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===i},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===a||e===i||e===p||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===v||e.$$typeof===h||e.$$typeof===g||e.$$typeof===b)},t.typeOf=w}()})),F=u((function(e){"production"===process.env.NODE_ENV?e.exports=I:e.exports=C})),N=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;function V(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var z=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 n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,o=V(e),i=1;i<arguments.length;i++){for(var a in r=Object(arguments[i]))A.call(r,a)&&(o[a]=r[a]);if(N){n=N(r);for(var l=0;l<n.length;l++)R.call(r,n[l])&&(o[n[l]]=r[n[l]])}}return o},L="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",D=function(){};if("production"!==process.env.NODE_ENV){var M=L,W={},G=Function.call.bind(Object.prototype.hasOwnProperty);D=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function q(e,t,r,n,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(G(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.");throw l.name="Invariant Violation",l}a=e[i](t,i,n,r,null,M)}catch(e){a=e}if(!a||a instanceof Error||D((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in W)){W[a.message]=!0;var c=o?o():"";D("Failed "+r+" type: "+a.message+(null!=c?c:""))}}}q.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(W={})};var B=q,H=Function.call.bind(Object.prototype.hasOwnProperty),U=function(){};function Y(){return null}"production"!==process.env.NODE_ENV&&(U=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}});var J=function(e,t){var r="function"==typeof Symbol&&Symbol.iterator;var n="<<anonymous>>",o={array:c("array"),bool:c("boolean"),func:c("function"),number:c("number"),object:c("object"),string:c("string"),symbol:c("symbol"),any:l(Y),arrayOf:function(e){return l((function(t,r,n,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new a("Invalid "+o+" `"+i+"` of type `"+s(l)+"` supplied to `"+n+"`, expected an array.");for(var c=0;c<l.length;c++){var u=e(l,c,n,o,i+"["+c+"]",L);if(u instanceof Error)return u}return null}))},element:l((function(t,r,n,o,i){var l=t[r];return e(l)?null:new a("Invalid "+o+" `"+i+"` of type `"+s(l)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:l((function(e,t,r,n,o){var i=e[t];return F.isValidElementType(i)?null:new a("Invalid "+n+" `"+o+"` of type `"+s(i)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return l((function(t,r,o,i,l){if(!(t[r]instanceof e)){var c=e.name||n;return new a("Invalid "+i+" `"+l+"` of type `"+(((u=t[r]).constructor&&u.constructor.name?u.constructor.name:n)+"` supplied to `")+o+"`, expected instance of `"+c+"`.")}var u;return null}))},node:l((function(e,t,r,n,o){return u(e[t])?null:new a("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return l((function(t,r,n,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var l=t[r],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+n+"`, expected an object.");for(var u in l)if(H(l,u)){var f=e(l,u,n,o,i+"."+u,L);if(f instanceof Error)return f}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&U(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),Y;function t(t,r,n,o,l){for(var c=t[r],u=0;u<e.length;u++)if(i(c,e[u]))return null;var s=JSON.stringify(e,(function(e,t){return"symbol"===f(t)?String(t):t}));return new a("Invalid "+o+" `"+l+"` of value `"+String(c)+"` supplied to `"+n+"`, expected one of "+s+".")}return l(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&U("Invalid argument supplied to oneOfType, expected an instance of array."),Y;for(var t=0;t<e.length;t++){var r=e[t];if("function"!=typeof r)return U("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(r)+" at index "+t+"."),Y}return l((function(t,r,n,o,i){for(var l=0;l<e.length;l++)if(null==(0,e[l])(t,r,n,o,i,L))return null;return new a("Invalid "+o+" `"+i+"` supplied to `"+n+"`.")}))},shape:function(e){return l((function(t,r,n,o,i){var l=t[r],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");for(var u in e){var f=e[u];if(f){var p=f(l,u,n,o,i+"."+u,L);if(p)return p}}return null}))},exact:function(e){return l((function(t,r,n,o,i){var l=t[r],c=s(l);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");var u=z({},t[r],e);for(var f in u){var p=e[f];if(!p)return new a("Invalid "+o+" `"+i+"` key `"+f+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(t[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var y=p(l,f,n,o,i+"."+f,L);if(y)return y}return null}))}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e){this.message=e,this.stack=""}function l(e){if("production"!==process.env.NODE_ENV)var r={},o=0;function i(i,l,c,u,s,f,p){if(u=u||n,f=f||c,p!==L){if(t){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var d=u+":"+c;!r[d]&&o<3&&(U("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[d]=!0,o++)}}return null==l[c]?i?null===l[c]?new a("The "+s+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new a("The "+s+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,c,u,s,f)}var l=i.bind(null,!1);return l.isRequired=i.bind(null,!0),l}function c(e){return l((function(t,r,n,o,i,l){var c=t[r];return s(c)!==e?new a("Invalid "+o+" `"+i+"` of type `"+f(c)+"` supplied to `"+n+"`, expected `"+e+"`."):null}))}function u(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(u);if(null===t||e(t))return!0;var n=function(e){var t=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!n)return!1;var o,i=n.call(t);if(n!==t.entries){for(;!(o=i.next()).done;)if(!u(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!u(a[1]))return!1}return!0;default:return!1}}function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function f(e){if(null==e)return""+e;var t=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=f(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return a.prototype=Error.prototype,o.checkPropTypes=B,o.resetWarningCache=B.resetWarningCache,o.PropTypes=o,o};function K(){}function Q(){}Q.resetWarningCache=K;var X=u((function(e){if("production"!==process.env.NODE_ENV){var t=F;e.exports=J(t.isElement,!0)}else e.exports=function(){function e(e,t,r,n,o,i){if(i!==L){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Q,resetWarningCache:K};return r.PropTypes=r,r}()})),Z=function(e){var r=t.default.useRef(null),o=e.onDone,i=void 0===o?function(){}:o,l=e.children;e.onSubmit;var c=a(e,["onDone","children","onSubmit"]);return t.default.createElement("form",n({ref:r,onSubmit:function(e){e.preventDefault();var t=r.current;(function(e){for(var t,r=!1,n=0;t=e.elements[n],n<e.elements.length;n++)t.checkValidity()?t.removeAttribute("aria-invalid"):(r||(t.nextElementSibling,t.scrollIntoViewIfNeeded?t.scrollIntoViewIfNeeded():t.scrollIntoView(!1),t.focus(),r=!0),t.setAttribute("aria-invalid","true"));return!r})(t)&&i(t)},noValidate:!0},c),l)};Z.propTypes={onDone:X.func,children:X.node},Z.defaultProps={onDone:function(){}};var ee=function(e){var r=e.showLabel,o=void 0===r||r,c=e.withGroup,u=void 0===c||c,s=e.style,f=void 0===s?{}:s,p=a(e,["showLabel","withGroup","style"]),y=e.label||e.name,d=e.type||"text",m="".concat(d,"_id_").concat(e.name),b=l(t.default.useState("#cccccc"),2),v=b[0],h=b[1],g=function(){h("#212121")},w=function(){h("#cccccc")},O={fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",margin:0,fontWeight:400,display:"block",width:"100%",padding:"5px 10px",boxSizing:"border-box",border:"1.5px solid ".concat(v),WebkitTransition:"0.5s",transition:"0.5s",outline:"none",backgroundColor:"transparent"};return t.default.createElement("div",{style:{marginBottom:u?".85rem":0,fontFamily:"inherit",fontSize:"0.95rem"}},o?t.default.createElement("label",{htmlFor:m,style:{display:"block",padding:"0.2rem 0",fontWeight:500,textTransform:"capitalize"}},y):null,"textarea"===d?t.default.createElement("textarea",n({onFocus:g,onBlur:w,id:m,placeholder:y,style:i(i({},O),f)},p)):t.default.createElement("input",n({onFocus:g,onBlur:w,type:d,id:m,style:i(i({},O),{},{overflow:"visible"},f)},p)))};ee.propTypes={name:X.string.isRequired,type:X.string,label:X.string,showLabel:X.bool,withGroup:X.bool},ee.defaultProps={type:"text",name:"field1",showLabel:!0,withGroup:!0};var te=function(e){var r=e.showLabel,o=void 0===r||r,c=e.withGroup,u=void 0===c||c,s=e.options,f=void 0===s?[]:s,p=e.style,y=void 0===p?{}:p,d=a(e,["showLabel","withGroup","options","style"]),m=l(t.default.useState("#cccccc"),2),b=m[0],v=m[1],h=e.label||e.name,g="select_id_".concat(e.name),w={fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",margin:0,fontWeight:400,display:"block",width:"100%",padding:"5px 10px",boxSizing:"border-box",border:"1.5px solid ".concat(b),WebkitTransition:"0.5s",transition:"0.5s",outline:"none",backgroundColor:"transparent"};return t.default.createElement("div",{style:{marginBottom:u?".85rem":0,fontFamily:"inherit",fontSize:"0.95rem"}},o?t.default.createElement("label",{htmlFor:g,style:{display:"block",padding:"0.2rem 0",fontWeight:500,textTransform:"capitalize"}},h):null,t.default.createElement("select",n({onFocus:function(){v("#212121")},onBlur:function(){v("#cccccc")},id:g,style:i(i({},w),y)},d),f.map((function(r,n){return t.default.createElement("option",{key:"select_".concat(e.name,"_").concat(n,"_").concat(r.value),value:r.value},r.label)}))))};te.propTypes={name:X.string.isRequired,label:X.string,showLabel:X.bool,withGroup:X.bool,options:X.arrayOf(X.exact({label:X.any,value:X.any}))},te.defaultProps={name:"selectfield1",showLabel:!0,withGroup:!0};var re=function(e){var r=e.inline,o=void 0===r||r,l=e.showLabel,c=void 0===l||l,u=e.withGroup,s=void 0===u||u,f=e.options,p=void 0===f?[]:f,y=e.selectedValues,d=void 0===y?[]:y,m=e.style,b=void 0===m?{}:m,v=a(e,["inline","showLabel","withGroup","options","selectedValues","style"]),h=e.label||e.name,g={fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",margin:0,fontWeight:400,display:"block",width:"100%",padding:"5px 10px",boxSizing:"border-box",border:"1.5px solid #ccc",WebkitTransition:"0.5s",transition:"0.5s",outline:"none",backgroundColor:"transparent"};return t.default.createElement("div",{style:{marginBottom:s?".85rem":0,fontFamily:"inherit",fontSize:"0.95rem"}},c?t.default.createElement("label",{style:{display:"block",padding:"0.2rem 0",fontWeight:500,textTransform:"capitalize"}},h):null,t.default.createElement("div",{style:{display:"flex",flexFlow:"".concat(o?"row":"column"," wrap")}},p.map((function(r,o){var a="checkbox_id_".concat(e.name,"_").concat(o,"_").concat(r.value);return t.default.createElement("div",{key:a,style:{margin:4,display:"inline-flex",flexFlow:"row wrap",alignItems:"center"}},t.default.createElement("input",n({id:a,value:r.value,type:"checkbox",defaultChecked:d&&d.includes(r.value),style:i(i({},g),{},{width:"1.5rem",height:"1.5rem",position:"relative"},b)},v)),t.default.createElement("label",{style:{marginLeft:"0.25rem",marginRight:"0.75rem",textTransform:"capitalize"},htmlFor:a},r.label))}))))};re.propTypes={inline:X.bool,name:X.string.isRequired,label:X.string,showLabel:X.bool,withGroup:X.bool,options:X.arrayOf(X.exact({label:X.any,value:X.any})),selectedValues:X.array},re.defaultProps={inline:!0,name:"checkboxfield1",showLabel:!0,withGroup:!0};var ne=function(e){var r=e.inline,o=void 0===r||r,l=e.showLabel,c=void 0===l||l,u=e.withGroup,s=void 0===u||u,f=e.options,p=void 0===f?[]:f,y=e.selectedValue,d=e.style,m=void 0===d?{}:d,b=a(e,["inline","showLabel","withGroup","options","selectedValue","style"]),v=e.label||e.name,h={fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",margin:0,fontWeight:400,display:"block",width:"100%",padding:"5px 10px",boxSizing:"border-box",border:"1.5px solid #ccc",WebkitTransition:"0.5s",transition:"0.5s",outline:"none",backgroundColor:"transparent"};return t.default.createElement("div",{style:{marginBottom:s?".85rem":0,fontFamily:"inherit",fontSize:"0.95rem"}},c?t.default.createElement("label",{style:{display:"block",padding:"0.2rem 0",fontWeight:500,textTransform:"capitalize"}},v):null,t.default.createElement("div",{style:{display:"flex",flexFlow:"".concat(o?"row":"column"," wrap")}},p.map((function(r,o){var a="radio_id_".concat(e.name,"_").concat(o,"_").concat(r.value);return t.default.createElement("div",{key:a,style:{margin:4,display:"inline-flex",flexFlow:"row wrap",alignItems:"center"}},t.default.createElement("input",n({id:a,value:r.value,type:"radio",defaultChecked:String(y)===String(r.value),style:i(i({},h),{},{width:"1.5rem",height:"1.5rem",position:"relative"},m)},b)),t.default.createElement("label",{style:{marginLeft:"0.25rem",marginRight:"0.75rem",textTransform:"capitalize"},htmlFor:a},r.label))}))))};ne.propTypes={inline:X.bool,name:X.string.isRequired,label:X.string,showLabel:X.bool,withGroup:X.bool,options:X.arrayOf(X.exact({label:X.any,value:X.any})),selectedValue:X.any},ne.defaultProps={inline:!0,name:"radiofield1",showLabel:!0,withGroup:!0},exports.AiCheckbox=re,exports.AiInput=ee,exports.AiRadio=ne,exports.AiSelect=te,exports.default=Z;