UNPKG

@deepbag/react-grid-x

Version:

ReactGridX is a customizable and flexible React table component that supports pagination, dynamic rendering of table data, and customizable column rendering. It provides an easy-to-use interface for displaying tabular data with configurable columns, pagin

591 lines (509 loc) 15.9 kB
/* rgx-arrow-pagination.css */ /* Pagination container styling */ .rgx-theme .rgx-arrow-pagination { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; } /* Information section in pagination (like current page and total pages) */ .rgx-theme .rgx-arrow-pagination-info { font-size: 14px; font-weight: 500; } /* Page number display, including "Page x of y" format */ .rgx-theme .rgx-arrow-pagination-page-of { font-size: 14px; font-weight: 500; display: flex; align-items: center; margin: 0 7px; } /* Row-per-page section styling */ .rgx-theme .rgx-arrow-pagination-row-per-page { display: flex; align-items: center; } .rgx-theme .rgx-arrow-pagination-rows-per-page-label { font-size: 14px; margin-right: 10px; } /* Styling for the select dropdown that controls rows per page */ .rgx-theme .rgx-arrow-pagination-rows-per-page-select { height: 30px; padding: 5px; border: 1px solid #ddd; background-color: #f9f9f9; cursor: pointer; font-size: 14px; font-weight: 500; } /* Disabled select dropdown style */ .rgx-theme .rgx-arrow-pagination-rows-per-page-select:disabled { cursor: not-allowed; } /* Rows-per-page label and select container */ .rgx-theme .rgx-arrow-pagination-rows-per-page { display: flex; align-items: center; margin-right: 10px; font-weight: 500; } /* Styling for the label inside the rows-per-page section */ .rgx-theme .rgx-theme.rgx-arrow-pagination-rows-per-page-label { font-size: 14px; color: #202020; margin-right: 10px; } /* Pagination button container for navigation buttons (Previous, Next, etc.) */ .rgx-theme .rgx-arrow-pagination-controls { display: flex; flex-wrap: wrap; gap: 5px; } /* Style for pagination buttons */ .rgx-theme .rgx-arrow-pagination-button { padding: 4.8px 5px 1.6px 5px; border: 1px solid #ddd; background-color: #f9f9f9; cursor: pointer; transition: background-color 0.3s; font-size: 14px; font-weight: 500; } /* Hover effect for pagination buttons */ .rgx-theme .rgx-arrow-pagination-button:hover { background-color: #ddd; } /* Style for disabled pagination buttons */ .rgx-theme .rgx-arrow-pagination-button:disabled { background-color: #eee; cursor: not-allowed; } /* Style for the active pagination button */ .rgx-theme .rgx-arrow-pagination-button.rgx-active { background-color: #007bff; color: white; border-color: #007bff; } /* Styling for the ellipsis (e.g., "..." for skipped page numbers) */ .rgx-theme .rgx-arrow-pagination-ellipsis { background-color: transparent; color: #888; cursor: not-allowed; } /* rgx-loader.css */ /* Loader container styling */ .rgx-theme .rgx-loader-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 9999; display: flex; align-items: center; background-color: #e2e2e2; padding: 8px 10px; border-radius: 4px; } /* Loader spinner styling */ .rgx-theme .rgx-loader-spinner { border: 4px solid #ddd; border-top: 4px solid #3498db; border-radius: 50%; width: 10px; height: 10px; animation: spin 2s linear infinite; } /* Loader message styling */ .rgx-theme .rgx-loader-message { font-size: 14px; color: #333; margin-left: 10px; } /* Spinner animation */ @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* rgx-popover.css */ /* Popover container, styled with background, border, shadow, padding, and positioning. */ .rgx-theme .rgx-popover-content { position: absolute; background-color: #fff; border: 1px solid #ccc; border-radius: 2px; padding: 6px; min-width: 150px; z-index: 1000; display: block; margin-left: -140px; margin-top: 6px; } /* Show popover when the "show" class is applied. */ .rgx-theme .rgx-popover-content.rgx-popover-show { display: block; } /* Small arrow pointing to the trigger element, created with a rotated square. */ .rgx-theme .rgx-popover-arrow { position: absolute; top: -5px; left: 90%; transform: translateX(-50%) rotate(45deg); width: 10px; height: 10px; background-color: #fff; border-left: 1px solid #ccc; border-top: 1px solid #ccc; } /* rgx-table-pagination.css */ /* Main pagination container, aligned with space between elements, wraps on smaller screens. */ .rgx-theme .rgx-table-pagination { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; } /* Pagination info section, styled with font size, color, and weight. */ .rgx-theme .rgx-table-pagination-info { font-size: 14px; font-weight: 500; } /* Rows per page section with label and select element aligned horizontally. */ .rgx-theme .rgx-table-pagination-row-per-page { display: flex; align-items: center; } /* Styling for rows per page select dropdown. */ .rgx-theme .rgx-table-pagination-rows-per-page-select { height: 30px; padding: 5px; border: 1px solid #ddd; background-color: #f9f9f9; cursor: pointer; font-size: 14px; font-weight: 500; } /* Disabled select element appearance, with a "not-allowed" cursor. */ .rgx-theme .rgx-table-pagination-rows-per-page-select:disabled { cursor: not-allowed; } /* Rows per page section label and select element, styled with margins and font weight. */ .rgx-theme .rgx-table-pagination-rows-per-page { display: flex; align-items: center; margin-right: 10px; font-weight: 500; } /* Label within rows per page section, with spacing and font styling. */ .rgx-theme .rgx-table-pagination-rows-per-page-label { font-size: 14px; margin-right: 10px; } /* Pagination control buttons container with flexible wrapping and spacing. */ .rgx-theme .rgx-table-pagination-controls { display: flex; flex-wrap: wrap; gap: 5px; } /* Individual pagination button styling, including padding, background, and hover effects. */ .rgx-theme .rgx-table-pagination-button { padding: 4px 10px 3px 10px; border: 1px solid #ddd; background-color: #f9f9f9; cursor: pointer; transition: background-color 0.3s; font-size: 14px; font-weight: 500; } /* Hover effect for pagination buttons, changing background color. */ .rgx-theme .rgx-table-pagination-button:hover { background-color: #ddd; } /* Disabled pagination button styling with light background and "not-allowed" cursor. */ .rgx-theme .rgx-table-pagination-ellipsis:disabled { background-color: #f1f1f1; cursor: not-allowed !important; border: 1px solid #ddd; } /* Active pagination button styling with custom background and border color. */ .rgx-theme .rgx-table-pagination-button.rgx-table-pagination-active { background-color: #007bff; color: white; border-color: #007bff; } /* Individual pagination button styling, including padding, background, and hover effects. */ .rgx-theme .rgx-table-pagination-button-icon { padding: 4.8px 5px 1.6px 5px; border: 1px solid #ddd; background-color: #f9f9f9; cursor: pointer; transition: background-color 0.3s; font-size: 14px; font-weight: 500; } /* Hover effect for pagination buttons, changing background color. */ .rgx-theme .rgx-table-pagination-button-icon:hover { background-color: #ddd; } /* Disabled pagination button styling with light background and "not-allowed" cursor. */ .rgx-theme .rgx-table-pagination-button-icon:disabled { background-color: #eee; cursor: not-allowed; } /* Active pagination button styling with custom background and border color. */ .rgx-theme .rgx-table-pagination-button-icon.rgx-table-pagination-active { background-color: #007bff; color: white; border-color: #007bff; } /* Ellipsis button for pagination, styled to be transparent with a gray color. */ .rgx-theme .rgx-table-pagination-ellipsis { background-color: transparent; color: #888; cursor: not-allowed; } /* rgx-theme.css */ /* Table theme styles, including table structure, borders, and font styling. */ .rgx-theme { width: 100%; } /* Container for the table with relative positioning and horizontal scroll support. */ .rgx-theme .rgx-table-container { position: relative; overflow-x: auto; max-width: 100%; border: 1px solid #ddd; } /* Styling for the scrollbar inside the table container, making it slimmer. */ .rgx-theme .rgx-table-container::-webkit-scrollbar { width: 3px; height: 3px; } /* Styling for the scrollbar thumb (draggable part), with a light transparent color. */ .rgx-theme .rgx-table-container::-webkit-scrollbar-thumb { background-color: rgba(158, 154, 154, 0.3); border-radius: 3px; } /* Hover effect for scrollbar thumb, darkening the background. */ .rgx-theme .rgx-table-container::-webkit-scrollbar-thumb:hover { background-color: rgba(44, 34, 34, 0.5); } /* Loader effect for the table while loading, applies blur and disables pointer events. */ .rgx-theme .rgx-table-container-loading { position: relative; } /* Basic table structure with a fixed minimum width for large data sets. */ .rgx-theme .rgx-table { min-width: 1000px; border-collapse: collapse; overflow-x: scroll !important; } /* Blurring effect for table body cells while loading, disables interaction. */ .rgx-theme .rgx-table-tobody-loading { filter: blur(0.8px); pointer-events: none; } /* Styling for table headers (th) and table data cells (td) with padding, borders, and font size. */ .rgx-theme .rgx-table-head-th, .rgx-theme .rgx-table-head-th-checkbox { padding: 10px; text-align: left; font-size: 14px; } /* Styling for table body data cells (td) with padding, borders, and font size. */ .rgx-theme .rgx-table-body-td, .rgx-theme .rgx-table-body-td-checkbox { padding: 4px 10px; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; text-align: left; font-size: 14px; } /* Alternating row background colors for even rows (light gray). */ .rgx-theme .rgx-table-body-tr:nth-child(even) { background-color: #f2f2f2; } /* Alternating row background colors for odd rows (lighter gray). */ .rgx-theme .rgx-table-body-tr:nth-child(odd) { background-color: #ffffff; } /* Changes the cursor to a pointer for rows, indicating interactivity. */ .rgx-theme .rgx-table-body-tr { cursor: pointer; height: "45px"; } /* Hover effect on rows, darkening the background for better user interaction feedback. */ .rgx-theme .rgx-table-body-tr:hover { background-color: #ebf0f6; } /* Sticky table header with light background color and default cursor style. */ .rgx-theme .rgx-table-head { position: sticky; top: 0; z-index: 1; background-color: #f8f8f8; cursor: default; } /* Styling for expanded rows, with smooth background transition on hover. */ .rgx-theme .rgx-table-body-tr-expanded { background-color: #f9f9f9; transition: background-color 0.3s ease; } /* Expanding row with additional left padding for content clarity. */ .rgx-theme .rgx-table-expanded-row-tr { background-color: #f9f9f9; padding-left: 20px; } /* Expanded row cells with additional padding and no top border. */ .rgx-theme .rgx-table-expanded-row-tr .rgx-table-expanded-row-td { padding: 20px; border-top: 0; } /* Styling for expanded row arrows, aligning them next to text for better UX. */ .rgx-theme .rgx-table-expanded-arrow { cursor: pointer; margin-right: 10px; text-align: center; } /* Additional padding for table data cells in expanded rows for better spacing. */ .rgx-theme .rgx-table-expanded-row-td { padding: 20px; } /* Font size for expanded row arrows to make them consistent with table content. */ .rgx-theme .rgx-table-expanded-arrow-icon { font-size: 14px; } /* Styling for table popup items (like options or actions) with font and padding. */ .rgx-theme .rgx-table-popup-items { font-weight: 400; padding: 4px 8px; font-size: 14px; border-radius: 5px; cursor: pointer; display: flex; } /* Hover effect on popup items, changing the background to light gray for better visibility. */ .rgx-theme .rgx-table-popup-items:hover { background-color: #ededed; } /* Styling for checkboxes in the header cell with a fixed size and cursor. */ .rgx-theme .rgx-table-head-th-checkbox input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; margin: 0; transition: background-color 0.2s ease; margin-bottom: -2px; } /* Styling for checkboxes in the table body cells, consistent with header checkboxes. */ .rgx-theme .rgx-table-body-td-checkbox input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; margin: 0; transition: background-color 0.2s ease; margin-bottom: -2px; } /* Checked state for checkboxes, turning the background to green. */ .rgx-theme .rgx-table-body-td-checkbox input[type="checkbox"]:checked, .rgx-theme .rgx-table-head-th-checkbox input[type="checkbox"]:checked { background-color: #4caf50; border-color: #4caf50; margin-bottom: -2px; } /* Hover effect for checkboxes, with a light green background when hovered. */ .rgx-theme .rgx-table-body-td-checkbox input[type="checkbox"]:hover, .rgx-theme .rgx-table-head-th-checkbox input[type="checkbox"]:hover { background-color: #4caf4f55; } /* Custom checkbox appearance with no default styles for more control over look. */ .rgx-theme .rgx-table-body-td-checkbox input[type="checkbox"] { -webkit-appearance: none; -moz-appearance: none; appearance: none; border: 1px solid #ddd; border-radius: 3px; position: relative; width: 17px; height: 17px; } /* Custom checkbox appearance for header checkboxes. */ .rgx-theme .rgx-table-head-th-checkbox input[type="checkbox"] { -webkit-appearance: none; -moz-appearance: none; appearance: none; border: 1px solid #ddd; border-radius: 3px; position: relative; width: 17px; height: 17px; } /* Green background when a checkbox is checked. */ .rgx-theme .rgx-table-body-td-checkbox input[type="checkbox"]:checked, .rgx-theme .rgx-table-head-th-checkbox input[type="checkbox"]:checked { background-color: #4caf50; } /* Checkmark inside checked checkbox styled for clarity. */ .rgx-theme .rgx-table-body-td-checkbox input[type="checkbox"]:checked::before, .rgx-theme .rgx-table-head-th-checkbox input[type="checkbox"]:checked::before { content: "✔"; position: absolute; top: 0; left: 3px; color: white; font-size: 12px; line-height: 16px; } /* rgx-tooltip.css */ /* Defines the container for elements with tooltips */ .rgx-theme .rgx-tooltip-container { position: relative; display: inline-block; } /* Styles the tooltip text, hidden by default */ .rgx-theme .rgx-tooltip-text { visibility: hidden; width: fit-content; max-width: 200px; background-color: rgba(0, 0, 0, 0.75); color: #fff; text-align: center; border-radius: 5px; padding: 5px 10px; position: absolute; z-index: 1; opacity: 0; transition: opacity 0.3s ease-in-out; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: wrap; margin-bottom: 8px; font-size: 14px; } /* Adds the arrow to the tooltip */ .rgx-theme .rgx-tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: rgba(0, 0, 0, 0.75) transparent transparent transparent; } /* Makes the tooltip visible when hovering over the container */ .rgx-theme .rgx-tooltip-container:hover .rgx-tooltip-text { visibility: visible; opacity: 1; }