@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 14.9 kB
JavaScript
var u=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)u(t,r,{get:e[r],enumerable:!0})},T=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of C(e))!N.call(t,a)&&a!==r&&u(t,a,{get:()=>e[a],enumerable:!(n=M(e,a))||n.enumerable});return t};var A=t=>T(u({},"__esModule",{value:!0}),t);var z={};D(z,{GRID_CLASSNAME:()=>s,Grid:()=>o,default:()=>q});module.exports=A(z);var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((r,n)=>e[n]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var g=(t,e)=>i({[`${t}-xs`]:e.size==="xsmall",[`${t}-sm`]:e.size==="small",[`${t}-md`]:e.size==="medium",[`${t}-lg`]:e.size==="large",[`${t}-xl`]:e.size==="xlarge",[`${t}-xxl`]:e.size==="xxlarge",[`${t}-xxxl`]:e.size==="xxxlarge"},{[`${t}-${e.fillMode}`]:e.fillMode},{[`${t}-${e.themeColor}`]:e.themeColor},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full","k-rounded-none":e.rounded==="none"});var l={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var c="grid",m=c;var d=require("react/jsx-runtime"),s="k-grid",E=[],G={size:[l.undefined,l.small,l.medium,l.large]},P=[],h={pagerPosition:"bottom"},o=t=>{let{size:e,pagerPosition:r=h.pagerPosition,toolbar:n,pager:a,groupingHeader:p,gridSelectionAggregates:b,_renderAriaRoot:k,resizable:w,ariaColCount:f,ariaRowCount:x,ariaRootId:y,ariaRole:v="grid",...R}=t;return(0,d.jsxs)("div",{...R,className:i(t.className,s,{[`${s}-resizable`]:w},g(s,{size:e})),children:[n,r==="top"&&a,p,t.children&&k?(0,d.jsx)("div",{className:"k-grid-aria-root",role:v,id:y,"aria-colcount":f,"aria-rowcount":x,children:t.children}):t.children,b,r==="bottom"&&a]})};o.states=E;o.options=G;o.variants=P;o.className=s;o.defaultOptions=h;o.moduleName=c;o.folderName=m;o.ariaSpec={selector:".k-grid",rules:[{selector:".k-grid-toolbar",attribute:"role=toolbar",usage:"The toolbar is a collection of command buttons and inputs."},{selector:".k-grid-toolbar",attribute:"aria-label",usage:"Clarifies the purpose of the toolbar."},{selector:".k-grid-toolbar",attribute:"aria-controls=.k-grid-aria-root id (when present)",usage:"Pointing to the id of the element with role=grid."},{selector:".k-grouping-header",attribute:"role=toolbar",usage:"The Grouping pane is a ToolBar (collection of buttons)."},{selector:".k-grouping-header",attribute:"aria-label",usage:"Clarifies the purpose of the grouping pane."},{selector:".k-grouping-header",attribute:"aria-controls=.k-grid-aria-root id (when present)",usage:"Pointing to the id of the element with role=grid."},{selector:".k-grouping-header .k-chip-list",attribute:"role=none",usage:"The ChipList default listbox role is removed to keep the toolbar --> button roles hierarchy."},{selector:".k-grouping-header .k-chip",attribute:"role=button",usage:"If the element used is not <button>, then the role must be specified."},{selector:".k-grid:not(.k-treelist) .k-grid-aria-root",attribute:"role=grid",usage:"The role specifies the element is a Data Grid."},{selector:".k-grid-aria-root",attribute:"aria-colcount (when present)",usage:"The total number of columns in the Grid. Needed for Virtual columns and Hidden columns scenarios."},{selector:".k-grid-aria-root",attribute:"aria-rowcount (when present)",usage:"The total number of rows in the table. Needed for Paging, Virtual rows, or Master/Detail rows scenarios."},{selector:".k-grid-header-wrap>table",attribute:"role=none",usage:"Negates the default semantic role of the <table> element."},{selector:".k-grid-header-wrap>table>thead",attribute:"role=rowgroup",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid-header-wrap>table>thead>tr:not(.k-filter-row)",attribute:"role=row",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid-header-wrap>table>thead>tr:not(.k-filter-row)",attribute:"aria-rowindex (when present)",usage:"Row number. Needed for Paging, Virtual rows, or Master/Detail rows scenarios."},{selector:".k-grid-header-wrap>table>thead>tr:not(.k-filter-row)>th:not(.k-hierarchy-cell):not(.k-group-cell):not(.k-drag-cell)",attribute:"role=columnheader",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid-header-wrap>table>thead>tr:not(.k-filter-row)>th",attribute:"aria-sort (when present)",usage:"Present if sorting is enabled for that column."},{selector:".k-grid-header-wrap>table>thead>tr:not(.k-filter-row)>th",attribute:"aria-colindex (when present)",usage:"Col number. Needed for Virtual columns and Hidden columns scenarios."},{selector:".k-grid-header-wrap>table>thead>tr:not(.k-filter-row)>th",attribute:"aria-haspopup=dialog (when present)",usage:"Present if the column has a ColumnMenu or FilterMenu."},{selector:".k-grid-header-wrap>table>thead>tr.k-filter-row>td",attribute:"role=gridcell",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid-header-wrap>table>thead>tr.k-filter-row>td",attribute:"aria-label",usage:"Has a label indicating that the cell is part of a filter row."},{selector:".k-grid:not(.k-grid-lockedcolumns) .k-grid-content>table, .k-grid-pinned-container .k-grid-table",attribute:"role=none",usage:"Negates the default semantic role of the <table> element."},{selector:".k-grid:not(.k-grid-lockedcolumns) .k-grid-content>table>tbody, .k-grid-pinned-container tbody",attribute:"role=rowgroup",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid:not(.k-grid-lockedcolumns) .k-grid-content>table>tbody>tr, .k-grid-pinned-container tbody tr",attribute:"role=row",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid:not(.k-grid-lockedcolumns) .k-grid-content>table>tbody>tr, .k-grid-pinned-container tbody tr",attribute:"aria-rowindex (when present)",usage:"Row number. Needed for Paging, Virtual rows, or Master/Detail rows scenarios."},{selector:".k-grid:not(.k-grid-lockedcolumns) .k-grid-content>table>tbody>tr>td, .k-grid-pinned-container tbody td",attribute:"role=gridcell",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid:not(.k-grid-lockedcolumns) .k-grid-content>table>tbody>tr>td, .k-grid-pinned-container tbody td",attribute:"aria-colindex (when present)",usage:"Col number. Needed for Virtual columns and Hidden columns scenarios."},{selector:"tr.k-selected",attribute:"aria-selected=true",usage:"Set on the currently selected row(s) in row selection mode. All cells within the selected row also carry aria-selected=true (without k-selected class). Applies to both regular and pinned rows."},{selector:"td.k-selected",attribute:"aria-selected=true",usage:"Set on the currently selected cell(s) in cell selection mode. The k-selected class on cells is only applied in cell selection mode, but aria-selected=true is present on cells regardless of selection mode."},{selector:".k-master-row .k-hierarchy-cell, .k-grouping-row>td",attribute:"aria-expanded",usage:"For cells holding grouping criteria values and for Master row cells in Detail template scenario."},{selector:".k-group-cell",attribute:"role=presentation",usage:"Group offset cells (header and content) are non-interactive placeholders with no semantic role."},{selector:".k-drag-cell",attribute:"aria-label",usage:"Must be present in a Drag Row scenario on the cell containing the drag handle."},{selector:".k-grid-header-locked table tr",attribute:"aria-owns",usage:"Locked header rows own cells from the corresponding non-locked header table rows."},{selector:".k-grid-content-locked table tr:not(.k-grouping-row)",attribute:"aria-owns",usage:"Locked content rows own cells from the corresponding non-locked content table rows. Group header rows are excluded because the non-locked group header rows are presentational."},{selector:".k-grid-lockedcolumns .k-grid-header .k-grid-header-wrap table tr",attribute:"role=none",usage:"Non-locked header rows have their semantic role removed when locked columns exist."},{selector:".k-grid-lockedcolumns .k-grid-content table tr",attribute:"role=none",usage:"Non-locked content rows have their semantic role removed when locked columns exist."},{selector:".k-grid-lockedcolumns .k-grid-header .k-grid-header-wrap th",attribute:"role=columnheader",usage:"Non-locked header cells retain columnheader role so they are announced correctly when owned via aria-owns."},{selector:".k-grid-lockedcolumns .k-grid-content td:not(.k-grouping-row td)",attribute:"role=gridcell",usage:"Non-locked data cells retain gridcell role so they are announced correctly when owned via aria-owns. Cells inside group header rows are excluded as those rows are presentational."},{selector:".k-grid-filter-popup",attribute:"role=dialog",usage:"The filter menu popup has dialog role."},{selector:".k-grid-filter-popup",attribute:"id",usage:"Unique id linked to the header cell aria-controls attribute."},{selector:".k-grid-filter-popup",attribute:"aria-label",usage:'Descriptive label for the filter menu, e.g. "Column Title Filter Menu".'},{selector:".k-grid-columnmenu-popup",attribute:"role=dialog",usage:"The column menu popup has dialog role."},{selector:".k-grid-columnmenu-popup",attribute:"id",usage:"Unique id linked to the header cell aria-controls attribute."},{selector:".k-grid-columnmenu-popup",attribute:"aria-label",usage:'Descriptive label for the column menu, e.g. "Column Title Column Menu".'},{selector:".k-grid-columnmenu-popup .k-columnmenu-item",attribute:"role=button",usage:"Column menu items have button role."},{selector:".k-grid-columnmenu-popup .k-columnmenu-item",attribute:"tabindex=0",usage:"Column menu items are focusable."},{selector:".k-grid-columnmenu-popup .k-columnmenu-item",attribute:"aria-expanded",usage:"Expandable column menu items announce their expanded state."},{selector:".k-grid-columnmenu-popup .k-columnmenu-item",attribute:"aria-controls",usage:"Expandable items point to the id of the content they control."},{selector:".k-grid-columnmenu-popup .k-column-list",attribute:"role=listbox",usage:"The column list is a listbox."},{selector:".k-grid-columnmenu-popup .k-column-list",attribute:"aria-multiselectable=true",usage:"The column list supports multiple selections."},{selector:".k-grid-columnmenu-popup .k-column-list",attribute:"aria-label",usage:"Accessible name for the column list."},{selector:".k-grid-columnmenu-popup .k-column-list-item",attribute:"role=option",usage:"Column list items are options."},{selector:".k-grid-columnmenu-popup .k-column-list-item",attribute:"aria-checked",usage:"Column list items announce their checked state."},{selector:"tfoot",attribute:"role=rowgroup",usage:"Required as the owner <table> element has its semantic role removed."},{selector:"tfoot tr",attribute:"role=row",usage:"Required as the owner <table> element has its semantic role removed."},{selector:"tfoot tr",attribute:"aria-rowindex (when present)",usage:"Row number. Needed for Paging, Virtual rows, or Master/Detail rows scenarios."},{selector:"tfoot tr td",attribute:"role=gridcell",usage:"Required as the owner <table> element has its semantic role removed."},{selector:"tfoot tr td",attribute:"aria-colindex (when present)",usage:"Col number. Needed for Virtual columns and Hidden columns scenarios."},{selector:".k-grid-selection-aggregates",attribute:"aria-live=polite",usage:"Ensures that changes in the calculated selection aggregates are announced by assistive technologies."},{selector:".k-grid-stack-cell",attribute:"tabindex=0",usage:"Stacked cell elements receive tabindex 0 when focus is within their parent .k-grid-stack-row element."},{selector:".k-grid-sticky-container",attribute:"role=none",usage:"Sticky group container has no semantic role."},{selector:".k-grid-sticky-container .k-grid-table",attribute:"role=none",usage:"Negates the default semantic role of the sticky group <table> element."},{selector:".k-grid-sticky-container tbody",attribute:"role=rowgroup",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid-sticky-container tr",attribute:"role=row",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-grid-sticky-container tr",attribute:"aria-rowindex",usage:"Matches the aria-rowindex of the real group header/footer row it mirrors."},{selector:".k-grid-sticky-container td:not(.k-group-cell)",attribute:"role=gridcell",usage:"Required as the owner <table> element has its semantic role removed. Group offset cells are excluded as they retain role=presentation."},{selector:".k-grid-sticky-container .k-grouping-row>td",attribute:"aria-expanded",usage:"Mirrors the expanded/collapsed state of the real group header row."},{selector:".k-grid-sticky-container td:not(.k-group-cell)",attribute:"tabindex",usage:"Receives tabindex 0 when focused, -1 otherwise, for keyboard navigation. Group offset cells are excluded as they are presentational."},{selector:".k-grid-sticky-container td",attribute:"aria-colindex (when present)",usage:"Col number. Typically 1 for the group header cell spanning all columns."},{selector:".k-grid-pinned-container",attribute:"role=none",usage:"Container for pinned rows has no semantic role."},{selector:".k-grid-pinned-container .k-grid-pinned-wrap",attribute:"role=none",usage:"Inner wrapper for the pinned rows table has no semantic role."},{selector:".k-grid-pinned-container tbody",attribute:"aria-label",usage:'Describes the purpose of the pinned rows group, e.g. "Top pinned rows" or "Bottom pinned rows".'},{selector:".k-grid-pinned-container td",attribute:"aria-haspopup=menu (when present)",usage:"Pinned row cells announce the context menu for row pinning operations."},{selector:".k-grid-pinned-container td",attribute:"aria-controls",usage:"Points to the ID of the context menu popup for row pinning."},{selector:".k-grid-pinned-container td",attribute:"aria-expanded",usage:"Indicates whether the context menu popup is open."},{selector:".k-grid-content td",attribute:"aria-haspopup=menu (when present)",usage:"Regular data cells announce context menu when row pinning uses contextual mode."},{selector:".k-grid-content td",attribute:"aria-controls",usage:"Points to the ID of the context menu popup for row pinning."},{selector:".k-grid-content td",attribute:"aria-expanded",usage:"Indicates whether the context menu popup is open."},{selector:'.k-pin-cell [class*="k-icon"]',attribute:"aria-hidden=true",usage:"Pin/unpin icon inside the dedicated column is decorative and must be hidden from assistive technologies."}]};var q=o;