UNPKG

@progress/kendo-react-grid

Version:

React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package

68 lines (67 loc) 2.96 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import * as n from "react"; import { getSelectionOptions as o, getEditableOptions as i } from "@progress/kendo-react-data-tools"; import { normalizeSortable as d } from "../sortCommon.mjs"; import { normalize as s } from "../paging/GridPagerSettings.mjs"; const u = (e) => ({ lockedColumn: e.some((t) => t.locked) }), m = (e) => ({ multiColumn: e.some((t) => t.children && t.children.length > 0) }), c = (e) => ({ columnCellTemplate: e.some((t) => t.columnType !== "data" ? !1 : t.cells) }), b = (e) => ({ columnMenu: e.some((t) => t.columnMenu) }), y = (e) => n.Children.toArray(e.children).some((r) => r && r.type && r.type.displayName === "KendoReactGridColumn" ? r.props.hidden : !1), h = (e) => n.Children.toArray(e.children).some((r) => r && r.type && r.type.displayName === "KendoReactGridToolbar" && r.props && r.props.children ? n.Children.toArray(r.props.children).some((a) => a.type && (a.type.displayName === "KendoReactGridToolbarSort" || a.type.displayName === "KendoReactGridToolbarFilter" || a.type.displayName === "KendoReactGridToolbarCheckboxFilter" || a.type.displayName === "KendoReactGridToolbarColumnsChooser" || a.type.displayName === "KendoReactGridToolbarGroup" || a.type.displayName === "KendoReactGridToolbarAIAssistant")) : !1), g = (e) => { const t = o(e.selectable), r = i(e.editable), l = e.sortable && d(e.sortable), a = e.pageable && s(e.pageable); return { cells: !!e.cells, pdf: !!e.pdf, detail: !!e.detail, rows: !!e.rows, highlight: !!e.highlight, editableInline: r.mode === "inline", selectionMultiple: t.enabled && t.mode === "multiple", selectionDrag: t.enabled && t.drag, columnMenu: !!e.columnMenu, filterOperators: !!e.filterOperators, groupable: !!e.groupable, group: !!e.group, groupExpand: !!e.groupExpand, customPager: !!e.pager, clipboard: !!e.clipboard, contextMenu: !!e.contextMenu, pinnable: !!e.pinnable, serverGrid: !e.isClient, scrollableVirtual: e.scrollable === "virtual", pageableInput: !!(e.pageable && a.type === "input"), sortableMultiple: !!(e.sortable && l.mode === "multiple"), hiddenColumns: y(e), stackedLayout: e.dataLayoutMode === "stacked" }; }, C = (e) => ({ ...u(e), ...m(e), ...c(e), ...b(e) }), p = (e) => ({ toolbarTools: h(e) }), T = (e, t) => { const r = { ...g(e), ...C(t), ...p(e) }; return Object.keys(r).filter((l) => r[l] === !0); }; export { T as gridPremiumFeatures, C as isPremiumGridByColumns, p as isPremiumGridByComponents, g as isPremiumGridByProps };