text: /**
   * @license
   * Copyright Akveo. All Rights Reserved.
   * Licensed under the MIT License. See License.txt in the project root for license information.
   */
  var __rest = (this && this.__rest) || function (s, e) {
      var t = {};
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
          t[p] = s[p];
      if (s != null && typeof Object.getOwnPropertySymbols === "function")
          for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
              if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                  t[p[i]] = s[p[i]];
          }
      return t;
  };
  import React from 'react';
  import { StyleSheet } from 'react-native';
  import { styled, } from '../../theme';
  import { Menu, } from '../menu/menu.component';
  import { Popover, } from '../popover/popover.component';
  /**
   * `OverflowMenu` renders vertical list of menu items in a modal.
   *
   * @extends React.Component
   *
   * @property {React.ReactElement<any>} children - Determines the element above
   * which the menu will be rendered.
   *
   * @property {boolean} visible - determines the visibility of the component.
   *
   * @property {OverflowMenuItemType[]} data - Determines menu items.
   *
   * @property {number} selectedIndex - Determines the index of currently selected item.
   *
   * @property {(index: number, event: GestureResponderEvent) => void} onSelect - Fires when selected item is changed.
   *
   * @property Omit<PopoverProps, 'content'>
   *
   * @property Override<MenuProps, { data: OverflowMenuItemType[] }>
   *
   * @property ModalPresentingBased
   *
   * @property StyledComponentProps
   *
   * @overview-example Simple Usage
   *
   * ```
   * import React from 'react';
   * import { OverflowMenu, Button } from '../..';
   *
   * export class OverflowMenuShowcase extends React.Component {
   *
   *   data = [
   *     { title: 'Menu Item 1' },
   *     { title: 'Menu Item 2' },
   *     { title: 'Menu Item 3' },
   *   ];
   *
   *   state = {
   *     menuVisible: false,
   *     selectedIndex: null,
   *   };
   *
   *   onItemSelect = (selectedIndex) => {
   *     this.setState({ selectedIndex });
   *   };
   *
   *   toggleMenu = () => {
   *     const menuVisible = !this.state.menuVisible;
   *     this.setState({ menuVisible });
   *   };
   *
   *   render() {
   *     return (
   *       <OverflowMenu
   *         data={this.data}
   *         visible={this.state.menuVisible}
   *         selectedIndex={this.state.selectedIndex}
   *         onSelect={this.onItemSelect}
   *         onBackdropPress={this.toggleMenu}>
   *         <Button onPress={this.toggleMenu}>TOGGLE MENU/Button>
   *       </OverflowMenu>
   *     );
   *   }
   * }
   * ```
   *
   * @overview-example With Icons
   *
   * ```
   * // IMPORTANT: To use Icon component make sure to follow this guide:
   * // https://akveo.github.io/react-native-ui-kitten/docs/guides/eva-icons
   *
   * import React from 'react';
   * import { OverflowMenu, Button, Icon } from '../..';
   *
   * const StarIcon = (style) => (
   *   <Icon {...style} name='star' />
   * );
   *
   * export class OverflowMenuShowcase extends React.Component {
   *
   *   data = [
   *     { title: 'Menu Item 1', icon: StarIcon },
   *     { title: 'Menu Item 2', icon: StarIcon },
   *     { title: 'Menu Item 3', icon: StarIcon },
   *   ];
   *
   *   state = {
   *     menuVisible: false,
   *     selectedIndex: null,
   *   };
   *
   *   onItemSelect = (selectedIndex) => {
   *     this.setState({ selectedIndex });
   *   };
   *
   *   toggleMenu = () => {
   *     const menuVisible = !this.state.menuVisible;
   *     this.setState({ menuVisible });
   *   };
   *
   *   render() {
   *     return (
   *       <OverflowMenu
   *         data={this.data}
   *         visible={this.state.menuVisible}
   *         selectedIndex={this.state.selectedIndex}
   *         onSelect={this.onItemSelect}
   *         onBackdropPress={this.toggleMenu}>
   *         <Button onPress={this.toggleMenu}>TOGGLE MENU</Button>
   *       </OverflowMenu>
   *     );
   *   }
   * }
   * ```
   *
   * @example Disabled Item
   *
   * ```
   * import React from 'react';
   * import { OverflowMenu, Button } from '../..';
   *
   * export class OverflowMenuShowcase extends React.Component {
   *
   *   data = [
   *     { title: 'Menu Item 1' },
   *     { title: 'Menu Item 2', disabled: true },
   *     { title: 'Menu Item 3' },
   *   ];
   *
   *   state = {
   *     menuVisible: false,
   *     selectedIndex: null,
   *   };
   *
   *   onItemSelect = (selectedIndex) => {
   *     this.setState({ selectedIndex });
   *   };
   *
   *   toggleMenu = () => {
   *     const menuVisible = !this.state.menuVisible;
   *     this.setState({ menuVisible });
   *   };
   *
   *   render() {
   *     return (
   *       <OverflowMenu
   *         data={this.data}
   *         visible={this.state.menuVisible}
   *         selectedIndex={this.state.selectedIndex}
   *         onSelect={this.onItemSelect}
   *         onBackdropPress={this.toggleMenu}>
   *         <Button onPress={this.toggleMenu}>TOGGLE MENU</Button>
   *       </OverflowMenu>
   *     );
   *   }
   * }
   * ```
   *
   * @example Without Divider
   *
   * ```
   * import React from 'react';
   * import { OverflowMenu, Button } from '../..';
   *
   * export class OverflowMenuShowcase extends React.Component {
   *
   *   data = [
   *     { title: 'Menu Item 1' },
   *     { title: 'Menu Item 2' },
   *     { title: 'Menu Item 3' },
   *   ];
   *
   *   state = {
   *     menuVisible: false,
   *     selectedIndex: null,
   *   };
   *
   *   onItemSelect = (selectedIndex) => {
   *     this.setState({ selectedIndex });
   *   };
   *
   *   toggleMenu = () => {
   *     const menuVisible = !this.state.menuVisible;
   *     this.setState({ menuVisible });
   *   };
   *
   *   render() {
   *     return (
   *       <OverflowMenu
   *         appearance='noDivider'
   *         data={this.data}
   *         visible={this.state.menuVisible}
   *         selectedIndex={this.state.selectedIndex}
   *         onSelect={this.onItemSelect}
   *         onBackdropPress={this.toggleMenu}>
   *         <Button onPress={this.toggleMenu}>TOGGLE MENU</Button>
   *       </OverflowMenu>
   *     );
   *   }
   * }
   * ```
   *
   * @example Using Asset Icons
   *
   * ```
   * import React from 'react';
   * import { Image } from 'react-native';
   * import { OverflowMenu, Button } from '../..';
   *
   * const StarIcon = (style) => (
   *   <Image style={style} source={require('path-to-assets/local-image.png')} />
   * );
   *
   * export class OverflowMenuShowcase extends React.Component {
   *
   *   data = [
   *     { title: 'Menu Item 1', icon: StarIcon },
   *     { title: 'Menu Item 2', icon: StarIcon },
   *     { title: 'Menu Item 3', icon: StarIcon },
   *   ];
   *
   *   state = {
   *     menuVisible: false,
   *     selectedIndex: null,
   *   };
   *
   *   onItemSelect = (selectedIndex) => {
   *     this.setState({ selectedIndex });
   *   };
   *
   *   toggleMenu = () => {
   *     const menuVisible = !this.state.menuVisible;
   *     this.setState({ menuVisible });
   *   };
   *
   *   render() {
   *     return (
   *       <OverflowMenu
   *         data={this.data}
   *         visible={this.state.menuVisible}
   *         selectedIndex={this.state.selectedIndex}
   *         onSelect={this.onItemSelect}
   *         onBackdropPress={this.toggleMenu}>
   *         <Button onPress={this.toggleMenu}>TOGGLE MENU</Button>
   *       </OverflowMenu>
   *     );
   *   }
   * }
   * ```
   */
  class OverflowMenuComponent extends React.Component {
      constructor() {
          super(...arguments);
          this.getComponentStyle = (source) => {
              const { indicatorBackgroundColor } = source, containerParameters = __rest(source, ["indicatorBackgroundColor"]);
              return {
                  container: containerParameters,
                  indicator: {
                      backgroundColor: indicatorBackgroundColor,
                  },
              };
          };
          this.renderPopoverContentElement = (style) => {
              const _a = this.props, { themedStyle, indicatorStyle, children, data } = _a, restProps = __rest(_a, ["themedStyle", "indicatorStyle", "children", "data"]);
              return (<Menu {...restProps} data={data} style={[styles.menu, style]} initialNumToRender={data.length} bounces={false}/>);
          };
      }
      render() {
          const _a = this.props, { themedStyle, style, indicatorStyle, children, appearance } = _a, restProps = __rest(_a, ["themedStyle", "style", "indicatorStyle", "children", "appearance"]);
          const { container, indicator } = this.getComponentStyle(themedStyle);
          const contentElement = this.renderPopoverContentElement(container);
          return (<Popover {...restProps} style={[styles.container, style]} indicatorStyle={[indicator, indicatorStyle]} content={contentElement}>
          {children}
        </Popover>);
      }
  }
  OverflowMenuComponent.styledComponentName = 'OverflowMenu';
  OverflowMenuComponent.defaultProps = {
      indicatorOffset: 12,
  };
  const styles = StyleSheet.create({
      container: {
          overflow: 'hidden',
      },
      menu: {
          flexGrow: 0,
      },
  });
  export const OverflowMenu = styled(OverflowMenuComponent);
  //# sourceMappingURL=overflowMenu.component.js.map