@progress/kendo-react-common
Version:
React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package
369 lines (368 loc) • 9.3 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { base as t, states as l, gridPrefix as $, containers as u, grid as o, elements as i, gridRowReorder as h, cursor as x, dimensions as T, sizeMap as m } from "./json-classes.mjs";
const n = {
wrapper: {
main: $,
size: {
small: `${$}-${m.small}`,
medium: `${$}-${m.medium}`
},
virtual: `${$}-${t.virtual}`,
stacked: `${$}-stack`
},
ariaRoot: `${$}-${o.ariaRoot}`,
container: `${$}-${u.container}`,
content: {
main: `${$}-${u.content}`,
virtual: `${t.prefix}-${t.virtual}-${u.content}`
},
tableWrap: `${$}-${o.tableWrap}`,
table: {
main: `${t.prefix}-${i.table}`,
gridTable: `${$}-${i.table}`,
size: {
small: `${t.prefix}-${i.table}-${m.small}`,
medium: `${t.prefix}-${i.table}-${m.medium}`
}
},
tbody: `${t.prefix}-${i.table}-${i.tbody}`,
thead: {
main: `${$}-${i.table}-${i.thead}`,
draggable: `${$}-${l.draggable}-${i.header}`
},
header: {
main: `${$}-${i.header}`,
draggable: `${$}-${l.draggable}-${i.header}`
},
headerWrap: `${$}-${i.header}-${u.wrap}`,
headerTable: {
main: `${t.prefix}-${i.table}`,
header: `${$}-${i.header}-${i.table}`,
size: {
small: `${t.prefix}-${i.table}-${m.small}`,
medium: `${t.prefix}-${i.table}-${m.medium}`
}
},
headerTh: {
main: `${t.prefix}-${i.table}-${i.th}`,
header: `${t.prefix}-${i.header}`,
first: `${t.prefix}-${l.first}`,
filterable: `${t.prefix}-${l.filterable}`,
locked: `${$}-${i.header}-${l.sticky}`,
sorted: `${t.prefix}-${l.sorted}`
},
tableThead: `${t.prefix}-${i.table}-${i.thead}`,
heightContainer: `${t.prefix}-${T.height}-${u.container}`,
sortIcon: `${t.prefix}-${l.sort}-${i.icon}`,
sortOrder: `${t.prefix}-${l.sort}-${l.order}`,
tr: {
main: `${t.prefix}-${i.table}-${o.row}`,
header: `${t.prefix}-${i.table}-${o.group}-${o.row}`,
grouping: `${t.prefix}-${l.grouping}-${o.row}`,
footer: `${t.prefix}-${o.group}-${i.footer}`,
master: `${t.prefix}-${o.master}-${o.row}`,
rowAlt: `${t.prefix}-${i.table}-${l.alt}-${o.row}`,
selected: `${t.prefix}-${l.selected}`,
highlighted: `${t.prefix}-${l.highlighted}`,
isInEdit: `${$}-${l.edit}-${o.row}`,
isPinned: `${t.prefix}-pinned-source`
},
detailTr: {
main: `${t.prefix}-${i.table}-${o.row}`,
row: `${t.prefix}-${o.detail}-${o.row}`,
rowAlt: `${t.prefix}-${i.table}-${l.alt}-${o.row}`
},
simpleTr: `${t.prefix}-${i.table}-${o.row}`,
headerCellInner: `${t.prefix}-${o.cellInner}`,
columnTitle: `${t.prefix}-${o.column}-${i.title}`,
headerCellLink: {
main: `${t.prefix}-${i.link}`,
notSortable: `${t.important}${t.prefix}-${x.default}`
},
noRecords: `${$}-${o.noRecords}`,
noRecordsTemplate: `${$}-${o.noRecords}-${l.template}`,
pager: `${$}-${o.pager}`,
sorted: `${t.prefix}-${l.sorted}`,
contentSticky: `${$}-${u.content}-${l.sticky}`,
hierarchyCell: {
main: `${t.prefix}-${o.hierarchy}-${o.cell}`,
header: `${t.prefix}-${i.header}`
},
rowReorder: {
dropIndicator: {
main: `${t.prefix}-${h.drop}-${h.hint}`,
direction: `${t.prefix}-${h.drop}-${h.hint}-${h.horizontal}`
},
dragClue: {
main: `${t.prefix}-${h.drag}-${h.clue}`,
operation: `${t.prefix}-${h.reorder}-${h.clue}`
}
},
td: {
main: `${t.prefix}-${i.table}-${i.td}`,
selected: `${t.prefix}-${l.selected}`,
highlighted: `${t.prefix}-${l.highlighted}`
},
detailTd: {
main: `${t.prefix}-${i.table}-${i.td}`,
cell: `${t.prefix}-${o.detail}-${o.cell}`
},
editTd: {
main: `${t.prefix}-${i.table}-${i.td}`,
cell: `${$}-${l.edit}-${o.cell}`,
selected: `${t.prefix}-${l.selected}`
},
hierarchyTd: {
main: `${t.prefix}-${i.table}-${i.td}`,
cell: `${t.prefix}-${o.hierarchy}-${o.cell}`
},
stickyContainer: {
main: `${$}-${l.sticky}-${u.container}`,
bottom: `${t.prefix}-pos-${l.bottom}`
},
srOnly: `${t.prefix}-sr-only`
}, y = {
wrapper: (r) => {
const { size: e, virtual: a, isStackedMode: c, c: s = n.wrapper } = r;
return {
[s.main]: !0,
[s.size[e]]: s.size[e],
[`${$}-${e}`]: e && !s.size[e],
[s.virtual]: a,
[s.stacked]: c
};
},
ariaRoot: (r) => {
const { c: e = n } = r;
return e.ariaRoot;
},
container: (r) => {
const { c: e = n } = r;
return e.container;
},
content: (r) => {
const { c: e = n.content } = r;
return {
[e.main]: !0,
[e.virtual]: !0
};
},
tableWrap: (r) => {
const { c: e = n } = r;
return e.tableWrap;
},
table: (r) => {
var c, s, d;
const { size: e, c: a = n.table } = r;
return {
[a.main]: !0,
[a.gridTable]: !0,
[(c = a.size) == null ? void 0 : c[e]]: e !== void 0 && ((s = a.size) == null ? void 0 : s[e]),
[`${t.prefix}-${i.table}-${e}`]: e !== void 0 && !((d = a.size) != null && d[e])
};
},
tbody: (r) => {
const { c: e = n } = r;
return e.tbody;
},
thead: (r) => {
const { draggable: e, c: a = n.thead } = r;
return {
[a.main]: !0,
[a.draggable]: e
};
},
header: (r) => {
const { draggable: e, c: a = n.header } = r;
return {
[a.main]: !0,
[a.draggable]: e
};
},
headerWrap: (r) => {
const { c: e = n } = r;
return e.headerWrap;
},
headerTable: (r) => {
const { size: e, c: a = n.headerTable } = r;
return {
[a.main]: !0,
[a.header]: !0,
[a.size[e]]: e !== void 0 && a.size[e],
[`${t.prefix}-${i.table}-${e}`]: e !== void 0 && !a.size[e]
};
},
headerTh: (r) => {
const { first: e, filterable: a, locked: c, sorted: s, c: d = n.headerTh } = r;
return {
[d.main]: !0,
[d.header]: !0,
[d.first]: e,
[d.filterable]: a,
[d.locked]: c,
[d.sorted]: s
};
},
tableThead: (r) => {
const { c: e = n } = r;
return e.tableThead;
},
heightContainer: (r) => {
const { c: e = n } = r;
return e.heightContainer;
},
sortIcon: (r) => {
const { c: e = n } = r;
return e.sortIcon;
},
sortOrder: (r) => {
const { c: e = n } = r;
return e.sortOrder;
},
tr: (r) => {
const {
isHeader: e,
isFooter: a,
isMaster: c,
isAltRow: s,
selected: d,
highlighted: f,
isInEdit: b,
isPinned: g,
c: p = n.tr
} = r;
return {
[p.main]: !0,
[p.header]: e,
[p.grouping]: e,
[p.footer]: a,
[p.master]: c,
[p.rowAlt]: c && s,
[p.selected]: d,
[p.highlighted]: f,
[p.isInEdit]: b,
[p.isPinned]: g
};
},
detailTr: (r) => {
const { isAlt: e, c: a = n.detailTr } = r;
return {
[a.main]: !0,
[a.row]: !0,
[a.rowAlt]: e
};
},
simpleTr: (r) => {
const { c: e = n } = r;
return e.simpleTr;
},
rowReorder: (r) => {
const {
dropIndicatorMain: e,
dropIndicatorDirection: a,
dragClueMain: c,
dragClueOperation: s,
c: d = n.rowReorder
} = r;
return {
[d.dropIndicator.main]: e,
[d.dropIndicator.direction]: a,
[d.dragClue.main]: c,
[d.dragClue.operation]: s
};
},
headerCellInner: (r) => {
const { c: e = n } = r;
return e.headerCellInner;
},
columnTitle: (r) => {
const { c: e = n } = r;
return e.columnTitle;
},
headerCellLink: (r) => {
const { sortable: e, c: a = n.headerCellLink } = r;
return {
[a.main]: !0,
[a.notSortable]: !e
};
},
noRecords: (r) => {
const { c: e = n } = r;
return e.noRecords;
},
noRecordsTemplate: (r) => {
const { c: e = n } = r;
return e.noRecordsTemplate;
},
pager: (r) => {
const { c: e = n } = r;
return e.pager;
},
sorted: (r) => {
const { c: e = n } = r;
return e.sorted;
},
contentSticky: (r) => {
const { locked: e, c: a = n } = r;
return {
[a.contentSticky]: e
};
},
hierarchyCell: (r) => {
const { c: e = n.hierarchyCell } = r;
return {
[e.main]: !0,
[e.header]: !0
};
},
td: (r) => {
const { selected: e, highlighted: a, c = n.td } = r;
return {
[c.main]: !0,
[c.selected]: e,
[c.highlighted]: a
};
},
detailTd: (r) => {
const { c: e = n.detailTd } = r;
return {
[e.main]: !0,
[e.cell]: !0
};
},
editTd: (r) => {
const { selected: e, c: a = n.editTd } = r;
return {
[a.main]: !0,
[a.cell]: !0,
[a.selected]: e
};
},
hierarchyTd: (r) => {
const { c: e = n.hierarchyTd } = r;
return {
[e.main]: !0,
[e.cell]: !0
};
},
stickyContainer: (r) => {
const { bottom: e, c: a = n.stickyContainer } = r;
return {
[a.main]: !0,
[a.bottom]: e
};
},
srOnly: (r) => {
const { c: e = n } = r;
return e.srOnly;
}
};
export {
y as uGrid
};