UNPKG

handsontable

Version:

Handsontable is a JavaScript Data Grid available for React, Angular and Vue.

23 lines 734 B
import * as C from "../../../i18n/constants.mjs"; import { checkSelectionBorders, markSelected } from "../utils.mjs"; /** * @param {CustomBorders} customBordersPlugin The plugin instance. * @returns {object} */ export default function bottom(customBordersPlugin) { return { key: 'borders:bottom', name() { let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_BORDERS_BOTTOM); const hasBorder = checkSelectionBorders(this, 'bottom'); if (hasBorder) { label = markSelected(label); } return label; }, callback(key, selected) { const hasBorder = checkSelectionBorders(this, 'bottom'); customBordersPlugin.prepareBorder(selected, 'bottom', hasBorder); } }; }