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