/**
 * @fileoverview added by tsickle
 * Generated from: action-menu/action-menu.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { __assign, __read, __spread } from "tslib";
/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { Component, Input } from '@angular/core';
import { ActionStyling, ActionType, TextIcon } from '../common/interfaces';
import { CommonUtil } from '../utils';
/**
 * To add default values to configs if they are not provided by the caller in the input config
 * @param {?=} cfg
 * @return {?}
 */
export function getDefaultActionDisplayConfig(cfg) {
    if (cfg === void 0) { cfg = {}; }
    /** @type {?} */
    var defaults = {
        contextual: {
            featuredCount: 0,
            styling: ActionStyling.INLINE,
            buttonContents: TextIcon.TEXT,
        },
        staticActionStyling: ActionStyling.INLINE,
    };
    return __assign(__assign({}, defaults), cfg);
}
/**
 * Renders actions in screens containing grids, cards and details container screens
 * R is the type of selected entity on which the action will be performed
 * T is the type of custom data passed to action handler methods
 * @template R, T
 */
var ActionMenuComponent = /** @class */ (function () {
    function ActionMenuComponent() {
        this._actions = [];
        /**
         * When there are no nested actions and if none of the contextual actions are marked to be featured, they are shown inline
         */
        this.shouldDisplayContextualActionsDropdown = false;
        this._actionDisplayConfig = getDefaultActionDisplayConfig();
        this.calculateActionsAvailability = true;
        /**
         * Text Content of the action menu dropdown trigger button. Used when {\@link #actionDisplayConfig} styling is
         * {\@link ActionStyling.DROPDOWN}
         */
        this.dropdownTriggerBtnText = null;
        this.inlineDropdownTriggerBtnText = 'vcd.cc.action.menu.actions';
        /**
         * Icon of the action menu dropdown trigger button. Used when {\@link #actionDisplayConfig} styling is
         * {\@link ActionStyling.DROPDOWN}
         */
        this.dropdownTriggerBtnIcon = null;
        /**
         * The direction in which the nested drop downs open. {\@link DropdownComponent.nestedDropdownPosition}
         */
        this.nestedDropdownPosition = 'right-top';
        /**
         * If a icon should be displayed inside contextual buttons
         */
        this.shouldShowIcon = (TextIcon.ICON & this.actionDisplayConfig.contextual.buttonContents) === TextIcon.ICON;
        /**
         * If a text should be displayed inside contextual buttons
         */
        this.shouldShowText = (TextIcon.TEXT & this.actionDisplayConfig.contextual.buttonContents) === TextIcon.TEXT;
        /**
         * If the contextual buttons with icons should have a tooltip
         */
        this.shouldShowTooltip = this.actionDisplayConfig.contextual.buttonContents === TextIcon.ICON;
        /**
         * Used in the html template
         */
        this.actionStyling = ActionStyling;
        /**
         * Used as {\@link ngForTrackBy} input value when iterating over action lists {\@link DropdownComponent.trackByFunction}
         * Without this method as input for ngForTrackBy, the dropdown gets rendered off screen
         */
        this.actionsTrackBy = (/**
         * @param {?} index
         * @param {?} item
         * @return {?}
         */
        function (index, item) {
            return item.textKey;
        });
    }
    Object.defineProperty(ActionMenuComponent.prototype, "actions", {
        get: /**
         * @return {?}
         */
        function () {
            return getDeepCopyOfActionItems(this._actions);
        },
        /**
         * List of actions containing both static and contextual that are given by the calling component
         */
        set: /**
         * List of actions containing both static and contextual that are given by the calling component
         * @param {?} actions
         * @return {?}
         */
        function (actions) {
            if (!actions) {
                return;
            }
            /** @type {?} */
            var copyOfActions = getDeepCopyOfActionItems(actions);
            /** @type {?} */
            var hasNestedActions = copyOfActions.some((/**
             * @param {?} action
             * @return {?}
             */
            function (action) { return action.children; }));
            /** @type {?} */
            var markUnmarkedActionsAsContextual = hasNestedActions ||
                this.getFlattenedActionList(copyOfActions, ActionType.CONTEXTUAL_FEATURED)
                    .some((/**
                 * @param {?} action
                 * @return {?}
                 */
                function (action) { return action.actionType && action.actionType === ActionType.CONTEXTUAL_FEATURED; }));
            this._actions = copyOfActions.map((/**
             * @param {?} action
             * @return {?}
             */
            function (action) {
                if (!action.actionType) {
                    if (markUnmarkedActionsAsContextual) {
                        action.actionType = ActionType.CONTEXTUAL;
                    }
                    else {
                        action.actionType = ActionType.CONTEXTUAL_FEATURED;
                    }
                }
                return action;
            }));
            this.shouldDisplayContextualActionsDropdown = hasNestedActions ||
                this._actions.some((/**
                 * @param {?} action
                 * @return {?}
                 */
                function (action) { return action.actionType === ActionType.CONTEXTUAL; }));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ActionMenuComponent.prototype, "extensionEntityActions", {
        /**
         * Used by the {@link EntityActionExtensionComponentsDirective} to provide the extension actions from plugins after
         * they are created asynchronously
         * @param val List of extension actions
         */
        set: /**
         * Used by the {\@link EntityActionExtensionComponentsDirective} to provide the extension actions from plugins after
         * they are created asynchronously
         * @param {?} val List of extension actions
         * @return {?}
         */
        function (val) {
            this._extensionEntityActions = val;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ActionMenuComponent.prototype, "actionDisplayConfig", {
        get: /**
         * @return {?}
         */
        function () {
            return this._actionDisplayConfig;
        },
        /**
         * Display configuration of both static and contextual actions
         * If null or undefined is passed, default config {@link _actionDisplayConfig} is used
         */
        set: /**
         * Display configuration of both static and contextual actions
         * If null or undefined is passed, default config {\@link _actionDisplayConfig} is used
         * @param {?} config
         * @return {?}
         */
        function (config) {
            this._actionDisplayConfig = getDefaultActionDisplayConfig(config || {});
            /** @type {?} */
            var buttonContents = this.actionDisplayConfig.contextual.buttonContents;
            this.shouldShowIcon = (TextIcon.ICON & buttonContents) === TextIcon.ICON;
            this.shouldShowText = (TextIcon.TEXT & buttonContents) === TextIcon.TEXT;
            this.shouldShowTooltip = buttonContents === TextIcon.ICON;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Returns the actions to be shown
     */
    /**
     * Returns the actions to be shown
     * @param {?} actions
     * @return {?}
     */
    ActionMenuComponent.prototype.getAvailableActions = /**
     * Returns the actions to be shown
     * @param {?} actions
     * @return {?}
     */
    function (actions) {
        var _this = this;
        if (!this.calculateActionsAvailability) {
            return actions;
        }
        return actions.filter((/**
         * @param {?} action
         * @return {?}
         */
        function (action) {
            /** @type {?} */
            var isActionAvailable = _this.isActionAvailable(action);
            if (isActionAvailable && action.children && action.children.length) {
                action.children = _this.getAvailableActions(action.children);
            }
            return isActionAvailable;
        }));
    };
    /**
     * An action whose availability is false but has the disabled state set to true is still shown on the screen in
     * disabled mode
     */
    /**
     * An action whose availability is false but has the disabled state set to true is still shown on the screen in
     * disabled mode
     * @private
     * @param {?} action
     * @return {?}
     */
    ActionMenuComponent.prototype.isActionAvailable = /**
     * An action whose availability is false but has the disabled state set to true is still shown on the screen in
     * disabled mode
     * @private
     * @param {?} action
     * @return {?}
     */
    function (action) {
        return !action.availability || action.availability(this.selectedEntities) || this.isActionDisabled(action);
    };
    Object.defineProperty(ActionMenuComponent.prototype, "staticActions", {
        /**
         * List of only the actions that are marked as {@link ActionType.STATIC}
         */
        get: /**
         * List of only the actions that are marked as {\@link ActionType.STATIC}
         * @return {?}
         */
        function () {
            /** @type {?} */
            var staticActions = this.actions.filter((/**
             * @param {?} action
             * @return {?}
             */
            function (action) { return action.actionType === ActionType.STATIC; }));
            return this.getAvailableActions(staticActions);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ActionMenuComponent.prototype, "staticFeaturedActions", {
        /**
         * List of only the actions that are marked as {@link ActionType.STATIC_FEATURED}
         */
        get: /**
         * List of only the actions that are marked as {\@link ActionType.STATIC_FEATURED}
         * @return {?}
         */
        function () {
            /** @type {?} */
            var staticFeaturedActions = this.actions.filter((/**
             * @param {?} action
             * @return {?}
             */
            function (action) { return action.actionType === ActionType.STATIC_FEATURED; }));
            return this.getAvailableActions(staticFeaturedActions);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ActionMenuComponent.prototype, "staticDropdownActions", {
        /**
         * List containing all the static actions. It has static featured actions in the beginning of the list followed by
         * non-featured static actions as children of grouped action called 'vcd.cc.action.menu.all.actions'
         */
        get: /**
         * List containing all the static actions. It has static featured actions in the beginning of the list followed by
         * non-featured static actions as children of grouped action called 'vcd.cc.action.menu.all.actions'
         * @return {?}
         */
        function () {
            return this.staticFeaturedActions.concat([
                { textKey: 'vcd.cc.action.menu.all.actions', children: this.staticActions },
            ]);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ActionMenuComponent.prototype, "contextualFeaturedActions", {
        /**
         * Actions that depend on selected entities and belong to main menu list. The returned list length is less than the
         * configured featured count in {@link actionDisplayConfig}
         */
        get: /**
         * Actions that depend on selected entities and belong to main menu list. The returned list length is less than the
         * configured featured count in {\@link actionDisplayConfig}
         * @return {?}
         */
        function () {
            var _a;
            if (this.calculateActionsAvailability && !((_a = this.selectedEntities) === null || _a === void 0 ? void 0 : _a.length)) {
                return [];
            }
            /** @type {?} */
            var flattenedFeaturedActionList = this.getFlattenedActionList(this.actions, ActionType.CONTEXTUAL_FEATURED);
            /** @type {?} */
            var availableFeaturedActions = this.getAvailableActions(flattenedFeaturedActionList);
            return this.actionDisplayConfig.contextual.featuredCount
                ? availableFeaturedActions.slice(0, this.actionDisplayConfig.contextual.featuredCount)
                : availableFeaturedActions;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Extracts the nested actions that are marked as featured and returns them as part of a flat list
     */
    /**
     * Extracts the nested actions that are marked as featured and returns them as part of a flat list
     * @private
     * @param {?} actions
     * @param {?} actionType
     * @return {?}
     */
    ActionMenuComponent.prototype.getFlattenedActionList = /**
     * Extracts the nested actions that are marked as featured and returns them as part of a flat list
     * @private
     * @param {?} actions
     * @param {?} actionType
     * @return {?}
     */
    function (actions, actionType) {
        var _this = this;
        /** @type {?} */
        var featuredActions = [];
        actions.forEach((/**
         * @param {?} action
         * @return {?}
         */
        function (action) {
            if (action.children && action.children.length) {
                featuredActions = featuredActions.concat(_this.getFlattenedActionList(action.children, actionType));
            }
            else if (action.actionType === actionType) {
                featuredActions.push(action);
            }
        }));
        return featuredActions;
    };
    Object.defineProperty(ActionMenuComponent.prototype, "contextualActions", {
        /**
         * Actions that depend on selected entities but belong to sub menu
         */
        get: /**
         * Actions that depend on selected entities but belong to sub menu
         * @return {?}
         */
        function () {
            var _a;
            if (this.calculateActionsAvailability && !((_a = this.selectedEntities) === null || _a === void 0 ? void 0 : _a.length)) {
                return [];
            }
            /** @type {?} */
            var contextualActions = this.actions.filter((/**
             * @param {?} action
             * @return {?}
             */
            function (action) {
                return !action.actionType ||
                    (action.actionType !== ActionType.STATIC_FEATURED && action.actionType !== ActionType.STATIC);
            }));
            /** @type {?} */
            var availableContextualActions = this.getAvailableActions(contextualActions);
            if (this._extensionEntityActions) {
                availableContextualActions.push.apply(availableContextualActions, __spread(this._extensionEntityActions));
            }
            return availableContextualActions;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Execute the {@link ActionItem.handler} function by passing it {@link #selectedEntities} and
     * {@link ActionItem.handlerData} as arguments
     */
    /**
     * Execute the {\@link ActionItem.handler} function by passing it {\@link #selectedEntities} and
     * {\@link ActionItem.handlerData} as arguments
     * @param {?} action
     * @return {?}
     */
    ActionMenuComponent.prototype.runActionHandler = /**
     * Execute the {\@link ActionItem.handler} function by passing it {\@link #selectedEntities} and
     * {\@link ActionItem.handlerData} as arguments
     * @param {?} action
     * @return {?}
     */
    function (action) {
        if (action.handler) {
            action.handler(this.selectedEntities, action.handlerData);
        }
    };
    /**
     * To disable a displayed action
     */
    /**
     * To disable a displayed action
     * @param {?} action
     * @return {?}
     */
    ActionMenuComponent.prototype.isActionDisabled = /**
     * To disable a displayed action
     * @param {?} action
     * @return {?}
     */
    function (action) {
        return (/** @type {?} */ ((CommonUtil.isFunction(action.disabled) ? action.disabled(this.selectedEntities) : action.disabled)));
    };
    /**
     * To show or hide the container elements containing inline and also dropdown actions
     */
    /**
     * To show or hide the container elements containing inline and also dropdown actions
     * @param {?} style
     * @return {?}
     */
    ActionMenuComponent.prototype.shouldDisplayActions = /**
     * To show or hide the container elements containing inline and also dropdown actions
     * @param {?} style
     * @return {?}
     */
    function (style) {
        return (this.shouldDisplayStaticFeaturedActions(style) ||
            this.shouldDisplayStaticActions(style) ||
            this.shouldDisplayContextualActions(style));
    };
    /**
     * To show or hide {@link ActionType.STATIC_FEATURED} actions in inline actions container
     */
    /**
     * To show or hide {\@link ActionType.STATIC_FEATURED} actions in inline actions container
     * @param {?} style
     * @return {?}
     */
    ActionMenuComponent.prototype.shouldDisplayStaticFeaturedActions = /**
     * To show or hide {\@link ActionType.STATIC_FEATURED} actions in inline actions container
     * @param {?} style
     * @return {?}
     */
    function (style) {
        return (this.staticFeaturedActions &&
            this.staticFeaturedActions.length &&
            this.actionDisplayConfig.staticActionStyling === style);
    };
    /**
     * To show or hide {@link ActionType.STATIC} actions in inline or dropdown action containers
     */
    /**
     * To show or hide {\@link ActionType.STATIC} actions in inline or dropdown action containers
     * @param {?} style
     * @return {?}
     */
    ActionMenuComponent.prototype.shouldDisplayStaticActions = /**
     * To show or hide {\@link ActionType.STATIC} actions in inline or dropdown action containers
     * @param {?} style
     * @return {?}
     */
    function (style) {
        return (this.staticActions && this.staticActions.length && this.actionDisplayConfig.staticActionStyling === style);
    };
    /**
     * To show or hide {@link ActionType.CONTEXTUAL} and {@link ActionType.CONTEXTUAL_FEATURED} actions in inline or
     * dropdown action containers
     */
    /**
     * To show or hide {\@link ActionType.CONTEXTUAL} and {\@link ActionType.CONTEXTUAL_FEATURED} actions in inline or
     * dropdown action containers
     * @param {?} style
     * @return {?}
     */
    ActionMenuComponent.prototype.shouldDisplayContextualActions = /**
     * To show or hide {\@link ActionType.CONTEXTUAL} and {\@link ActionType.CONTEXTUAL_FEATURED} actions in inline or
     * dropdown action containers
     * @param {?} style
     * @return {?}
     */
    function (style) {
        var _a;
        return ((!this.calculateActionsAvailability || ((_a = this.selectedEntities) === null || _a === void 0 ? void 0 : _a.length)) &&
            this.contextualActions.length &&
            this.actionDisplayConfig.contextual.styling === style);
    };
    Object.defineProperty(ActionMenuComponent.prototype, "shouldDisplayStaticAndStaticFeaturedActionsDropdown", {
        /**
         * To show or hide {@link ActionType.STATIC_FEATURED} and {@link ActionType.STATIC} actions in a dropdown
         */
        get: /**
         * To show or hide {\@link ActionType.STATIC_FEATURED} and {\@link ActionType.STATIC} actions in a dropdown
         * @return {?}
         */
        function () {
            return (this.shouldDisplayStaticActions(this.actionStyling.DROPDOWN) ||
                this.shouldDisplayStaticFeaturedActions(this.actionStyling.DROPDOWN));
        },
        enumerable: true,
        configurable: true
    });
    ActionMenuComponent.decorators = [
        { type: Component, args: [{
                    selector: 'vcd-action-menu',
                    template: "<div class=\"inline-actions-container\" *ngIf=\"shouldDisplayActions(actionStyling.INLINE)\">\n    <ng-container *ngIf=\"shouldDisplayStaticFeaturedActions(actionStyling.INLINE)\">\n        <ng-container *ngFor=\"let action of staticFeaturedActions; trackBy: actionsTrackBy\">\n            <ng-template *ngTemplateOutlet=\"actionButton; context: { $implicit: action }\"></ng-template>\n        </ng-container>\n    </ng-container>\n\n    <ng-container *ngIf=\"shouldDisplayContextualActions(actionStyling.INLINE)\">\n        <ng-container *ngFor=\"let action of contextualFeaturedActions; trackBy: actionsTrackBy\">\n            <ng-template *ngTemplateOutlet=\"actionButton; context: { $implicit: action }\"></ng-template>\n        </ng-container>\n\n        <vcd-dropdown\n            class=\"inline-action-dropdown\"\n            *ngIf=\"contextualActions.length && shouldDisplayContextualActionsDropdown\"\n            [items]=\"contextualActions\"\n            [trackByFunction]=\"actionsTrackBy\"\n            [dropdownPosition]=\"dropdownPosition\"\n            [nestedDropdownPosition]=\"nestedDropdownPosition\"\n            [onItemClickedCb]=\"runActionHandler.bind(this)\"\n            [isItemDisabledCb]=\"isActionDisabled.bind(this)\"\n            [dropdownTriggerBtnTxt]=\"inlineDropdownTriggerBtnText | translate\"\n            [dropdownItemContents]=\"actionDisplayConfig.contextual.buttonContents\"\n            [isDropdownDisabled]=\"disabled\"\n        ></vcd-dropdown>\n    </ng-container>\n\n    <ng-container *ngIf=\"shouldDisplayStaticActions(actionStyling.INLINE)\">\n        <div class=\"static-actions-separator\"></div>\n        <ng-container *ngFor=\"let action of staticActions; trackBy: actionsTrackBy\">\n            <ng-template *ngTemplateOutlet=\"actionButton; context: { $implicit: action }\"></ng-template>\n        </ng-container>\n    </ng-container>\n</div>\n\n<vcd-dropdown\n    *ngIf=\"shouldDisplayStaticAndStaticFeaturedActionsDropdown\"\n    [items]=\"staticDropdownActions\"\n    [trackByFunction]=\"actionsTrackBy\"\n    [dropdownPosition]=\"dropdownPosition\"\n    [nestedDropdownPosition]=\"nestedDropdownPosition\"\n    [onItemClickedCb]=\"runActionHandler.bind(this)\"\n    [isItemDisabledCb]=\"isActionDisabled.bind(this)\"\n    [dropdownTriggerBtnTxt]=\"dropdownTriggerBtnText | translate\"\n    [dropdownTriggerBtnIcon]=\"dropdownTriggerBtnIcon\"\n    [dropdownItemContents]=\"actionDisplayConfig.contextual.buttonContents\"\n    [isDropdownDisabled]=\"disabled\"\n></vcd-dropdown>\n\n<vcd-dropdown\n    *ngIf=\"shouldDisplayContextualActions(actionStyling.DROPDOWN)\"\n    [items]=\"contextualActions\"\n    [trackByFunction]=\"actionsTrackBy\"\n    [dropdownPosition]=\"dropdownPosition\"\n    [nestedDropdownPosition]=\"nestedDropdownPosition\"\n    [onItemClickedCb]=\"runActionHandler.bind(this)\"\n    [isItemDisabledCb]=\"isActionDisabled.bind(this)\"\n    [dropdownTriggerBtnTxt]=\"dropdownTriggerBtnText | translate\"\n    [dropdownTriggerBtnIcon]=\"dropdownTriggerBtnIcon\"\n    [dropdownItemContents]=\"actionDisplayConfig.contextual.buttonContents\"\n    [isDropdownDisabled]=\"disabled\"\n></vcd-dropdown>\n\n<ng-template #actionButton let-action>\n    <button\n        class=\"btn btn-link\"\n        [ngClass]=\"action.class\"\n        (click)=\"runActionHandler(action)\"\n        [disabled]=\"isActionDisabled(action)\"\n    >\n        <ng-container *ngIf=\"shouldShowText\">{{\n            action.isTranslatable === false ? action.textKey : (action.textKey | translate)\n        }}</ng-container>\n\n        <a *ngIf=\"shouldShowIcon\" role=\"tooltip\" aria-haspopup=\"true\" class=\"tooltip tooltip-sm\">\n            <clr-icon size=\"1em\" [attr.shape]=\"action.icon\"></clr-icon>\n            <span class=\"tooltip-content\" *ngIf=\"shouldShowTooltip\">{{ action.textKey }}</span>\n        </a>\n    </button>\n</ng-template>\n",
                    styles: [".inline-actions-container{display:flex;flex-direction:row}.inline-actions-container>.static-actions-separator{flex:1 1 auto}.inline-actions-container .inline-action-dropdown ::ng-deep .nested-dropdown>.first-dropdown-toggle{margin-top:.3rem}"]
                }] }
    ];
    ActionMenuComponent.propDecorators = {
        actions: [{ type: Input }],
        actionDisplayConfig: [{ type: Input }],
        calculateActionsAvailability: [{ type: Input }],
        dropdownTriggerBtnText: [{ type: Input }],
        dropdownTriggerBtnIcon: [{ type: Input }],
        disabled: [{ type: Input }],
        selectedEntities: [{ type: Input }],
        dropdownPosition: [{ type: Input }],
        nestedDropdownPosition: [{ type: Input }]
    };
    return ActionMenuComponent;
}());
export { ActionMenuComponent };
if (false) {
    /**
     * @type {?}
     * @private
     */
    ActionMenuComponent.prototype._actions;
    /**
     * @type {?}
     * @private
     */
    ActionMenuComponent.prototype._extensionEntityActions;
    /**
     * When there are no nested actions and if none of the contextual actions are marked to be featured, they are shown inline
     * @type {?}
     */
    ActionMenuComponent.prototype.shouldDisplayContextualActionsDropdown;
    /**
     * @type {?}
     * @private
     */
    ActionMenuComponent.prototype._actionDisplayConfig;
    /** @type {?} */
    ActionMenuComponent.prototype.calculateActionsAvailability;
    /**
     * Text Content of the action menu dropdown trigger button. Used when {\@link #actionDisplayConfig} styling is
     * {\@link ActionStyling.DROPDOWN}
     * @type {?}
     */
    ActionMenuComponent.prototype.dropdownTriggerBtnText;
    /** @type {?} */
    ActionMenuComponent.prototype.inlineDropdownTriggerBtnText;
    /**
     * Icon of the action menu dropdown trigger button. Used when {\@link #actionDisplayConfig} styling is
     * {\@link ActionStyling.DROPDOWN}
     * @type {?}
     */
    ActionMenuComponent.prototype.dropdownTriggerBtnIcon;
    /**
     * Used for disabling the menu bar or menu dropdown
     * @type {?}
     */
    ActionMenuComponent.prototype.disabled;
    /**
     * The list of entities selected on which contextualActions are performed
     * @type {?}
     */
    ActionMenuComponent.prototype.selectedEntities;
    /**
     * The direction with respect to the root dropdown trigger button in which the root drop down should open
     * {\@link DropdownComponent.dropdownPosition}
     * @type {?}
     */
    ActionMenuComponent.prototype.dropdownPosition;
    /**
     * The direction in which the nested drop downs open. {\@link DropdownComponent.nestedDropdownPosition}
     * @type {?}
     */
    ActionMenuComponent.prototype.nestedDropdownPosition;
    /**
     * If a icon should be displayed inside contextual buttons
     * @type {?}
     */
    ActionMenuComponent.prototype.shouldShowIcon;
    /**
     * If a text should be displayed inside contextual buttons
     * @type {?}
     */
    ActionMenuComponent.prototype.shouldShowText;
    /**
     * If the contextual buttons with icons should have a tooltip
     * @type {?}
     */
    ActionMenuComponent.prototype.shouldShowTooltip;
    /**
     * Used in the html template
     * @type {?}
     */
    ActionMenuComponent.prototype.actionStyling;
    /**
     * Used as {\@link ngForTrackBy} input value when iterating over action lists {\@link DropdownComponent.trackByFunction}
     * Without this method as input for ngForTrackBy, the dropdown gets rendered off screen
     * @type {?}
     */
    ActionMenuComponent.prototype.actionsTrackBy;
}
/**
 * Without the deep copy, the changes made to any of the action children in one of the methods will persist in other methods
 * @template R, T
 * @param {?} actions
 * @return {?}
 */
export function getDeepCopyOfActionItems(actions) {
    return actions.map((/**
     * @param {?} action
     * @return {?}
     */
    function (action) {
        if (action.children && action.children.length) {
            action.children = getDeepCopyOfActionItems(action.children);
        }
        return __assign({}, action);
    }));
}
//# sourceMappingURL=data:application/json;base64, 