Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.152/Validation/SelectDateType",["module","exports","require","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/tooltip","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r("@frontend-taglib-clay$clayui/drop-down"),l=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("@frontend-taglib-clay$clayui/icon")),n=r("@frontend-taglib-clay$clayui/tooltip"),o=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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=a?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(r,l,n):r[l]=e[l]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));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 a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}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=({dateFieldName:e,dateFieldOptions:t,label:r,onChange:i,options:d,tooltip:c,type:u})=>{const f=(0,o.useMemo)((()=>{if("dateField"===u){var r;const a=t.find((({name:t})=>e===t));return null!==(r=null==a?void 0:a.label)&&void 0!==r?r:"Response Date"}const a=null==d?void 0:d.find((({value:e})=>e===u));return null==a?void 0:a.label}),[e,u,t,d]),s=[...d.map((e=>_objectSpread(_objectSpread({},e),{},{onClick:()=>i(e.value)})))];t.length&&s.push({type:"divider"},{items:t.map((e=>_objectSpread(_objectSpread({},e),{},{onClick:()=>{i("dateField",e.name)}}))),label:Liferay.Language.get("date-fields"),type:"group"});const p=o.default.createElement("div",{className:"form-builder-select-field input-group-container"},o.default.createElement("div",{className:"form-control results-chosen select-field-trigger"},o.default.createElement("div",{className:"option-selected"},f),o.default.createElement("a",{className:"select-arrow-down-container"},o.default.createElement(l.default,{symbol:"caret-double"}))));return o.default.createElement("div",{className:"ddm__validation-date-start-end"},o.default.createElement("div",{className:"ddm__validation-date-start-end-label"},o.default.createElement("label",null,r),c&&o.default.createElement(n.ClayTooltipProvider,null,o.default.createElement("div",{"data-tooltip-align":"top",title:c},o.default.createElement(l.default,{className:"ddm__validation-date-start-end-icon",symbol:"question-circle-full"})))),o.default.createElement(a.ClayDropDownWithItems,{items:s,menuElementAttrs:{className:"ddm-select-dropdown"},trigger:p}))};t.default=_default}}));
//# sourceMappingURL=SelectDateType.js.map