Liferay.Loader.define("@liferay/object-web@1.0.181/js/components/ObjectField/AttachmentFormBase",["module","exports","require","@frontend-taglib-clay$clayui/form","@liferay/object-js-components-web","liferay!frontend-js-react-web$react","../../utils/fieldSettings","./ObjectFieldFormBase.scss"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.AttachmentFormBase=function AttachmentFormBase({disabled:t,error:a,objectFieldSettings:r,objectName:s,setValues:d}){const u=(0,l.normalizeFieldSettings)(r),c=e.find((({value:e})=>e===u.fileSource));return i.default.createElement(i.default.Fragment,null,i.default.createElement(o.SingleSelect,{disabled:t,error:a,label:Liferay.Language.get("request-files"),onChange:({value:e})=>{const t=r.filter((e=>"fileSource"!==e.name&&"showFilesInDocumentsAndMedia"!==e.name&&"storageDLFolderPath"!==e.name));t.push({name:"fileSource",value:e}),"userComputer"===e&&t.push({name:"showFilesInDocumentsAndMedia",value:!1}),d({objectFieldSettings:t})},options:e,required:!0,value:null==c?void 0:c.label}),"userComputer"===u.fileSource&&i.default.createElement(n.default.Group,{className:"lfr-objects__object-field-form-base-container"},i.default.createElement(o.Toggle,{disabled:t,label:Liferay.Language.get("show-files-in-documents-and-media"),name:"showFilesInDocumentsAndMedia",onToggle:e=>{const t=r.filter((e=>"showFilesInDocumentsAndMedia"!==e.name&&"storageDLFolderPath"!==e.name));t.push({name:"showFilesInDocumentsAndMedia",value:e}),e&&t.push({name:"storageDLFolderPath",value:"/".concat(s)}),d({objectFieldSettings:t})},toggled:!!u.showFilesInDocumentsAndMedia,tooltip:Liferay.Language.get("when-activated-users-can-define-a-folder-within-documents-and-media-to-display-the-files-leave-it-unchecked-for-files-to-be-stored-individually-per-entry"),tooltipAlign:"top"})))};var n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/form")),o=a("@liferay/object-js-components-web"),i=_interopRequireDefault(a("liferay!frontend-js-react-web$react")),l=a("../../utils/fieldSettings");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}a("./ObjectFieldFormBase.scss");const e=[{description:Liferay.Language.get("files-can-be-stored-in-an-object-entry-or-in-a-specific-folder-in-documents-and-media"),label:Liferay.Language.get("upload-directly-from-users-computer"),value:"userComputer"},{description:Liferay.Language.get("users-can-upload-or-select-existing-files-from-documents-and-media"),label:Liferay.Language.get("upload-or-select-from-documents-and-media-item-selector"),value:"documentsAndMedia"}]}}));
//# sourceMappingURL=AttachmentFormBase.js.map