"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.MultiLevelSortingOrderSelect = void 0;
exports._MultiLevelSortingOrderSelect = _MultiLevelSortingOrderSelect;
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _designSystem = require("@wix/design-system");
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _react2 = require("@wix/bex-core/react");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/MultiLevelSortingPanel/MultiLevelSortingOrderSelect.tsx";
function _MultiLevelSortingOrderSelect(props) {
  const {
    translate: t
  } = (0, _react2.useWixPatternsContainer)();
  const {
    sortableColumn,
    state
  } = props;
  const options = [(0, _designSystem.listItemSelectBuilder)({
    id: 'asc',
    prefix: /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 29,
        columnNumber: 9
      }
    }, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.ArrowUpSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 30,
        columnNumber: 11
      }
    })),
    title: t('cairo.table.advanced-sorting.ascending.order'),
    label: t('cairo.table.advanced-sorting.ascending.order')
  }), (0, _designSystem.listItemSelectBuilder)({
    id: 'desc',
    prefix: /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 39,
        columnNumber: 9
      }
    }, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.ArrowDownSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 40,
        columnNumber: 11
      }
    })),
    title: t('cairo.table.advanced-sorting.descending.order'),
    label: t('cairo.table.advanced-sorting.descending.order')
  })];
  return /*#__PURE__*/_react.default.createElement(_designSystem.Dropdown, {
    dataHook: "multi-level-sorting-select-order",
    onSelect: ({
      id
    }) => {
      state.changeSortOrder(sortableColumn.columnId, id);
    },
    popoverProps: {
      appendTo: 'window'
    },
    options: options,
    selectedId: sortableColumn.direction,
    size: "small",
    prefix: /*#__PURE__*/_react.default.createElement(_designSystem.Input.IconAffix, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 61,
        columnNumber: 9
      }
    }, sortableColumn.direction === 'asc' ? /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.ArrowUpSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 63,
        columnNumber: 13
      }
    }) : /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.ArrowDownSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 65,
        columnNumber: 13
      }
    })),
    valueParser: option => option.label,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 49,
      columnNumber: 5
    }
  });
}
const MultiLevelSortingOrderSelect = exports.MultiLevelSortingOrderSelect = (0, _mobxReactLite.observer)(_MultiLevelSortingOrderSelect);
//# sourceMappingURL=MultiLevelSortingOrderSelect.js.map