Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@data-driven-forms/carbon-component-mapper

Package Overview
Dependencies
Maintainers
2
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@data-driven-forms/carbon-component-mapper - npm Package Compare versions

Comparing version 2.20.1 to 2.20.2

2

dist/cjs/form-template.js

@@ -1,2 +0,2 @@

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./extends-edb29469.js"),t=require("./objectWithoutProperties-6a6333c3.js"),r=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),n=require("./clsx.m-fe63e0e7.js"),s=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-form-api")),a=require("./toConsumableArray-43caa138.js"),u=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/form-spy")),i=_interopDefault(require("carbon-components-react/lib/components/Button/Button.js")),p=_interopDefault(require("carbon-components-react/lib/components/Form/Form.js")),l=_interopDefault(require("carbon-components-react/lib/components/ButtonSet/ButtonSet.js")),c=function isDisabled(e,t){return e.map((function(e){return t()[e]})).find((function(e){return!!e}))},m=function FormControls(t){var o=t.onCancel,n=t.onReset,s=t.submitLabel,u=t.cancelLabel,i=t.resetLabel,p=t.canReset,l=t.disableSubmit,c=t.buttonOrder,m=t.buttonClassName,d=t.FormButtons,b=t.Button,f=t.ButtonGroup,y=t.formSpyProps,_=t.buttonsProps,h=t.buttonGroupProps;if(d)return r.createElement(d,null);var P=y.submitting,T=y.pristine,v=y.validating,x=_.submit,j=_.reset,O=_.cancel,g={submit:r.createElement(b,e._extends({key:"form-submit",type:"submit",variant:"primary",buttonType:"submit",disabled:P||v||l,label:s},x)),reset:p?r.createElement(b,e._extends({key:"form-reset",type:"button",buttonType:"reset",disabled:T,onClick:n,label:i},j)):null,cancel:o?r.createElement(b,e._extends({key:"form-cancel",type:"button",buttonType:"cancel",onClick:o,label:u},O)):null};return r.createElement(f,e._extends({},h,m&&{className:m}),function completeButtons(e){var t=a._toConsumableArray(e);return t.includes("submit")||t.push("submit"),t.includes("reset")||t.push("reset"),t.includes("cancel")||t.push("cancel"),t}(c).map((function(e){return g[e]})))};m.propTypes={onCancel:o.func,onReset:o.func,submitLabel:o.node,cancelLabel:o.node,resetLabel:o.node,canReset:o.bool,disableSubmit:o.bool,buttonOrder:o.arrayOf(o.string),buttonClassName:o.string,FormButtons:o.oneOfType([o.node,o.element,o.func]),Button:o.oneOfType([o.node,o.element,o.func]),ButtonGroup:o.oneOfType([o.node,o.element,o.func]),formSpyProps:o.shape({submitting:o.bool,pristine:o.bool,validating:o.bool,form:o.shape({reset:o.func}),values:o.object}),buttonGroupProps:o.object,buttonsProps:o.object},m.defaultProps={submitLabel:"Submit",cancelLabel:"Cancel",resetLabel:"Reset",canReset:!1,canSubmit:!1,buttonOrder:["submit","reset","cancel"],buttonsProps:{}};var d=function FormTemplate(o){var n=o.FormWrapper,a=o.Title,i=o.Description,p=o.Button,l=o.ButtonGroup,d=o.formWrapperProps,b=o.showFormControls,f=o.disableSubmit,y=o.Header,_=o.headerProps,h=o.titleProps,P=o.descriptionProps,T=o.buttonGroupProps,v=o.buttonsProps,x=t._objectWithoutProperties(o,["FormWrapper","Title","Description","Button","ButtonGroup","formWrapperProps","showFormControls","disableSubmit","Header","headerProps","titleProps","descriptionProps","buttonGroupProps","buttonsProps"]),j=x.schema,O=j.title,g=j.description,B=j.label,F=x.formFields,E=s(),S=E.onReset,C=E.onCancel,q=E.getState,D=E.handleSubmit;return r.createElement(n,e._extends({onSubmit:D},d),(O||B||g)&&r.createElement(y,_,(O||B)&&r.createElement(a,h,O||B),g&&r.createElement(i,P,g)),F,b&&r.createElement(u,null,(function(t){return r.createElement(m,e._extends({Button:p,FormSpy:u,buttonGroupProps:T,buttonsProps:v,ButtonGroup:l,onReset:S,onCancel:C,disableSubmit:c(f,q),formSpyProps:t},x))})))};d.propTypes={FormWrapper:o.oneOfType([o.node,o.func,o.element]).isRequired,Title:o.oneOfType([o.node,o.func,o.element]).isRequired,Description:o.oneOfType([o.node,o.func,o.element]).isRequired,Button:o.oneOfType([o.node,o.func,o.element]).isRequired,ButtonGroup:o.oneOfType([o.node,o.func,o.element]).isRequired,formWrapperProps:o.object,showFormControls:o.bool,disableSubmit:o.arrayOf(o.string),Header:o.oneOfType([o.node,o.func,o.element,o.oneOf([r.Fragment])]),headerProps:o.object,titleProps:o.object,descriptionProps:o.object,buttonGroupProps:o.object,buttonsProps:o.object},d.defaultProps={showFormControls:!0,disableSubmit:[],Header:r.Fragment},function ___$insertStyle(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".ddorg__carbon-form-template-buttons {\n margin-top: 48px;\n}\n\n.ddorg__carbon-form-template-form > :not(:last-child) {\n margin-bottom: 32px;\n}\n.ddorg__carbon-form-template-form .ddorg__carbon-form-template-header {\n margin-bottom: 40px;\n}\n.ddorg__carbon-form-template-form .ddorg__carbon-form-template-header div {\n margin-top: 8px;\n}");var b=function Button(o){var n=o.label,s=o.buttonType,a=t._objectWithoutProperties(o,["label","buttonType"]);return r.createElement(i,e._extends({kind:"submit"===s?"primary":"secondary"},a),n)};b.propTypes={label:o.oneOfType([o.arrayOf(o.node),o.node]),buttonType:o.string};var f=function ButtonGroup(o){var s=o.children,a=o.className,u=t._objectWithoutProperties(o,["children","className"]);return r.createElement(l,e._extends({},u,{className:n.clsx("ddorg__carbon-form-template-buttons",a)}),s)};f.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node]),className:o.string};var y=function Title(e){var o=e.children,n=t._objectWithoutProperties(e,["children"]);return r.createElement("h3",n,o)};y.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node])};var _=function Description(e){var o=e.children,n=t._objectWithoutProperties(e,["children"]);return r.createElement("div",n,o)};_.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node])};var h=function Form(o){var s=o.children,a=o.className,u=t._objectWithoutProperties(o,["children","className"]);return r.createElement(p,e._extends({noValidate:!0},u,{className:n.clsx("ddorg__carbon-form-template-form",a)}),s)};h.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node]),className:o.string};var P=function Header(t){return r.createElement("div",e._extends({className:"ddorg__carbon-form-template-header"},t))};exports.Button=b,exports.ButtonGroup=f,exports.Description=_,exports.Form=h,exports.Header=P,exports.Title=y,exports.default=function WrappedFormTemplate(t){return r.createElement(d,e._extends({FormWrapper:h,Button:b,ButtonGroup:f,Title:y,Description:_,buttonOrder:["cancel","reset","submit"],Header:P},t))};
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./extends-edb29469.js"),t=require("./objectWithoutProperties-6a6333c3.js"),r=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),n=require("./clsx.m-fe63e0e7.js"),s=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-form-api")),a=require("./toConsumableArray-43caa138.js"),u=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/form-spy")),i=_interopDefault(require("carbon-components-react/lib/components/Button/Button.js")),p=_interopDefault(require("carbon-components-react/lib/components/Form/Form.js")),l=_interopDefault(require("carbon-components-react/lib/components/ButtonSet/ButtonSet.js")),c=function isDisabled(e,t){return e.map((function(e){return t()[e]})).find((function(e){return!!e}))},m=function FormControls(t){var o=t.onCancel,n=t.onReset,s=t.submitLabel,u=t.cancelLabel,i=t.resetLabel,p=t.canReset,l=t.disableSubmit,c=t.buttonOrder,m=t.buttonClassName,d=t.FormButtons,b=t.Button,f=t.ButtonGroup,y=t.formSpyProps,_=t.buttonsProps,h=t.buttonGroupProps;if(d)return r.createElement(d,null);var P=y.submitting,T=y.pristine,v=y.validating,x=_.submit,j=_.reset,O=_.cancel,g={submit:r.createElement(b,e._extends({key:"form-submit",type:"submit",variant:"primary",buttonType:"submit",disabled:P||v||l,label:s},x)),reset:p?r.createElement(b,e._extends({key:"form-reset",type:"button",buttonType:"reset",disabled:T,onClick:n,label:i},j)):null,cancel:o?r.createElement(b,e._extends({key:"form-cancel",type:"button",buttonType:"cancel",onClick:o,label:u},O)):null};return r.createElement(f,e._extends({},h,m&&{className:m}),function completeButtons(e){var t=a._toConsumableArray(e);return t.includes("submit")||t.push("submit"),t.includes("reset")||t.push("reset"),t.includes("cancel")||t.push("cancel"),t}(c).map((function(e){return g[e]})))};m.propTypes={onCancel:o.func,onReset:o.func,submitLabel:o.node,cancelLabel:o.node,resetLabel:o.node,canReset:o.bool,disableSubmit:o.bool,buttonOrder:o.arrayOf(o.string),buttonClassName:o.string,FormButtons:o.oneOfType([o.node,o.element,o.func]),Button:o.oneOfType([o.node,o.element,o.func]),ButtonGroup:o.oneOfType([o.node,o.element,o.func]),formSpyProps:o.shape({submitting:o.bool,pristine:o.bool,validating:o.bool,form:o.shape({reset:o.func}),values:o.object}),buttonGroupProps:o.object,buttonsProps:o.object},m.defaultProps={submitLabel:"Submit",cancelLabel:"Cancel",resetLabel:"Reset",canReset:!1,canSubmit:!1,buttonOrder:["submit","reset","cancel"],buttonsProps:{}};var d=function FormTemplate(o){var n=o.FormWrapper,a=o.Title,i=o.Description,p=o.Button,l=o.ButtonGroup,d=o.formWrapperProps,b=o.showFormControls,f=o.disableSubmit,y=o.Header,_=o.headerProps,h=o.titleProps,P=o.descriptionProps,T=o.buttonGroupProps,v=o.buttonsProps,x=t._objectWithoutProperties(o,["FormWrapper","Title","Description","Button","ButtonGroup","formWrapperProps","showFormControls","disableSubmit","Header","headerProps","titleProps","descriptionProps","buttonGroupProps","buttonsProps"]),j=x.schema,O=j.title,g=j.description,B=j.label,F=x.formFields,E=s(),S=E.onReset,C=E.onCancel,q=E.getState,D=E.handleSubmit;return r.createElement(n,e._extends({onSubmit:D},d),(O||B||g)&&r.createElement(y,_,(O||B)&&r.createElement(a,h,O||B),g&&r.createElement(i,P,g)),F,b&&r.createElement(u,null,(function(t){return r.createElement(m,e._extends({Button:p,FormSpy:u,buttonGroupProps:T,buttonsProps:v,ButtonGroup:l,onReset:S,onCancel:C,disableSubmit:c(f,q),formSpyProps:t},x))})))};d.propTypes={FormWrapper:o.oneOfType([o.node,o.func,o.element]).isRequired,Title:o.oneOfType([o.node,o.func,o.element]).isRequired,Description:o.oneOfType([o.node,o.func,o.element]).isRequired,Button:o.oneOfType([o.node,o.func,o.element]).isRequired,ButtonGroup:o.oneOfType([o.node,o.func,o.element]).isRequired,formWrapperProps:o.object,showFormControls:o.bool,disableSubmit:o.arrayOf(o.string),Header:o.oneOfType([o.node,o.func,o.element,o.oneOf([r.Fragment])]),headerProps:o.object,titleProps:o.object,descriptionProps:o.object,buttonGroupProps:o.object,buttonsProps:o.object},d.defaultProps={showFormControls:!0,disableSubmit:[],Header:r.Fragment},function ___$insertStyle(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".ddorg__carbon-form-template-buttons {\n margin-top: 48px;\n}\n\n.ddorg__carbon-form-template-form > :not(:last-child) {\n margin-bottom: 32px;\n}\n.ddorg__carbon-form-template-form .ddorg__carbon-form-template-header {\n margin-bottom: 40px;\n}\n.ddorg__carbon-form-template-form .ddorg__carbon-form-template-header div {\n margin-top: 8px;\n}");var b=function Button(o){var n=o.label,s=o.buttonType,a=t._objectWithoutProperties(o,["label","buttonType"]);return r.createElement(i,e._extends({kind:"submit"===s?"primary":"secondary"},a),n)};b.propTypes={label:o.oneOfType([o.arrayOf(o.node),o.node]),buttonType:o.string};var f=function ButtonGroup(o){var s=o.children,a=o.className,u=t._objectWithoutProperties(o,["children","className"]);return r.createElement(l,e._extends({},u,{className:n.clsx("ddorg__carbon-form-template-buttons",a)}),s)};f.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node]),className:o.string};var y=function Title(e){var o=e.children,n=t._objectWithoutProperties(e,["children"]);return r.createElement("h3",n,o)};y.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node])};var _=function Description(e){var o=e.children,n=t._objectWithoutProperties(e,["children"]);return r.createElement("div",n,o)};_.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node])};var h=function Form(o){var s=o.children,a=o.className,u=t._objectWithoutProperties(o,["children","className"]);return r.createElement(p,e._extends({noValidate:!0},u,{className:n.clsx("ddorg__carbon-form-template-form",a)}),s)};h.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node]),className:o.string};var P=function Header(t){return r.createElement("div",e._extends({className:"ddorg__carbon-form-template-header"},t))};exports.Button=b,exports.ButtonGroup=f,exports.Description=_,exports.Form=h,exports.Header=P,exports.Title=y,exports.default=function WrappedFormTemplate(t){return r.createElement(d,e._extends({FormWrapper:h,Button:b,ButtonGroup:f,Title:y,Description:_,buttonOrder:["submit","reset","cancel"],Header:P},t))};
//# sourceMappingURL=form-template.js.map

@@ -1,2 +0,2 @@

import{_ as e}from"./extends-4d5fdb5f.js";import{_ as t}from"./objectWithoutProperties-85da668a.js";import r from"react";import o from"prop-types";import{c as n}from"./clsx.m-a083186a.js";import a from"@data-driven-forms/react-form-renderer/dist/esm/use-form-api";import{_ as s}from"./toConsumableArray-48c131d8.js";import p from"@data-driven-forms/react-form-renderer/dist/esm/form-spy";import m from"carbon-components-react/es/components/Button/Button.js";import i from"carbon-components-react/es/components/Form/Form.js";import u from"carbon-components-react/es/components/ButtonSet/ButtonSet.js";var l=function isDisabled(e,t){return e.map((function(e){return t()[e]})).find((function(e){return!!e}))},c=function FormControls(t){var o=t.onCancel,n=t.onReset,a=t.submitLabel,p=t.cancelLabel,m=t.resetLabel,i=t.canReset,u=t.disableSubmit,l=t.buttonOrder,c=t.buttonClassName,d=t.FormButtons,b=t.Button,f=t.ButtonGroup,y=t.formSpyProps,T=t.buttonsProps,h=t.buttonGroupProps;if(d)return r.createElement(d,null);var P=y.submitting,v=y.pristine,g=y.validating,O=T.submit,_=T.reset,B=T.cancel,F={submit:r.createElement(b,e({key:"form-submit",type:"submit",variant:"primary",buttonType:"submit",disabled:P||g||u,label:a},O)),reset:i?r.createElement(b,e({key:"form-reset",type:"button",buttonType:"reset",disabled:v,onClick:n,label:m},_)):null,cancel:o?r.createElement(b,e({key:"form-cancel",type:"button",buttonType:"cancel",onClick:o,label:p},B)):null};return r.createElement(f,e({},h,c&&{className:c}),function completeButtons(e){var t=s(e);return t.includes("submit")||t.push("submit"),t.includes("reset")||t.push("reset"),t.includes("cancel")||t.push("cancel"),t}(l).map((function(e){return F[e]})))};c.propTypes={onCancel:o.func,onReset:o.func,submitLabel:o.node,cancelLabel:o.node,resetLabel:o.node,canReset:o.bool,disableSubmit:o.bool,buttonOrder:o.arrayOf(o.string),buttonClassName:o.string,FormButtons:o.oneOfType([o.node,o.element,o.func]),Button:o.oneOfType([o.node,o.element,o.func]),ButtonGroup:o.oneOfType([o.node,o.element,o.func]),formSpyProps:o.shape({submitting:o.bool,pristine:o.bool,validating:o.bool,form:o.shape({reset:o.func}),values:o.object}),buttonGroupProps:o.object,buttonsProps:o.object},c.defaultProps={submitLabel:"Submit",cancelLabel:"Cancel",resetLabel:"Reset",canReset:!1,canSubmit:!1,buttonOrder:["submit","reset","cancel"],buttonsProps:{}};var d=function FormTemplate(o){var n=o.FormWrapper,s=o.Title,m=o.Description,i=o.Button,u=o.ButtonGroup,d=o.formWrapperProps,b=o.showFormControls,f=o.disableSubmit,y=o.Header,T=o.headerProps,h=o.titleProps,P=o.descriptionProps,v=o.buttonGroupProps,g=o.buttonsProps,O=t(o,["FormWrapper","Title","Description","Button","ButtonGroup","formWrapperProps","showFormControls","disableSubmit","Header","headerProps","titleProps","descriptionProps","buttonGroupProps","buttonsProps"]),_=O.schema,B=_.title,F=_.description,E=_.label,S=O.formFields,j=a(),C=j.onReset,G=j.onCancel,R=j.getState,N=j.handleSubmit;return r.createElement(n,e({onSubmit:N},d),(B||E||F)&&r.createElement(y,T,(B||E)&&r.createElement(s,h,B||E),F&&r.createElement(m,P,F)),S,b&&r.createElement(p,null,(function(t){return r.createElement(c,e({Button:i,FormSpy:p,buttonGroupProps:v,buttonsProps:g,ButtonGroup:u,onReset:C,onCancel:G,disableSubmit:l(f,R),formSpyProps:t},O))})))};d.propTypes={FormWrapper:o.oneOfType([o.node,o.func,o.element]).isRequired,Title:o.oneOfType([o.node,o.func,o.element]).isRequired,Description:o.oneOfType([o.node,o.func,o.element]).isRequired,Button:o.oneOfType([o.node,o.func,o.element]).isRequired,ButtonGroup:o.oneOfType([o.node,o.func,o.element]).isRequired,formWrapperProps:o.object,showFormControls:o.bool,disableSubmit:o.arrayOf(o.string),Header:o.oneOfType([o.node,o.func,o.element,o.oneOf([r.Fragment])]),headerProps:o.object,titleProps:o.object,descriptionProps:o.object,buttonGroupProps:o.object,buttonsProps:o.object},d.defaultProps={showFormControls:!0,disableSubmit:[],Header:r.Fragment},function ___$insertStyle(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".ddorg__carbon-form-template-buttons {\n margin-top: 48px;\n}\n\n.ddorg__carbon-form-template-form > :not(:last-child) {\n margin-bottom: 32px;\n}\n.ddorg__carbon-form-template-form .ddorg__carbon-form-template-header {\n margin-bottom: 40px;\n}\n.ddorg__carbon-form-template-form .ddorg__carbon-form-template-header div {\n margin-top: 8px;\n}");var b=function Button(o){var n=o.label,a=o.buttonType,s=t(o,["label","buttonType"]);return r.createElement(m,e({kind:"submit"===a?"primary":"secondary"},s),n)};b.propTypes={label:o.oneOfType([o.arrayOf(o.node),o.node]),buttonType:o.string};var f=function ButtonGroup(o){var a=o.children,s=o.className,p=t(o,["children","className"]);return r.createElement(u,e({},p,{className:n("ddorg__carbon-form-template-buttons",s)}),a)};f.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node]),className:o.string};var y=function Title(e){var o=e.children,n=t(e,["children"]);return r.createElement("h3",n,o)};y.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node])};var T=function Description(e){var o=e.children,n=t(e,["children"]);return r.createElement("div",n,o)};T.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node])};var h=function Form(o){var a=o.children,s=o.className,p=t(o,["children","className"]);return r.createElement(i,e({noValidate:!0},p,{className:n("ddorg__carbon-form-template-form",s)}),a)};h.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node]),className:o.string};var P=function Header(t){return r.createElement("div",e({className:"ddorg__carbon-form-template-header"},t))};export default function WrappedFormTemplate(t){return r.createElement(d,e({FormWrapper:h,Button:b,ButtonGroup:f,Title:y,Description:T,buttonOrder:["cancel","reset","submit"],Header:P},t))}export{b as Button,f as ButtonGroup,T as Description,h as Form,P as Header,y as Title};
import{_ as e}from"./extends-4d5fdb5f.js";import{_ as t}from"./objectWithoutProperties-85da668a.js";import r from"react";import o from"prop-types";import{c as n}from"./clsx.m-a083186a.js";import a from"@data-driven-forms/react-form-renderer/dist/esm/use-form-api";import{_ as s}from"./toConsumableArray-48c131d8.js";import p from"@data-driven-forms/react-form-renderer/dist/esm/form-spy";import m from"carbon-components-react/es/components/Button/Button.js";import i from"carbon-components-react/es/components/Form/Form.js";import u from"carbon-components-react/es/components/ButtonSet/ButtonSet.js";var l=function isDisabled(e,t){return e.map((function(e){return t()[e]})).find((function(e){return!!e}))},c=function FormControls(t){var o=t.onCancel,n=t.onReset,a=t.submitLabel,p=t.cancelLabel,m=t.resetLabel,i=t.canReset,u=t.disableSubmit,l=t.buttonOrder,c=t.buttonClassName,d=t.FormButtons,b=t.Button,f=t.ButtonGroup,y=t.formSpyProps,T=t.buttonsProps,h=t.buttonGroupProps;if(d)return r.createElement(d,null);var P=y.submitting,v=y.pristine,g=y.validating,O=T.submit,_=T.reset,B=T.cancel,F={submit:r.createElement(b,e({key:"form-submit",type:"submit",variant:"primary",buttonType:"submit",disabled:P||g||u,label:a},O)),reset:i?r.createElement(b,e({key:"form-reset",type:"button",buttonType:"reset",disabled:v,onClick:n,label:m},_)):null,cancel:o?r.createElement(b,e({key:"form-cancel",type:"button",buttonType:"cancel",onClick:o,label:p},B)):null};return r.createElement(f,e({},h,c&&{className:c}),function completeButtons(e){var t=s(e);return t.includes("submit")||t.push("submit"),t.includes("reset")||t.push("reset"),t.includes("cancel")||t.push("cancel"),t}(l).map((function(e){return F[e]})))};c.propTypes={onCancel:o.func,onReset:o.func,submitLabel:o.node,cancelLabel:o.node,resetLabel:o.node,canReset:o.bool,disableSubmit:o.bool,buttonOrder:o.arrayOf(o.string),buttonClassName:o.string,FormButtons:o.oneOfType([o.node,o.element,o.func]),Button:o.oneOfType([o.node,o.element,o.func]),ButtonGroup:o.oneOfType([o.node,o.element,o.func]),formSpyProps:o.shape({submitting:o.bool,pristine:o.bool,validating:o.bool,form:o.shape({reset:o.func}),values:o.object}),buttonGroupProps:o.object,buttonsProps:o.object},c.defaultProps={submitLabel:"Submit",cancelLabel:"Cancel",resetLabel:"Reset",canReset:!1,canSubmit:!1,buttonOrder:["submit","reset","cancel"],buttonsProps:{}};var d=function FormTemplate(o){var n=o.FormWrapper,s=o.Title,m=o.Description,i=o.Button,u=o.ButtonGroup,d=o.formWrapperProps,b=o.showFormControls,f=o.disableSubmit,y=o.Header,T=o.headerProps,h=o.titleProps,P=o.descriptionProps,v=o.buttonGroupProps,g=o.buttonsProps,O=t(o,["FormWrapper","Title","Description","Button","ButtonGroup","formWrapperProps","showFormControls","disableSubmit","Header","headerProps","titleProps","descriptionProps","buttonGroupProps","buttonsProps"]),_=O.schema,B=_.title,F=_.description,E=_.label,S=O.formFields,j=a(),C=j.onReset,G=j.onCancel,R=j.getState,N=j.handleSubmit;return r.createElement(n,e({onSubmit:N},d),(B||E||F)&&r.createElement(y,T,(B||E)&&r.createElement(s,h,B||E),F&&r.createElement(m,P,F)),S,b&&r.createElement(p,null,(function(t){return r.createElement(c,e({Button:i,FormSpy:p,buttonGroupProps:v,buttonsProps:g,ButtonGroup:u,onReset:C,onCancel:G,disableSubmit:l(f,R),formSpyProps:t},O))})))};d.propTypes={FormWrapper:o.oneOfType([o.node,o.func,o.element]).isRequired,Title:o.oneOfType([o.node,o.func,o.element]).isRequired,Description:o.oneOfType([o.node,o.func,o.element]).isRequired,Button:o.oneOfType([o.node,o.func,o.element]).isRequired,ButtonGroup:o.oneOfType([o.node,o.func,o.element]).isRequired,formWrapperProps:o.object,showFormControls:o.bool,disableSubmit:o.arrayOf(o.string),Header:o.oneOfType([o.node,o.func,o.element,o.oneOf([r.Fragment])]),headerProps:o.object,titleProps:o.object,descriptionProps:o.object,buttonGroupProps:o.object,buttonsProps:o.object},d.defaultProps={showFormControls:!0,disableSubmit:[],Header:r.Fragment},function ___$insertStyle(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".ddorg__carbon-form-template-buttons {\n margin-top: 48px;\n}\n\n.ddorg__carbon-form-template-form > :not(:last-child) {\n margin-bottom: 32px;\n}\n.ddorg__carbon-form-template-form .ddorg__carbon-form-template-header {\n margin-bottom: 40px;\n}\n.ddorg__carbon-form-template-form .ddorg__carbon-form-template-header div {\n margin-top: 8px;\n}");var b=function Button(o){var n=o.label,a=o.buttonType,s=t(o,["label","buttonType"]);return r.createElement(m,e({kind:"submit"===a?"primary":"secondary"},s),n)};b.propTypes={label:o.oneOfType([o.arrayOf(o.node),o.node]),buttonType:o.string};var f=function ButtonGroup(o){var a=o.children,s=o.className,p=t(o,["children","className"]);return r.createElement(u,e({},p,{className:n("ddorg__carbon-form-template-buttons",s)}),a)};f.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node]),className:o.string};var y=function Title(e){var o=e.children,n=t(e,["children"]);return r.createElement("h3",n,o)};y.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node])};var T=function Description(e){var o=e.children,n=t(e,["children"]);return r.createElement("div",n,o)};T.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node])};var h=function Form(o){var a=o.children,s=o.className,p=t(o,["children","className"]);return r.createElement(i,e({noValidate:!0},p,{className:n("ddorg__carbon-form-template-form",s)}),a)};h.propTypes={children:o.oneOfType([o.arrayOf(o.node),o.node]),className:o.string};var P=function Header(t){return r.createElement("div",e({className:"ddorg__carbon-form-template-header"},t))};export default function WrappedFormTemplate(t){return r.createElement(d,e({FormWrapper:h,Button:b,ButtonGroup:f,Title:y,Description:T,buttonOrder:["submit","reset","cancel"],Header:P},t))}export{b as Button,f as ButtonGroup,T as Description,h as Form,P as Header,y as Title};
//# sourceMappingURL=form-template.js.map
{
"name": "@data-driven-forms/carbon-component-mapper",
"version": "2.20.1",
"version": "2.20.2",
"description": "carbon-component-mapper for data-driven-forms.",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc