UNPKG

handsontable

Version:

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

29 lines (28 loc) 1.52 kB
"use strict"; exports.__esModule = true; exports.default = right; var C = _interopRequireWildcard(require("../../../i18n/constants")); var _utils = require("../utils"); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } /** * @param {CustomBorders} customBordersPlugin The plugin instance. * @returns {object} */ function right(customBordersPlugin) { const borderDirection = customBordersPlugin.hot.isRtl() ? 'start' : 'end'; return { key: 'borders:right', name() { let label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_BORDERS_RIGHT); const hasBorder = (0, _utils.checkSelectionBorders)(this, borderDirection); if (hasBorder) { label = (0, _utils.markSelected)(label); } return label; }, callback(key, selected) { const hasBorder = (0, _utils.checkSelectionBorders)(this, borderDirection); customBordersPlugin.prepareBorder(selected, borderDirection, hasBorder); } }; }