Liferay.Loader.define("data-engine-taglib@3.3.53/data_layout_builder/js/components/rules/editor/CalculatorButtonArea.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","data-engine-js-components-web","liferay!frontend-js-react-web$react"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var l=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=_getRequireWildcardCache();if(a&&a.has(e))return a.get(e);var t={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(t,n,r):t[n]=e[n]}t.default=e,a&&a.set(e,t);return t}(t("@frontend-taglib-clay$clayui/button")),n=t("@frontend-taglib-clay$clayui/drop-down"),r=t("data-engine-js-components-web"),o=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(t("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}const e=["1","2","3","4","5","6","7","8","9"],i=[{label:Liferay.Language.get("add"),value:"+"},{label:Liferay.Language.get("divide"),value:"/"},{label:Liferay.Language.get("multiply"),value:"*"},{label:Liferay.Language.get("subtract"),value:"-"}],u={BACKSPACE:"Backspace",LITERAL:r.Token.LITERAL,OPERATOR:r.Token.OPERATOR,PARENTHESIS_LEFT:r.Token.LEFT_PARENTHESIS,PARENTHESIS_RIGHT:r.Token.RIGHT_PARENTHESIS};var c=function CalculatorButtonArea({disableDot:a,disableFunctions:t,disableNumbers:r,disableOperators:c,functions:d,onClick:s,onFunctionSelected:f}){return o.default.createElement("div",{className:"calculator-button-area"},o.default.createElement("div",{className:"calculator-buttons calculator-buttons-numbers"},o.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("backspace"),className:"border-top-left calculator-button",displayType:"secondary",onClick:()=>s({tokenType:u.BACKSPACE,tokenValue:"backspace"}),symbol:"angle-left",title:Liferay.Language.get("backspace")}),o.default.createElement(l.default,{"aria-label":Liferay.Language.get("left-parenthesis"),className:"calculator-button",disabled:r,displayType:"secondary",monospaced:!0,onClick:()=>s({tokenType:u.PARENTHESIS_LEFT,tokenValue:"("}),title:Liferay.Language.get("left-parenthesis")},"("),o.default.createElement(l.default,{"aria-label":Liferay.Language.get("right-parenthesis"),className:"border-top-right calculator-button",disabled:r,displayType:"secondary",monospaced:!0,onClick:()=>s({tokenType:u.PARENTHESIS_RIGHT,tokenValue:")"}),title:Liferay.Language.get("right-parenthesis")},")"),e.map((e=>o.default.createElement(l.default,{className:"calculator-button",disabled:r,displayType:"secondary",key:e,monospaced:!0,onClick:()=>s({tokenType:u.LITERAL,tokenValue:e})},e))),o.default.createElement(l.default,{"aria-label":Liferay.Language.get("zero"),className:"border-bottom-left button-two-columns calculator-button",disabled:r,displayType:"secondary",monospaced:!0,onClick:()=>s({tokenType:u.LITERAL,tokenValue:"0"})},"0"),o.default.createElement(l.default,{"aria-label":Liferay.Language.get("period"),className:"border-bottom-right calculator-button",disabled:a||r,displayType:"secondary",monospaced:!0,onClick:()=>s({tokenType:u.LITERAL,tokenValue:"."})},".")),o.default.createElement("div",{className:"calculator-buttons calculator-buttons-operators"},o.default.createElement("div",{className:"btn-group-vertical",role:"group"},o.default.createElement(n.ClayDropDownWithItems,{className:"dropdown-action",items:d.map((e=>({label:e.label,onClick:()=>f(e)}))),trigger:o.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("actions"),className:"calculator-add-operator-button-area",disabled:t,symbol:"ellipsis-v",title:Liferay.Language.get("actions")})}),i.map((({label:e,value:a})=>o.default.createElement(l.default,{"aria-label":e,className:"calculator-button",disabled:c,displayType:"secondary",key:e,monospaced:!0,onClick:()=>s({tokenType:u.OPERATOR,tokenValue:a})},a))))))};a.default=c}}));
//# sourceMappingURL=CalculatorButtonArea.es.js.map