@data-driven-forms/carbon-component-mapper
Advanced tools
Comparing version 2.16.2 to 2.17.0
@@ -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("./defineProperty-75110086.js"),r=require("./extends-edb29469.js"),t=require("./objectWithoutProperties-6a6333c3.js"),o=_interopDefault(require("react")),n=_interopDefault(require("prop-types")),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var p=require("./prepare-props-11a1ca5a.js"),a=_interopDefault(require("carbon-components-react/lib/components/FormGroup/FormGroup.js")),c=_interopDefault(require("carbon-components-react/lib/components/Checkbox/Checkbox.js")),l=require("./helper-text-block-045ee2cb.js");function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){e._defineProperty(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var s=function SingleCheckbox(e){var n=i(_objectSpread(_objectSpread({},e),{},{type:"checkbox"})),p=n.input,a=n.Checkbox,c=t._objectWithoutProperties(n,["input","Checkbox"]);return o.createElement(a,r._extends({},p,c))},b=function MultipleChoiceList(e){var n=i(e),p=n.Wrapper,a=n.Checkbox,c=n.label,l=n.isRequired,b=n.helperText,u=n.meta,d=n.input,f=n.options,h=n.isDisabled,j=n.isReadOnly,y=n.description,m=t._objectWithoutProperties(n,["Wrapper","Checkbox","label","isRequired","helperText","meta","input","options","isDisabled","isReadOnly","description"]),O=u.error,x=u.touched&&O;return o.createElement(p,{showError:x,isRequired:l,label:c,helperText:b,meta:u,description:y,rest:m,error:O,name:d.name},f.map((function(e){return o.createElement(s,r._extends({Checkbox:a,"aria-label":e["aria-label"]||e.label},m,{value:e.value,label:e.label,name:d.name,option:e,id:"".concat(m.id||d.name,"-").concat(e.value),key:"".concat(m.id||d.name,"-").concat(e.value),isDisabled:h||j}))})))};b.propTypes={name:n.string.isRequired,Wrapper:n.oneOfType([n.node,n.func]),Checkbox:n.oneOfType([n.node,n.func])};_objectSpread(_objectSpread({},p.formGroup),{},{children:n.oneOfType([n.arrayOf(n.node),n.node])});function ownKeys$1(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread$1(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(o),!0).forEach((function(t){e._defineProperty(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys$1(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var u=function Wrapper(e){var r=e.label,t=e.description,n=e.children,i=e.helperText,c=e.error,s=e.showError,b=e.isRequired;return o.createElement(a,{legendText:t?o.createElement(p.WithDescription,{labelText:p.buildLabel(r,b),description:t}):p.buildLabel(r,b)},n,o.createElement(l.HelperTextBlock,{helperText:i,errorText:s&&c}))};u.propTypes={label:n.node,children:n.node,description:n.node,helperText:n.node,error:n.node,showError:n.bool,isRequired:n.bool};var d=function SingleCheckbox(e){var n=i(p.prepareProps(_objectSpread$1(_objectSpread$1({},e),{},{type:"checkbox"}))),a=n.input,s=n.meta,b=n.validateOnMount,u=n.helperText,d=n.WrapperProps,f=t._objectWithoutProperties(n,["input","meta","validateOnMount","helperText","WrapperProps"]),h=(s.touched||b)&&s.error,j=(s.touched||b)&&s.warning;return o.createElement("div",d,o.createElement(c,r._extends({},a,{id:a.name},f)),o.createElement(l.HelperTextBlock,{helperText:u,errorText:h,warnText:j}))},f=function SingleCheckboxInCommon(e){var r=e.label,n=e.isDisabled,i=e.id;t._objectWithoutProperties(e,["label","isDisabled","id"]);return o.createElement(c,{id:i,labelText:r,disabled:n})};f.propTypes={label:n.node,input:n.object,isDisabled:n.bool,isRequired:n.bool,name:n.string,id:n.string,WrapperProps:n.object};var h=function Checkbox(e){var n=e.options,i=t._objectWithoutProperties(e,["options"]);return n?o.createElement(b,r._extends({options:n},i,{Wrapper:u,Checkbox:f})):o.createElement(d,i)};h.propTypes={options:n.arrayOf(n.shape({label:n.node,value:n.any}))},exports.default=h; | ||
"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("./defineProperty-75110086.js"),r=require("./extends-edb29469.js"),t=require("./objectWithoutProperties-6a6333c3.js"),o=_interopDefault(require("react")),n=_interopDefault(require("prop-types")),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var p=require("./prepare-props-4fe8d115.js"),a=_interopDefault(require("carbon-components-react/lib/components/FormGroup/FormGroup.js")),c=_interopDefault(require("carbon-components-react/lib/components/Checkbox/Checkbox.js")),l=require("./helper-text-block-045ee2cb.js");function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){e._defineProperty(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var s=function SingleCheckbox(e){var n=i(_objectSpread(_objectSpread({},e),{},{type:"checkbox"})),p=n.input,a=n.Checkbox,c=t._objectWithoutProperties(n,["input","Checkbox"]);return o.createElement(a,r._extends({},p,c))},b=function MultipleChoiceList(e){var n=i(e),p=n.Wrapper,a=n.Checkbox,c=n.label,l=n.isRequired,b=n.helperText,u=n.meta,d=n.input,f=n.options,h=n.isDisabled,j=n.isReadOnly,y=n.description,m=t._objectWithoutProperties(n,["Wrapper","Checkbox","label","isRequired","helperText","meta","input","options","isDisabled","isReadOnly","description"]),O=u.error,x=u.touched&&O;return o.createElement(p,{showError:x,isRequired:l,label:c,helperText:b,meta:u,description:y,rest:m,error:O,name:d.name},f.map((function(e){return o.createElement(s,r._extends({Checkbox:a,"aria-label":e["aria-label"]||e.label},m,{value:e.value,label:e.label,name:d.name,option:e,id:"".concat(m.id||d.name,"-").concat(e.value),key:"".concat(m.id||d.name,"-").concat(e.value),isDisabled:h||j}))})))};b.propTypes={name:n.string.isRequired,Wrapper:n.oneOfType([n.node,n.func]),Checkbox:n.oneOfType([n.node,n.func])};_objectSpread(_objectSpread({},p.formGroup),{},{children:n.oneOfType([n.arrayOf(n.node),n.node])});function ownKeys$1(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread$1(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(o),!0).forEach((function(t){e._defineProperty(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys$1(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var u=function Wrapper(e){var r=e.label,t=e.description,n=e.children,i=e.helperText,c=e.error,s=e.showError,b=e.isRequired;return o.createElement(a,{legendText:t?o.createElement(p.WithDescription,{labelText:p.buildLabel(r,b),description:t}):p.buildLabel(r,b)},n,o.createElement(l.HelperTextBlock,{helperText:i,errorText:s&&c}))};u.propTypes={label:n.node,children:n.node,description:n.node,helperText:n.node,error:n.node,showError:n.bool,isRequired:n.bool};var d=function SingleCheckbox(e){var n=i(p.prepareProps(_objectSpread$1(_objectSpread$1({},e),{},{type:"checkbox"}))),a=n.input,s=n.meta,b=n.validateOnMount,u=n.helperText,d=n.WrapperProps,f=t._objectWithoutProperties(n,["input","meta","validateOnMount","helperText","WrapperProps"]),h=(s.touched||b)&&s.error,j=(s.touched||b)&&s.warning;return o.createElement("div",d,o.createElement(c,r._extends({},a,{id:a.name},f)),o.createElement(l.HelperTextBlock,{helperText:u,errorText:h,warnText:j}))},f=function SingleCheckboxInCommon(e){var r=e.label,n=e.isDisabled,i=e.id;t._objectWithoutProperties(e,["label","isDisabled","id"]);return o.createElement(c,{id:i,labelText:r,disabled:n})};f.propTypes={label:n.node,input:n.object,isDisabled:n.bool,isRequired:n.bool,name:n.string,id:n.string,WrapperProps:n.object};var h=function Checkbox(e){var n=e.options,i=t._objectWithoutProperties(e,["options"]);return n?o.createElement(b,r._extends({options:n},i,{Wrapper:u,Checkbox:f})):o.createElement(d,i)};h.propTypes={options:n.arrayOf(n.shape({label:n.node,value:n.any}))},exports.default=h; | ||
//# sourceMappingURL=checkbox.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./defineProperty-75110086.js"),r=function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(require("@data-driven-forms/react-form-renderer/dist/cjs/component-types"));require("./extends-edb29469.js"),require("./objectWithoutProperties-6a6333c3.js"),require("react"),require("prop-types"),require("./clsx.m-fe63e0e7.js"),require("carbon-components-react/lib/components/Tabs/Tabs.js"),require("carbon-components-react/lib/components/Tab/Tab.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/use-form-api");var t=require("./tabs.js"),o=require("./sub-form.js");require("./toConsumableArray-43caa138.js"),require("./typeof-aef86737.js"),require("./slicedToArray-bbb33c2c.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/wizard-context"),require("./_arrayPush-f10aef75.js");var n=require("./wizard.js");require("@data-driven-forms/react-form-renderer/dist/cjs/form-spy"),require("carbon-components-react/lib/components/Button/Button.js"),require("carbon-components-react/lib/components/Grid/Column.js"),require("carbon-components-react/lib/components/Grid/Grid.js"),require("carbon-components-react/lib/components/Grid/Row.js"),require("carbon-components-react/lib/components/ProgressIndicator/ProgressIndicator.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api");var i=require("./select.js");require("./isEqual-4af7d099.js"),require("carbon-components-react/lib/components/Select/Select.js"),require("carbon-components-react/lib/components/MultiSelect/MultiSelect.js"),require("carbon-components-react/lib/components/SelectItem/SelectItem.js"),require("carbon-components-react/lib/components/ComboBox/ComboBox.js"),require("carbon-components-react/lib/components/Tooltip/Tooltip.js"),require("./prepare-props-11a1ca5a.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/field-array"),require("carbon-components-react/lib/components/FormGroup/FormGroup.js"),require("@carbon/icons-react/lib/add--alt/32.js"),require("@carbon/icons-react/lib/subtract/32.js");var c=require("./field-array.js");require("carbon-components-react/lib/components/TextInput/TextInput.js");var a=require("./text-field.js");require("carbon-components-react/lib/components/TextArea/TextArea.js");var s=require("./textarea.js"),u=require("./checkbox.js");require("carbon-components-react/lib/components/Checkbox/Checkbox.js"),require("./helper-text-block-045ee2cb.js"),require("carbon-components-react/lib/components/RadioButtonGroup/RadioButtonGroup.js"),require("carbon-components-react/lib/components/RadioButton/RadioButton.js");var l=require("./radio.js");require("carbon-components-react/lib/components/DatePicker/DatePicker.js"),require("carbon-components-react/lib/components/DatePickerInput/DatePickerInput.js");var d=require("./date-picker.js");require("carbon-components-react/lib/components/TimePicker/TimePicker.js"),require("carbon-components-react/lib/components/TimePickerSelect/TimePickerSelect.js");var p=require("./time-picker.js");require("carbon-components-react/lib/components/Toggle/Toggle.js");var b=require("./switch.js"),m=require("./plain-text.js"),f=require("./dual-list-select.js");require("carbon-components-react/lib/components/Search/Search.js"),require("carbon-components-react/lib/components/TooltipIcon/TooltipIcon.js"),require("@carbon/icons-react/lib/checkmark--filled/16.js"),require("@carbon/icons-react/lib/chevron--right/32.js"),require("@carbon/icons-react/lib/chevron--left/32.js"),require("@carbon/icons-react/lib/caret--sort--down/32.js"),require("@carbon/icons-react/lib/caret--sort--up/32.js"),require("carbon-components-react/lib/components/StructuredList/StructuredList.js"),require("carbon-components-react/lib/components/Slider/Slider.js");var j,q=require("./slider.js"),T=(j={},e._defineProperty(j,r.TEXT_FIELD,a.default),e._defineProperty(j,r.TEXTAREA,s.default),e._defineProperty(j,r.SELECT,i.default),e._defineProperty(j,r.CHECKBOX,u.default),e._defineProperty(j,r.SUB_FORM,o.default),e._defineProperty(j,r.RADIO,l.default),e._defineProperty(j,r.TABS,t.default),e._defineProperty(j,r.DATE_PICKER,d.default),e._defineProperty(j,r.TIME_PICKER,p.default),e._defineProperty(j,r.WIZARD,n.default),e._defineProperty(j,r.SWITCH,b.default),e._defineProperty(j,r.PLAIN_TEXT,m.default),e._defineProperty(j,r.FIELD_ARRAY,c.default),e._defineProperty(j,r.DUAL_LIST_SELECT,f.default),e._defineProperty(j,r.SLIDER,q.default),j),P={TextField:a.default,Textarea:s.default,Checkbox:u.default,Radio:l.default,Select:i.default,DatePicker:d.default,TimePicker:p.default,Switch:b.default,PlainText:m.default,DualListSelect:f.default,Slider:q.default,FieldArray:c.default,SubForm:o.default,Wizard:n.default,Tabs:t.default};exports.components=P,exports.default=T; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./defineProperty-75110086.js"),r=function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(require("@data-driven-forms/react-form-renderer/dist/cjs/component-types"));require("./extends-edb29469.js"),require("./objectWithoutProperties-6a6333c3.js"),require("react"),require("prop-types"),require("./clsx.m-fe63e0e7.js"),require("carbon-components-react/lib/components/Tabs/Tabs.js"),require("carbon-components-react/lib/components/Tab/Tab.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/use-form-api");var t=require("./tabs.js"),o=require("./sub-form.js");require("./toConsumableArray-43caa138.js"),require("./typeof-aef86737.js"),require("./slicedToArray-bbb33c2c.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/wizard-context"),require("./_arrayPush-f10aef75.js");var n=require("./wizard.js");require("@data-driven-forms/react-form-renderer/dist/cjs/form-spy"),require("carbon-components-react/lib/components/Button/Button.js"),require("carbon-components-react/lib/components/Grid/Column.js"),require("carbon-components-react/lib/components/Grid/Grid.js"),require("carbon-components-react/lib/components/Grid/Row.js"),require("carbon-components-react/lib/components/ProgressIndicator/ProgressIndicator.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api");var i=require("./select.js");require("./isEqual-4af7d099.js"),require("carbon-components-react/lib/components/Select/Select.js"),require("carbon-components-react/lib/components/MultiSelect/MultiSelect.js"),require("carbon-components-react/lib/components/SelectItem/SelectItem.js"),require("carbon-components-react/lib/components/ComboBox/ComboBox.js"),require("carbon-components-react/lib/components/Tooltip/Tooltip.js"),require("./prepare-props-4fe8d115.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/field-array"),require("carbon-components-react/lib/components/FormGroup/FormGroup.js"),require("@carbon/icons-react/lib/add--alt/32.js"),require("@carbon/icons-react/lib/subtract/32.js");var c=require("./field-array.js");require("carbon-components-react/lib/components/TextInput/TextInput.js");var a=require("./text-field.js");require("carbon-components-react/lib/components/TextArea/TextArea.js");var s=require("./textarea.js"),u=require("./checkbox.js");require("carbon-components-react/lib/components/Checkbox/Checkbox.js"),require("./helper-text-block-045ee2cb.js"),require("carbon-components-react/lib/components/RadioButtonGroup/RadioButtonGroup.js"),require("carbon-components-react/lib/components/RadioButton/RadioButton.js");var l=require("./radio.js");require("carbon-components-react/lib/components/DatePicker/DatePicker.js"),require("carbon-components-react/lib/components/DatePickerInput/DatePickerInput.js");var d=require("./date-picker.js");require("carbon-components-react/lib/components/TimePicker/TimePicker.js"),require("carbon-components-react/lib/components/TimePickerSelect/TimePickerSelect.js");var p=require("./time-picker.js");require("carbon-components-react/lib/components/Toggle/Toggle.js");var b=require("./switch.js"),m=require("./plain-text.js"),f=require("./dual-list-select.js");require("carbon-components-react/lib/components/Search/Search.js"),require("carbon-components-react/lib/components/TooltipIcon/TooltipIcon.js"),require("@carbon/icons-react/lib/checkmark--filled/16.js"),require("@carbon/icons-react/lib/chevron--right/32.js"),require("@carbon/icons-react/lib/chevron--left/32.js"),require("@carbon/icons-react/lib/caret--sort--down/32.js"),require("@carbon/icons-react/lib/caret--sort--up/32.js"),require("carbon-components-react/lib/components/StructuredList/StructuredList.js"),require("carbon-components-react/lib/components/Slider/Slider.js");var j,q=require("./slider.js"),T=(j={},e._defineProperty(j,r.TEXT_FIELD,a.default),e._defineProperty(j,r.TEXTAREA,s.default),e._defineProperty(j,r.SELECT,i.default),e._defineProperty(j,r.CHECKBOX,u.default),e._defineProperty(j,r.SUB_FORM,o.default),e._defineProperty(j,r.RADIO,l.default),e._defineProperty(j,r.TABS,t.default),e._defineProperty(j,r.DATE_PICKER,d.default),e._defineProperty(j,r.TIME_PICKER,p.default),e._defineProperty(j,r.WIZARD,n.default),e._defineProperty(j,r.SWITCH,b.default),e._defineProperty(j,r.PLAIN_TEXT,m.default),e._defineProperty(j,r.FIELD_ARRAY,c.default),e._defineProperty(j,r.DUAL_LIST_SELECT,f.default),e._defineProperty(j,r.SLIDER,q.default),j),P={TextField:a.default,Textarea:s.default,Checkbox:u.default,Radio:l.default,Select:i.default,DatePicker:d.default,TimePicker:p.default,Switch:b.default,PlainText:m.default,DualListSelect:f.default,Slider:q.default,FieldArray:c.default,SubForm:o.default,Wizard:n.default,Tabs:t.default};exports.components=P,exports.default=T; | ||
//# sourceMappingURL=component-mapper.js.map |
@@ -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}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var a=require("./prepare-props-11a1ca5a.js"),p=require("./helper-text-block-045ee2cb.js"),n=_interopDefault(require("carbon-components-react/lib/components/DatePicker/DatePicker.js")),c=_interopDefault(require("carbon-components-react/lib/components/DatePickerInput/DatePickerInput.js")),s=function DatePicker(o){var s=i(a.prepareProps(o)),u=s.input,l=s.datePickerType,d=s.meta,P=s.DatePickerProps,b=s.validateOnMount,f=s.helperText,j=s.WrapperProps,k=r._objectWithoutProperties(s,["input","datePickerType","meta","DatePickerProps","validateOnMount","helperText","WrapperProps"]),m=(d.touched||b)&&d.error,D=(d.touched||b)&&d.warning;return t.createElement("div",j,t.createElement(n,e._extends({},u,{datePickerType:l},P),t.createElement(c,e._extends({id:u.name,invalid:Boolean(m),invalidText:m||""},k))),t.createElement(p.HelperTextBlock,{helperText:!m&&f,warnText:D}))};s.propTypes={isDisabled:o.bool,isRequired:o.bool,datePickerType:o.string,DatePickerProps:o.object,WrapperProps:o.object},s.defaultProps={datePickerType:"single"},exports.default=s; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var p=require("./prepare-props-4fe8d115.js"),a=require("./helper-text-block-045ee2cb.js"),n=_interopDefault(require("carbon-components-react/lib/components/DatePicker/DatePicker.js")),c=_interopDefault(require("carbon-components-react/lib/components/DatePickerInput/DatePickerInput.js")),s=function DatePicker(o){var s=i(p.prepareProps(o)),u=s.input,l=s.datePickerType,d=s.meta,P=s.DatePickerProps,f=s.validateOnMount,b=s.helperText,j=s.WrapperProps,k=r._objectWithoutProperties(s,["input","datePickerType","meta","DatePickerProps","validateOnMount","helperText","WrapperProps"]),m=(d.touched||f)&&d.error,D=(d.touched||f)&&d.warning;return t.createElement("div",j,t.createElement(n,e._extends({},u,{datePickerType:l},P),t.createElement(c,e._extends({id:u.name,invalid:Boolean(m),invalidText:m||""},k))),t.createElement(a.HelperTextBlock,{helperText:!m&&b,warnText:D}))};s.propTypes={isDisabled:o.bool,isRequired:o.bool,datePickerType:o.string,DatePickerProps:o.object,WrapperProps:o.object},s.defaultProps={datePickerType:"single"},exports.default=s; | ||
//# sourceMappingURL=date-picker.js.map |
@@ -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("./defineProperty-75110086.js"),t=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),o=require("react"),n=_interopDefault(o),l=_interopDefault(require("prop-types")),s=require("./clsx.m-fe63e0e7.js"),i=require("./toConsumableArray-43caa138.js"),a=require("./slicedToArray-bbb33c2c.js");require("./_arrayPush-f10aef75.js");var c=_interopDefault(require("carbon-components-react/lib/components/Button/Button.js")),u=_interopDefault(require("carbon-components-react/lib/components/Grid/Column.js")),p=_interopDefault(require("carbon-components-react/lib/components/Grid/Grid.js")),d=_interopDefault(require("carbon-components-react/lib/components/Grid/Row.js")),f=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api")),b=require("./isEqual-4af7d099.js");require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var m=require("./prepare-props-11a1ca5a.js"),h=_interopDefault(require("carbon-components-react/lib/components/FormGroup/FormGroup.js")),g=_interopDefault(require("carbon-components-react/lib/components/Search/Search.js")),P=_interopDefault(require("carbon-components-react/lib/components/TooltipIcon/TooltipIcon.js")),y=_interopDefault(require("@carbon/icons-react/lib/checkmark--filled/16.js")),j=_interopDefault(require("@carbon/icons-react/lib/chevron--right/32.js")),_=_interopDefault(require("@carbon/icons-react/lib/chevron--left/32.js")),v=_interopDefault(require("@carbon/icons-react/lib/caret--sort--down/32.js")),O=_interopDefault(require("@carbon/icons-react/lib/caret--sort--up/32.js")),T=require("carbon-components-react/lib/components/StructuredList/StructuredList.js");function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(o),!0).forEach((function(r){e._defineProperty(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var L={lastLeftClicked:void 0,selectedLeftValues:[],lastRightClicked:void 0,selectedRightValues:[],sortLeftDesc:!0,sortRightDesc:!0,filterOptions:"",filterValue:""},S=function reducer(e,t){var r=t.type,o=t.value,n=t.values,l=t.isRight;switch(r){case"setSelectedValue":return _objectSpread(_objectSpread(_objectSpread({},e),l?{selectedLeftValues:n}:{selectedRightValues:n}),l?{lastLeftClicked:o}:{lastRightClicked:o});case"setFilterValue":return _objectSpread(_objectSpread({},e),{},{filterValue:o});case"setFilterOptions":return _objectSpread(_objectSpread({},e),{},{filterOptions:o});case"sortValue":return _objectSpread(_objectSpread({},e),{},{sortRightDesc:!e.sortRightDesc});case"sortOptions":return _objectSpread(_objectSpread({},e),{},{sortLeftDesc:!e.sortLeftDesc});case"clearRightValues":return _objectSpread(_objectSpread({},e),{},{selectedRightValues:[]});case"clearLeftOptions":return _objectSpread(_objectSpread({},e),{},{selectedLeftValues:[]});default:return e}};function ownKeys$1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread$1(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$1(Object(o),!0).forEach((function(r){e._defineProperty(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$1(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var R=function getOptionsGroup(e,t,r){var o=r.map((function(e){return e.value.toString()})).indexOf(t.toString()),n=r.map((function(e){return e.value.toString()})).indexOf(e),l=Math.min(o,n),s=Math.max(o,n)+1;return i._toConsumableArray(r.slice(l,s).map((function(e){return e.value.toString()})))},V=function handleOptionClick(e,t,r,o,n,l){var s=o?"selectedLeftValues":"selectedRightValues",a=o?"lastLeftClicked":"lastRightClicked";if(e.shiftKey&&l[a])n({type:"setSelectedValue",value:t,values:R(t,l[a],r),isRight:o});else if(e.ctrlKey&&l[a]){var c=l[s].includes(t)?l[s].filter((function(e){return e!==t})):[].concat(i._toConsumableArray(l[s]),[t]);n({type:"setSelectedValue",value:t,values:c,isRight:o})}else n({type:"setSelectedValue",value:t,values:[t],isRight:o})},C=function DualListSelectCommon(e){var l=o.useReducer(S,L),s=a._slicedToArray(l,2),c=s[0],u=s[1],p=f(_objectSpread$1(_objectSpread$1({},e),{},{isEqual:function isEqual$1(e,t){return b._isEqual(i._toConsumableArray(e||[]).sort(),i._toConsumableArray(t||[]).sort())}})),d=p.DualListSelect,m=r._objectWithoutProperties(p,["DualListSelect"]),h=m.options.filter((function(e){return!m.input.value.includes(e.value)&&e.label.includes(c.filterOptions)})).sort((function(e,t){return c.sortLeftDesc?e.label.localeCompare(t.label):t.label.localeCompare(e.label)})),g=m.options.filter((function(e){return m.input.value.includes(e.value)&&e.label.includes(c.filterValue)})).sort((function(e,t){return c.sortRightDesc?e.label.localeCompare(t.label):t.label.localeCompare(e.label)}));return n.createElement(d,t._extends({},m,{leftValues:h,rightValues:g,handleOptionsClick:function handleOptionsClick(e,t){return V(e,t,h,!0,u,c)},handleValuesClick:function handleValuesClick(e,t){return V(e,t,g,!1,u,c)},handleMoveRight:function handleMoveRight(){m.input.onChange([].concat(i._toConsumableArray(m.input.value),i._toConsumableArray(c.selectedLeftValues))),u({type:"clearLeftOptions"})},handleMoveLeft:function handleMoveLeft(){m.input.onChange(m.input.value.filter((function(e){return!c.selectedRightValues.includes(e)}))),u({type:"clearRightValues"})},sortOptions:function sortOptions(){return u({type:"sortOptions"})},sortValues:function sortValues(){return u({type:"sortValue"})},filterOptions:function filterOptions(e){return u({type:"setFilterOptions",value:e})},filterValues:function filterValues(e){return u({type:"setFilterValue",value:e})},handleClearLeftValues:function handleClearLeftValues(){u({type:"clearLeftValues"}),m.input.onChange([].concat(i._toConsumableArray(m.input.value),i._toConsumableArray(h.map((function(e){return e.value})))))},handleClearRightValues:function handleClearRightValues(){u({type:"clearRightValue"}),m.input.onChange(i._toConsumableArray(m.input.value.filter((function(e){return!g.find((function(t){var r=t.value;return e===r}))}))))},state:c}))};function ownKeys$2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread$2(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$2(Object(o),!0).forEach((function(r){e._defineProperty(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$2(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}C.propTypes={DualListSelect:l.oneOfType([l.node,l.func])},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-dual-list {\n max-height: 500px;\n overflow: auto;\n display: block;\n margin-bottom: 0px;\n}\n\n.ddorg__carbon-dual-list-body {\n width: 100%;\n display: inline-table;\n}\n\n.ddorg__carbon-dual-list-button-wrapper {\n flex-direction: column;\n padding: 8px !important;\n padding-top: 8px !important;\n}\n.ddorg__carbon-dual-list-button-wrapper button {\n width: 100%;\n max-width: 100%;\n}\n@media (max-width: 1055px) {\n .ddorg__carbon-dual-list-button-wrapper button svg {\n transform: rotate(90deg);\n }\n}\n.ddorg__carbon-dual-list-button-wrapper button:not(:last-child) {\n margin-bottom: 8px;\n}\n\n.ddorg__carbon-dual-list-toolbar {\n display: flex;\n}\n\n.ddorg__carbon-dual-list-tooltipbutton {\n background: #c2c1c1 !important;\n}");var E=function EmptyList(e){var t=e.message;return n.createElement(T.StructuredListWrapper,null,n.createElement(T.StructuredListBody,null,n.createElement(T.StructuredListRow,null,n.createElement(T.StructuredListCell,null,t))))};E.propTypes={message:l.string};var x=function List(e){var r=e.options,o=e.selectedValues,l=e.handleOptionsClick,i=e.noTitle,a=e.ListProps,c=e.BodyProps;return r.length>0?n.createElement(T.StructuredListWrapper,t._extends({selection:!0},a,{className:s.clsx("ddorg__carbon-dual-list",a.className)}),n.createElement(T.StructuredListBody,t._extends({},c,{className:s.clsx("ddorg__carbon-dual-list-body",c.className)}),r.map((function(e){var r=e.value,s=e.label,i=e.ListRowProps,a=e.ListCellProps,c=e.GridProps,f=e.RowProps,b=e.LabelProps,m=e.CheckmarkProps;return n.createElement(T.StructuredListRow,t._extends({key:r},i,{onClick:function onClick(e){return l(_objectSpread$2(_objectSpread$2({},e),{},{ctrlKey:!0}),r)}}),n.createElement(T.StructuredListCell,a,n.createElement(p,c,n.createElement(d,t._extends({narrow:!0},f),n.createElement(u,t._extends({sm:3},b),s),n.createElement(u,t._extends({sm:1},m),o.includes(r)&&n.createElement(y,null))))))})))):n.createElement(E,{message:i})};x.propTypes={options:l.array,selectedValues:l.array,handleOptionsClick:l.func,noTitle:l.node,ListProps:l.object,BodyProps:l.object};var w=function Toolbar(e){var r=e.sortTitle,o=e.onFilter,l=e.onSort,i=e.sortDirection,a=e.placeholder,c=e.ToolbarProps,u=e.SearchProps,p=e.SortProps;return n.createElement("div",t._extends({},c,{className:s.clsx("ddorg__carbon-dual-list-toolbar",c.className)}),n.createElement(g,t._extends({onChange:function onChange(e){return o(e.target.value)},labelText:"",placeHolderText:a},u)),n.createElement(P,t._extends({onClick:l,tooltipText:r},p,{className:s.clsx("ddorg__carbon-dual-list-tooltipbutton",p.className)}),i?n.createElement(v,null):n.createElement(O,null)))};w.propTypes={sortTitle:l.string,onFilter:l.func,onSort:l.func,sortDirection:l.bool,placeholder:l.string,ToolbarProps:l.object,SearchProps:l.object,SortProps:l.object};var D=function isEmpty(e){return 0===e.length},k=function DualListSelectInner(e){var r=e.leftValues,o=e.handleOptionsClick,l=e.rightValues,i=e.handleValuesClick,a=e.handleMoveRight,f=e.handleClearLeftValues,b=e.handleMoveLeft,g=e.handleClearRightValues,P=e.state,y=e.filterOptions,v=e.filterValues,O=e.sortOptions,T=e.sortValues,L=e.noOptionsTitle,S=e.noValueTitle,R=e.leftTitle,V=e.rightTitle,C=e.LeftTitleElement,E=e.RightTitleElement,k=e.LeftTitleProps,A=e.RightTitleProps,q=e.moveLeftTitle,B=e.moveRightTitle,F=e.moveAllLeftTitle,G=e.moveAllRightTitle,$=e.label,K=e.isRequired,M=e.filterOptionsTitle,N=e.filterValuesTitle,I=e.sortOptionsTitle,W=e.sortValuesTitle,H=e.filterOptionsText,z=e.filterValueText,J=e.FormGroupProps,Q=e.GridProps,U=e.RowProps,X=e.OptionsColumnProps,Y=e.ButtonColumnProps,Z=e.ValuesColumnProps,ee=e.AddButtonProps,te=e.AddAllButtonProps,re=e.RemoveButtonProps,oe=e.RemoveAllButtonProps,ne=e.LeftToolbarProps,le=e.RightToolbarProps,se=e.LeftSearchProps,ie=e.RightSearchProps,ae=e.LeftSortProps,ce=e.RightSortProps,ue=e.LeftListProps,pe=e.LeftBodyProps,de=e.RightListProps,fe=e.RightBodyProps;return n.createElement(h,t._extends({legendText:m.buildLabel($||"",K)},J),n.createElement(p,Q,n.createElement(d,t._extends({condensed:!0},U),n.createElement(u,t._extends({sm:4,md:8,lg:5},X),n.createElement(C,k,R),n.createElement(w,{onFilter:y,placeholder:M,sortDirection:P.sortLeftDesc,onSort:O,sortTitle:I,ToolbarProps:ne,SearchProps:se,SortProps:ae}),n.createElement(x,{ListProps:ue,BodyProps:pe,options:r,selectedValues:P.selectedLeftValues,handleOptionsClick:o,noTitle:P.filterOptions?H:L})),n.createElement(u,t._extends({sm:4,md:8,lg:2},Y,{className:s.clsx("ddorg__carbon-dual-list-button-wrapper",Y.className)}),n.createElement(c,t._extends({id:"move-right",renderIcon:j,onClick:a,disabled:D(P.selectedLeftValues)},ee),B),n.createElement(c,t._extends({id:"move-all-right",onClick:f,disabled:D(r)},te),G),n.createElement(c,t._extends({id:"move-all-left",onClick:g,disabled:D(l)},oe),F),n.createElement(c,t._extends({id:"move-left",renderIcon:_,onClick:b,disabled:D(P.selectedRightValues)},re),q)),n.createElement(u,t._extends({sm:4,md:8,lg:5},Z),n.createElement(E,A,V),n.createElement(w,{onFilter:v,placeholder:N,sortDirection:P.sortRightDesc,onSort:T,sortTitle:W,ToolbarProps:le,SearchProps:ie,SortProps:ce}),n.createElement(x,{ListProps:de,BodyProps:fe,options:l,selectedValues:P.selectedRightValues,handleOptionsClick:i,noTitle:P.filterValue?z:S})))))};k.propTypes={leftValues:l.array,handleOptionsClick:l.func,rightValues:l.array,handleValuesClick:l.func,handleMoveRight:l.func,handleClearLeftValues:l.func,handleMoveLeft:l.func,handleClearRightValues:l.func,state:l.object,filterOptions:l.func,filterValues:l.func,sortValues:l.func,sortOptions:l.func,noOptionsTitle:l.node,noValueTitle:l.node,leftTitle:l.node,rightTitle:l.node,LeftTitleElement:l.string,RightTitleElement:l.string,LeftTitleProps:l.object,RightTitleProps:l.object,moveLeftTitle:l.node,moveRightTitle:l.node,moveAllLeftTitle:l.node,moveAllRightTitle:l.node,label:l.node,isRequired:l.bool,filterOptionsTitle:l.string,filterValuesTitle:l.string,sortOptionsTitle:l.string,sortValuesTitle:l.string,filterOptionsText:l.node,filterValueText:l.node,FormGroupProps:l.object,GridProps:l.object,RowProps:l.object,OptionsColumnProps:l.object,ButtonColumnProps:l.object,ValuesColumnProps:l.object,AddButtonProps:l.object,AddAllButtonProps:l.object,RemoveButtonProps:l.object,RemoveAllButtonProps:l.object,LeftToolbarProps:l.object,RightToolbarProps:l.object,LeftSearchProps:l.object,RightSearchProps:l.object,LeftSortProps:l.object,RightSortProps:l.object,LeftListProps:l.object,LeftBodyProps:l.object,RightListProps:l.object,RightBodyProps:l.object},k.defaultProps={noOptionsTitle:"No option available",noValueTitle:"No option selected",leftTitle:"Options",rightTitle:"Selected",LeftTitleElement:"h6",RightTitleElement:"h6",moveLeftTitle:"Remove",moveRightTitle:"Add",moveAllLeftTitle:"Remove All",moveAllRightTitle:"Add All",filterOptionsTitle:"Filter options",filterValuesTitle:"Filter values",sortOptionsTitle:"Sort options",sortValuesTitle:"Sort values",filterOptionsText:"Remove your filter to see all options",filterValueText:"Remove your filter to see all selected",FormGroupProps:{},GridProps:{},RowProps:{},OptionsColumnProps:{},ButtonColumnProps:{},ValuesColumnProps:{},AddButtonProps:{},AddAllButtonProps:{},RemoveButtonProps:{},RemoveAllButtonProps:{},LeftToolbarProps:{},RightToolbarProps:{},LeftSearchProps:{},RightSearchProps:{},LeftSortProps:{},RightSortProps:{},LeftListProps:{},LeftBodyProps:{},RightListProps:{},RightBodyProps:{}};exports.default=function DualListSelect(e){return n.createElement(C,t._extends({},e,{DualListSelect:k}))}; | ||
"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("./defineProperty-75110086.js"),t=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),o=require("react"),n=_interopDefault(o),l=_interopDefault(require("prop-types")),s=require("./clsx.m-fe63e0e7.js"),i=require("./toConsumableArray-43caa138.js"),a=require("./slicedToArray-bbb33c2c.js");require("./_arrayPush-f10aef75.js");var c=_interopDefault(require("carbon-components-react/lib/components/Button/Button.js")),u=_interopDefault(require("carbon-components-react/lib/components/Grid/Column.js")),p=_interopDefault(require("carbon-components-react/lib/components/Grid/Grid.js")),d=_interopDefault(require("carbon-components-react/lib/components/Grid/Row.js")),f=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api")),b=require("./isEqual-4af7d099.js");require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var m=require("./prepare-props-4fe8d115.js"),h=_interopDefault(require("carbon-components-react/lib/components/FormGroup/FormGroup.js")),g=_interopDefault(require("carbon-components-react/lib/components/Search/Search.js")),P=_interopDefault(require("carbon-components-react/lib/components/TooltipIcon/TooltipIcon.js")),y=_interopDefault(require("@carbon/icons-react/lib/checkmark--filled/16.js")),j=_interopDefault(require("@carbon/icons-react/lib/chevron--right/32.js")),_=_interopDefault(require("@carbon/icons-react/lib/chevron--left/32.js")),v=_interopDefault(require("@carbon/icons-react/lib/caret--sort--down/32.js")),O=_interopDefault(require("@carbon/icons-react/lib/caret--sort--up/32.js")),T=require("carbon-components-react/lib/components/StructuredList/StructuredList.js");function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(o),!0).forEach((function(r){e._defineProperty(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var L={lastLeftClicked:void 0,selectedLeftValues:[],lastRightClicked:void 0,selectedRightValues:[],sortLeftDesc:!0,sortRightDesc:!0,filterOptions:"",filterValue:""},S=function reducer(e,t){var r=t.type,o=t.value,n=t.values,l=t.isRight;switch(r){case"setSelectedValue":return _objectSpread(_objectSpread(_objectSpread({},e),l?{selectedLeftValues:n}:{selectedRightValues:n}),l?{lastLeftClicked:o}:{lastRightClicked:o});case"setFilterValue":return _objectSpread(_objectSpread({},e),{},{filterValue:o});case"setFilterOptions":return _objectSpread(_objectSpread({},e),{},{filterOptions:o});case"sortValue":return _objectSpread(_objectSpread({},e),{},{sortRightDesc:!e.sortRightDesc});case"sortOptions":return _objectSpread(_objectSpread({},e),{},{sortLeftDesc:!e.sortLeftDesc});case"clearRightValues":return _objectSpread(_objectSpread({},e),{},{selectedRightValues:[]});case"clearLeftOptions":return _objectSpread(_objectSpread({},e),{},{selectedLeftValues:[]});default:return e}};function ownKeys$1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread$1(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$1(Object(o),!0).forEach((function(r){e._defineProperty(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$1(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var R=function getOptionsGroup(e,t,r){var o=r.map((function(e){return e.value.toString()})).indexOf(t.toString()),n=r.map((function(e){return e.value.toString()})).indexOf(e),l=Math.min(o,n),s=Math.max(o,n)+1;return i._toConsumableArray(r.slice(l,s).map((function(e){return e.value.toString()})))},V=function handleOptionClick(e,t,r,o,n,l){var s=o?"selectedLeftValues":"selectedRightValues",a=o?"lastLeftClicked":"lastRightClicked";if(e.shiftKey&&l[a])n({type:"setSelectedValue",value:t,values:R(t,l[a],r),isRight:o});else if(e.ctrlKey&&l[a]){var c=l[s].includes(t)?l[s].filter((function(e){return e!==t})):[].concat(i._toConsumableArray(l[s]),[t]);n({type:"setSelectedValue",value:t,values:c,isRight:o})}else n({type:"setSelectedValue",value:t,values:[t],isRight:o})},C=function DualListSelectCommon(e){var l=o.useReducer(S,L),s=a._slicedToArray(l,2),c=s[0],u=s[1],p=f(_objectSpread$1(_objectSpread$1({},e),{},{isEqual:function isEqual$1(e,t){return b._isEqual(i._toConsumableArray(e||[]).sort(),i._toConsumableArray(t||[]).sort())}})),d=p.DualListSelect,m=r._objectWithoutProperties(p,["DualListSelect"]),h=m.options.filter((function(e){return!m.input.value.includes(e.value)&&e.label.includes(c.filterOptions)})).sort((function(e,t){return c.sortLeftDesc?e.label.localeCompare(t.label):t.label.localeCompare(e.label)})),g=m.options.filter((function(e){return m.input.value.includes(e.value)&&e.label.includes(c.filterValue)})).sort((function(e,t){return c.sortRightDesc?e.label.localeCompare(t.label):t.label.localeCompare(e.label)}));return n.createElement(d,t._extends({},m,{leftValues:h,rightValues:g,handleOptionsClick:function handleOptionsClick(e,t){return V(e,t,h,!0,u,c)},handleValuesClick:function handleValuesClick(e,t){return V(e,t,g,!1,u,c)},handleMoveRight:function handleMoveRight(){m.input.onChange([].concat(i._toConsumableArray(m.input.value),i._toConsumableArray(c.selectedLeftValues))),u({type:"clearLeftOptions"})},handleMoveLeft:function handleMoveLeft(){m.input.onChange(m.input.value.filter((function(e){return!c.selectedRightValues.includes(e)}))),u({type:"clearRightValues"})},sortOptions:function sortOptions(){return u({type:"sortOptions"})},sortValues:function sortValues(){return u({type:"sortValue"})},filterOptions:function filterOptions(e){return u({type:"setFilterOptions",value:e})},filterValues:function filterValues(e){return u({type:"setFilterValue",value:e})},handleClearLeftValues:function handleClearLeftValues(){u({type:"clearLeftValues"}),m.input.onChange([].concat(i._toConsumableArray(m.input.value),i._toConsumableArray(h.map((function(e){return e.value})))))},handleClearRightValues:function handleClearRightValues(){u({type:"clearRightValue"}),m.input.onChange(i._toConsumableArray(m.input.value.filter((function(e){return!g.find((function(t){var r=t.value;return e===r}))}))))},state:c}))};function ownKeys$2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread$2(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$2(Object(o),!0).forEach((function(r){e._defineProperty(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys$2(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}C.propTypes={DualListSelect:l.oneOfType([l.node,l.func])},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-dual-list {\n max-height: 500px;\n overflow: auto;\n display: block;\n margin-bottom: 0px;\n}\n\n.ddorg__carbon-dual-list-body {\n width: 100%;\n display: inline-table;\n}\n\n.ddorg__carbon-dual-list-button-wrapper {\n flex-direction: column;\n padding: 8px !important;\n padding-top: 8px !important;\n}\n.ddorg__carbon-dual-list-button-wrapper button {\n width: 100%;\n max-width: 100%;\n}\n@media (max-width: 1055px) {\n .ddorg__carbon-dual-list-button-wrapper button svg {\n transform: rotate(90deg);\n }\n}\n.ddorg__carbon-dual-list-button-wrapper button:not(:last-child) {\n margin-bottom: 8px;\n}\n\n.ddorg__carbon-dual-list-toolbar {\n display: flex;\n}\n\n.ddorg__carbon-dual-list-tooltipbutton {\n background: #c2c1c1 !important;\n}");var E=function EmptyList(e){var t=e.message;return n.createElement(T.StructuredListWrapper,null,n.createElement(T.StructuredListBody,null,n.createElement(T.StructuredListRow,null,n.createElement(T.StructuredListCell,null,t))))};E.propTypes={message:l.string};var x=function List(e){var r=e.options,o=e.selectedValues,l=e.handleOptionsClick,i=e.noTitle,a=e.ListProps,c=e.BodyProps;return r.length>0?n.createElement(T.StructuredListWrapper,t._extends({selection:!0},a,{className:s.clsx("ddorg__carbon-dual-list",a.className)}),n.createElement(T.StructuredListBody,t._extends({},c,{className:s.clsx("ddorg__carbon-dual-list-body",c.className)}),r.map((function(e){var r=e.value,s=e.label,i=e.ListRowProps,a=e.ListCellProps,c=e.GridProps,f=e.RowProps,b=e.LabelProps,m=e.CheckmarkProps;return n.createElement(T.StructuredListRow,t._extends({key:r},i,{onClick:function onClick(e){return l(_objectSpread$2(_objectSpread$2({},e),{},{ctrlKey:!0}),r)}}),n.createElement(T.StructuredListCell,a,n.createElement(p,c,n.createElement(d,t._extends({narrow:!0},f),n.createElement(u,t._extends({sm:3},b),s),n.createElement(u,t._extends({sm:1},m),o.includes(r)&&n.createElement(y,null))))))})))):n.createElement(E,{message:i})};x.propTypes={options:l.array,selectedValues:l.array,handleOptionsClick:l.func,noTitle:l.node,ListProps:l.object,BodyProps:l.object};var w=function Toolbar(e){var r=e.sortTitle,o=e.onFilter,l=e.onSort,i=e.sortDirection,a=e.placeholder,c=e.ToolbarProps,u=e.SearchProps,p=e.SortProps;return n.createElement("div",t._extends({},c,{className:s.clsx("ddorg__carbon-dual-list-toolbar",c.className)}),n.createElement(g,t._extends({onChange:function onChange(e){return o(e.target.value)},labelText:"",placeHolderText:a},u)),n.createElement(P,t._extends({onClick:l,tooltipText:r},p,{className:s.clsx("ddorg__carbon-dual-list-tooltipbutton",p.className)}),i?n.createElement(v,null):n.createElement(O,null)))};w.propTypes={sortTitle:l.string,onFilter:l.func,onSort:l.func,sortDirection:l.bool,placeholder:l.string,ToolbarProps:l.object,SearchProps:l.object,SortProps:l.object};var D=function isEmpty(e){return 0===e.length},k=function DualListSelectInner(e){var r=e.leftValues,o=e.handleOptionsClick,l=e.rightValues,i=e.handleValuesClick,a=e.handleMoveRight,f=e.handleClearLeftValues,b=e.handleMoveLeft,g=e.handleClearRightValues,P=e.state,y=e.filterOptions,v=e.filterValues,O=e.sortOptions,T=e.sortValues,L=e.noOptionsTitle,S=e.noValueTitle,R=e.leftTitle,V=e.rightTitle,C=e.LeftTitleElement,E=e.RightTitleElement,k=e.LeftTitleProps,A=e.RightTitleProps,q=e.moveLeftTitle,B=e.moveRightTitle,F=e.moveAllLeftTitle,G=e.moveAllRightTitle,$=e.label,K=e.isRequired,M=e.filterOptionsTitle,N=e.filterValuesTitle,I=e.sortOptionsTitle,W=e.sortValuesTitle,H=e.filterOptionsText,z=e.filterValueText,J=e.FormGroupProps,Q=e.GridProps,U=e.RowProps,X=e.OptionsColumnProps,Y=e.ButtonColumnProps,Z=e.ValuesColumnProps,ee=e.AddButtonProps,te=e.AddAllButtonProps,re=e.RemoveButtonProps,oe=e.RemoveAllButtonProps,ne=e.LeftToolbarProps,le=e.RightToolbarProps,se=e.LeftSearchProps,ie=e.RightSearchProps,ae=e.LeftSortProps,ce=e.RightSortProps,ue=e.LeftListProps,pe=e.LeftBodyProps,de=e.RightListProps,fe=e.RightBodyProps;return n.createElement(h,t._extends({legendText:m.buildLabel($||"",K)},J),n.createElement(p,Q,n.createElement(d,t._extends({condensed:!0},U),n.createElement(u,t._extends({sm:4,md:8,lg:5},X),n.createElement(C,k,R),n.createElement(w,{onFilter:y,placeholder:M,sortDirection:P.sortLeftDesc,onSort:O,sortTitle:I,ToolbarProps:ne,SearchProps:se,SortProps:ae}),n.createElement(x,{ListProps:ue,BodyProps:pe,options:r,selectedValues:P.selectedLeftValues,handleOptionsClick:o,noTitle:P.filterOptions?H:L})),n.createElement(u,t._extends({sm:4,md:8,lg:2},Y,{className:s.clsx("ddorg__carbon-dual-list-button-wrapper",Y.className)}),n.createElement(c,t._extends({id:"move-right",renderIcon:j,onClick:a,disabled:D(P.selectedLeftValues)},ee),B),n.createElement(c,t._extends({id:"move-all-right",onClick:f,disabled:D(r)},te),G),n.createElement(c,t._extends({id:"move-all-left",onClick:g,disabled:D(l)},oe),F),n.createElement(c,t._extends({id:"move-left",renderIcon:_,onClick:b,disabled:D(P.selectedRightValues)},re),q)),n.createElement(u,t._extends({sm:4,md:8,lg:5},Z),n.createElement(E,A,V),n.createElement(w,{onFilter:v,placeholder:N,sortDirection:P.sortRightDesc,onSort:T,sortTitle:W,ToolbarProps:le,SearchProps:ie,SortProps:ce}),n.createElement(x,{ListProps:de,BodyProps:fe,options:l,selectedValues:P.selectedRightValues,handleOptionsClick:i,noTitle:P.filterValue?z:S})))))};k.propTypes={leftValues:l.array,handleOptionsClick:l.func,rightValues:l.array,handleValuesClick:l.func,handleMoveRight:l.func,handleClearLeftValues:l.func,handleMoveLeft:l.func,handleClearRightValues:l.func,state:l.object,filterOptions:l.func,filterValues:l.func,sortValues:l.func,sortOptions:l.func,noOptionsTitle:l.node,noValueTitle:l.node,leftTitle:l.node,rightTitle:l.node,LeftTitleElement:l.string,RightTitleElement:l.string,LeftTitleProps:l.object,RightTitleProps:l.object,moveLeftTitle:l.node,moveRightTitle:l.node,moveAllLeftTitle:l.node,moveAllRightTitle:l.node,label:l.node,isRequired:l.bool,filterOptionsTitle:l.string,filterValuesTitle:l.string,sortOptionsTitle:l.string,sortValuesTitle:l.string,filterOptionsText:l.node,filterValueText:l.node,FormGroupProps:l.object,GridProps:l.object,RowProps:l.object,OptionsColumnProps:l.object,ButtonColumnProps:l.object,ValuesColumnProps:l.object,AddButtonProps:l.object,AddAllButtonProps:l.object,RemoveButtonProps:l.object,RemoveAllButtonProps:l.object,LeftToolbarProps:l.object,RightToolbarProps:l.object,LeftSearchProps:l.object,RightSearchProps:l.object,LeftSortProps:l.object,RightSortProps:l.object,LeftListProps:l.object,LeftBodyProps:l.object,RightListProps:l.object,RightBodyProps:l.object},k.defaultProps={noOptionsTitle:"No option available",noValueTitle:"No option selected",leftTitle:"Options",rightTitle:"Selected",LeftTitleElement:"h6",RightTitleElement:"h6",moveLeftTitle:"Remove",moveRightTitle:"Add",moveAllLeftTitle:"Remove All",moveAllRightTitle:"Add All",filterOptionsTitle:"Filter options",filterValuesTitle:"Filter values",sortOptionsTitle:"Sort options",sortValuesTitle:"Sort values",filterOptionsText:"Remove your filter to see all options",filterValueText:"Remove your filter to see all selected",FormGroupProps:{},GridProps:{},RowProps:{},OptionsColumnProps:{},ButtonColumnProps:{},ValuesColumnProps:{},AddButtonProps:{},AddAllButtonProps:{},RemoveButtonProps:{},RemoveAllButtonProps:{},LeftToolbarProps:{},RightToolbarProps:{},LeftSearchProps:{},RightSearchProps:{},LeftSortProps:{},RightSortProps:{},LeftListProps:{},LeftBodyProps:{},RightListProps:{},RightBodyProps:{}};exports.default=function DualListSelect(e){return n.createElement(C,t._extends({},e,{DualListSelect:k}))}; | ||
//# sourceMappingURL=dual-list-select.js.map |
@@ -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("./defineProperty-75110086.js"),r=require("./extends-edb29469.js");require("./objectWithoutProperties-6a6333c3.js");var t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),n=require("./clsx.m-fe63e0e7.js"),a=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-form-api")),s=_interopDefault(require("carbon-components-react/lib/components/Button/Button.js")),d=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var i=require("./prepare-props-11a1ca5a.js"),c=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/field-array")),p=_interopDefault(require("carbon-components-react/lib/components/FormGroup/FormGroup.js")),m=_interopDefault(require("@carbon/icons-react/lib/add--alt/32.js")),l=_interopDefault(require("@carbon/icons-react/lib/subtract/32.js"));function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){e._defineProperty(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}!function ___$insertStyle(e){if(e&&"undefined"!=typeof window){var r=document.createElement("style");return r.setAttribute("type","text/css"),r.innerHTML=e,document.head.appendChild(r),e}}(".ddorg__carbon-field-array-add {\n margin-top: 16px;\n}\n\n.ddorg__carbon-field-array-add-container {\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n}\n\n.ddorg__carbon-field-array-remove {\n margin-top: 8px;\n margin-bottom: 8px;\n}\n\n.ddorg__carbon-field-array-form-group .bx--form__requirements {\n color: #da1e28;\n}");var u=function ArrayItem(e){var o=e.remove,d=e.fields,i=e.name,c=e.removeText,p=e.buttonDisabled,m=e.RemoveButtonProps,u=e.ArrayItemProps,f=a(),b=d.map((function(e){return _objectSpread(_objectSpread({},e),e.name?{name:"".concat(i,".").concat(e.name)}:{name:i})}));return t.createElement("div",u,f.renderForm(b,f),t.createElement(s,r._extends({disabled:p,renderIcon:l,id:"remove-".concat(i),kind:"danger",onClick:o},m,{className:n.clsx("ddorg__carbon-field-array-remove",m.className)}),c))};u.propTypes={remove:o.func,fields:o.array,name:o.string,removeText:o.node,buttonDisabled:o.bool,RemoveButtonProps:o.object,ArrayItemProps:o.object},u.defaultProps={RemoveButtonProps:{},ArrayItemProps:{}};var f=function FieldArray(e){var o=d(i.prepareProps(e)),a=o.AddContainerProps,l=o.AddButtonProps,f=o.FormGroupProps,b=o.WrapperProps,y=o.ArrayItemProps,v=o.RemoveButtonProps,_=o.defaultItem,P=o.maxItems,j=o.minItems,g=o.fields,x=o.input,I=o.arrayValidator,A=o.labelText,O=o.buttonLabels,q=o.noItemsMessage,D=o.meta,h=o.validateOnMount,B=_objectSpread({add:"Add",remove:"Remove"},O),w=(D.touched||h)&&!Array.isArray(D.error)&&D.error;return t.createElement(p,r._extends({legendText:A||"",invalid:Boolean(w),message:Boolean(w),messageText:w||""},f,{className:n.clsx("ddorg__carbon-field-array-form-group",f.className)}),t.createElement(c,{name:x.name,validate:I},(function(e){return t.createElement("div",b,0===e.fields.length&&q,e.fields.map((function(r,o){return t.createElement(u,{removeText:B.remove,key:o,remove:function remove(){return e.fields.remove(o)},name:r,fields:g,buttonDisabled:j>=e.fields.length,ArrayItemProps:y,RemoveButtonProps:v})})),t.createElement("div",r._extends({},a,{className:n.clsx("ddorg__carbon-field-array-add-container",a.className)}),t.createElement(s,r._extends({disabled:e.fields.length>=P,renderIcon:m,id:"add-".concat(x.name),onClick:function onClick(){return e.fields.push(_)}},l,{className:n.clsx("ddorg__carbon-field-array-add",l.className)}),B.add)))})))};f.propTypes={noItemsMessage:o.node,maxItems:o.number,minItems:o.number,buttonLabels:o.shape({add:o.node,remove:o.node}),AddContainerProps:o.object,AddButtonProps:o.object,FormGroupProps:o.object,WrapperProps:o.object,ArrayItemProps:o.object,RemoveButtonProps:o.object,defaultItem:o.any,isRequired:o.bool,fields:o.array},f.defaultProps={noItemsMessage:"No items",maxItems:1/0,minItems:0,AddContainerProps:{},AddButtonProps:{},FormGroupProps:{},WrapperProps:{},ArrayItemProps:{},RemoveButtonProps:{}},exports.default=f; | ||
"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("./defineProperty-75110086.js"),r=require("./extends-edb29469.js");require("./objectWithoutProperties-6a6333c3.js");var t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),n=require("./clsx.m-fe63e0e7.js"),a=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-form-api")),s=_interopDefault(require("carbon-components-react/lib/components/Button/Button.js")),d=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var i=require("./prepare-props-4fe8d115.js"),c=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/field-array")),p=_interopDefault(require("carbon-components-react/lib/components/FormGroup/FormGroup.js")),m=_interopDefault(require("@carbon/icons-react/lib/add--alt/32.js")),l=_interopDefault(require("@carbon/icons-react/lib/subtract/32.js"));function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){e._defineProperty(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}!function ___$insertStyle(e){if(e&&"undefined"!=typeof window){var r=document.createElement("style");return r.setAttribute("type","text/css"),r.innerHTML=e,document.head.appendChild(r),e}}(".ddorg__carbon-field-array-add {\n margin-top: 16px;\n}\n\n.ddorg__carbon-field-array-add-container {\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n}\n\n.ddorg__carbon-field-array-remove {\n margin-top: 8px;\n margin-bottom: 8px;\n}\n\n.ddorg__carbon-field-array-form-group .bx--form__requirements {\n color: #da1e28;\n}");var u=function ArrayItem(e){var o=e.remove,d=e.fields,i=e.name,c=e.removeText,p=e.buttonDisabled,m=e.RemoveButtonProps,u=e.ArrayItemProps,f=a(),b=d.map((function(e){return _objectSpread(_objectSpread({},e),e.name?{name:"".concat(i,".").concat(e.name)}:{name:i})}));return t.createElement("div",u,f.renderForm(b,f),t.createElement(s,r._extends({disabled:p,renderIcon:l,id:"remove-".concat(i),kind:"danger",onClick:o},m,{className:n.clsx("ddorg__carbon-field-array-remove",m.className)}),c))};u.propTypes={remove:o.func,fields:o.array,name:o.string,removeText:o.node,buttonDisabled:o.bool,RemoveButtonProps:o.object,ArrayItemProps:o.object},u.defaultProps={RemoveButtonProps:{},ArrayItemProps:{}};var f=function FieldArray(e){var o=d(i.prepareProps(e)),a=o.AddContainerProps,l=o.AddButtonProps,f=o.FormGroupProps,b=o.WrapperProps,y=o.ArrayItemProps,v=o.RemoveButtonProps,_=o.defaultItem,P=o.maxItems,j=o.minItems,g=o.fields,x=o.input,I=o.arrayValidator,A=o.labelText,O=o.buttonLabels,q=o.noItemsMessage,D=o.meta,h=o.validateOnMount,B=_objectSpread({add:"Add",remove:"Remove"},O),w=(D.touched||h)&&!Array.isArray(D.error)&&D.error;return t.createElement(p,r._extends({legendText:A||"",invalid:Boolean(w),message:Boolean(w),messageText:w||""},f,{className:n.clsx("ddorg__carbon-field-array-form-group",f.className)}),t.createElement(c,{name:x.name,validate:I},(function(e){return t.createElement("div",b,0===e.fields.length&&q,e.fields.map((function(r,o){return t.createElement(u,{removeText:B.remove,key:o,remove:function remove(){return e.fields.remove(o)},name:r,fields:g,buttonDisabled:j>=e.fields.length,ArrayItemProps:y,RemoveButtonProps:v})})),t.createElement("div",r._extends({},a,{className:n.clsx("ddorg__carbon-field-array-add-container",a.className)}),t.createElement(s,r._extends({disabled:e.fields.length>=P,renderIcon:m,id:"add-".concat(x.name),onClick:function onClick(){return e.fields.push(_)}},l,{className:n.clsx("ddorg__carbon-field-array-add",l.className)}),B.add)))})))};f.propTypes={noItemsMessage:o.node,maxItems:o.number,minItems:o.number,buttonLabels:o.shape({add:o.node,remove:o.node}),AddContainerProps:o.object,AddButtonProps:o.object,FormGroupProps:o.object,WrapperProps:o.object,ArrayItemProps:o.object,RemoveButtonProps:o.object,defaultItem:o.any,isRequired:o.bool,fields:o.array},f.defaultProps={noItemsMessage:"No items",maxItems:1/0,minItems:0,AddContainerProps:{},AddButtonProps:{},FormGroupProps:{},WrapperProps:{},ArrayItemProps:{},RemoveButtonProps:{}},exports.default=f; | ||
//# sourceMappingURL=field-array.js.map |
@@ -17,2 +17,4 @@ export { default as Checkbox } from './checkbox'; | ||
export * from './plain-text'; | ||
export { default as PrepareProps } from './prepare-props'; | ||
export * from './prepare-props'; | ||
export { default as Radio } from './radio'; | ||
@@ -19,0 +21,0 @@ export * from './radio'; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("./defineProperty-75110086.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/component-types"),require("./extends-edb29469.js"),require("./objectWithoutProperties-6a6333c3.js"),require("react"),require("prop-types"),require("./clsx.m-fe63e0e7.js"),require("carbon-components-react/lib/components/Tabs/Tabs.js"),require("carbon-components-react/lib/components/Tab/Tab.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/use-form-api");var e=require("./tabs.js"),r=require("./sub-form.js");require("./toConsumableArray-43caa138.js"),require("./typeof-aef86737.js"),require("./slicedToArray-bbb33c2c.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/wizard-context"),require("./_arrayPush-f10aef75.js");var o=require("./wizard.js");require("@data-driven-forms/react-form-renderer/dist/cjs/form-spy"),require("carbon-components-react/lib/components/Button/Button.js"),require("carbon-components-react/lib/components/Grid/Column.js"),require("carbon-components-react/lib/components/Grid/Grid.js"),require("carbon-components-react/lib/components/Grid/Row.js"),require("carbon-components-react/lib/components/ProgressIndicator/ProgressIndicator.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api");var t=require("./select.js");require("./isEqual-4af7d099.js"),require("carbon-components-react/lib/components/Select/Select.js"),require("carbon-components-react/lib/components/MultiSelect/MultiSelect.js"),require("carbon-components-react/lib/components/SelectItem/SelectItem.js"),require("carbon-components-react/lib/components/ComboBox/ComboBox.js"),require("carbon-components-react/lib/components/Tooltip/Tooltip.js"),require("./prepare-props-11a1ca5a.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/field-array"),require("carbon-components-react/lib/components/FormGroup/FormGroup.js"),require("@carbon/icons-react/lib/add--alt/32.js"),require("@carbon/icons-react/lib/subtract/32.js");var c=require("./field-array.js");require("carbon-components-react/lib/components/TextInput/TextInput.js"),require("./text-field.js"),require("carbon-components-react/lib/components/TextArea/TextArea.js");var n=require("./textarea.js"),s=require("./checkbox.js");require("carbon-components-react/lib/components/Checkbox/Checkbox.js"),require("./helper-text-block-045ee2cb.js"),require("carbon-components-react/lib/components/RadioButtonGroup/RadioButtonGroup.js"),require("carbon-components-react/lib/components/RadioButton/RadioButton.js");var i=require("./radio.js");require("carbon-components-react/lib/components/DatePicker/DatePicker.js"),require("carbon-components-react/lib/components/DatePickerInput/DatePickerInput.js");var a=require("./date-picker.js");require("carbon-components-react/lib/components/TimePicker/TimePicker.js"),require("carbon-components-react/lib/components/TimePickerSelect/TimePickerSelect.js");var u=require("./time-picker.js");require("carbon-components-react/lib/components/Toggle/Toggle.js");var p=require("./switch.js"),m=require("./plain-text.js"),l=require("./dual-list-select.js");require("carbon-components-react/lib/components/Search/Search.js"),require("carbon-components-react/lib/components/TooltipIcon/TooltipIcon.js"),require("@carbon/icons-react/lib/checkmark--filled/16.js"),require("@carbon/icons-react/lib/chevron--right/32.js"),require("@carbon/icons-react/lib/chevron--left/32.js"),require("@carbon/icons-react/lib/caret--sort--down/32.js"),require("@carbon/icons-react/lib/caret--sort--up/32.js"),require("carbon-components-react/lib/components/StructuredList/StructuredList.js"),require("carbon-components-react/lib/components/Slider/Slider.js");var b=require("./slider.js"),d=require("./component-mapper.js");require("carbon-components-react/lib/components/Form/Form.js"),require("carbon-components-react/lib/components/ButtonSet/ButtonSet.js");var q=require("./form-template.js");exports.Tabs=e.default,exports.SubForm=r.default,exports.Wizard=o.default,exports.Select=t.default,exports.FieldArray=c.default,exports.Textarea=n.default,exports.Checkbox=s.default,exports.Radio=i.default,exports.DatePicker=a.default,exports.TimePicker=u.default,exports.Switch=p.default,exports.PlainText=m.default,exports.DualListSelect=l.default,exports.Slider=b.default,exports.componentMapper=d.default,exports.components=d.components,exports.FormTemplate=q.default; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("./defineProperty-75110086.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/component-types"),require("./extends-edb29469.js"),require("./objectWithoutProperties-6a6333c3.js"),require("react"),require("prop-types"),require("./clsx.m-fe63e0e7.js"),require("carbon-components-react/lib/components/Tabs/Tabs.js"),require("carbon-components-react/lib/components/Tab/Tab.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/use-form-api");var e=require("./tabs.js"),r=require("./sub-form.js");require("./toConsumableArray-43caa138.js"),require("./typeof-aef86737.js"),require("./slicedToArray-bbb33c2c.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/wizard-context"),require("./_arrayPush-f10aef75.js");var o=require("./wizard.js");require("@data-driven-forms/react-form-renderer/dist/cjs/form-spy"),require("carbon-components-react/lib/components/Button/Button.js"),require("carbon-components-react/lib/components/Grid/Column.js"),require("carbon-components-react/lib/components/Grid/Grid.js"),require("carbon-components-react/lib/components/Grid/Row.js"),require("carbon-components-react/lib/components/ProgressIndicator/ProgressIndicator.js"),require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api");var t=require("./select.js");require("./isEqual-4af7d099.js"),require("carbon-components-react/lib/components/Select/Select.js"),require("carbon-components-react/lib/components/MultiSelect/MultiSelect.js"),require("carbon-components-react/lib/components/SelectItem/SelectItem.js"),require("carbon-components-react/lib/components/ComboBox/ComboBox.js"),require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var c=require("./prepare-props-4fe8d115.js");require("@data-driven-forms/react-form-renderer/dist/cjs/field-array"),require("carbon-components-react/lib/components/FormGroup/FormGroup.js"),require("@carbon/icons-react/lib/add--alt/32.js"),require("@carbon/icons-react/lib/subtract/32.js");var n=require("./field-array.js");require("carbon-components-react/lib/components/TextInput/TextInput.js"),require("./text-field.js"),require("carbon-components-react/lib/components/TextArea/TextArea.js");var s=require("./textarea.js"),i=require("./checkbox.js");require("carbon-components-react/lib/components/Checkbox/Checkbox.js"),require("./helper-text-block-045ee2cb.js"),require("carbon-components-react/lib/components/RadioButtonGroup/RadioButtonGroup.js"),require("carbon-components-react/lib/components/RadioButton/RadioButton.js");var a=require("./radio.js");require("carbon-components-react/lib/components/DatePicker/DatePicker.js"),require("carbon-components-react/lib/components/DatePickerInput/DatePickerInput.js");var u=require("./date-picker.js");require("carbon-components-react/lib/components/TimePicker/TimePicker.js"),require("carbon-components-react/lib/components/TimePickerSelect/TimePickerSelect.js");var p=require("./time-picker.js");require("carbon-components-react/lib/components/Toggle/Toggle.js");var l=require("./switch.js"),m=require("./plain-text.js"),b=require("./dual-list-select.js");require("carbon-components-react/lib/components/Search/Search.js"),require("carbon-components-react/lib/components/TooltipIcon/TooltipIcon.js"),require("@carbon/icons-react/lib/checkmark--filled/16.js"),require("@carbon/icons-react/lib/chevron--right/32.js"),require("@carbon/icons-react/lib/chevron--left/32.js"),require("@carbon/icons-react/lib/caret--sort--down/32.js"),require("@carbon/icons-react/lib/caret--sort--up/32.js"),require("carbon-components-react/lib/components/StructuredList/StructuredList.js"),require("carbon-components-react/lib/components/Slider/Slider.js");var d=require("./slider.js"),q=require("./component-mapper.js");require("carbon-components-react/lib/components/Form/Form.js"),require("carbon-components-react/lib/components/ButtonSet/ButtonSet.js");var j=require("./form-template.js");exports.Tabs=e.default,exports.SubForm=r.default,exports.Wizard=o.default,exports.Select=t.default,exports.buildLabel=c.buildLabel,exports.prepareProps=c.prepareProps,exports.FieldArray=n.default,exports.Textarea=s.default,exports.Checkbox=i.default,exports.Radio=a.default,exports.DatePicker=u.default,exports.TimePicker=p.default,exports.Switch=l.default,exports.PlainText=m.default,exports.DualListSelect=b.default,exports.Slider=d.default,exports.componentMapper=q.default,exports.components=q.components,exports.FormTemplate=j.default; | ||
//# sourceMappingURL=index.js.map |
@@ -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("./defineProperty-75110086.js"),r=require("./extends-edb29469.js"),t=require("./objectWithoutProperties-6a6333c3.js"),o=_interopDefault(require("react")),n=_interopDefault(require("prop-types")),a=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var p=require("./prepare-props-11a1ca5a.js"),i=_interopDefault(require("carbon-components-react/lib/components/FormGroup/FormGroup.js")),u=require("./helper-text-block-045ee2cb.js"),l=_interopDefault(require("carbon-components-react/lib/components/RadioButtonGroup/RadioButtonGroup.js")),s=_interopDefault(require("carbon-components-react/lib/components/RadioButton/RadioButton.js"));function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}var c=function Radio(n){var c=a(p.prepareProps(function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){e._defineProperty(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}({type:"radio"},n))),b=c.labelText,d=c.disabled,f=c.input,j=c.options,m=c.FormGroupProps,y=c.helperText,O=c.meta,v=c.validateOnMount,x=t._objectWithoutProperties(c,["labelText","disabled","input","options","FormGroupProps","helperText","meta","validateOnMount"]),P=(O.touched||v)&&O.error,_=(O.touched||v)&&O.warning;return o.createElement(i,r._extends({legendText:b},m),o.createElement(l,r._extends({},f,{valueSelected:f.value,disabled:d},x),j.map((function(e){return o.createElement(s,r._extends({key:e.value,disabled:d,labelText:e.label,value:e.value},e))}))),o.createElement(u.HelperTextBlock,{helperText:y,errorText:P,warnText:_}))};c.propTypes={FormGroupProps:n.object,isDisabled:n.bool,label:n.node,isRequired:n.bool,options:n.arrayOf(n.shape({label:n.node,value:n.oneOfType([n.string,n.number])}))},exports.default=c; | ||
"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("./defineProperty-75110086.js"),r=require("./extends-edb29469.js"),t=require("./objectWithoutProperties-6a6333c3.js"),o=_interopDefault(require("react")),n=_interopDefault(require("prop-types")),a=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var p=require("./prepare-props-4fe8d115.js"),i=_interopDefault(require("carbon-components-react/lib/components/FormGroup/FormGroup.js")),u=require("./helper-text-block-045ee2cb.js"),l=_interopDefault(require("carbon-components-react/lib/components/RadioButtonGroup/RadioButtonGroup.js")),s=_interopDefault(require("carbon-components-react/lib/components/RadioButton/RadioButton.js"));function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}var c=function Radio(n){var c=a(p.prepareProps(function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){e._defineProperty(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}({type:"radio"},n))),b=c.labelText,d=c.disabled,f=c.input,j=c.options,m=c.FormGroupProps,y=c.helperText,O=c.meta,v=c.validateOnMount,x=t._objectWithoutProperties(c,["labelText","disabled","input","options","FormGroupProps","helperText","meta","validateOnMount"]),P=(O.touched||v)&&O.error,_=(O.touched||v)&&O.warning;return o.createElement(i,r._extends({legendText:b},m),o.createElement(l,r._extends({},f,{valueSelected:f.value,disabled:d},x),j.map((function(e){return o.createElement(s,r._extends({key:e.value,disabled:d,labelText:e.label,value:e.value},e))}))),o.createElement(u.HelperTextBlock,{helperText:y,errorText:P,warnText:_}))};c.propTypes={FormGroupProps:n.object,isDisabled:n.bool,label:n.node,isRequired:n.bool,options:n.arrayOf(n.shape({label:n.node,value:n.oneOfType([n.string,n.number])}))},exports.default=c; | ||
//# sourceMappingURL=radio.js.map |
@@ -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("./defineProperty-75110086.js"),n=require("./extends-edb29469.js"),o=require("./objectWithoutProperties-6a6333c3.js"),i=require("react"),t=_interopDefault(i),a=_interopDefault(require("prop-types")),l=require("./toConsumableArray-43caa138.js"),r=require("./typeof-aef86737.js"),s=require("./slicedToArray-bbb33c2c.js");require("./_arrayPush-f10aef75.js");var c=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api")),u=require("./isEqual-4af7d099.js"),p=_interopDefault(require("carbon-components-react/lib/components/Select/Select.js")),d=_interopDefault(require("carbon-components-react/lib/components/MultiSelect/MultiSelect.js")),b=_interopDefault(require("carbon-components-react/lib/components/SelectItem/SelectItem.js")),f=_interopDefault(require("carbon-components-react/lib/components/ComboBox/ComboBox.js"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var g=require("./prepare-props-11a1ca5a.js");function toVal(e){var n,o,i="";if(e)if("object"==typeof e)if(e.push)for(n=0;n<e.length;n++)e[n]&&(o=toVal(e[n]))&&(i&&(i+=" "),i+=o);else for(n in e)e[n]&&(o=toVal(n))&&(i&&(i+=" "),i+=o);else"boolean"==typeof e||e.call||(i&&(i+=" "),i+=e);return i}function clsx(){for(var e,n=0,o="";n<arguments.length;)(e=toVal(arguments[n++]))&&(o&&(o+=" "),o+=e);return o}var h=function fnToString(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\s+/g," ")};function ownKeys(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(i),!0).forEach((function(o){e._defineProperty(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var v=function reducer(e,n){var o=n.type,i=n.payload,t=n.options,a=void 0===t?[]:t;switch(o){case"updateOptions":return _objectSpread(_objectSpread({},e),{},{options:i,isLoading:!1,promises:{}});case"loaded":return _objectSpread(_objectSpread({},e),{},{isLoading:!1});case"startLoading":return _objectSpread(_objectSpread({},e),{},{isLoading:!0});case"setOptions":return _objectSpread(_objectSpread({},e),{},{options:i});case"initialLoaded":return _objectSpread(_objectSpread({},e),{},{isInitialLoaded:!0});case"setPromises":return _objectSpread(_objectSpread({},e),{},{promises:_objectSpread(_objectSpread({},e.promises),i),options:[].concat(l._toConsumableArray(e.options),l._toConsumableArray(a.filter((function(n){var o=n.value;return!e.options.find((function(e){return e.value===o}))}))))});default:return e}},O=function getSelectValue(e,n,o,i){return n?i.filter((function(n){var i=n.value;return o?e.includes(i):u._isEqual(i,e)})):e},m=function Select(a){var l=a.invalid,c=a.classNamePrefix,u=a.simpleValue,p=a.isMulti,d=a.pluckSingleValue,b=a.options,f=a.loadOptions,g=a.loadingMessage,m=a.loadingProps,y=(a.selectVariant,a.updatingMessage),S=a.noOptionsMessage,C=a.value,M=a.onChange,x=a.loadOptionsChangeCounter,j=a.SelectComponent,_=a.noValueUpdates,P=o._objectWithoutProperties(a,["invalid","classNamePrefix","simpleValue","isMulti","pluckSingleValue","options","loadOptions","loadingMessage","loadingProps","selectVariant","updatingMessage","noOptionsMessage","value","onChange","loadOptionsChangeCounter","SelectComponent","noValueUpdates"]),T=i.useReducer(v,{isLoading:!1,options:b,promises:{},isInitialLoaded:!1}),D=s._slicedToArray(T,2),q=D[0],I=D[1],L=function useIsMounted(){var e=i.useRef(!1);return i.useEffect((function(){return e.current=!0,function(){return e.current=!1}}),[]),e}(),V=function updateOptions(){return I({type:"startLoading"}),f().then((function(e){if(L.current){if(!_)if(C&&Array.isArray(C)){var n=C.filter((function(n){return"object"===r._typeof(n)?e.find((function(e){return n.value===e.value})):e.find((function(e){return n===e.value}))}));M(0===n.length?void 0:n)}else C&&!e.find((function(e){return e.value===C}))&&M(void 0);I({type:"updateOptions",payload:e})}}))};i.useEffect((function(){f&&V(),I({type:"initialLoaded"})}),[]);var N=f?h(f):"";i.useEffect((function(){N&&q.isInitialLoaded&&V()}),[N,x]),i.useEffect((function(){q.isInitialLoaded&&(_||!C||b.map((function(e){return e.value})).includes(C)||M(void 0),I({type:"setOptions",payload:b}))}),[b]);var E=function renderNoOptionsMessage(){return Object.values(q.promises).some((function(e){return e}))?function(){return y}:function(){return S}};if(q.isLoading)return t.createElement(j,n._extends({},P,{classNamePrefix:c,isDisabled:!0,isFetching:!0,placeholder:g,options:q.options,onChange:function onChange(){}},m,{noOptionsMessage:E()}));var F=d?p?C:Array.isArray(C)&&C[0]?C[0]:C:C;return t.createElement(j,n._extends({className:clsx(c,{"has-error":l})},P,{isDisabled:P.isDisabled||P.isReadOnly,options:q.options,classNamePrefix:c,isMulti:p,value:O(F,u,p,q.options),onChange:function onChange(e){return function handleSelectChange(e,n,o,i){var t=!e&&o?[]:e;return i(n?o?t.map((function(e){return e.value})):t?t.value:void 0:t)}(e,u,p,M)},onInputChange:function onInputChange(n){n&&f&&void 0===q.promises[n]&&P.isSearchable&&(I({type:"setPromises",payload:e._defineProperty({},n,!0)}),f(n).then((function(o){L.current&&I({type:"setPromises",payload:e._defineProperty({},n,!1),options:o})})).catch((function(o){throw I({type:"setPromises",payload:e._defineProperty({},n,!1)}),o})))},isFetching:Object.values(q.promises).some((function(e){return e})),noOptionsMessage:E(),hideSelectedOptions:!1,closeMenuOnSelect:!p}))};m.propTypes={options:a.array,onChange:a.func,classNamePrefix:a.string,invalid:a.bool,simpleValue:a.bool,isMulti:a.bool,pluckSingleValue:a.bool,value:a.any,placeholder:a.string,loadOptionsChangeCounter:a.number,isDisabled:a.bool,isReadOnly:a.bool,loadOptions:a.func,loadingMessage:a.node,loadingProps:a.object,selectVariant:a.string,updatingMessage:a.node,noOptionsMessage:a.node,isSearchable:a.bool,SelectComponent:a.elementType.isRequired,noValueUpdates:a.bool},m.defaultProps={options:[],invalid:!1,simpleValue:!0,pluckSingleValue:!0,placeholder:"Choose...",isSearchable:!1,isClearable:!1};var y=function multiOnChange(e,n){return function(o){var i=o.selectedItems;return n?e.onChange(i.map((function(e){return e.value}))):e.onChange(i)}},S=function ClearedMultiSelectFilterable(e){var i=e.invalidText,a=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=(e.isFetching,e.invalid,e.isMulti,e.classNamePrefix,e.closeMenuOnSelect,e.onChange,e.originalOnChange),r=e.carbonLabel,s=e.placeholder,c=e.isDisabled,u=o._objectWithoutProperties(e,["invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","isMulti","classNamePrefix","closeMenuOnSelect","onChange","originalOnChange","carbonLabel","placeholder","isDisabled"]);return t.createElement(d.Filterable,n._extends({disabled:c},u,{placeholder:r||s,onChange:l,titleText:u.labelText,id:u.name,invalid:Boolean(i),invalidText:i,items:a,initialSelectedItems:Array.isArray(u.value)?u.value:[]}))};S.propTypes={invalidText:a.node,hideSelectedOptions:a.any,noOptionsMessage:a.any,onInputChange:a.func,options:a.array,isFetching:a.bool,invalid:a.oneOfType([a.bool,a.node]),isMulti:a.bool,classNamePrefix:a.any,closeMenuOnSelect:a.any,onChange:a.func,originalOnChange:a.func,carbonLabel:a.node,placeholder:a.node,isRequired:a.bool,isDisabled:a.bool};var C=function ClearedMultiSelect(e){var i=e.invalidText,a=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=(e.isFetching,e.invalid,e.isMulti,e.classNamePrefix,e.closeMenuOnSelect,e.onChange,e.originalOnChange),r=e.carbonLabel,s=e.placeholder,c=e.isDisabled,u=o._objectWithoutProperties(e,["invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","isMulti","classNamePrefix","closeMenuOnSelect","onChange","originalOnChange","carbonLabel","placeholder","isDisabled"]);return t.createElement(d,n._extends({disabled:c},u,{label:r||s,onChange:l,titleText:u.labelText,id:u.name,invalid:Boolean(i),invalidText:i,items:a,initialSelectedItems:Array.isArray(u.value)?u.value:[]}))};C.propTypes={invalidText:a.node,hideSelectedOptions:a.any,noOptionsMessage:a.any,onInputChange:a.func,options:a.array,isFetching:a.bool,invalid:a.oneOfType([a.bool,a.node]),isMulti:a.bool,classNamePrefix:a.any,closeMenuOnSelect:a.any,onChange:a.func,originalOnChange:a.func,carbonLabel:a.node,placeholder:a.node,isRequired:a.bool,isDisabled:a.bool};var M=function ClearedSelect(e){e.isSearchable,e.isClearable,e.isDisabled,e.isMulti;var i=e.invalidText,a=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=e.isFetching,r=(e.invalid,e.classNamePrefix,e.closeMenuOnSelect,e.originalOnChange,e.placeholder),s=o._objectWithoutProperties(e,["isSearchable","isClearable","isDisabled","isMulti","invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","classNamePrefix","closeMenuOnSelect","originalOnChange","placeholder"]);return t.createElement(p,n._extends({disabled:l},s,{id:s.name,invalid:Boolean(i),invalidText:i}),l&&t.createElement(b,{text:r,value:""}),a.map((function(e,o){return t.createElement(b,n._extends({key:e.value||o,text:e.label},e))})))};M.propTypes={invalidText:a.node,hideSelectedOptions:a.any,noOptionsMessage:a.any,onInputChange:a.func,options:a.array,isFetching:a.bool,invalid:a.oneOfType([a.bool,a.node]),isMulti:a.bool,classNamePrefix:a.any,closeMenuOnSelect:a.any,onChange:a.func,originalOnChange:a.func,carbonLabel:a.node,placeholder:a.node,isDisabled:a.bool,isRequired:a.bool,isSearchable:a.bool,isClearable:a.bool};var x=function ClearedSelectSearchable(e){e.isSearchable,e.isClearable,e.isDisabled,e.isMulti;var i=e.invalidText,a=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=e.isFetching,r=(e.invalid,e.classNamePrefix,e.closeMenuOnSelect,e.originalOnChange),s=e.placeholder,c=e.labelText,u=o._objectWithoutProperties(e,["isSearchable","isClearable","isDisabled","isMulti","invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","classNamePrefix","closeMenuOnSelect","originalOnChange","placeholder","labelText"]);return t.createElement(f,n._extends({disabled:l},u,{id:u.name,invalid:Boolean(i),invalidText:i,initialSelectedItem:u.value,items:a,placeholder:s,titleText:c,onChange:r}))};x.propTypes={invalidText:a.node,hideSelectedOptions:a.any,noOptionsMessage:a.any,onInputChange:a.func,options:a.array,isFetching:a.bool,invalid:a.oneOfType([a.bool,a.node]),isMulti:a.bool,classNamePrefix:a.any,closeMenuOnSelect:a.any,onChange:a.func,originalOnChange:a.func,carbonLabel:a.node,placeholder:a.node,isDisabled:a.bool,isRequired:a.bool,isSearchable:a.bool,isClearable:a.bool,labelText:a.string};var j=function Select$1(e){var a=c(g.prepareProps(e)),l=a.isMulti,r=a.isSearchable,u=a.isClearable,p=a.loadOptions,d=a.input,b=a.meta,f=a.validateOnMount,v=a.helperText,O=o._objectWithoutProperties(a,["isMulti","isSearchable","isClearable","loadOptions","input","meta","validateOnMount","helperText"]),j=i.useState(0),_=s._slicedToArray(j,2),P=_[0],T=_[1],D=h(p);i.useEffect((function(){T(P+1)}),[D]);var q=r||u,I=l&&q?S:l?C:q?x:M,L=(b.touched||f)&&b.error||"",V=(b.touched||f)&&b.warning||v;return t.createElement(m,n._extends({SelectComponent:I,simpleValue:!1},O,d,{loadOptions:p,invalidText:L,loadOptionsChangeCounter:P,originalOnChange:y(d,O.simpleValue),helperText:V}))};j.propTypes={isDisabled:a.bool,isRequired:a.bool,options:a.arrayOf(a.shape({value:a.oneOfType([a.string,a.number]),label:a.node}))},j.defaultProps={loadingMessage:"Loading..."},exports.default=j,exports.multiOnChange=y; | ||
"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("./defineProperty-75110086.js"),n=require("./extends-edb29469.js"),o=require("./objectWithoutProperties-6a6333c3.js"),i=require("react"),t=_interopDefault(i),a=_interopDefault(require("prop-types")),l=require("./toConsumableArray-43caa138.js"),r=require("./typeof-aef86737.js"),s=require("./slicedToArray-bbb33c2c.js");require("./_arrayPush-f10aef75.js");var c=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api")),u=require("./isEqual-4af7d099.js"),p=_interopDefault(require("carbon-components-react/lib/components/Select/Select.js")),d=_interopDefault(require("carbon-components-react/lib/components/MultiSelect/MultiSelect.js")),b=_interopDefault(require("carbon-components-react/lib/components/SelectItem/SelectItem.js")),f=_interopDefault(require("carbon-components-react/lib/components/ComboBox/ComboBox.js"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var g=require("./prepare-props-4fe8d115.js");function toVal(e){var n,o,i="";if(e)if("object"==typeof e)if(e.push)for(n=0;n<e.length;n++)e[n]&&(o=toVal(e[n]))&&(i&&(i+=" "),i+=o);else for(n in e)e[n]&&(o=toVal(n))&&(i&&(i+=" "),i+=o);else"boolean"==typeof e||e.call||(i&&(i+=" "),i+=e);return i}function clsx(){for(var e,n=0,o="";n<arguments.length;)(e=toVal(arguments[n++]))&&(o&&(o+=" "),o+=e);return o}var h=function fnToString(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\s+/g," ")};function ownKeys(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(i),!0).forEach((function(o){e._defineProperty(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var v=function reducer(e,n){var o=n.type,i=n.payload,t=n.options,a=void 0===t?[]:t;switch(o){case"updateOptions":return _objectSpread(_objectSpread({},e),{},{options:i,isLoading:!1,promises:{}});case"loaded":return _objectSpread(_objectSpread({},e),{},{isLoading:!1});case"startLoading":return _objectSpread(_objectSpread({},e),{},{isLoading:!0});case"setOptions":return _objectSpread(_objectSpread({},e),{},{options:i});case"initialLoaded":return _objectSpread(_objectSpread({},e),{},{isInitialLoaded:!0});case"setPromises":return _objectSpread(_objectSpread({},e),{},{promises:_objectSpread(_objectSpread({},e.promises),i),options:[].concat(l._toConsumableArray(e.options),l._toConsumableArray(a.filter((function(n){var o=n.value;return!e.options.find((function(e){return e.value===o}))}))))});default:return e}},O=function getSelectValue(e,n,o,i){return n?i.filter((function(n){var i=n.value;return o?e.includes(i):u._isEqual(i,e)})):e},m=function Select(a){var l=a.invalid,c=a.classNamePrefix,u=a.simpleValue,p=a.isMulti,d=a.pluckSingleValue,b=a.options,f=a.loadOptions,g=a.loadingMessage,m=a.loadingProps,y=(a.selectVariant,a.updatingMessage),S=a.noOptionsMessage,C=a.value,M=a.onChange,x=a.loadOptionsChangeCounter,j=a.SelectComponent,_=a.noValueUpdates,P=o._objectWithoutProperties(a,["invalid","classNamePrefix","simpleValue","isMulti","pluckSingleValue","options","loadOptions","loadingMessage","loadingProps","selectVariant","updatingMessage","noOptionsMessage","value","onChange","loadOptionsChangeCounter","SelectComponent","noValueUpdates"]),T=i.useReducer(v,{isLoading:!1,options:b,promises:{},isInitialLoaded:!1}),D=s._slicedToArray(T,2),q=D[0],I=D[1],L=function useIsMounted(){var e=i.useRef(!1);return i.useEffect((function(){return e.current=!0,function(){return e.current=!1}}),[]),e}(),V=function updateOptions(){return I({type:"startLoading"}),f().then((function(e){if(L.current){if(!_)if(C&&Array.isArray(C)){var n=C.filter((function(n){return"object"===r._typeof(n)?e.find((function(e){return n.value===e.value})):e.find((function(e){return n===e.value}))}));M(0===n.length?void 0:n)}else C&&!e.find((function(e){return e.value===C}))&&M(void 0);I({type:"updateOptions",payload:e})}}))};i.useEffect((function(){f&&V(),I({type:"initialLoaded"})}),[]);var N=f?h(f):"";i.useEffect((function(){N&&q.isInitialLoaded&&V()}),[N,x]),i.useEffect((function(){q.isInitialLoaded&&(_||!C||b.map((function(e){return e.value})).includes(C)||M(void 0),I({type:"setOptions",payload:b}))}),[b]);var E=function renderNoOptionsMessage(){return Object.values(q.promises).some((function(e){return e}))?function(){return y}:function(){return S}};if(q.isLoading)return t.createElement(j,n._extends({},P,{classNamePrefix:c,isDisabled:!0,isFetching:!0,placeholder:g,options:q.options,onChange:function onChange(){}},m,{noOptionsMessage:E()}));var F=d?p?C:Array.isArray(C)&&C[0]?C[0]:C:C;return t.createElement(j,n._extends({className:clsx(c,{"has-error":l})},P,{isDisabled:P.isDisabled||P.isReadOnly,options:q.options,classNamePrefix:c,isMulti:p,value:O(F,u,p,q.options),onChange:function onChange(e){return function handleSelectChange(e,n,o,i){var t=!e&&o?[]:e;return i(n?o?t.map((function(e){return e.value})):t?t.value:void 0:t)}(e,u,p,M)},onInputChange:function onInputChange(n){n&&f&&void 0===q.promises[n]&&P.isSearchable&&(I({type:"setPromises",payload:e._defineProperty({},n,!0)}),f(n).then((function(o){L.current&&I({type:"setPromises",payload:e._defineProperty({},n,!1),options:o})})).catch((function(o){throw I({type:"setPromises",payload:e._defineProperty({},n,!1)}),o})))},isFetching:Object.values(q.promises).some((function(e){return e})),noOptionsMessage:E(),hideSelectedOptions:!1,closeMenuOnSelect:!p}))};m.propTypes={options:a.array,onChange:a.func,classNamePrefix:a.string,invalid:a.bool,simpleValue:a.bool,isMulti:a.bool,pluckSingleValue:a.bool,value:a.any,placeholder:a.string,loadOptionsChangeCounter:a.number,isDisabled:a.bool,isReadOnly:a.bool,loadOptions:a.func,loadingMessage:a.node,loadingProps:a.object,selectVariant:a.string,updatingMessage:a.node,noOptionsMessage:a.node,isSearchable:a.bool,SelectComponent:a.elementType.isRequired,noValueUpdates:a.bool},m.defaultProps={options:[],invalid:!1,simpleValue:!0,pluckSingleValue:!0,placeholder:"Choose...",isSearchable:!1,isClearable:!1};var y=function multiOnChange(e,n){return function(o){var i=o.selectedItems;return n?e.onChange(i.map((function(e){return e.value}))):e.onChange(i)}},S=function ClearedMultiSelectFilterable(e){var i=e.invalidText,a=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=(e.isFetching,e.invalid,e.isMulti,e.classNamePrefix,e.closeMenuOnSelect,e.onChange,e.originalOnChange),r=e.carbonLabel,s=e.placeholder,c=e.isDisabled,u=o._objectWithoutProperties(e,["invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","isMulti","classNamePrefix","closeMenuOnSelect","onChange","originalOnChange","carbonLabel","placeholder","isDisabled"]);return t.createElement(d.Filterable,n._extends({disabled:c},u,{placeholder:r||s,onChange:l,titleText:u.labelText,id:u.name,invalid:Boolean(i),invalidText:i,items:a,initialSelectedItems:Array.isArray(u.value)?u.value:[]}))};S.propTypes={invalidText:a.node,hideSelectedOptions:a.any,noOptionsMessage:a.any,onInputChange:a.func,options:a.array,isFetching:a.bool,invalid:a.oneOfType([a.bool,a.node]),isMulti:a.bool,classNamePrefix:a.any,closeMenuOnSelect:a.any,onChange:a.func,originalOnChange:a.func,carbonLabel:a.node,placeholder:a.node,isRequired:a.bool,isDisabled:a.bool};var C=function ClearedMultiSelect(e){var i=e.invalidText,a=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=(e.isFetching,e.invalid,e.isMulti,e.classNamePrefix,e.closeMenuOnSelect,e.onChange,e.originalOnChange),r=e.carbonLabel,s=e.placeholder,c=e.isDisabled,u=o._objectWithoutProperties(e,["invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","isMulti","classNamePrefix","closeMenuOnSelect","onChange","originalOnChange","carbonLabel","placeholder","isDisabled"]);return t.createElement(d,n._extends({disabled:c},u,{label:r||s,onChange:l,titleText:u.labelText,id:u.name,invalid:Boolean(i),invalidText:i,items:a,initialSelectedItems:Array.isArray(u.value)?u.value:[]}))};C.propTypes={invalidText:a.node,hideSelectedOptions:a.any,noOptionsMessage:a.any,onInputChange:a.func,options:a.array,isFetching:a.bool,invalid:a.oneOfType([a.bool,a.node]),isMulti:a.bool,classNamePrefix:a.any,closeMenuOnSelect:a.any,onChange:a.func,originalOnChange:a.func,carbonLabel:a.node,placeholder:a.node,isRequired:a.bool,isDisabled:a.bool};var M=function ClearedSelect(e){e.isSearchable,e.isClearable,e.isDisabled,e.isMulti;var i=e.invalidText,a=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=e.isFetching,r=(e.invalid,e.classNamePrefix,e.closeMenuOnSelect,e.originalOnChange,e.placeholder),s=o._objectWithoutProperties(e,["isSearchable","isClearable","isDisabled","isMulti","invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","classNamePrefix","closeMenuOnSelect","originalOnChange","placeholder"]);return t.createElement(p,n._extends({disabled:l},s,{id:s.name,invalid:Boolean(i),invalidText:i}),l&&t.createElement(b,{text:r,value:""}),a.map((function(e,o){return t.createElement(b,n._extends({key:e.value||o,text:e.label},e))})))};M.propTypes={invalidText:a.node,hideSelectedOptions:a.any,noOptionsMessage:a.any,onInputChange:a.func,options:a.array,isFetching:a.bool,invalid:a.oneOfType([a.bool,a.node]),isMulti:a.bool,classNamePrefix:a.any,closeMenuOnSelect:a.any,onChange:a.func,originalOnChange:a.func,carbonLabel:a.node,placeholder:a.node,isDisabled:a.bool,isRequired:a.bool,isSearchable:a.bool,isClearable:a.bool};var x=function ClearedSelectSearchable(e){e.isSearchable,e.isClearable,e.isDisabled,e.isMulti;var i=e.invalidText,a=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=e.isFetching,r=(e.invalid,e.classNamePrefix,e.closeMenuOnSelect,e.originalOnChange),s=e.placeholder,c=e.labelText,u=o._objectWithoutProperties(e,["isSearchable","isClearable","isDisabled","isMulti","invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","classNamePrefix","closeMenuOnSelect","originalOnChange","placeholder","labelText"]);return t.createElement(f,n._extends({disabled:l},u,{id:u.name,invalid:Boolean(i),invalidText:i,initialSelectedItem:u.value,items:a,placeholder:s,titleText:c,onChange:r}))};x.propTypes={invalidText:a.node,hideSelectedOptions:a.any,noOptionsMessage:a.any,onInputChange:a.func,options:a.array,isFetching:a.bool,invalid:a.oneOfType([a.bool,a.node]),isMulti:a.bool,classNamePrefix:a.any,closeMenuOnSelect:a.any,onChange:a.func,originalOnChange:a.func,carbonLabel:a.node,placeholder:a.node,isDisabled:a.bool,isRequired:a.bool,isSearchable:a.bool,isClearable:a.bool,labelText:a.string};var j=function Select$1(e){var a=c(g.prepareProps(e)),l=a.isMulti,r=a.isSearchable,u=a.isClearable,p=a.loadOptions,d=a.input,b=a.meta,f=a.validateOnMount,v=a.helperText,O=o._objectWithoutProperties(a,["isMulti","isSearchable","isClearable","loadOptions","input","meta","validateOnMount","helperText"]),j=i.useState(0),_=s._slicedToArray(j,2),P=_[0],T=_[1],D=h(p);i.useEffect((function(){T(P+1)}),[D]);var q=r||u,I=l&&q?S:l?C:q?x:M,L=(b.touched||f)&&b.error||"",V=(b.touched||f)&&b.warning||v;return t.createElement(m,n._extends({SelectComponent:I,simpleValue:!1},O,d,{loadOptions:p,invalidText:L,loadOptionsChangeCounter:P,originalOnChange:y(d,O.simpleValue),helperText:V}))};j.propTypes={isDisabled:a.bool,isRequired:a.bool,options:a.arrayOf(a.shape({value:a.oneOfType([a.string,a.number]),label:a.node}))},j.defaultProps={loadingMessage:"Loading..."},exports.default=j,exports.multiOnChange=y; | ||
//# sourceMappingURL=select.js.map |
@@ -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}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var a=require("./prepare-props-11a1ca5a.js"),n=require("./helper-text-block-045ee2cb.js"),p=_interopDefault(require("carbon-components-react/lib/components/Slider/Slider.js")),l=function Slider(o){var l=i(a.prepareProps(o)),u=l.input,s=l.meta,d=l.isRequired,c=l.validateOnMount,b=l.helperText,f=l.WrapperProps,m=r._objectWithoutProperties(l,["input","meta","isRequired","validateOnMount","helperText","WrapperProps"]),q=(s.touched||c)&&s.error,j=(s.touched||c)&&s.warning;return t.createElement("div",f,t.createElement(p,e._extends({},u,{value:Number(u.value)||0,key:u.name,id:u.name,invalid:Boolean(q),min:0,max:100,required:d},m)),t.createElement(n.HelperTextBlock,{helperText:b,errorText:q,warnText:j}))};l.propTypes={isDisabled:o.bool,isRequired:o.bool,label:o.node,labelText:o.node,description:o.node,WrapperProps:o.object},exports.default=l; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var n=require("./prepare-props-4fe8d115.js"),p=require("./helper-text-block-045ee2cb.js"),a=_interopDefault(require("carbon-components-react/lib/components/Slider/Slider.js")),l=function Slider(o){var l=i(n.prepareProps(o)),u=l.input,s=l.meta,d=l.isRequired,c=l.validateOnMount,b=l.helperText,f=l.WrapperProps,m=r._objectWithoutProperties(l,["input","meta","isRequired","validateOnMount","helperText","WrapperProps"]),q=(s.touched||c)&&s.error,j=(s.touched||c)&&s.warning;return t.createElement("div",f,t.createElement(a,e._extends({},u,{value:Number(u.value)||0,key:u.name,id:u.name,invalid:Boolean(q),min:0,max:100,required:d},m)),t.createElement(p.HelperTextBlock,{helperText:b,errorText:q,warnText:j}))};l.propTypes={isDisabled:o.bool,isRequired:o.bool,label:o.node,labelText:o.node,description:o.node,WrapperProps:o.object},exports.default=l; | ||
//# sourceMappingURL=slider.js.map |
@@ -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}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),a=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var n=require("./prepare-props-11a1ca5a.js"),p=require("./helper-text-block-045ee2cb.js"),i=_interopDefault(require("carbon-components-react/lib/components/Toggle/Toggle.js")),l=function Switch(o){var l=a(n.prepareProps(o)),s=l.input,u=l.meta,c=l.onText,d=l.offText,b=l.validateOnMount,f=l.helperText,x=l.WrapperProps,T=r._objectWithoutProperties(l,["input","meta","onText","offText","validateOnMount","helperText","WrapperProps"]),j=(u.touched||b)&&u.error,m=(u.touched||b)&&u.warning;return t.createElement("div",x,t.createElement(i,e._extends({},s,{key:s.name,id:s.name,labelA:d,labelB:c},T)),t.createElement(p.HelperTextBlock,{helperText:f,errorText:j,warnText:m}))};l.propTypes={isDisabled:o.bool,isReadOnly:o.bool,isRequired:o.bool,label:o.node,labelText:o.node,description:o.node,WrapperProps:o.object},exports.default=l; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),n=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var p=require("./prepare-props-4fe8d115.js"),i=require("./helper-text-block-045ee2cb.js"),a=_interopDefault(require("carbon-components-react/lib/components/Toggle/Toggle.js")),l=function Switch(o){var l=n(p.prepareProps(o)),s=l.input,u=l.meta,c=l.onText,d=l.offText,f=l.validateOnMount,b=l.helperText,x=l.WrapperProps,T=r._objectWithoutProperties(l,["input","meta","onText","offText","validateOnMount","helperText","WrapperProps"]),j=(u.touched||f)&&u.error,m=(u.touched||f)&&u.warning;return t.createElement("div",x,t.createElement(a,e._extends({},s,{key:s.name,id:s.name,labelA:d,labelB:c},T)),t.createElement(i.HelperTextBlock,{helperText:b,errorText:j,warnText:m}))};l.propTypes={isDisabled:o.bool,isReadOnly:o.bool,isRequired:o.bool,label:o.node,labelText:o.node,description:o.node,WrapperProps:o.object},exports.default=l; | ||
//# sourceMappingURL=switch.js.map |
@@ -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}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),n=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var i=require("./prepare-props-11a1ca5a.js"),a=_interopDefault(require("carbon-components-react/lib/components/TextInput/TextInput.js")),p=function TextField(o){var p=n(i.prepareProps(o)),u=p.input,l=p.meta,s=p.validateOnMount,d=r._objectWithoutProperties(p,["input","meta","validateOnMount"]),c=(l.touched||s)&&l.error,f=(l.touched||s)&&l.warning;return t.createElement(a,e._extends({},u,{key:u.name,id:u.name,invalid:Boolean(c),invalidText:c||"",warn:Boolean(f),warnText:f||""},d))};p.propTypes={isDisabled:o.bool,isReadOnly:o.bool,isRequired:o.bool,label:o.node,labelText:o.node,description:o.node},exports.default=p; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),n=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var i=require("./prepare-props-4fe8d115.js"),a=_interopDefault(require("carbon-components-react/lib/components/TextInput/TextInput.js")),p=function TextField(o){var p=n(i.prepareProps(o)),u=p.input,l=p.meta,s=p.validateOnMount,d=r._objectWithoutProperties(p,["input","meta","validateOnMount"]),c=(l.touched||s)&&l.error,f=(l.touched||s)&&l.warning;return t.createElement(a,e._extends({},u,{key:u.name,id:u.name,invalid:Boolean(c),invalidText:c||"",warn:Boolean(f),warnText:f||""},d))};p.propTypes={isDisabled:o.bool,isReadOnly:o.bool,isRequired:o.bool,label:o.node,labelText:o.node,description:o.node},exports.default=p; | ||
//# sourceMappingURL=text-field.js.map |
@@ -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}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var a=require("./prepare-props-11a1ca5a.js"),n=_interopDefault(require("carbon-components-react/lib/components/TextArea/TextArea.js")),p=function Textarea(o){var p=i(a.prepareProps(o)),l=p.input,u=p.meta,s=p.validateOnMount,d=p.helperText,c=r._objectWithoutProperties(p,["input","meta","validateOnMount","helperText"]),f=(u.touched||s)&&u.error,b=(u.touched||s)&&u.warning||d;return t.createElement(n,e._extends({},l,{key:l.name,id:l.name,invalid:Boolean(f),invalidText:f||"",helperText:b},c))};p.propTypes={isDisabled:o.bool,isReadOnly:o.bool,isRequired:o.bool,label:o.node,labelText:o.node,description:o.node,helperText:o.node},exports.default=p; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),r=require("./objectWithoutProperties-6a6333c3.js"),t=_interopDefault(require("react")),o=_interopDefault(require("prop-types")),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var n=require("./prepare-props-4fe8d115.js"),a=_interopDefault(require("carbon-components-react/lib/components/TextArea/TextArea.js")),p=function Textarea(o){var p=i(n.prepareProps(o)),l=p.input,u=p.meta,s=p.validateOnMount,d=p.helperText,c=r._objectWithoutProperties(p,["input","meta","validateOnMount","helperText"]),f=(u.touched||s)&&u.error,b=(u.touched||s)&&u.warning||d;return t.createElement(a,e._extends({},l,{key:l.name,id:l.name,invalid:Boolean(f),invalidText:f||"",helperText:b},c))};p.propTypes={isDisabled:o.bool,isReadOnly:o.bool,isRequired:o.bool,label:o.node,labelText:o.node,description:o.node,helperText:o.node},exports.default=p; | ||
//# sourceMappingURL=textarea.js.map |
@@ -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}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),t=require("./objectWithoutProperties-6a6333c3.js"),r=require("react"),o=_interopDefault(r),n=_interopDefault(require("prop-types")),a=require("./slicedToArray-bbb33c2c.js"),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api")),l=_interopDefault(require("carbon-components-react/lib/components/SelectItem/SelectItem.js"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var c=require("./prepare-props-11a1ca5a.js"),u=require("./helper-text-block-045ee2cb.js"),s=_interopDefault(require("carbon-components-react/lib/components/TimePicker/TimePicker.js")),p=_interopDefault(require("carbon-components-react/lib/components/TimePickerSelect/TimePickerSelect.js")),d=function TimePicker(n){var d,m=i(c.prepareProps(n)),v=m.input,b=m.meta,f=m.twelveHoursFormat,T=m.timezones,h=m.validateOnMount,x=m.helperText,P=m.WrapperProps,j=t._objectWithoutProperties(m,["input","meta","twelveHoursFormat","timezones","validateOnMount","helperText","WrapperProps"]),q=r.useState(T?null===(d=T[0])||void 0===d?void 0:d.value:""),_=a._slicedToArray(q,2),y=_[0],g=_[1],A=r.useState("AM"),S=a._slicedToArray(A,2),w=S[0],D=S[1],k=r.useRef(!1),E=(b.touched||h)&&b.error,M=(b.touched||h)&&b.warning,O=v.value;if(v.value instanceof Date){var R,W=v.value.toLocaleTimeString("en-us",{hour12:!!f,timeZone:null==T||null===(R=T.find((function(e){return e.value===y})))||void 0===R?void 0:R.showAs}).split(":"),z=a._slicedToArray(W,2),B=z[0],C=void 0===B?"00":B,H=z[1],N=void 0===H?"00":H;O="".concat(String(C).padStart(2,"0"),":").concat(String(N).padStart(2,"0"))}var F=function enhnancedOnBlur(){var e,t=(null===(e=O)||void 0===e?void 0:e.split(":"))||[],r=a._slicedToArray(t,2),o=r[0],n=void 0===o?"00":o,i=r[1],l=void 0===i?"00":i;n&&!isNaN(n)||(n="00"),l&&!isNaN(l)||(l="00"),f?(n%=12,"PM"===w&&(n+=12)):n%=24,l%=59;var c=new Date("Jan 1 2000 ".concat(n,":").concat(l,":00 ").concat(y));v.onChange(c),v.onBlur()};return r.useEffect((function(){!0===k.current?F():k.current=!0}),[y,w]),o.createElement("div",P,o.createElement(s,e._extends({},v,{value:O,onBlur:F,key:v.name,id:v.name,invalid:Boolean(E),invalidText:E||""},j),f&&o.createElement(p,{labelText:"Period",id:"".concat(j.id||v.name,"-12h"),onChange:function onChange(e){var t=e.target.value;return D(t)}},o.createElement(l,{value:"AM",text:"AM"}),o.createElement(l,{value:"PM",text:"PM"})),T&&o.createElement(p,{labelText:"Timezone",id:"".concat(j.id||v.name,"-timezones"),onChange:function onChange(e){var t=e.target.value;return g(t)}},T.map((function(r){r.showAs;var n=t._objectWithoutProperties(r,["showAs"]);return o.createElement(l,e._extends({key:n.value,text:n.label},n))})))),o.createElement(u.HelperTextBlock,{helperText:!E&&x,warnText:M}))};d.propTypes={isDisabled:n.bool,isReadOnly:n.bool,isRequired:n.bool,label:n.node,labelText:n.node,description:n.node,twelveHoursFormat:n.bool,timezones:n.arrayOf(n.shape({value:n.string.isRequired,label:n.node.isRequired,showAs:n.string.isRequired})),WrapperProps:n.object},exports.default=d; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0}),require("./defineProperty-75110086.js");var e=require("./extends-edb29469.js"),t=require("./objectWithoutProperties-6a6333c3.js"),r=require("react"),o=_interopDefault(r),n=_interopDefault(require("prop-types")),a=require("./slicedToArray-bbb33c2c.js"),i=_interopDefault(require("@data-driven-forms/react-form-renderer/dist/cjs/use-field-api")),l=_interopDefault(require("carbon-components-react/lib/components/SelectItem/SelectItem.js"));require("carbon-components-react/lib/components/Tooltip/Tooltip.js");var c=require("./prepare-props-4fe8d115.js"),u=require("./helper-text-block-045ee2cb.js"),s=_interopDefault(require("carbon-components-react/lib/components/TimePicker/TimePicker.js")),p=_interopDefault(require("carbon-components-react/lib/components/TimePickerSelect/TimePickerSelect.js")),d=function TimePicker(n){var d,m=i(c.prepareProps(n)),v=m.input,f=m.meta,b=m.twelveHoursFormat,T=m.timezones,h=m.validateOnMount,x=m.helperText,P=m.WrapperProps,j=t._objectWithoutProperties(m,["input","meta","twelveHoursFormat","timezones","validateOnMount","helperText","WrapperProps"]),q=r.useState(T?null===(d=T[0])||void 0===d?void 0:d.value:""),_=a._slicedToArray(q,2),y=_[0],g=_[1],A=r.useState("AM"),S=a._slicedToArray(A,2),w=S[0],D=S[1],k=r.useRef(!1),E=(f.touched||h)&&f.error,M=(f.touched||h)&&f.warning,O=v.value;if(v.value instanceof Date){var R,W=v.value.toLocaleTimeString("en-us",{hour12:!!b,timeZone:null==T||null===(R=T.find((function(e){return e.value===y})))||void 0===R?void 0:R.showAs}).split(":"),z=a._slicedToArray(W,2),B=z[0],C=void 0===B?"00":B,H=z[1],N=void 0===H?"00":H;O="".concat(String(C).padStart(2,"0"),":").concat(String(N).padStart(2,"0"))}var F=function enhnancedOnBlur(){var e,t=(null===(e=O)||void 0===e?void 0:e.split(":"))||[],r=a._slicedToArray(t,2),o=r[0],n=void 0===o?"00":o,i=r[1],l=void 0===i?"00":i;n&&!isNaN(n)||(n="00"),l&&!isNaN(l)||(l="00"),b?(n%=12,"PM"===w&&(n+=12)):n%=24,l%=59;var c=new Date("Jan 1 2000 ".concat(n,":").concat(l,":00 ").concat(y));v.onChange(c),v.onBlur()};return r.useEffect((function(){!0===k.current?F():k.current=!0}),[y,w]),o.createElement("div",P,o.createElement(s,e._extends({},v,{value:O,onBlur:F,key:v.name,id:v.name,invalid:Boolean(E),invalidText:E||""},j),b&&o.createElement(p,{labelText:"Period",id:"".concat(j.id||v.name,"-12h"),onChange:function onChange(e){var t=e.target.value;return D(t)}},o.createElement(l,{value:"AM",text:"AM"}),o.createElement(l,{value:"PM",text:"PM"})),T&&o.createElement(p,{labelText:"Timezone",id:"".concat(j.id||v.name,"-timezones"),onChange:function onChange(e){var t=e.target.value;return g(t)}},T.map((function(r){r.showAs;var n=t._objectWithoutProperties(r,["showAs"]);return o.createElement(l,e._extends({key:n.value,text:n.label},n))})))),o.createElement(u.HelperTextBlock,{helperText:!E&&x,warnText:M}))};d.propTypes={isDisabled:n.bool,isReadOnly:n.bool,isRequired:n.bool,label:n.node,labelText:n.node,description:n.node,twelveHoursFormat:n.bool,timezones:n.arrayOf(n.shape({value:n.string.isRequired,label:n.node.isRequired,showAs:n.string.isRequired})),WrapperProps:n.object},exports.default=d; | ||
//# sourceMappingURL=time-picker.js.map |
@@ -1,2 +0,2 @@ | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as r}from"./extends-4d5fdb5f.js";import{_ as t}from"./objectWithoutProperties-85da668a.js";import o from"react";import n from"prop-types";import a from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{f as p,W as i,b as c,p as s}from"./prepare-props-c681d64b.js";import l from"carbon-components-react/es/components/FormGroup/FormGroup.js";import b from"carbon-components-react/es/components/Checkbox/Checkbox.js";import{H as d}from"./helper-text-block-711c3d01.js";function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var u=function SingleCheckbox(e){var n=a(_objectSpread(_objectSpread({},e),{},{type:"checkbox"})),p=n.input,i=n.Checkbox,c=t(n,["input","Checkbox"]);return o.createElement(i,r({},p,c))},m=function MultipleChoiceList(e){var n=a(e),p=n.Wrapper,i=n.Checkbox,c=n.label,s=n.isRequired,l=n.helperText,b=n.meta,d=n.input,m=n.options,f=n.isDisabled,h=n.isReadOnly,y=n.description,O=t(n,["Wrapper","Checkbox","label","isRequired","helperText","meta","input","options","isDisabled","isReadOnly","description"]),j=b.error,x=b.touched&&j;return o.createElement(p,{showError:x,isRequired:s,label:c,helperText:l,meta:b,description:y,rest:O,error:j,name:d.name},m.map((function(e){return o.createElement(u,r({Checkbox:i,"aria-label":e["aria-label"]||e.label},O,{value:e.value,label:e.label,name:d.name,option:e,id:"".concat(O.id||d.name,"-").concat(e.value),key:"".concat(O.id||d.name,"-").concat(e.value),isDisabled:f||h}))})))};m.propTypes={name:n.string.isRequired,Wrapper:n.oneOfType([n.node,n.func]),Checkbox:n.oneOfType([n.node,n.func])};_objectSpread(_objectSpread({},p),{},{children:n.oneOfType([n.arrayOf(n.node),n.node])});function ownKeys$1(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread$1(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys$1(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var f=function Wrapper(e){var r=e.label,t=e.description,n=e.children,a=e.helperText,p=e.error,s=e.showError,b=e.isRequired;return o.createElement(l,{legendText:t?o.createElement(i,{labelText:c(r,b),description:t}):c(r,b)},n,o.createElement(d,{helperText:a,errorText:s&&p}))};f.propTypes={label:n.node,children:n.node,description:n.node,helperText:n.node,error:n.node,showError:n.bool,isRequired:n.bool};var h=function SingleCheckbox(e){var n=a(s(_objectSpread$1(_objectSpread$1({},e),{},{type:"checkbox"}))),p=n.input,i=n.meta,c=n.validateOnMount,l=n.helperText,u=n.WrapperProps,m=t(n,["input","meta","validateOnMount","helperText","WrapperProps"]),f=(i.touched||c)&&i.error,h=(i.touched||c)&&i.warning;return o.createElement("div",u,o.createElement(b,r({},p,{id:p.name},m)),o.createElement(d,{helperText:l,errorText:f,warnText:h}))},y=function SingleCheckboxInCommon(e){var r=e.label,n=e.isDisabled,a=e.id;t(e,["label","isDisabled","id"]);return o.createElement(b,{id:a,labelText:r,disabled:n})};y.propTypes={label:n.node,input:n.object,isDisabled:n.bool,isRequired:n.bool,name:n.string,id:n.string,WrapperProps:n.object};var O=function Checkbox(e){var n=e.options,a=t(e,["options"]);return n?o.createElement(m,r({options:n},a,{Wrapper:f,Checkbox:y})):o.createElement(h,a)};O.propTypes={options:n.arrayOf(n.shape({label:n.node,value:n.any}))};export default O; | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as r}from"./extends-4d5fdb5f.js";import{_ as t}from"./objectWithoutProperties-85da668a.js";import o from"react";import n from"prop-types";import a from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{f as p,W as i,b as c,p as s}from"./prepare-props-c0a0d61e.js";import l from"carbon-components-react/es/components/FormGroup/FormGroup.js";import b from"carbon-components-react/es/components/Checkbox/Checkbox.js";import{H as d}from"./helper-text-block-711c3d01.js";function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var u=function SingleCheckbox(e){var n=a(_objectSpread(_objectSpread({},e),{},{type:"checkbox"})),p=n.input,i=n.Checkbox,c=t(n,["input","Checkbox"]);return o.createElement(i,r({},p,c))},m=function MultipleChoiceList(e){var n=a(e),p=n.Wrapper,i=n.Checkbox,c=n.label,s=n.isRequired,l=n.helperText,b=n.meta,d=n.input,m=n.options,f=n.isDisabled,h=n.isReadOnly,y=n.description,O=t(n,["Wrapper","Checkbox","label","isRequired","helperText","meta","input","options","isDisabled","isReadOnly","description"]),j=b.error,x=b.touched&&j;return o.createElement(p,{showError:x,isRequired:s,label:c,helperText:l,meta:b,description:y,rest:O,error:j,name:d.name},m.map((function(e){return o.createElement(u,r({Checkbox:i,"aria-label":e["aria-label"]||e.label},O,{value:e.value,label:e.label,name:d.name,option:e,id:"".concat(O.id||d.name,"-").concat(e.value),key:"".concat(O.id||d.name,"-").concat(e.value),isDisabled:f||h}))})))};m.propTypes={name:n.string.isRequired,Wrapper:n.oneOfType([n.node,n.func]),Checkbox:n.oneOfType([n.node,n.func])};_objectSpread(_objectSpread({},p),{},{children:n.oneOfType([n.arrayOf(n.node),n.node])});function ownKeys$1(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread$1(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ownKeys$1(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var f=function Wrapper(e){var r=e.label,t=e.description,n=e.children,a=e.helperText,p=e.error,s=e.showError,b=e.isRequired;return o.createElement(l,{legendText:t?o.createElement(i,{labelText:c(r,b),description:t}):c(r,b)},n,o.createElement(d,{helperText:a,errorText:s&&p}))};f.propTypes={label:n.node,children:n.node,description:n.node,helperText:n.node,error:n.node,showError:n.bool,isRequired:n.bool};var h=function SingleCheckbox(e){var n=a(s(_objectSpread$1(_objectSpread$1({},e),{},{type:"checkbox"}))),p=n.input,i=n.meta,c=n.validateOnMount,l=n.helperText,u=n.WrapperProps,m=t(n,["input","meta","validateOnMount","helperText","WrapperProps"]),f=(i.touched||c)&&i.error,h=(i.touched||c)&&i.warning;return o.createElement("div",u,o.createElement(b,r({},p,{id:p.name},m)),o.createElement(d,{helperText:l,errorText:f,warnText:h}))},y=function SingleCheckboxInCommon(e){var r=e.label,n=e.isDisabled,a=e.id;t(e,["label","isDisabled","id"]);return o.createElement(b,{id:a,labelText:r,disabled:n})};y.propTypes={label:n.node,input:n.object,isDisabled:n.bool,isRequired:n.bool,name:n.string,id:n.string,WrapperProps:n.object};var O=function Checkbox(e){var n=e.options,a=t(e,["options"]);return n?o.createElement(m,r({options:n},a,{Wrapper:f,Checkbox:y})):o.createElement(h,a)};O.propTypes={options:n.arrayOf(n.shape({label:n.node,value:n.any}))};export default O; | ||
//# sourceMappingURL=checkbox.js.map |
@@ -1,2 +0,2 @@ | ||
import{_ as o}from"./defineProperty-984bc41a.js";import e from"@data-driven-forms/react-form-renderer/dist/esm/component-types";import"./extends-4d5fdb5f.js";import"./objectWithoutProperties-85da668a.js";import"react";import"prop-types";import"./clsx.m-a083186a.js";import"carbon-components-react/es/components/Tabs/Tabs.js";import"carbon-components-react/es/components/Tab/Tab.js";import"@data-driven-forms/react-form-renderer/dist/esm/use-form-api";import r from"./tabs.js";import t from"./sub-form.js";import"./toConsumableArray-48c131d8.js";import"./typeof-9ba06920.js";import"./slicedToArray-de9f1c8c.js";import"@data-driven-forms/react-form-renderer/dist/esm/wizard-context";import"./_arrayPush-df1e7be1.js";import s from"./wizard.js";import"@data-driven-forms/react-form-renderer/dist/esm/form-spy";import"carbon-components-react/es/components/Button/Button.js";import"carbon-components-react/es/components/Grid/Column.js";import"carbon-components-react/es/components/Grid/Grid.js";import"carbon-components-react/es/components/Grid/Row.js";import"carbon-components-react/es/components/ProgressIndicator/ProgressIndicator.js";import"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import c from"./select.js";import"./isEqual-a0592893.js";import"carbon-components-react/es/components/Select/Select.js";import"carbon-components-react/es/components/MultiSelect/MultiSelect.js";import"carbon-components-react/es/components/SelectItem/SelectItem.js";import"carbon-components-react/es/components/ComboBox/ComboBox.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import"./prepare-props-c681d64b.js";import"@data-driven-forms/react-form-renderer/dist/esm/field-array";import"carbon-components-react/es/components/FormGroup/FormGroup.js";import"@carbon/icons-react/es/add--alt/32.js";import"@carbon/icons-react/es/subtract/32.js";import n from"./field-array.js";import"carbon-components-react/es/components/TextInput/TextInput.js";import m from"./text-field.js";import"carbon-components-react/es/components/TextArea/TextArea.js";import p from"./textarea.js";import i from"./checkbox.js";import"carbon-components-react/es/components/Checkbox/Checkbox.js";import"./helper-text-block-711c3d01.js";import"carbon-components-react/es/components/RadioButtonGroup/RadioButtonGroup.js";import"carbon-components-react/es/components/RadioButton/RadioButton.js";import a from"./radio.js";import"carbon-components-react/es/components/DatePicker/DatePicker.js";import"carbon-components-react/es/components/DatePickerInput/DatePickerInput.js";import d from"./date-picker.js";import"carbon-components-react/es/components/TimePicker/TimePicker.js";import"carbon-components-react/es/components/TimePickerSelect/TimePickerSelect.js";import j from"./time-picker.js";import"carbon-components-react/es/components/Toggle/Toggle.js";import b from"./switch.js";import l from"./plain-text.js";import f from"./dual-list-select.js";import"carbon-components-react/es/components/Search/Search.js";import"carbon-components-react/es/components/TooltipIcon/TooltipIcon.js";import"@carbon/icons-react/es/checkmark--filled/16.js";import"@carbon/icons-react/es/chevron--right/32.js";import"@carbon/icons-react/es/chevron--left/32.js";import"@carbon/icons-react/es/caret--sort--down/32.js";import"@carbon/icons-react/es/caret--sort--up/32.js";import"carbon-components-react/es/components/StructuredList/StructuredList.js";import"carbon-components-react/es/components/Slider/Slider.js";import T from"./slider.js";var u,S=(o(u={},e.TEXT_FIELD,m),o(u,e.TEXTAREA,p),o(u,e.SELECT,c),o(u,e.CHECKBOX,i),o(u,e.SUB_FORM,t),o(u,e.RADIO,a),o(u,e.TABS,r),o(u,e.DATE_PICKER,d),o(u,e.TIME_PICKER,j),o(u,e.WIZARD,s),o(u,e.SWITCH,b),o(u,e.PLAIN_TEXT,l),o(u,e.FIELD_ARRAY,n),o(u,e.DUAL_LIST_SELECT,f),o(u,e.SLIDER,T),u),x={TextField:m,Textarea:p,Checkbox:i,Radio:a,Select:c,DatePicker:d,TimePicker:j,Switch:b,PlainText:l,DualListSelect:f,Slider:T,FieldArray:n,SubForm:t,Wizard:s,Tabs:r};export default S;export{x as components}; | ||
import{_ as o}from"./defineProperty-984bc41a.js";import e from"@data-driven-forms/react-form-renderer/dist/esm/component-types";import"./extends-4d5fdb5f.js";import"./objectWithoutProperties-85da668a.js";import"react";import"prop-types";import"./clsx.m-a083186a.js";import"carbon-components-react/es/components/Tabs/Tabs.js";import"carbon-components-react/es/components/Tab/Tab.js";import"@data-driven-forms/react-form-renderer/dist/esm/use-form-api";import r from"./tabs.js";import t from"./sub-form.js";import"./toConsumableArray-48c131d8.js";import"./typeof-9ba06920.js";import"./slicedToArray-de9f1c8c.js";import"@data-driven-forms/react-form-renderer/dist/esm/wizard-context";import"./_arrayPush-df1e7be1.js";import s from"./wizard.js";import"@data-driven-forms/react-form-renderer/dist/esm/form-spy";import"carbon-components-react/es/components/Button/Button.js";import"carbon-components-react/es/components/Grid/Column.js";import"carbon-components-react/es/components/Grid/Grid.js";import"carbon-components-react/es/components/Grid/Row.js";import"carbon-components-react/es/components/ProgressIndicator/ProgressIndicator.js";import"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import c from"./select.js";import"./isEqual-a0592893.js";import"carbon-components-react/es/components/Select/Select.js";import"carbon-components-react/es/components/MultiSelect/MultiSelect.js";import"carbon-components-react/es/components/SelectItem/SelectItem.js";import"carbon-components-react/es/components/ComboBox/ComboBox.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import"./prepare-props-c0a0d61e.js";import"@data-driven-forms/react-form-renderer/dist/esm/field-array";import"carbon-components-react/es/components/FormGroup/FormGroup.js";import"@carbon/icons-react/es/add--alt/32.js";import"@carbon/icons-react/es/subtract/32.js";import n from"./field-array.js";import"carbon-components-react/es/components/TextInput/TextInput.js";import m from"./text-field.js";import"carbon-components-react/es/components/TextArea/TextArea.js";import p from"./textarea.js";import a from"./checkbox.js";import"carbon-components-react/es/components/Checkbox/Checkbox.js";import"./helper-text-block-711c3d01.js";import"carbon-components-react/es/components/RadioButtonGroup/RadioButtonGroup.js";import"carbon-components-react/es/components/RadioButton/RadioButton.js";import i from"./radio.js";import"carbon-components-react/es/components/DatePicker/DatePicker.js";import"carbon-components-react/es/components/DatePickerInput/DatePickerInput.js";import d from"./date-picker.js";import"carbon-components-react/es/components/TimePicker/TimePicker.js";import"carbon-components-react/es/components/TimePickerSelect/TimePickerSelect.js";import j from"./time-picker.js";import"carbon-components-react/es/components/Toggle/Toggle.js";import b from"./switch.js";import l from"./plain-text.js";import f from"./dual-list-select.js";import"carbon-components-react/es/components/Search/Search.js";import"carbon-components-react/es/components/TooltipIcon/TooltipIcon.js";import"@carbon/icons-react/es/checkmark--filled/16.js";import"@carbon/icons-react/es/chevron--right/32.js";import"@carbon/icons-react/es/chevron--left/32.js";import"@carbon/icons-react/es/caret--sort--down/32.js";import"@carbon/icons-react/es/caret--sort--up/32.js";import"carbon-components-react/es/components/StructuredList/StructuredList.js";import"carbon-components-react/es/components/Slider/Slider.js";import T from"./slider.js";var u,S=(o(u={},e.TEXT_FIELD,m),o(u,e.TEXTAREA,p),o(u,e.SELECT,c),o(u,e.CHECKBOX,a),o(u,e.SUB_FORM,t),o(u,e.RADIO,i),o(u,e.TABS,r),o(u,e.DATE_PICKER,d),o(u,e.TIME_PICKER,j),o(u,e.WIZARD,s),o(u,e.SWITCH,b),o(u,e.PLAIN_TEXT,l),o(u,e.FIELD_ARRAY,n),o(u,e.DUAL_LIST_SELECT,f),o(u,e.SLIDER,T),u),x={TextField:m,Textarea:p,Checkbox:a,Radio:i,Select:c,DatePicker:d,TimePicker:j,Switch:b,PlainText:l,DualListSelect:f,Slider:T,FieldArray:n,SubForm:t,Wizard:s,Tabs:r};export default S;export{x as components}; | ||
//# sourceMappingURL=component-mapper.js.map |
@@ -1,2 +0,2 @@ | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as r}from"./objectWithoutProperties-85da668a.js";import t from"react";import o from"prop-types";import p from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c681d64b.js";import{H as i}from"./helper-text-block-711c3d01.js";import n from"carbon-components-react/es/components/DatePicker/DatePicker.js";import s from"carbon-components-react/es/components/DatePickerInput/DatePickerInput.js";var c=function DatePicker(o){var c=p(a(o)),m=c.input,d=c.datePickerType,l=c.meta,P=c.DatePickerProps,f=c.validateOnMount,u=c.helperText,k=c.WrapperProps,b=r(c,["input","datePickerType","meta","DatePickerProps","validateOnMount","helperText","WrapperProps"]),T=(l.touched||f)&&l.error,j=(l.touched||f)&&l.warning;return t.createElement("div",k,t.createElement(n,e({},m,{datePickerType:d},P),t.createElement(s,e({id:m.name,invalid:Boolean(T),invalidText:T||""},b))),t.createElement(i,{helperText:!T&&u,warnText:j}))};c.propTypes={isDisabled:o.bool,isRequired:o.bool,datePickerType:o.string,DatePickerProps:o.object,WrapperProps:o.object},c.defaultProps={datePickerType:"single"};export default c; | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as r}from"./objectWithoutProperties-85da668a.js";import t from"react";import o from"prop-types";import p from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c0a0d61e.js";import{H as i}from"./helper-text-block-711c3d01.js";import n from"carbon-components-react/es/components/DatePicker/DatePicker.js";import s from"carbon-components-react/es/components/DatePickerInput/DatePickerInput.js";var c=function DatePicker(o){var c=p(a(o)),m=c.input,d=c.datePickerType,l=c.meta,P=c.DatePickerProps,f=c.validateOnMount,u=c.helperText,k=c.WrapperProps,T=r(c,["input","datePickerType","meta","DatePickerProps","validateOnMount","helperText","WrapperProps"]),b=(l.touched||f)&&l.error,j=(l.touched||f)&&l.warning;return t.createElement("div",k,t.createElement(n,e({},m,{datePickerType:d},P),t.createElement(s,e({id:m.name,invalid:Boolean(b),invalidText:b||""},T))),t.createElement(i,{helperText:!b&&u,warnText:j}))};c.propTypes={isDisabled:o.bool,isRequired:o.bool,datePickerType:o.string,DatePickerProps:o.object,WrapperProps:o.object},c.defaultProps={datePickerType:"single"};export default c; | ||
//# sourceMappingURL=date-picker.js.map |
@@ -1,2 +0,2 @@ | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as t}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import r,{useReducer as n}from"react";import l from"prop-types";import{c as s}from"./clsx.m-a083186a.js";import{_ as i}from"./toConsumableArray-48c131d8.js";import{_ as a}from"./slicedToArray-de9f1c8c.js";import"./_arrayPush-df1e7be1.js";import c from"carbon-components-react/es/components/Button/Button.js";import p from"carbon-components-react/es/components/Grid/Column.js";import u from"carbon-components-react/es/components/Grid/Grid.js";import d from"carbon-components-react/es/components/Grid/Row.js";import f from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import{_ as m}from"./isEqual-a0592893.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{b}from"./prepare-props-c681d64b.js";import h from"carbon-components-react/es/components/FormGroup/FormGroup.js";import g from"carbon-components-react/es/components/Search/Search.js";import P from"carbon-components-react/es/components/TooltipIcon/TooltipIcon.js";import j from"@carbon/icons-react/es/checkmark--filled/16.js";import v from"@carbon/icons-react/es/chevron--right/32.js";import O from"@carbon/icons-react/es/chevron--left/32.js";import y from"@carbon/icons-react/es/caret--sort--down/32.js";import T from"@carbon/icons-react/es/caret--sort--up/32.js";import{StructuredListWrapper as L,StructuredListBody as S,StructuredListRow as V,StructuredListCell as R}from"carbon-components-react/es/components/StructuredList/StructuredList.js";function ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function _objectSpread(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var C={lastLeftClicked:void 0,selectedLeftValues:[],lastRightClicked:void 0,selectedRightValues:[],sortLeftDesc:!0,sortRightDesc:!0,filterOptions:"",filterValue:""},_=function reducer(e,t){var o=t.type,r=t.value,n=t.values,l=t.isRight;switch(o){case"setSelectedValue":return _objectSpread(_objectSpread(_objectSpread({},e),l?{selectedLeftValues:n}:{selectedRightValues:n}),l?{lastLeftClicked:r}:{lastRightClicked:r});case"setFilterValue":return _objectSpread(_objectSpread({},e),{},{filterValue:r});case"setFilterOptions":return _objectSpread(_objectSpread({},e),{},{filterOptions:r});case"sortValue":return _objectSpread(_objectSpread({},e),{},{sortRightDesc:!e.sortRightDesc});case"sortOptions":return _objectSpread(_objectSpread({},e),{},{sortLeftDesc:!e.sortLeftDesc});case"clearRightValues":return _objectSpread(_objectSpread({},e),{},{selectedRightValues:[]});case"clearLeftOptions":return _objectSpread(_objectSpread({},e),{},{selectedLeftValues:[]});default:return e}};function ownKeys$1(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function _objectSpread$1(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?ownKeys$1(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$1(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var E=function getOptionsGroup(e,t,o){var r=o.map((function(e){return e.value.toString()})).indexOf(t.toString()),n=o.map((function(e){return e.value.toString()})).indexOf(e),l=Math.min(r,n),s=Math.max(r,n)+1;return i(o.slice(l,s).map((function(e){return e.value.toString()})))},w=function handleOptionClick(e,t,o,r,n,l){var s=r?"selectedLeftValues":"selectedRightValues",a=r?"lastLeftClicked":"lastRightClicked";if(e.shiftKey&&l[a])n({type:"setSelectedValue",value:t,values:E(t,l[a],o),isRight:r});else if(e.ctrlKey&&l[a]){var c=l[s].includes(t)?l[s].filter((function(e){return e!==t})):[].concat(i(l[s]),[t]);n({type:"setSelectedValue",value:t,values:c,isRight:r})}else n({type:"setSelectedValue",value:t,values:[t],isRight:r})},k=function DualListSelectCommon(e){var l=n(_,C),s=a(l,2),c=s[0],p=s[1],u=f(_objectSpread$1(_objectSpread$1({},e),{},{isEqual:function isEqual(e,t){return m(i(e||[]).sort(),i(t||[]).sort())}})),d=u.DualListSelect,b=o(u,["DualListSelect"]),h=b.options.filter((function(e){return!b.input.value.includes(e.value)&&e.label.includes(c.filterOptions)})).sort((function(e,t){return c.sortLeftDesc?e.label.localeCompare(t.label):t.label.localeCompare(e.label)})),g=b.options.filter((function(e){return b.input.value.includes(e.value)&&e.label.includes(c.filterValue)})).sort((function(e,t){return c.sortRightDesc?e.label.localeCompare(t.label):t.label.localeCompare(e.label)}));return r.createElement(d,t({},b,{leftValues:h,rightValues:g,handleOptionsClick:function handleOptionsClick(e,t){return w(e,t,h,!0,p,c)},handleValuesClick:function handleValuesClick(e,t){return w(e,t,g,!1,p,c)},handleMoveRight:function handleMoveRight(){b.input.onChange([].concat(i(b.input.value),i(c.selectedLeftValues))),p({type:"clearLeftOptions"})},handleMoveLeft:function handleMoveLeft(){b.input.onChange(b.input.value.filter((function(e){return!c.selectedRightValues.includes(e)}))),p({type:"clearRightValues"})},sortOptions:function sortOptions(){return p({type:"sortOptions"})},sortValues:function sortValues(){return p({type:"sortValue"})},filterOptions:function filterOptions(e){return p({type:"setFilterOptions",value:e})},filterValues:function filterValues(e){return p({type:"setFilterValue",value:e})},handleClearLeftValues:function handleClearLeftValues(){p({type:"clearLeftValues"}),b.input.onChange([].concat(i(b.input.value),i(h.map((function(e){return e.value})))))},handleClearRightValues:function handleClearRightValues(){p({type:"clearRightValue"}),b.input.onChange(i(b.input.value.filter((function(e){return!g.find((function(t){var o=t.value;return e===o}))}))))},state:c}))};function ownKeys$2(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function _objectSpread$2(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?ownKeys$2(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$2(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}k.propTypes={DualListSelect:l.oneOfType([l.node,l.func])},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-dual-list {\n max-height: 500px;\n overflow: auto;\n display: block;\n margin-bottom: 0px;\n}\n\n.ddorg__carbon-dual-list-body {\n width: 100%;\n display: inline-table;\n}\n\n.ddorg__carbon-dual-list-button-wrapper {\n flex-direction: column;\n padding: 8px !important;\n padding-top: 8px !important;\n}\n.ddorg__carbon-dual-list-button-wrapper button {\n width: 100%;\n max-width: 100%;\n}\n@media (max-width: 1055px) {\n .ddorg__carbon-dual-list-button-wrapper button svg {\n transform: rotate(90deg);\n }\n}\n.ddorg__carbon-dual-list-button-wrapper button:not(:last-child) {\n margin-bottom: 8px;\n}\n\n.ddorg__carbon-dual-list-toolbar {\n display: flex;\n}\n\n.ddorg__carbon-dual-list-tooltipbutton {\n background: #c2c1c1 !important;\n}");var D=function EmptyList(e){var t=e.message;return r.createElement(L,null,r.createElement(S,null,r.createElement(V,null,r.createElement(R,null,t))))};D.propTypes={message:l.string};var x=function List(e){var o=e.options,n=e.selectedValues,l=e.handleOptionsClick,i=e.noTitle,a=e.ListProps,c=e.BodyProps;return o.length>0?r.createElement(L,t({selection:!0},a,{className:s("ddorg__carbon-dual-list",a.className)}),r.createElement(S,t({},c,{className:s("ddorg__carbon-dual-list-body",c.className)}),o.map((function(e){var o=e.value,s=e.label,i=e.ListRowProps,a=e.ListCellProps,c=e.GridProps,f=e.RowProps,m=e.LabelProps,b=e.CheckmarkProps;return r.createElement(V,t({key:o},i,{onClick:function onClick(e){return l(_objectSpread$2(_objectSpread$2({},e),{},{ctrlKey:!0}),o)}}),r.createElement(R,a,r.createElement(u,c,r.createElement(d,t({narrow:!0},f),r.createElement(p,t({sm:3},m),s),r.createElement(p,t({sm:1},b),n.includes(o)&&r.createElement(j,null))))))})))):r.createElement(D,{message:i})};x.propTypes={options:l.array,selectedValues:l.array,handleOptionsClick:l.func,noTitle:l.node,ListProps:l.object,BodyProps:l.object};var B=function Toolbar(e){var o=e.sortTitle,n=e.onFilter,l=e.onSort,i=e.sortDirection,a=e.placeholder,c=e.ToolbarProps,p=e.SearchProps,u=e.SortProps;return r.createElement("div",t({},c,{className:s("ddorg__carbon-dual-list-toolbar",c.className)}),r.createElement(g,t({onChange:function onChange(e){return n(e.target.value)},labelText:"",placeHolderText:a},p)),r.createElement(P,t({onClick:l,tooltipText:o},u,{className:s("ddorg__carbon-dual-list-tooltipbutton",u.className)}),i?r.createElement(y,null):r.createElement(T,null)))};B.propTypes={sortTitle:l.string,onFilter:l.func,onSort:l.func,sortDirection:l.bool,placeholder:l.string,ToolbarProps:l.object,SearchProps:l.object,SortProps:l.object};var A=function isEmpty(e){return 0===e.length},F=function DualListSelectInner(e){var o=e.leftValues,n=e.handleOptionsClick,l=e.rightValues,i=e.handleValuesClick,a=e.handleMoveRight,f=e.handleClearLeftValues,m=e.handleMoveLeft,g=e.handleClearRightValues,P=e.state,j=e.filterOptions,y=e.filterValues,T=e.sortOptions,L=e.sortValues,S=e.noOptionsTitle,V=e.noValueTitle,R=e.leftTitle,C=e.rightTitle,_=e.LeftTitleElement,E=e.RightTitleElement,w=e.LeftTitleProps,k=e.RightTitleProps,D=e.moveLeftTitle,F=e.moveRightTitle,G=e.moveAllLeftTitle,$=e.moveAllRightTitle,K=e.label,N=e.isRequired,M=e.filterOptionsTitle,q=e.filterValuesTitle,I=e.sortOptionsTitle,H=e.sortValuesTitle,W=e.filterOptionsText,z=e.filterValueText,J=e.FormGroupProps,Q=e.GridProps,U=e.RowProps,X=e.OptionsColumnProps,Y=e.ButtonColumnProps,Z=e.ValuesColumnProps,ee=e.AddButtonProps,te=e.AddAllButtonProps,oe=e.RemoveButtonProps,re=e.RemoveAllButtonProps,ne=e.LeftToolbarProps,le=e.RightToolbarProps,se=e.LeftSearchProps,ie=e.RightSearchProps,ae=e.LeftSortProps,ce=e.RightSortProps,pe=e.LeftListProps,ue=e.LeftBodyProps,de=e.RightListProps,fe=e.RightBodyProps;return r.createElement(h,t({legendText:b(K||"",N)},J),r.createElement(u,Q,r.createElement(d,t({condensed:!0},U),r.createElement(p,t({sm:4,md:8,lg:5},X),r.createElement(_,w,R),r.createElement(B,{onFilter:j,placeholder:M,sortDirection:P.sortLeftDesc,onSort:T,sortTitle:I,ToolbarProps:ne,SearchProps:se,SortProps:ae}),r.createElement(x,{ListProps:pe,BodyProps:ue,options:o,selectedValues:P.selectedLeftValues,handleOptionsClick:n,noTitle:P.filterOptions?W:S})),r.createElement(p,t({sm:4,md:8,lg:2},Y,{className:s("ddorg__carbon-dual-list-button-wrapper",Y.className)}),r.createElement(c,t({id:"move-right",renderIcon:v,onClick:a,disabled:A(P.selectedLeftValues)},ee),F),r.createElement(c,t({id:"move-all-right",onClick:f,disabled:A(o)},te),$),r.createElement(c,t({id:"move-all-left",onClick:g,disabled:A(l)},re),G),r.createElement(c,t({id:"move-left",renderIcon:O,onClick:m,disabled:A(P.selectedRightValues)},oe),D)),r.createElement(p,t({sm:4,md:8,lg:5},Z),r.createElement(E,k,C),r.createElement(B,{onFilter:y,placeholder:q,sortDirection:P.sortRightDesc,onSort:L,sortTitle:H,ToolbarProps:le,SearchProps:ie,SortProps:ce}),r.createElement(x,{ListProps:de,BodyProps:fe,options:l,selectedValues:P.selectedRightValues,handleOptionsClick:i,noTitle:P.filterValue?z:V})))))};F.propTypes={leftValues:l.array,handleOptionsClick:l.func,rightValues:l.array,handleValuesClick:l.func,handleMoveRight:l.func,handleClearLeftValues:l.func,handleMoveLeft:l.func,handleClearRightValues:l.func,state:l.object,filterOptions:l.func,filterValues:l.func,sortValues:l.func,sortOptions:l.func,noOptionsTitle:l.node,noValueTitle:l.node,leftTitle:l.node,rightTitle:l.node,LeftTitleElement:l.string,RightTitleElement:l.string,LeftTitleProps:l.object,RightTitleProps:l.object,moveLeftTitle:l.node,moveRightTitle:l.node,moveAllLeftTitle:l.node,moveAllRightTitle:l.node,label:l.node,isRequired:l.bool,filterOptionsTitle:l.string,filterValuesTitle:l.string,sortOptionsTitle:l.string,sortValuesTitle:l.string,filterOptionsText:l.node,filterValueText:l.node,FormGroupProps:l.object,GridProps:l.object,RowProps:l.object,OptionsColumnProps:l.object,ButtonColumnProps:l.object,ValuesColumnProps:l.object,AddButtonProps:l.object,AddAllButtonProps:l.object,RemoveButtonProps:l.object,RemoveAllButtonProps:l.object,LeftToolbarProps:l.object,RightToolbarProps:l.object,LeftSearchProps:l.object,RightSearchProps:l.object,LeftSortProps:l.object,RightSortProps:l.object,LeftListProps:l.object,LeftBodyProps:l.object,RightListProps:l.object,RightBodyProps:l.object},F.defaultProps={noOptionsTitle:"No option available",noValueTitle:"No option selected",leftTitle:"Options",rightTitle:"Selected",LeftTitleElement:"h6",RightTitleElement:"h6",moveLeftTitle:"Remove",moveRightTitle:"Add",moveAllLeftTitle:"Remove All",moveAllRightTitle:"Add All",filterOptionsTitle:"Filter options",filterValuesTitle:"Filter values",sortOptionsTitle:"Sort options",sortValuesTitle:"Sort values",filterOptionsText:"Remove your filter to see all options",filterValueText:"Remove your filter to see all selected",FormGroupProps:{},GridProps:{},RowProps:{},OptionsColumnProps:{},ButtonColumnProps:{},ValuesColumnProps:{},AddButtonProps:{},AddAllButtonProps:{},RemoveButtonProps:{},RemoveAllButtonProps:{},LeftToolbarProps:{},RightToolbarProps:{},LeftSearchProps:{},RightSearchProps:{},LeftSortProps:{},RightSortProps:{},LeftListProps:{},LeftBodyProps:{},RightListProps:{},RightBodyProps:{}};export default function DualListSelect(e){return r.createElement(k,t({},e,{DualListSelect:F}))} | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as t}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import r,{useReducer as n}from"react";import l from"prop-types";import{c as s}from"./clsx.m-a083186a.js";import{_ as i}from"./toConsumableArray-48c131d8.js";import{_ as a}from"./slicedToArray-de9f1c8c.js";import"./_arrayPush-df1e7be1.js";import c from"carbon-components-react/es/components/Button/Button.js";import p from"carbon-components-react/es/components/Grid/Column.js";import u from"carbon-components-react/es/components/Grid/Grid.js";import d from"carbon-components-react/es/components/Grid/Row.js";import f from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import{_ as m}from"./isEqual-a0592893.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{b}from"./prepare-props-c0a0d61e.js";import h from"carbon-components-react/es/components/FormGroup/FormGroup.js";import g from"carbon-components-react/es/components/Search/Search.js";import P from"carbon-components-react/es/components/TooltipIcon/TooltipIcon.js";import j from"@carbon/icons-react/es/checkmark--filled/16.js";import v from"@carbon/icons-react/es/chevron--right/32.js";import O from"@carbon/icons-react/es/chevron--left/32.js";import y from"@carbon/icons-react/es/caret--sort--down/32.js";import T from"@carbon/icons-react/es/caret--sort--up/32.js";import{StructuredListWrapper as L,StructuredListBody as S,StructuredListRow as V,StructuredListCell as R}from"carbon-components-react/es/components/StructuredList/StructuredList.js";function ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function _objectSpread(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var C={lastLeftClicked:void 0,selectedLeftValues:[],lastRightClicked:void 0,selectedRightValues:[],sortLeftDesc:!0,sortRightDesc:!0,filterOptions:"",filterValue:""},_=function reducer(e,t){var o=t.type,r=t.value,n=t.values,l=t.isRight;switch(o){case"setSelectedValue":return _objectSpread(_objectSpread(_objectSpread({},e),l?{selectedLeftValues:n}:{selectedRightValues:n}),l?{lastLeftClicked:r}:{lastRightClicked:r});case"setFilterValue":return _objectSpread(_objectSpread({},e),{},{filterValue:r});case"setFilterOptions":return _objectSpread(_objectSpread({},e),{},{filterOptions:r});case"sortValue":return _objectSpread(_objectSpread({},e),{},{sortRightDesc:!e.sortRightDesc});case"sortOptions":return _objectSpread(_objectSpread({},e),{},{sortLeftDesc:!e.sortLeftDesc});case"clearRightValues":return _objectSpread(_objectSpread({},e),{},{selectedRightValues:[]});case"clearLeftOptions":return _objectSpread(_objectSpread({},e),{},{selectedLeftValues:[]});default:return e}};function ownKeys$1(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function _objectSpread$1(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?ownKeys$1(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$1(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var E=function getOptionsGroup(e,t,o){var r=o.map((function(e){return e.value.toString()})).indexOf(t.toString()),n=o.map((function(e){return e.value.toString()})).indexOf(e),l=Math.min(r,n),s=Math.max(r,n)+1;return i(o.slice(l,s).map((function(e){return e.value.toString()})))},w=function handleOptionClick(e,t,o,r,n,l){var s=r?"selectedLeftValues":"selectedRightValues",a=r?"lastLeftClicked":"lastRightClicked";if(e.shiftKey&&l[a])n({type:"setSelectedValue",value:t,values:E(t,l[a],o),isRight:r});else if(e.ctrlKey&&l[a]){var c=l[s].includes(t)?l[s].filter((function(e){return e!==t})):[].concat(i(l[s]),[t]);n({type:"setSelectedValue",value:t,values:c,isRight:r})}else n({type:"setSelectedValue",value:t,values:[t],isRight:r})},k=function DualListSelectCommon(e){var l=n(_,C),s=a(l,2),c=s[0],p=s[1],u=f(_objectSpread$1(_objectSpread$1({},e),{},{isEqual:function isEqual(e,t){return m(i(e||[]).sort(),i(t||[]).sort())}})),d=u.DualListSelect,b=o(u,["DualListSelect"]),h=b.options.filter((function(e){return!b.input.value.includes(e.value)&&e.label.includes(c.filterOptions)})).sort((function(e,t){return c.sortLeftDesc?e.label.localeCompare(t.label):t.label.localeCompare(e.label)})),g=b.options.filter((function(e){return b.input.value.includes(e.value)&&e.label.includes(c.filterValue)})).sort((function(e,t){return c.sortRightDesc?e.label.localeCompare(t.label):t.label.localeCompare(e.label)}));return r.createElement(d,t({},b,{leftValues:h,rightValues:g,handleOptionsClick:function handleOptionsClick(e,t){return w(e,t,h,!0,p,c)},handleValuesClick:function handleValuesClick(e,t){return w(e,t,g,!1,p,c)},handleMoveRight:function handleMoveRight(){b.input.onChange([].concat(i(b.input.value),i(c.selectedLeftValues))),p({type:"clearLeftOptions"})},handleMoveLeft:function handleMoveLeft(){b.input.onChange(b.input.value.filter((function(e){return!c.selectedRightValues.includes(e)}))),p({type:"clearRightValues"})},sortOptions:function sortOptions(){return p({type:"sortOptions"})},sortValues:function sortValues(){return p({type:"sortValue"})},filterOptions:function filterOptions(e){return p({type:"setFilterOptions",value:e})},filterValues:function filterValues(e){return p({type:"setFilterValue",value:e})},handleClearLeftValues:function handleClearLeftValues(){p({type:"clearLeftValues"}),b.input.onChange([].concat(i(b.input.value),i(h.map((function(e){return e.value})))))},handleClearRightValues:function handleClearRightValues(){p({type:"clearRightValue"}),b.input.onChange(i(b.input.value.filter((function(e){return!g.find((function(t){var o=t.value;return e===o}))}))))},state:c}))};function ownKeys$2(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function _objectSpread$2(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?ownKeys$2(Object(r),!0).forEach((function(o){e(t,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys$2(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}k.propTypes={DualListSelect:l.oneOfType([l.node,l.func])},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-dual-list {\n max-height: 500px;\n overflow: auto;\n display: block;\n margin-bottom: 0px;\n}\n\n.ddorg__carbon-dual-list-body {\n width: 100%;\n display: inline-table;\n}\n\n.ddorg__carbon-dual-list-button-wrapper {\n flex-direction: column;\n padding: 8px !important;\n padding-top: 8px !important;\n}\n.ddorg__carbon-dual-list-button-wrapper button {\n width: 100%;\n max-width: 100%;\n}\n@media (max-width: 1055px) {\n .ddorg__carbon-dual-list-button-wrapper button svg {\n transform: rotate(90deg);\n }\n}\n.ddorg__carbon-dual-list-button-wrapper button:not(:last-child) {\n margin-bottom: 8px;\n}\n\n.ddorg__carbon-dual-list-toolbar {\n display: flex;\n}\n\n.ddorg__carbon-dual-list-tooltipbutton {\n background: #c2c1c1 !important;\n}");var D=function EmptyList(e){var t=e.message;return r.createElement(L,null,r.createElement(S,null,r.createElement(V,null,r.createElement(R,null,t))))};D.propTypes={message:l.string};var x=function List(e){var o=e.options,n=e.selectedValues,l=e.handleOptionsClick,i=e.noTitle,a=e.ListProps,c=e.BodyProps;return o.length>0?r.createElement(L,t({selection:!0},a,{className:s("ddorg__carbon-dual-list",a.className)}),r.createElement(S,t({},c,{className:s("ddorg__carbon-dual-list-body",c.className)}),o.map((function(e){var o=e.value,s=e.label,i=e.ListRowProps,a=e.ListCellProps,c=e.GridProps,f=e.RowProps,m=e.LabelProps,b=e.CheckmarkProps;return r.createElement(V,t({key:o},i,{onClick:function onClick(e){return l(_objectSpread$2(_objectSpread$2({},e),{},{ctrlKey:!0}),o)}}),r.createElement(R,a,r.createElement(u,c,r.createElement(d,t({narrow:!0},f),r.createElement(p,t({sm:3},m),s),r.createElement(p,t({sm:1},b),n.includes(o)&&r.createElement(j,null))))))})))):r.createElement(D,{message:i})};x.propTypes={options:l.array,selectedValues:l.array,handleOptionsClick:l.func,noTitle:l.node,ListProps:l.object,BodyProps:l.object};var B=function Toolbar(e){var o=e.sortTitle,n=e.onFilter,l=e.onSort,i=e.sortDirection,a=e.placeholder,c=e.ToolbarProps,p=e.SearchProps,u=e.SortProps;return r.createElement("div",t({},c,{className:s("ddorg__carbon-dual-list-toolbar",c.className)}),r.createElement(g,t({onChange:function onChange(e){return n(e.target.value)},labelText:"",placeHolderText:a},p)),r.createElement(P,t({onClick:l,tooltipText:o},u,{className:s("ddorg__carbon-dual-list-tooltipbutton",u.className)}),i?r.createElement(y,null):r.createElement(T,null)))};B.propTypes={sortTitle:l.string,onFilter:l.func,onSort:l.func,sortDirection:l.bool,placeholder:l.string,ToolbarProps:l.object,SearchProps:l.object,SortProps:l.object};var A=function isEmpty(e){return 0===e.length},F=function DualListSelectInner(e){var o=e.leftValues,n=e.handleOptionsClick,l=e.rightValues,i=e.handleValuesClick,a=e.handleMoveRight,f=e.handleClearLeftValues,m=e.handleMoveLeft,g=e.handleClearRightValues,P=e.state,j=e.filterOptions,y=e.filterValues,T=e.sortOptions,L=e.sortValues,S=e.noOptionsTitle,V=e.noValueTitle,R=e.leftTitle,C=e.rightTitle,_=e.LeftTitleElement,E=e.RightTitleElement,w=e.LeftTitleProps,k=e.RightTitleProps,D=e.moveLeftTitle,F=e.moveRightTitle,G=e.moveAllLeftTitle,$=e.moveAllRightTitle,K=e.label,N=e.isRequired,M=e.filterOptionsTitle,q=e.filterValuesTitle,I=e.sortOptionsTitle,H=e.sortValuesTitle,W=e.filterOptionsText,z=e.filterValueText,J=e.FormGroupProps,Q=e.GridProps,U=e.RowProps,X=e.OptionsColumnProps,Y=e.ButtonColumnProps,Z=e.ValuesColumnProps,ee=e.AddButtonProps,te=e.AddAllButtonProps,oe=e.RemoveButtonProps,re=e.RemoveAllButtonProps,ne=e.LeftToolbarProps,le=e.RightToolbarProps,se=e.LeftSearchProps,ie=e.RightSearchProps,ae=e.LeftSortProps,ce=e.RightSortProps,pe=e.LeftListProps,ue=e.LeftBodyProps,de=e.RightListProps,fe=e.RightBodyProps;return r.createElement(h,t({legendText:b(K||"",N)},J),r.createElement(u,Q,r.createElement(d,t({condensed:!0},U),r.createElement(p,t({sm:4,md:8,lg:5},X),r.createElement(_,w,R),r.createElement(B,{onFilter:j,placeholder:M,sortDirection:P.sortLeftDesc,onSort:T,sortTitle:I,ToolbarProps:ne,SearchProps:se,SortProps:ae}),r.createElement(x,{ListProps:pe,BodyProps:ue,options:o,selectedValues:P.selectedLeftValues,handleOptionsClick:n,noTitle:P.filterOptions?W:S})),r.createElement(p,t({sm:4,md:8,lg:2},Y,{className:s("ddorg__carbon-dual-list-button-wrapper",Y.className)}),r.createElement(c,t({id:"move-right",renderIcon:v,onClick:a,disabled:A(P.selectedLeftValues)},ee),F),r.createElement(c,t({id:"move-all-right",onClick:f,disabled:A(o)},te),$),r.createElement(c,t({id:"move-all-left",onClick:g,disabled:A(l)},re),G),r.createElement(c,t({id:"move-left",renderIcon:O,onClick:m,disabled:A(P.selectedRightValues)},oe),D)),r.createElement(p,t({sm:4,md:8,lg:5},Z),r.createElement(E,k,C),r.createElement(B,{onFilter:y,placeholder:q,sortDirection:P.sortRightDesc,onSort:L,sortTitle:H,ToolbarProps:le,SearchProps:ie,SortProps:ce}),r.createElement(x,{ListProps:de,BodyProps:fe,options:l,selectedValues:P.selectedRightValues,handleOptionsClick:i,noTitle:P.filterValue?z:V})))))};F.propTypes={leftValues:l.array,handleOptionsClick:l.func,rightValues:l.array,handleValuesClick:l.func,handleMoveRight:l.func,handleClearLeftValues:l.func,handleMoveLeft:l.func,handleClearRightValues:l.func,state:l.object,filterOptions:l.func,filterValues:l.func,sortValues:l.func,sortOptions:l.func,noOptionsTitle:l.node,noValueTitle:l.node,leftTitle:l.node,rightTitle:l.node,LeftTitleElement:l.string,RightTitleElement:l.string,LeftTitleProps:l.object,RightTitleProps:l.object,moveLeftTitle:l.node,moveRightTitle:l.node,moveAllLeftTitle:l.node,moveAllRightTitle:l.node,label:l.node,isRequired:l.bool,filterOptionsTitle:l.string,filterValuesTitle:l.string,sortOptionsTitle:l.string,sortValuesTitle:l.string,filterOptionsText:l.node,filterValueText:l.node,FormGroupProps:l.object,GridProps:l.object,RowProps:l.object,OptionsColumnProps:l.object,ButtonColumnProps:l.object,ValuesColumnProps:l.object,AddButtonProps:l.object,AddAllButtonProps:l.object,RemoveButtonProps:l.object,RemoveAllButtonProps:l.object,LeftToolbarProps:l.object,RightToolbarProps:l.object,LeftSearchProps:l.object,RightSearchProps:l.object,LeftSortProps:l.object,RightSortProps:l.object,LeftListProps:l.object,LeftBodyProps:l.object,RightListProps:l.object,RightBodyProps:l.object},F.defaultProps={noOptionsTitle:"No option available",noValueTitle:"No option selected",leftTitle:"Options",rightTitle:"Selected",LeftTitleElement:"h6",RightTitleElement:"h6",moveLeftTitle:"Remove",moveRightTitle:"Add",moveAllLeftTitle:"Remove All",moveAllRightTitle:"Add All",filterOptionsTitle:"Filter options",filterValuesTitle:"Filter values",sortOptionsTitle:"Sort options",sortValuesTitle:"Sort values",filterOptionsText:"Remove your filter to see all options",filterValueText:"Remove your filter to see all selected",FormGroupProps:{},GridProps:{},RowProps:{},OptionsColumnProps:{},ButtonColumnProps:{},ValuesColumnProps:{},AddButtonProps:{},AddAllButtonProps:{},RemoveButtonProps:{},RemoveAllButtonProps:{},LeftToolbarProps:{},RightToolbarProps:{},LeftSearchProps:{},RightSearchProps:{},LeftSortProps:{},RightSortProps:{},LeftListProps:{},LeftBodyProps:{},RightListProps:{},RightBodyProps:{}};export default function DualListSelect(e){return r.createElement(k,t({},e,{DualListSelect:F}))} | ||
//# sourceMappingURL=dual-list-select.js.map |
@@ -1,2 +0,2 @@ | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as r}from"./extends-4d5fdb5f.js";import"./objectWithoutProperties-85da668a.js";import o from"react";import t 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 s from"carbon-components-react/es/components/Button/Button.js";import m from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as d}from"./prepare-props-c681d64b.js";import i from"@data-driven-forms/react-form-renderer/dist/esm/field-array";import c from"carbon-components-react/es/components/FormGroup/FormGroup.js";import p from"@carbon/icons-react/es/add--alt/32.js";import l from"@carbon/icons-react/es/subtract/32.js";function ownKeys(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,t)}return o}function _objectSpread(r){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(t),!0).forEach((function(o){e(r,o,t[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}!function ___$insertStyle(e){if(e&&"undefined"!=typeof window){var r=document.createElement("style");return r.setAttribute("type","text/css"),r.innerHTML=e,document.head.appendChild(r),e}}(".ddorg__carbon-field-array-add {\n margin-top: 16px;\n}\n\n.ddorg__carbon-field-array-add-container {\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n}\n\n.ddorg__carbon-field-array-remove {\n margin-top: 8px;\n margin-bottom: 8px;\n}\n\n.ddorg__carbon-field-array-form-group .bx--form__requirements {\n color: #da1e28;\n}");var f=function ArrayItem(e){var t=e.remove,m=e.fields,d=e.name,i=e.removeText,c=e.buttonDisabled,p=e.RemoveButtonProps,f=e.ArrayItemProps,u=a(),b=m.map((function(e){return _objectSpread(_objectSpread({},e),e.name?{name:"".concat(d,".").concat(e.name)}:{name:d})}));return o.createElement("div",f,u.renderForm(b,u),o.createElement(s,r({disabled:c,renderIcon:l,id:"remove-".concat(d),kind:"danger",onClick:t},p,{className:n("ddorg__carbon-field-array-remove",p.className)}),i))};f.propTypes={remove:t.func,fields:t.array,name:t.string,removeText:t.node,buttonDisabled:t.bool,RemoveButtonProps:t.object,ArrayItemProps:t.object},f.defaultProps={RemoveButtonProps:{},ArrayItemProps:{}};var u=function FieldArray(e){var t=m(d(e)),a=t.AddContainerProps,l=t.AddButtonProps,u=t.FormGroupProps,b=t.WrapperProps,y=t.ArrayItemProps,v=t.RemoveButtonProps,P=t.defaultItem,j=t.maxItems,g=t.minItems,_=t.fields,I=t.input,x=t.arrayValidator,A=t.labelText,O=t.buttonLabels,h=t.noItemsMessage,B=t.meta,w=t.validateOnMount,E=_objectSpread({add:"Add",remove:"Remove"},O),T=(B.touched||w)&&!Array.isArray(B.error)&&B.error;return o.createElement(c,r({legendText:A||"",invalid:Boolean(T),message:Boolean(T),messageText:T||""},u,{className:n("ddorg__carbon-field-array-form-group",u.className)}),o.createElement(i,{name:I.name,validate:x},(function(e){return o.createElement("div",b,0===e.fields.length&&h,e.fields.map((function(r,t){return o.createElement(f,{removeText:E.remove,key:t,remove:function remove(){return e.fields.remove(t)},name:r,fields:_,buttonDisabled:g>=e.fields.length,ArrayItemProps:y,RemoveButtonProps:v})})),o.createElement("div",r({},a,{className:n("ddorg__carbon-field-array-add-container",a.className)}),o.createElement(s,r({disabled:e.fields.length>=j,renderIcon:p,id:"add-".concat(I.name),onClick:function onClick(){return e.fields.push(P)}},l,{className:n("ddorg__carbon-field-array-add",l.className)}),E.add)))})))};u.propTypes={noItemsMessage:t.node,maxItems:t.number,minItems:t.number,buttonLabels:t.shape({add:t.node,remove:t.node}),AddContainerProps:t.object,AddButtonProps:t.object,FormGroupProps:t.object,WrapperProps:t.object,ArrayItemProps:t.object,RemoveButtonProps:t.object,defaultItem:t.any,isRequired:t.bool,fields:t.array},u.defaultProps={noItemsMessage:"No items",maxItems:1/0,minItems:0,AddContainerProps:{},AddButtonProps:{},FormGroupProps:{},WrapperProps:{},ArrayItemProps:{},RemoveButtonProps:{}};export default u; | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as r}from"./extends-4d5fdb5f.js";import"./objectWithoutProperties-85da668a.js";import o from"react";import t 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 s from"carbon-components-react/es/components/Button/Button.js";import m from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as d}from"./prepare-props-c0a0d61e.js";import i from"@data-driven-forms/react-form-renderer/dist/esm/field-array";import c from"carbon-components-react/es/components/FormGroup/FormGroup.js";import p from"@carbon/icons-react/es/add--alt/32.js";import l from"@carbon/icons-react/es/subtract/32.js";function ownKeys(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,t)}return o}function _objectSpread(r){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(t),!0).forEach((function(o){e(r,o,t[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}!function ___$insertStyle(e){if(e&&"undefined"!=typeof window){var r=document.createElement("style");return r.setAttribute("type","text/css"),r.innerHTML=e,document.head.appendChild(r),e}}(".ddorg__carbon-field-array-add {\n margin-top: 16px;\n}\n\n.ddorg__carbon-field-array-add-container {\n width: 100%;\n display: flex;\n flex-direction: row-reverse;\n}\n\n.ddorg__carbon-field-array-remove {\n margin-top: 8px;\n margin-bottom: 8px;\n}\n\n.ddorg__carbon-field-array-form-group .bx--form__requirements {\n color: #da1e28;\n}");var f=function ArrayItem(e){var t=e.remove,m=e.fields,d=e.name,i=e.removeText,c=e.buttonDisabled,p=e.RemoveButtonProps,f=e.ArrayItemProps,u=a(),b=m.map((function(e){return _objectSpread(_objectSpread({},e),e.name?{name:"".concat(d,".").concat(e.name)}:{name:d})}));return o.createElement("div",f,u.renderForm(b,u),o.createElement(s,r({disabled:c,renderIcon:l,id:"remove-".concat(d),kind:"danger",onClick:t},p,{className:n("ddorg__carbon-field-array-remove",p.className)}),i))};f.propTypes={remove:t.func,fields:t.array,name:t.string,removeText:t.node,buttonDisabled:t.bool,RemoveButtonProps:t.object,ArrayItemProps:t.object},f.defaultProps={RemoveButtonProps:{},ArrayItemProps:{}};var u=function FieldArray(e){var t=m(d(e)),a=t.AddContainerProps,l=t.AddButtonProps,u=t.FormGroupProps,b=t.WrapperProps,y=t.ArrayItemProps,v=t.RemoveButtonProps,P=t.defaultItem,j=t.maxItems,g=t.minItems,_=t.fields,I=t.input,x=t.arrayValidator,A=t.labelText,O=t.buttonLabels,h=t.noItemsMessage,B=t.meta,w=t.validateOnMount,E=_objectSpread({add:"Add",remove:"Remove"},O),T=(B.touched||w)&&!Array.isArray(B.error)&&B.error;return o.createElement(c,r({legendText:A||"",invalid:Boolean(T),message:Boolean(T),messageText:T||""},u,{className:n("ddorg__carbon-field-array-form-group",u.className)}),o.createElement(i,{name:I.name,validate:x},(function(e){return o.createElement("div",b,0===e.fields.length&&h,e.fields.map((function(r,t){return o.createElement(f,{removeText:E.remove,key:t,remove:function remove(){return e.fields.remove(t)},name:r,fields:_,buttonDisabled:g>=e.fields.length,ArrayItemProps:y,RemoveButtonProps:v})})),o.createElement("div",r({},a,{className:n("ddorg__carbon-field-array-add-container",a.className)}),o.createElement(s,r({disabled:e.fields.length>=j,renderIcon:p,id:"add-".concat(I.name),onClick:function onClick(){return e.fields.push(P)}},l,{className:n("ddorg__carbon-field-array-add",l.className)}),E.add)))})))};u.propTypes={noItemsMessage:t.node,maxItems:t.number,minItems:t.number,buttonLabels:t.shape({add:t.node,remove:t.node}),AddContainerProps:t.object,AddButtonProps:t.object,FormGroupProps:t.object,WrapperProps:t.object,ArrayItemProps:t.object,RemoveButtonProps:t.object,defaultItem:t.any,isRequired:t.bool,fields:t.array},u.defaultProps={noItemsMessage:"No items",maxItems:1/0,minItems:0,AddContainerProps:{},AddButtonProps:{},FormGroupProps:{},WrapperProps:{},ArrayItemProps:{},RemoveButtonProps:{}};export default u; | ||
//# sourceMappingURL=field-array.js.map |
@@ -1,2 +0,2 @@ | ||
import"./defineProperty-984bc41a.js";import"@data-driven-forms/react-form-renderer/dist/esm/component-types";import"./extends-4d5fdb5f.js";import"./objectWithoutProperties-85da668a.js";import"react";import"prop-types";import"./clsx.m-a083186a.js";import"carbon-components-react/es/components/Tabs/Tabs.js";import"carbon-components-react/es/components/Tab/Tab.js";import"@data-driven-forms/react-form-renderer/dist/esm/use-form-api";export{default as Tabs}from"./tabs.js";export{default as SubForm}from"./sub-form.js";import"./toConsumableArray-48c131d8.js";import"./typeof-9ba06920.js";import"./slicedToArray-de9f1c8c.js";import"@data-driven-forms/react-form-renderer/dist/esm/wizard-context";import"./_arrayPush-df1e7be1.js";export{default as Wizard}from"./wizard.js";import"@data-driven-forms/react-form-renderer/dist/esm/form-spy";import"carbon-components-react/es/components/Button/Button.js";import"carbon-components-react/es/components/Grid/Column.js";import"carbon-components-react/es/components/Grid/Grid.js";import"carbon-components-react/es/components/Grid/Row.js";import"carbon-components-react/es/components/ProgressIndicator/ProgressIndicator.js";import"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";export{default as Select}from"./select.js";import"./isEqual-a0592893.js";import"carbon-components-react/es/components/Select/Select.js";import"carbon-components-react/es/components/MultiSelect/MultiSelect.js";import"carbon-components-react/es/components/SelectItem/SelectItem.js";import"carbon-components-react/es/components/ComboBox/ComboBox.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import"./prepare-props-c681d64b.js";import"@data-driven-forms/react-form-renderer/dist/esm/field-array";import"carbon-components-react/es/components/FormGroup/FormGroup.js";import"@carbon/icons-react/es/add--alt/32.js";import"@carbon/icons-react/es/subtract/32.js";export{default as FieldArray}from"./field-array.js";import"carbon-components-react/es/components/TextInput/TextInput.js";import"./text-field.js";import"carbon-components-react/es/components/TextArea/TextArea.js";export{default as Textarea}from"./textarea.js";export{default as Checkbox}from"./checkbox.js";import"carbon-components-react/es/components/Checkbox/Checkbox.js";import"./helper-text-block-711c3d01.js";import"carbon-components-react/es/components/RadioButtonGroup/RadioButtonGroup.js";import"carbon-components-react/es/components/RadioButton/RadioButton.js";export{default as Radio}from"./radio.js";import"carbon-components-react/es/components/DatePicker/DatePicker.js";import"carbon-components-react/es/components/DatePickerInput/DatePickerInput.js";export{default as DatePicker}from"./date-picker.js";import"carbon-components-react/es/components/TimePicker/TimePicker.js";import"carbon-components-react/es/components/TimePickerSelect/TimePickerSelect.js";export{default as TimePicker}from"./time-picker.js";import"carbon-components-react/es/components/Toggle/Toggle.js";export{default as Switch}from"./switch.js";export{default as PlainText}from"./plain-text.js";export{default as DualListSelect}from"./dual-list-select.js";import"carbon-components-react/es/components/Search/Search.js";import"carbon-components-react/es/components/TooltipIcon/TooltipIcon.js";import"@carbon/icons-react/es/checkmark--filled/16.js";import"@carbon/icons-react/es/chevron--right/32.js";import"@carbon/icons-react/es/chevron--left/32.js";import"@carbon/icons-react/es/caret--sort--down/32.js";import"@carbon/icons-react/es/caret--sort--up/32.js";import"carbon-components-react/es/components/StructuredList/StructuredList.js";import"carbon-components-react/es/components/Slider/Slider.js";export{default as Slider}from"./slider.js";export{default as componentMapper,components}from"./component-mapper.js";import"carbon-components-react/es/components/Form/Form.js";import"carbon-components-react/es/components/ButtonSet/ButtonSet.js";export{default as FormTemplate}from"./form-template.js"; | ||
import"./defineProperty-984bc41a.js";import"@data-driven-forms/react-form-renderer/dist/esm/component-types";import"./extends-4d5fdb5f.js";import"./objectWithoutProperties-85da668a.js";import"react";import"prop-types";import"./clsx.m-a083186a.js";import"carbon-components-react/es/components/Tabs/Tabs.js";import"carbon-components-react/es/components/Tab/Tab.js";import"@data-driven-forms/react-form-renderer/dist/esm/use-form-api";export{default as Tabs}from"./tabs.js";export{default as SubForm}from"./sub-form.js";import"./toConsumableArray-48c131d8.js";import"./typeof-9ba06920.js";import"./slicedToArray-de9f1c8c.js";import"@data-driven-forms/react-form-renderer/dist/esm/wizard-context";import"./_arrayPush-df1e7be1.js";export{default as Wizard}from"./wizard.js";import"@data-driven-forms/react-form-renderer/dist/esm/form-spy";import"carbon-components-react/es/components/Button/Button.js";import"carbon-components-react/es/components/Grid/Column.js";import"carbon-components-react/es/components/Grid/Grid.js";import"carbon-components-react/es/components/Grid/Row.js";import"carbon-components-react/es/components/ProgressIndicator/ProgressIndicator.js";import"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";export{default as Select}from"./select.js";import"./isEqual-a0592893.js";import"carbon-components-react/es/components/Select/Select.js";import"carbon-components-react/es/components/MultiSelect/MultiSelect.js";import"carbon-components-react/es/components/SelectItem/SelectItem.js";import"carbon-components-react/es/components/ComboBox/ComboBox.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";export{b as buildLabel,p as prepareProps}from"./prepare-props-c0a0d61e.js";import"@data-driven-forms/react-form-renderer/dist/esm/field-array";import"carbon-components-react/es/components/FormGroup/FormGroup.js";import"@carbon/icons-react/es/add--alt/32.js";import"@carbon/icons-react/es/subtract/32.js";export{default as FieldArray}from"./field-array.js";import"carbon-components-react/es/components/TextInput/TextInput.js";import"./text-field.js";import"carbon-components-react/es/components/TextArea/TextArea.js";export{default as Textarea}from"./textarea.js";export{default as Checkbox}from"./checkbox.js";import"carbon-components-react/es/components/Checkbox/Checkbox.js";import"./helper-text-block-711c3d01.js";import"carbon-components-react/es/components/RadioButtonGroup/RadioButtonGroup.js";import"carbon-components-react/es/components/RadioButton/RadioButton.js";export{default as Radio}from"./radio.js";import"carbon-components-react/es/components/DatePicker/DatePicker.js";import"carbon-components-react/es/components/DatePickerInput/DatePickerInput.js";export{default as DatePicker}from"./date-picker.js";import"carbon-components-react/es/components/TimePicker/TimePicker.js";import"carbon-components-react/es/components/TimePickerSelect/TimePickerSelect.js";export{default as TimePicker}from"./time-picker.js";import"carbon-components-react/es/components/Toggle/Toggle.js";export{default as Switch}from"./switch.js";export{default as PlainText}from"./plain-text.js";export{default as DualListSelect}from"./dual-list-select.js";import"carbon-components-react/es/components/Search/Search.js";import"carbon-components-react/es/components/TooltipIcon/TooltipIcon.js";import"@carbon/icons-react/es/checkmark--filled/16.js";import"@carbon/icons-react/es/chevron--right/32.js";import"@carbon/icons-react/es/chevron--left/32.js";import"@carbon/icons-react/es/caret--sort--down/32.js";import"@carbon/icons-react/es/caret--sort--up/32.js";import"carbon-components-react/es/components/StructuredList/StructuredList.js";import"carbon-components-react/es/components/Slider/Slider.js";export{default as Slider}from"./slider.js";export{default as componentMapper,components}from"./component-mapper.js";import"carbon-components-react/es/components/Form/Form.js";import"carbon-components-react/es/components/ButtonSet/ButtonSet.js";export{default as FormTemplate}from"./form-template.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as r}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import t from"react";import n from"prop-types";import p from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c681d64b.js";import s from"carbon-components-react/es/components/FormGroup/FormGroup.js";import{H as i}from"./helper-text-block-711c3d01.js";import c from"carbon-components-react/es/components/RadioButtonGroup/RadioButtonGroup.js";import l from"carbon-components-react/es/components/RadioButton/RadioButton.js";function ownKeys(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,t)}return o}var m=function Radio(n){var m=p(a(function _objectSpread(r){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(t),!0).forEach((function(o){e(r,o,t[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}({type:"radio"},n))),u=m.labelText,d=m.disabled,b=m.input,f=m.options,j=m.FormGroupProps,y=m.helperText,O=m.meta,v=m.validateOnMount,P=o(m,["labelText","disabled","input","options","FormGroupProps","helperText","meta","validateOnMount"]),T=(O.touched||v)&&O.error,h=(O.touched||v)&&O.warning;return t.createElement(s,r({legendText:u},j),t.createElement(c,r({},b,{valueSelected:b.value,disabled:d},P),f.map((function(e){return t.createElement(l,r({key:e.value,disabled:d,labelText:e.label,value:e.value},e))}))),t.createElement(i,{helperText:y,errorText:T,warnText:h}))};m.propTypes={FormGroupProps:n.object,isDisabled:n.bool,label:n.node,isRequired:n.bool,options:n.arrayOf(n.shape({label:n.node,value:n.oneOfType([n.string,n.number])}))};export default m; | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as r}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import t from"react";import n from"prop-types";import p from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c0a0d61e.js";import s from"carbon-components-react/es/components/FormGroup/FormGroup.js";import{H as i}from"./helper-text-block-711c3d01.js";import c from"carbon-components-react/es/components/RadioButtonGroup/RadioButtonGroup.js";import l from"carbon-components-react/es/components/RadioButton/RadioButton.js";function ownKeys(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,t)}return o}var m=function Radio(n){var m=p(a(function _objectSpread(r){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(t),!0).forEach((function(o){e(r,o,t[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}({type:"radio"},n))),u=m.labelText,d=m.disabled,b=m.input,f=m.options,j=m.FormGroupProps,y=m.helperText,O=m.meta,v=m.validateOnMount,P=o(m,["labelText","disabled","input","options","FormGroupProps","helperText","meta","validateOnMount"]),T=(O.touched||v)&&O.error,h=(O.touched||v)&&O.warning;return t.createElement(s,r({legendText:u},j),t.createElement(c,r({},b,{valueSelected:b.value,disabled:d},P),f.map((function(e){return t.createElement(l,r({key:e.value,disabled:d,labelText:e.label,value:e.value},e))}))),t.createElement(i,{helperText:y,errorText:T,warnText:h}))};m.propTypes={FormGroupProps:n.object,isDisabled:n.bool,label:n.node,isRequired:n.bool,options:n.arrayOf(n.shape({label:n.node,value:n.oneOfType([n.string,n.number])}))};export default m; | ||
//# sourceMappingURL=radio.js.map |
@@ -1,2 +0,2 @@ | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as n}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import i,{useRef as a,useEffect as t,useReducer as l,useState as s}from"react";import r from"prop-types";import{_ as c}from"./toConsumableArray-48c131d8.js";import{_ as p}from"./typeof-9ba06920.js";import{_ as d}from"./slicedToArray-de9f1c8c.js";import"./_arrayPush-df1e7be1.js";import u from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import{_ as b}from"./isEqual-a0592893.js";import g from"carbon-components-react/es/components/Select/Select.js";import f from"carbon-components-react/es/components/MultiSelect/MultiSelect.js";import h from"carbon-components-react/es/components/SelectItem/SelectItem.js";import m from"carbon-components-react/es/components/ComboBox/ComboBox.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as v}from"./prepare-props-c681d64b.js";function toVal(e){var n,o,i="";if(e)if("object"==typeof e)if(e.push)for(n=0;n<e.length;n++)e[n]&&(o=toVal(e[n]))&&(i&&(i+=" "),i+=o);else for(n in e)e[n]&&(o=toVal(n))&&(i&&(i+=" "),i+=o);else"boolean"==typeof e||e.call||(i&&(i+=" "),i+=e);return i}function clsx(){for(var e,n=0,o="";n<arguments.length;)(e=toVal(arguments[n++]))&&(o&&(o+=" "),o+=e);return o}var O=function fnToString(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\s+/g," ")};function ownKeys(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var y=function reducer(e,n){var o=n.type,i=n.payload,a=n.options,t=void 0===a?[]:a;switch(o){case"updateOptions":return _objectSpread(_objectSpread({},e),{},{options:i,isLoading:!1,promises:{}});case"loaded":return _objectSpread(_objectSpread({},e),{},{isLoading:!1});case"startLoading":return _objectSpread(_objectSpread({},e),{},{isLoading:!0});case"setOptions":return _objectSpread(_objectSpread({},e),{},{options:i});case"initialLoaded":return _objectSpread(_objectSpread({},e),{},{isInitialLoaded:!0});case"setPromises":return _objectSpread(_objectSpread({},e),{},{promises:_objectSpread(_objectSpread({},e.promises),i),options:[].concat(c(e.options),c(t.filter((function(n){var o=n.value;return!e.options.find((function(e){return e.value===o}))}))))});default:return e}},S=function getSelectValue(e,n,o,i){return n?i.filter((function(n){var i=n.value;return o?e.includes(i):b(i,e)})):e},C=function Select(s){var r=s.invalid,c=s.classNamePrefix,u=s.simpleValue,b=s.isMulti,g=s.pluckSingleValue,f=s.options,h=s.loadOptions,m=s.loadingMessage,v=s.loadingProps,C=(s.selectVariant,s.updatingMessage),M=s.noOptionsMessage,x=s.value,j=s.onChange,T=s.loadOptionsChangeCounter,P=s.SelectComponent,I=s.noValueUpdates,_=o(s,["invalid","classNamePrefix","simpleValue","isMulti","pluckSingleValue","options","loadOptions","loadingMessage","loadingProps","selectVariant","updatingMessage","noOptionsMessage","value","onChange","loadOptionsChangeCounter","SelectComponent","noValueUpdates"]),L=l(y,{isLoading:!1,options:f,promises:{},isInitialLoaded:!1}),D=d(L,2),V=D[0],N=D[1],F=function useIsMounted(){var e=a(!1);return t((function(){return e.current=!0,function(){return e.current=!1}}),[]),e}(),w=function updateOptions(){return N({type:"startLoading"}),h().then((function(e){if(F.current){if(!I)if(x&&Array.isArray(x)){var n=x.filter((function(n){return"object"===p(n)?e.find((function(e){return n.value===e.value})):e.find((function(e){return n===e.value}))}));j(0===n.length?void 0:n)}else x&&!e.find((function(e){return e.value===x}))&&j(void 0);N({type:"updateOptions",payload:e})}}))};t((function(){h&&w(),N({type:"initialLoaded"})}),[]);var E=h?O(h):"";t((function(){E&&V.isInitialLoaded&&w()}),[E,T]),t((function(){V.isInitialLoaded&&(I||!x||f.map((function(e){return e.value})).includes(x)||j(void 0),N({type:"setOptions",payload:f}))}),[f]);var A=function renderNoOptionsMessage(){return Object.values(V.promises).some((function(e){return e}))?function(){return C}:function(){return M}};if(V.isLoading)return i.createElement(P,n({},_,{classNamePrefix:c,isDisabled:!0,isFetching:!0,placeholder:m,options:V.options,onChange:function onChange(){}},v,{noOptionsMessage:A()}));var R=g?b?x:Array.isArray(x)&&x[0]?x[0]:x:x;return i.createElement(P,n({className:clsx(c,{"has-error":r})},_,{isDisabled:_.isDisabled||_.isReadOnly,options:V.options,classNamePrefix:c,isMulti:b,value:S(R,u,b,V.options),onChange:function onChange(e){return function handleSelectChange(e,n,o,i){var a=!e&&o?[]:e;return i(n?o?a.map((function(e){return e.value})):a?a.value:void 0:a)}(e,u,b,j)},onInputChange:function onInputChange(n){n&&h&&void 0===V.promises[n]&&_.isSearchable&&(N({type:"setPromises",payload:e({},n,!0)}),h(n).then((function(o){F.current&&N({type:"setPromises",payload:e({},n,!1),options:o})})).catch((function(o){throw N({type:"setPromises",payload:e({},n,!1)}),o})))},isFetching:Object.values(V.promises).some((function(e){return e})),noOptionsMessage:A(),hideSelectedOptions:!1,closeMenuOnSelect:!b}))};C.propTypes={options:r.array,onChange:r.func,classNamePrefix:r.string,invalid:r.bool,simpleValue:r.bool,isMulti:r.bool,pluckSingleValue:r.bool,value:r.any,placeholder:r.string,loadOptionsChangeCounter:r.number,isDisabled:r.bool,isReadOnly:r.bool,loadOptions:r.func,loadingMessage:r.node,loadingProps:r.object,selectVariant:r.string,updatingMessage:r.node,noOptionsMessage:r.node,isSearchable:r.bool,SelectComponent:r.elementType.isRequired,noValueUpdates:r.bool},C.defaultProps={options:[],invalid:!1,simpleValue:!0,pluckSingleValue:!0,placeholder:"Choose...",isSearchable:!1,isClearable:!1};var M=function multiOnChange(e,n){return function(o){var i=o.selectedItems;return n?e.onChange(i.map((function(e){return e.value}))):e.onChange(i)}},x=function ClearedMultiSelectFilterable(e){var a=e.invalidText,t=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=(e.isFetching,e.invalid,e.isMulti,e.classNamePrefix,e.closeMenuOnSelect,e.onChange,e.originalOnChange),s=e.carbonLabel,r=e.placeholder,c=e.isDisabled,p=o(e,["invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","isMulti","classNamePrefix","closeMenuOnSelect","onChange","originalOnChange","carbonLabel","placeholder","isDisabled"]);return i.createElement(f.Filterable,n({disabled:c},p,{placeholder:s||r,onChange:l,titleText:p.labelText,id:p.name,invalid:Boolean(a),invalidText:a,items:t,initialSelectedItems:Array.isArray(p.value)?p.value:[]}))};x.propTypes={invalidText:r.node,hideSelectedOptions:r.any,noOptionsMessage:r.any,onInputChange:r.func,options:r.array,isFetching:r.bool,invalid:r.oneOfType([r.bool,r.node]),isMulti:r.bool,classNamePrefix:r.any,closeMenuOnSelect:r.any,onChange:r.func,originalOnChange:r.func,carbonLabel:r.node,placeholder:r.node,isRequired:r.bool,isDisabled:r.bool};var j=function ClearedMultiSelect(e){var a=e.invalidText,t=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=(e.isFetching,e.invalid,e.isMulti,e.classNamePrefix,e.closeMenuOnSelect,e.onChange,e.originalOnChange),s=e.carbonLabel,r=e.placeholder,c=e.isDisabled,p=o(e,["invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","isMulti","classNamePrefix","closeMenuOnSelect","onChange","originalOnChange","carbonLabel","placeholder","isDisabled"]);return i.createElement(f,n({disabled:c},p,{label:s||r,onChange:l,titleText:p.labelText,id:p.name,invalid:Boolean(a),invalidText:a,items:t,initialSelectedItems:Array.isArray(p.value)?p.value:[]}))};j.propTypes={invalidText:r.node,hideSelectedOptions:r.any,noOptionsMessage:r.any,onInputChange:r.func,options:r.array,isFetching:r.bool,invalid:r.oneOfType([r.bool,r.node]),isMulti:r.bool,classNamePrefix:r.any,closeMenuOnSelect:r.any,onChange:r.func,originalOnChange:r.func,carbonLabel:r.node,placeholder:r.node,isRequired:r.bool,isDisabled:r.bool};var T=function ClearedSelect(e){e.isSearchable,e.isClearable,e.isDisabled,e.isMulti;var a=e.invalidText,t=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=e.isFetching,s=(e.invalid,e.classNamePrefix,e.closeMenuOnSelect,e.originalOnChange,e.placeholder),r=o(e,["isSearchable","isClearable","isDisabled","isMulti","invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","classNamePrefix","closeMenuOnSelect","originalOnChange","placeholder"]);return i.createElement(g,n({disabled:l},r,{id:r.name,invalid:Boolean(a),invalidText:a}),l&&i.createElement(h,{text:s,value:""}),t.map((function(e,o){return i.createElement(h,n({key:e.value||o,text:e.label},e))})))};T.propTypes={invalidText:r.node,hideSelectedOptions:r.any,noOptionsMessage:r.any,onInputChange:r.func,options:r.array,isFetching:r.bool,invalid:r.oneOfType([r.bool,r.node]),isMulti:r.bool,classNamePrefix:r.any,closeMenuOnSelect:r.any,onChange:r.func,originalOnChange:r.func,carbonLabel:r.node,placeholder:r.node,isDisabled:r.bool,isRequired:r.bool,isSearchable:r.bool,isClearable:r.bool};var P=function ClearedSelectSearchable(e){e.isSearchable,e.isClearable,e.isDisabled,e.isMulti;var a=e.invalidText,t=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=e.isFetching,s=(e.invalid,e.classNamePrefix,e.closeMenuOnSelect,e.originalOnChange),r=e.placeholder,c=e.labelText,p=o(e,["isSearchable","isClearable","isDisabled","isMulti","invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","classNamePrefix","closeMenuOnSelect","originalOnChange","placeholder","labelText"]);return i.createElement(m,n({disabled:l},p,{id:p.name,invalid:Boolean(a),invalidText:a,initialSelectedItem:p.value,items:t,placeholder:r,titleText:c,onChange:s}))};P.propTypes={invalidText:r.node,hideSelectedOptions:r.any,noOptionsMessage:r.any,onInputChange:r.func,options:r.array,isFetching:r.bool,invalid:r.oneOfType([r.bool,r.node]),isMulti:r.bool,classNamePrefix:r.any,closeMenuOnSelect:r.any,onChange:r.func,originalOnChange:r.func,carbonLabel:r.node,placeholder:r.node,isDisabled:r.bool,isRequired:r.bool,isSearchable:r.bool,isClearable:r.bool,labelText:r.string};var I=function Select$1(e){var a=u(v(e)),l=a.isMulti,r=a.isSearchable,c=a.isClearable,p=a.loadOptions,b=a.input,g=a.meta,f=a.validateOnMount,h=a.helperText,m=o(a,["isMulti","isSearchable","isClearable","loadOptions","input","meta","validateOnMount","helperText"]),y=s(0),S=d(y,2),I=S[0],_=S[1],L=O(p);t((function(){_(I+1)}),[L]);var D=r||c,V=l&&D?x:l?j:D?P:T,N=(g.touched||f)&&g.error||"",F=(g.touched||f)&&g.warning||h;return i.createElement(C,n({SelectComponent:V,simpleValue:!1},m,b,{loadOptions:p,invalidText:N,loadOptionsChangeCounter:I,originalOnChange:M(b,m.simpleValue),helperText:F}))};I.propTypes={isDisabled:r.bool,isRequired:r.bool,options:r.arrayOf(r.shape({value:r.oneOfType([r.string,r.number]),label:r.node}))},I.defaultProps={loadingMessage:"Loading..."};export default I;export{M as multiOnChange}; | ||
import{_ as e}from"./defineProperty-984bc41a.js";import{_ as n}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import i,{useRef as a,useEffect as t,useReducer as l,useState as s}from"react";import r from"prop-types";import{_ as c}from"./toConsumableArray-48c131d8.js";import{_ as p}from"./typeof-9ba06920.js";import{_ as d}from"./slicedToArray-de9f1c8c.js";import"./_arrayPush-df1e7be1.js";import u from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import{_ as b}from"./isEqual-a0592893.js";import g from"carbon-components-react/es/components/Select/Select.js";import f from"carbon-components-react/es/components/MultiSelect/MultiSelect.js";import h from"carbon-components-react/es/components/SelectItem/SelectItem.js";import m from"carbon-components-react/es/components/ComboBox/ComboBox.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as v}from"./prepare-props-c0a0d61e.js";function toVal(e){var n,o,i="";if(e)if("object"==typeof e)if(e.push)for(n=0;n<e.length;n++)e[n]&&(o=toVal(e[n]))&&(i&&(i+=" "),i+=o);else for(n in e)e[n]&&(o=toVal(n))&&(i&&(i+=" "),i+=o);else"boolean"==typeof e||e.call||(i&&(i+=" "),i+=e);return i}function clsx(){for(var e,n=0,o="";n<arguments.length;)(e=toVal(arguments[n++]))&&(o&&(o+=" "),o+=e);return o}var O=function fnToString(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\s+/g," ")};function ownKeys(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,i)}return o}function _objectSpread(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(i),!0).forEach((function(o){e(n,o,i[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}var y=function reducer(e,n){var o=n.type,i=n.payload,a=n.options,t=void 0===a?[]:a;switch(o){case"updateOptions":return _objectSpread(_objectSpread({},e),{},{options:i,isLoading:!1,promises:{}});case"loaded":return _objectSpread(_objectSpread({},e),{},{isLoading:!1});case"startLoading":return _objectSpread(_objectSpread({},e),{},{isLoading:!0});case"setOptions":return _objectSpread(_objectSpread({},e),{},{options:i});case"initialLoaded":return _objectSpread(_objectSpread({},e),{},{isInitialLoaded:!0});case"setPromises":return _objectSpread(_objectSpread({},e),{},{promises:_objectSpread(_objectSpread({},e.promises),i),options:[].concat(c(e.options),c(t.filter((function(n){var o=n.value;return!e.options.find((function(e){return e.value===o}))}))))});default:return e}},S=function getSelectValue(e,n,o,i){return n?i.filter((function(n){var i=n.value;return o?e.includes(i):b(i,e)})):e},C=function Select(s){var r=s.invalid,c=s.classNamePrefix,u=s.simpleValue,b=s.isMulti,g=s.pluckSingleValue,f=s.options,h=s.loadOptions,m=s.loadingMessage,v=s.loadingProps,C=(s.selectVariant,s.updatingMessage),M=s.noOptionsMessage,x=s.value,j=s.onChange,T=s.loadOptionsChangeCounter,P=s.SelectComponent,I=s.noValueUpdates,_=o(s,["invalid","classNamePrefix","simpleValue","isMulti","pluckSingleValue","options","loadOptions","loadingMessage","loadingProps","selectVariant","updatingMessage","noOptionsMessage","value","onChange","loadOptionsChangeCounter","SelectComponent","noValueUpdates"]),L=l(y,{isLoading:!1,options:f,promises:{},isInitialLoaded:!1}),D=d(L,2),V=D[0],N=D[1],F=function useIsMounted(){var e=a(!1);return t((function(){return e.current=!0,function(){return e.current=!1}}),[]),e}(),w=function updateOptions(){return N({type:"startLoading"}),h().then((function(e){if(F.current){if(!I)if(x&&Array.isArray(x)){var n=x.filter((function(n){return"object"===p(n)?e.find((function(e){return n.value===e.value})):e.find((function(e){return n===e.value}))}));j(0===n.length?void 0:n)}else x&&!e.find((function(e){return e.value===x}))&&j(void 0);N({type:"updateOptions",payload:e})}}))};t((function(){h&&w(),N({type:"initialLoaded"})}),[]);var E=h?O(h):"";t((function(){E&&V.isInitialLoaded&&w()}),[E,T]),t((function(){V.isInitialLoaded&&(I||!x||f.map((function(e){return e.value})).includes(x)||j(void 0),N({type:"setOptions",payload:f}))}),[f]);var A=function renderNoOptionsMessage(){return Object.values(V.promises).some((function(e){return e}))?function(){return C}:function(){return M}};if(V.isLoading)return i.createElement(P,n({},_,{classNamePrefix:c,isDisabled:!0,isFetching:!0,placeholder:m,options:V.options,onChange:function onChange(){}},v,{noOptionsMessage:A()}));var R=g?b?x:Array.isArray(x)&&x[0]?x[0]:x:x;return i.createElement(P,n({className:clsx(c,{"has-error":r})},_,{isDisabled:_.isDisabled||_.isReadOnly,options:V.options,classNamePrefix:c,isMulti:b,value:S(R,u,b,V.options),onChange:function onChange(e){return function handleSelectChange(e,n,o,i){var a=!e&&o?[]:e;return i(n?o?a.map((function(e){return e.value})):a?a.value:void 0:a)}(e,u,b,j)},onInputChange:function onInputChange(n){n&&h&&void 0===V.promises[n]&&_.isSearchable&&(N({type:"setPromises",payload:e({},n,!0)}),h(n).then((function(o){F.current&&N({type:"setPromises",payload:e({},n,!1),options:o})})).catch((function(o){throw N({type:"setPromises",payload:e({},n,!1)}),o})))},isFetching:Object.values(V.promises).some((function(e){return e})),noOptionsMessage:A(),hideSelectedOptions:!1,closeMenuOnSelect:!b}))};C.propTypes={options:r.array,onChange:r.func,classNamePrefix:r.string,invalid:r.bool,simpleValue:r.bool,isMulti:r.bool,pluckSingleValue:r.bool,value:r.any,placeholder:r.string,loadOptionsChangeCounter:r.number,isDisabled:r.bool,isReadOnly:r.bool,loadOptions:r.func,loadingMessage:r.node,loadingProps:r.object,selectVariant:r.string,updatingMessage:r.node,noOptionsMessage:r.node,isSearchable:r.bool,SelectComponent:r.elementType.isRequired,noValueUpdates:r.bool},C.defaultProps={options:[],invalid:!1,simpleValue:!0,pluckSingleValue:!0,placeholder:"Choose...",isSearchable:!1,isClearable:!1};var M=function multiOnChange(e,n){return function(o){var i=o.selectedItems;return n?e.onChange(i.map((function(e){return e.value}))):e.onChange(i)}},x=function ClearedMultiSelectFilterable(e){var a=e.invalidText,t=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=(e.isFetching,e.invalid,e.isMulti,e.classNamePrefix,e.closeMenuOnSelect,e.onChange,e.originalOnChange),s=e.carbonLabel,r=e.placeholder,c=e.isDisabled,p=o(e,["invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","isMulti","classNamePrefix","closeMenuOnSelect","onChange","originalOnChange","carbonLabel","placeholder","isDisabled"]);return i.createElement(f.Filterable,n({disabled:c},p,{placeholder:s||r,onChange:l,titleText:p.labelText,id:p.name,invalid:Boolean(a),invalidText:a,items:t,initialSelectedItems:Array.isArray(p.value)?p.value:[]}))};x.propTypes={invalidText:r.node,hideSelectedOptions:r.any,noOptionsMessage:r.any,onInputChange:r.func,options:r.array,isFetching:r.bool,invalid:r.oneOfType([r.bool,r.node]),isMulti:r.bool,classNamePrefix:r.any,closeMenuOnSelect:r.any,onChange:r.func,originalOnChange:r.func,carbonLabel:r.node,placeholder:r.node,isRequired:r.bool,isDisabled:r.bool};var j=function ClearedMultiSelect(e){var a=e.invalidText,t=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=(e.isFetching,e.invalid,e.isMulti,e.classNamePrefix,e.closeMenuOnSelect,e.onChange,e.originalOnChange),s=e.carbonLabel,r=e.placeholder,c=e.isDisabled,p=o(e,["invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","isMulti","classNamePrefix","closeMenuOnSelect","onChange","originalOnChange","carbonLabel","placeholder","isDisabled"]);return i.createElement(f,n({disabled:c},p,{label:s||r,onChange:l,titleText:p.labelText,id:p.name,invalid:Boolean(a),invalidText:a,items:t,initialSelectedItems:Array.isArray(p.value)?p.value:[]}))};j.propTypes={invalidText:r.node,hideSelectedOptions:r.any,noOptionsMessage:r.any,onInputChange:r.func,options:r.array,isFetching:r.bool,invalid:r.oneOfType([r.bool,r.node]),isMulti:r.bool,classNamePrefix:r.any,closeMenuOnSelect:r.any,onChange:r.func,originalOnChange:r.func,carbonLabel:r.node,placeholder:r.node,isRequired:r.bool,isDisabled:r.bool};var T=function ClearedSelect(e){e.isSearchable,e.isClearable,e.isDisabled,e.isMulti;var a=e.invalidText,t=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=e.isFetching,s=(e.invalid,e.classNamePrefix,e.closeMenuOnSelect,e.originalOnChange,e.placeholder),r=o(e,["isSearchable","isClearable","isDisabled","isMulti","invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","classNamePrefix","closeMenuOnSelect","originalOnChange","placeholder"]);return i.createElement(g,n({disabled:l},r,{id:r.name,invalid:Boolean(a),invalidText:a}),l&&i.createElement(h,{text:s,value:""}),t.map((function(e,o){return i.createElement(h,n({key:e.value||o,text:e.label},e))})))};T.propTypes={invalidText:r.node,hideSelectedOptions:r.any,noOptionsMessage:r.any,onInputChange:r.func,options:r.array,isFetching:r.bool,invalid:r.oneOfType([r.bool,r.node]),isMulti:r.bool,classNamePrefix:r.any,closeMenuOnSelect:r.any,onChange:r.func,originalOnChange:r.func,carbonLabel:r.node,placeholder:r.node,isDisabled:r.bool,isRequired:r.bool,isSearchable:r.bool,isClearable:r.bool};var P=function ClearedSelectSearchable(e){e.isSearchable,e.isClearable,e.isDisabled,e.isMulti;var a=e.invalidText,t=(e.hideSelectedOptions,e.noOptionsMessage,e.onInputChange,e.options),l=e.isFetching,s=(e.invalid,e.classNamePrefix,e.closeMenuOnSelect,e.originalOnChange),r=e.placeholder,c=e.labelText,p=o(e,["isSearchable","isClearable","isDisabled","isMulti","invalidText","hideSelectedOptions","noOptionsMessage","onInputChange","options","isFetching","invalid","classNamePrefix","closeMenuOnSelect","originalOnChange","placeholder","labelText"]);return i.createElement(m,n({disabled:l},p,{id:p.name,invalid:Boolean(a),invalidText:a,initialSelectedItem:p.value,items:t,placeholder:r,titleText:c,onChange:s}))};P.propTypes={invalidText:r.node,hideSelectedOptions:r.any,noOptionsMessage:r.any,onInputChange:r.func,options:r.array,isFetching:r.bool,invalid:r.oneOfType([r.bool,r.node]),isMulti:r.bool,classNamePrefix:r.any,closeMenuOnSelect:r.any,onChange:r.func,originalOnChange:r.func,carbonLabel:r.node,placeholder:r.node,isDisabled:r.bool,isRequired:r.bool,isSearchable:r.bool,isClearable:r.bool,labelText:r.string};var I=function Select$1(e){var a=u(v(e)),l=a.isMulti,r=a.isSearchable,c=a.isClearable,p=a.loadOptions,b=a.input,g=a.meta,f=a.validateOnMount,h=a.helperText,m=o(a,["isMulti","isSearchable","isClearable","loadOptions","input","meta","validateOnMount","helperText"]),y=s(0),S=d(y,2),I=S[0],_=S[1],L=O(p);t((function(){_(I+1)}),[L]);var D=r||c,V=l&&D?x:l?j:D?P:T,N=(g.touched||f)&&g.error||"",F=(g.touched||f)&&g.warning||h;return i.createElement(C,n({SelectComponent:V,simpleValue:!1},m,b,{loadOptions:p,invalidText:N,loadOptionsChangeCounter:I,originalOnChange:M(b,m.simpleValue),helperText:F}))};I.propTypes={isDisabled:r.bool,isRequired:r.bool,options:r.arrayOf(r.shape({value:r.oneOfType([r.string,r.number]),label:r.node}))},I.defaultProps={loadingMessage:"Loading..."};export default I;export{M as multiOnChange}; | ||
//# sourceMappingURL=select.js.map |
@@ -1,2 +0,2 @@ | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as r}from"./objectWithoutProperties-85da668a.js";import o from"react";import t from"prop-types";import p from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c681d64b.js";import{H as i}from"./helper-text-block-711c3d01.js";import n from"carbon-components-react/es/components/Slider/Slider.js";var m=function Slider(t){var m=p(a(t)),s=m.input,d=m.meta,l=m.isRequired,c=m.validateOnMount,u=m.helperText,f=m.WrapperProps,b=r(m,["input","meta","isRequired","validateOnMount","helperText","WrapperProps"]),x=(d.touched||c)&&d.error,j=(d.touched||c)&&d.warning;return o.createElement("div",f,o.createElement(n,e({},s,{value:Number(s.value)||0,key:s.name,id:s.name,invalid:Boolean(x),min:0,max:100,required:l},b)),o.createElement(i,{helperText:u,errorText:x,warnText:j}))};m.propTypes={isDisabled:t.bool,isRequired:t.bool,label:t.node,labelText:t.node,description:t.node,WrapperProps:t.object};export default m; | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as r}from"./objectWithoutProperties-85da668a.js";import o from"react";import t from"prop-types";import p from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c0a0d61e.js";import{H as i}from"./helper-text-block-711c3d01.js";import n from"carbon-components-react/es/components/Slider/Slider.js";var m=function Slider(t){var m=p(a(t)),s=m.input,d=m.meta,l=m.isRequired,c=m.validateOnMount,u=m.helperText,f=m.WrapperProps,b=r(m,["input","meta","isRequired","validateOnMount","helperText","WrapperProps"]),x=(d.touched||c)&&d.error,j=(d.touched||c)&&d.warning;return o.createElement("div",f,o.createElement(n,e({},s,{value:Number(s.value)||0,key:s.name,id:s.name,invalid:Boolean(x),min:0,max:100,required:l},b)),o.createElement(i,{helperText:u,errorText:x,warnText:j}))};m.propTypes={isDisabled:t.bool,isRequired:t.bool,label:t.node,labelText:t.node,description:t.node,WrapperProps:t.object};export default m; | ||
//# sourceMappingURL=slider.js.map |
@@ -1,2 +0,2 @@ | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import r from"react";import t from"prop-types";import p from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c681d64b.js";import{H as n}from"./helper-text-block-711c3d01.js";import i from"carbon-components-react/es/components/Toggle/Toggle.js";var s=function Switch(t){var s=p(a(t)),m=s.input,l=s.meta,d=s.onText,c=s.offText,f=s.validateOnMount,b=s.helperText,T=s.WrapperProps,x=o(s,["input","meta","onText","offText","validateOnMount","helperText","WrapperProps"]),u=(l.touched||f)&&l.error,j=(l.touched||f)&&l.warning;return r.createElement("div",T,r.createElement(i,e({},m,{key:m.name,id:m.name,labelA:c,labelB:d},x)),r.createElement(n,{helperText:b,errorText:u,warnText:j}))};s.propTypes={isDisabled:t.bool,isReadOnly:t.bool,isRequired:t.bool,label:t.node,labelText:t.node,description:t.node,WrapperProps:t.object};export default s; | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import r from"react";import t from"prop-types";import p from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c0a0d61e.js";import{H as n}from"./helper-text-block-711c3d01.js";import i from"carbon-components-react/es/components/Toggle/Toggle.js";var s=function Switch(t){var s=p(a(t)),m=s.input,l=s.meta,d=s.onText,c=s.offText,f=s.validateOnMount,b=s.helperText,T=s.WrapperProps,x=o(s,["input","meta","onText","offText","validateOnMount","helperText","WrapperProps"]),u=(l.touched||f)&&l.error,j=(l.touched||f)&&l.warning;return r.createElement("div",T,r.createElement(i,e({},m,{key:m.name,id:m.name,labelA:c,labelB:d},x)),r.createElement(n,{helperText:b,errorText:u,warnText:j}))};s.propTypes={isDisabled:t.bool,isReadOnly:t.bool,isRequired:t.bool,label:t.node,labelText:t.node,description:t.node,WrapperProps:t.object};export default s; | ||
//# sourceMappingURL=switch.js.map |
@@ -1,2 +0,2 @@ | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import t from"react";import r from"prop-types";import n from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c681d64b.js";import i from"carbon-components-react/es/components/TextInput/TextInput.js";var p=function TextField(r){var p=n(a(r)),s=p.input,m=p.meta,d=p.validateOnMount,l=o(p,["input","meta","validateOnMount"]),c=(m.touched||d)&&m.error,f=(m.touched||d)&&m.warning;return t.createElement(i,e({},s,{key:s.name,id:s.name,invalid:Boolean(c),invalidText:c||"",warn:Boolean(f),warnText:f||""},l))};p.propTypes={isDisabled:r.bool,isReadOnly:r.bool,isRequired:r.bool,label:r.node,labelText:r.node,description:r.node};export default p; | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import t from"react";import r from"prop-types";import n from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as a}from"./prepare-props-c0a0d61e.js";import i from"carbon-components-react/es/components/TextInput/TextInput.js";var p=function TextField(r){var p=n(a(r)),s=p.input,m=p.meta,d=p.validateOnMount,l=o(p,["input","meta","validateOnMount"]),c=(m.touched||d)&&m.error,f=(m.touched||d)&&m.warning;return t.createElement(i,e({},s,{key:s.name,id:s.name,invalid:Boolean(c),invalidText:c||"",warn:Boolean(f),warnText:f||""},l))};p.propTypes={isDisabled:r.bool,isReadOnly:r.bool,isRequired:r.bool,label:r.node,labelText:r.node,description:r.node};export default p; | ||
//# sourceMappingURL=text-field.js.map |
@@ -1,2 +0,2 @@ | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import r from"react";import t from"prop-types";import a from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as n}from"./prepare-props-c681d64b.js";import p from"carbon-components-react/es/components/TextArea/TextArea.js";var i=function Textarea(t){var i=a(n(t)),s=i.input,m=i.meta,d=i.validateOnMount,l=i.helperText,c=o(i,["input","meta","validateOnMount","helperText"]),f=(m.touched||d)&&m.error,b=(m.touched||d)&&m.warning||l;return r.createElement(p,e({},s,{key:s.name,id:s.name,invalid:Boolean(f),invalidText:f||"",helperText:b},c))};i.propTypes={isDisabled:t.bool,isReadOnly:t.bool,isRequired:t.bool,label:t.node,labelText:t.node,description:t.node,helperText:t.node};export default i; | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as o}from"./objectWithoutProperties-85da668a.js";import r from"react";import t from"prop-types";import a from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as n}from"./prepare-props-c0a0d61e.js";import p from"carbon-components-react/es/components/TextArea/TextArea.js";var i=function Textarea(t){var i=a(n(t)),s=i.input,m=i.meta,d=i.validateOnMount,l=i.helperText,c=o(i,["input","meta","validateOnMount","helperText"]),f=(m.touched||d)&&m.error,u=(m.touched||d)&&m.warning||l;return r.createElement(p,e({},s,{key:s.name,id:s.name,invalid:Boolean(f),invalidText:f||"",helperText:u},c))};i.propTypes={isDisabled:t.bool,isReadOnly:t.bool,isRequired:t.bool,label:t.node,labelText:t.node,description:t.node,helperText:t.node};export default i; | ||
//# sourceMappingURL=textarea.js.map |
@@ -1,2 +0,2 @@ | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as t}from"./objectWithoutProperties-85da668a.js";import o,{useState as r,useRef as n,useEffect as a}from"react";import i from"prop-types";import{_ as l}from"./slicedToArray-de9f1c8c.js";import c from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import s from"carbon-components-react/es/components/SelectItem/SelectItem.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as m}from"./prepare-props-c681d64b.js";import{H as p}from"./helper-text-block-711c3d01.js";import d from"carbon-components-react/es/components/TimePicker/TimePicker.js";import u from"carbon-components-react/es/components/TimePickerSelect/TimePickerSelect.js";var v=function TimePicker(i){var v,f=c(m(i)),b=f.input,h=f.meta,T=f.twelveHoursFormat,x=f.timezones,P=f.validateOnMount,g=f.helperText,j=f.WrapperProps,w=t(f,["input","meta","twelveHoursFormat","timezones","validateOnMount","helperText","WrapperProps"]),S=r(x?null===(v=x[0])||void 0===v?void 0:v.value:""),k=l(S,2),y=k[0],A=k[1],E=r("AM"),M=l(E,2),z=M[0],C=M[1],O=n(!1),R=(h.touched||P)&&h.error,q=(h.touched||P)&&h.warning,B=b.value;if(b.value instanceof Date){var H,N=b.value.toLocaleTimeString("en-us",{hour12:!!T,timeZone:null==x||null===(H=x.find((function(e){return e.value===y})))||void 0===H?void 0:H.showAs}).split(":"),W=l(N,2),D=W[0],F=void 0===D?"00":D,_=W[1],I=void 0===_?"00":_;B="".concat(String(F).padStart(2,"0"),":").concat(String(I).padStart(2,"0"))}var J=function enhnancedOnBlur(){var e,t=(null===(e=B)||void 0===e?void 0:e.split(":"))||[],o=l(t,2),r=o[0],n=void 0===r?"00":r,a=o[1],i=void 0===a?"00":a;n&&!isNaN(n)||(n="00"),i&&!isNaN(i)||(i="00"),T?(n%=12,"PM"===z&&(n+=12)):n%=24,i%=59;var c=new Date("Jan 1 2000 ".concat(n,":").concat(i,":00 ").concat(y));b.onChange(c),b.onBlur()};return a((function(){!0===O.current?J():O.current=!0}),[y,z]),o.createElement("div",j,o.createElement(d,e({},b,{value:B,onBlur:J,key:b.name,id:b.name,invalid:Boolean(R),invalidText:R||""},w),T&&o.createElement(u,{labelText:"Period",id:"".concat(w.id||b.name,"-12h"),onChange:function onChange(e){var t=e.target.value;return C(t)}},o.createElement(s,{value:"AM",text:"AM"}),o.createElement(s,{value:"PM",text:"PM"})),x&&o.createElement(u,{labelText:"Timezone",id:"".concat(w.id||b.name,"-timezones"),onChange:function onChange(e){var t=e.target.value;return A(t)}},x.map((function(r){r.showAs;var n=t(r,["showAs"]);return o.createElement(s,e({key:n.value,text:n.label},n))})))),o.createElement(p,{helperText:!R&&g,warnText:q}))};v.propTypes={isDisabled:i.bool,isReadOnly:i.bool,isRequired:i.bool,label:i.node,labelText:i.node,description:i.node,twelveHoursFormat:i.bool,timezones:i.arrayOf(i.shape({value:i.string.isRequired,label:i.node.isRequired,showAs:i.string.isRequired})),WrapperProps:i.object};export default v; | ||
import"./defineProperty-984bc41a.js";import{_ as e}from"./extends-4d5fdb5f.js";import{_ as t}from"./objectWithoutProperties-85da668a.js";import o,{useState as r,useRef as n,useEffect as a}from"react";import i from"prop-types";import{_ as l}from"./slicedToArray-de9f1c8c.js";import c from"@data-driven-forms/react-form-renderer/dist/esm/use-field-api";import s from"carbon-components-react/es/components/SelectItem/SelectItem.js";import"carbon-components-react/es/components/Tooltip/Tooltip.js";import{p as m}from"./prepare-props-c0a0d61e.js";import{H as p}from"./helper-text-block-711c3d01.js";import d from"carbon-components-react/es/components/TimePicker/TimePicker.js";import u from"carbon-components-react/es/components/TimePickerSelect/TimePickerSelect.js";var v=function TimePicker(i){var v,f=c(m(i)),b=f.input,h=f.meta,T=f.twelveHoursFormat,x=f.timezones,P=f.validateOnMount,g=f.helperText,j=f.WrapperProps,w=t(f,["input","meta","twelveHoursFormat","timezones","validateOnMount","helperText","WrapperProps"]),S=r(x?null===(v=x[0])||void 0===v?void 0:v.value:""),k=l(S,2),y=k[0],A=k[1],E=r("AM"),M=l(E,2),z=M[0],C=M[1],O=n(!1),R=(h.touched||P)&&h.error,q=(h.touched||P)&&h.warning,B=b.value;if(b.value instanceof Date){var H,N=b.value.toLocaleTimeString("en-us",{hour12:!!T,timeZone:null==x||null===(H=x.find((function(e){return e.value===y})))||void 0===H?void 0:H.showAs}).split(":"),W=l(N,2),D=W[0],F=void 0===D?"00":D,_=W[1],I=void 0===_?"00":_;B="".concat(String(F).padStart(2,"0"),":").concat(String(I).padStart(2,"0"))}var J=function enhnancedOnBlur(){var e,t=(null===(e=B)||void 0===e?void 0:e.split(":"))||[],o=l(t,2),r=o[0],n=void 0===r?"00":r,a=o[1],i=void 0===a?"00":a;n&&!isNaN(n)||(n="00"),i&&!isNaN(i)||(i="00"),T?(n%=12,"PM"===z&&(n+=12)):n%=24,i%=59;var c=new Date("Jan 1 2000 ".concat(n,":").concat(i,":00 ").concat(y));b.onChange(c),b.onBlur()};return a((function(){!0===O.current?J():O.current=!0}),[y,z]),o.createElement("div",j,o.createElement(d,e({},b,{value:B,onBlur:J,key:b.name,id:b.name,invalid:Boolean(R),invalidText:R||""},w),T&&o.createElement(u,{labelText:"Period",id:"".concat(w.id||b.name,"-12h"),onChange:function onChange(e){var t=e.target.value;return C(t)}},o.createElement(s,{value:"AM",text:"AM"}),o.createElement(s,{value:"PM",text:"PM"})),x&&o.createElement(u,{labelText:"Timezone",id:"".concat(w.id||b.name,"-timezones"),onChange:function onChange(e){var t=e.target.value;return A(t)}},x.map((function(r){r.showAs;var n=t(r,["showAs"]);return o.createElement(s,e({key:n.value,text:n.label},n))})))),o.createElement(p,{helperText:!R&&g,warnText:q}))};v.propTypes={isDisabled:i.bool,isReadOnly:i.bool,isRequired:i.bool,label:i.node,labelText:i.node,description:i.node,twelveHoursFormat:i.bool,timezones:i.arrayOf(i.shape({value:i.string.isRequired,label:i.node.isRequired,showAs:i.string.isRequired})),WrapperProps:i.object};export default v; | ||
//# sourceMappingURL=time-picker.js.map |
{ | ||
"name": "@data-driven-forms/carbon-component-mapper", | ||
"version": "2.16.2", | ||
"version": "2.17.0", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
334948
144
1547
26