Liferay.Loader.define("@liferay/object-web@1.0.181/js/components/ObjectField/DefaultValueFields/PicklistDefaultValueSelect",["module","exports","require","@liferay/object-js-components-web","liferay!frontend-js-react-web$react","../../../utils/defaultValues","../../ListTypeDefinition/utils"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r("@liferay/object-js-components-web"),i=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=r("../../../utils/defaultValues"),o=r("../../ListTypeDefinition/utils");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _default=({creationLanguageId:e,defaultValue:t,error:r,label:l,required:c,setValues:u,values:f})=>{const[s,d]=(0,i.useState)();return(0,i.useEffect)((()=>{f.listTypeDefinitionId&&n.API.getPickListItems(f.listTypeDefinitionId).then((e=>{e.length&&d(e.map((e=>_objectSpread(_objectSpread({},e),{},{name_i18n:(0,o.fixLocaleKeys)(e.name_i18n)}))))}))}),[t,u,f,f.listTypeDefinitionId]),i.default.createElement(i.default.Fragment,null,s&&f.listTypeDefinitionId&&i.default.createElement(n.PicklistEntryBaseField,{creationLanguageId:e,error:r,label:l,onChange:e=>{e&&u({objectFieldSettings:(0,a.getUpdatedDefaultValueFieldSettings)(f,e.key,"inputAsValue")})},picklistItems:s,placeholder:Liferay.Language.get("choose-an-option"),required:c,selectedPicklistItemKey:t}))};t.default=_default}}));
//# sourceMappingURL=PicklistDefaultValueSelect.js.map