"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRowActionButtonId = getRowActionButtonId;
exports.getTableActionButtonId = getTableActionButtonId;
exports.composeClassNames = composeClassNames;
/**
 * Get row actions button id.
 *
 * @param {string} tableId
 * @param {number | undefined} rowNumber
 * @param {string} actionName
 * @returns {string}
 */
function getRowActionButtonId(tableId, rowNumber, actionName) {
    return `table-${tableId || 'unknown'}-content-row-${rowNumber ?? 'unknown'}-actions-${actionName}`;
}
/**
 * Gets table actions button id.
 *
 * @param {string} tableId
 * @param {string} actionName
 * @returns {string}
 */
function getTableActionButtonId(tableId, actionName) {
    return `table-${tableId || 'unknown'}-actions-${actionName}`;
}
/**
 * Composes class name.
 *
 * @param {string} initialClass
 * @param {string | string[]} additionalClassNames
 * @returns {string}
 */
function composeClassNames(initialClass, additionalClassNames) {
    const classList = [initialClass];
    const addToArray = (array, items) => {
        if (items) {
            if (Array.isArray(items)) {
                items.forEach((i) => addToArray(array, i));
            }
            else {
                array.push(items);
            }
        }
    };
    addToArray(classList, additionalClassNames);
    return classList.filter((item) => !!item).join(' ');
}
//# sourceMappingURL=utils.js.map