Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2dce854
Basic NuGrid Component, only display
sloorush Jan 19, 2026
30dc9e1
Build 2dce854
github-actions[bot] Jan 19, 2026
ed4b9a7
Headers (ColTitles, RowTitles) and varying CellWidths
sloorush Jan 19, 2026
15c618e
Build ed4b9a7
github-actions[bot] Jan 19, 2026
a6ca496
Numbers right-align, text left-aligns. Locale formatting (1,500 vs 1.…
sloorush Jan 19, 2026
2487e91
Build a6ca496
github-actions[bot] Jan 19, 2026
a16be39
Navigation
sloorush Jan 19, 2026
f3e94af
Build a16be39
github-actions[bot] Jan 19, 2026
4cf76b2
cellmove and navigation events implemented
sloorush Jan 19, 2026
1a5fff0
Build 4cf76b2
github-actions[bot] Jan 19, 2026
aa7b0f6
scrolling
sloorush Jan 20, 2026
102e9f0
scrollbars
sloorush Jan 20, 2026
d31e151
Build 102e9f0
github-actions[bot] Jan 20, 2026
f420ae0
implement components in grid
sloorush Jan 29, 2026
9c8cb53
Build f420ae0
github-actions[bot] Jan 29, 2026
2c4b676
excel like ui for grid
sloorush Jan 29, 2026
fa50934
Build 2c4b676
github-actions[bot] Jan 29, 2026
66ec54d
Don't fall back to select in the new grid
cursork Jan 29, 2026
605599a
Build 66ec54d
github-actions[bot] Jan 29, 2026
1be5c9e
update ui and bug fixes
sloorush Jan 30, 2026
7c89a89
Build 1be5c9e
github-actions[bot] Jan 30, 2026
02fb484
fix scrolling issues
sloorush Feb 20, 2026
66d17af
Build 02fb484
github-actions[bot] Feb 20, 2026
0ea49bc
make scrolling consistent
sloorush Feb 20, 2026
d39af9f
Build 0ea49bc
github-actions[bot] Feb 20, 2026
884d37a
styling fixes on checkbox and cell sizes
sloorush Feb 24, 2026
6d3b9d7
Build 884d37a
github-actions[bot] Feb 24, 2026
cc538aa
fix cell change
sloorush Feb 25, 2026
4fffd99
Build cc538aa
github-actions[bot] Feb 25, 2026
9cd7ada
support BCol FCol and related properties for nugrid
sloorush Feb 25, 2026
efdb12e
Build 9cd7ada
github-actions[bot] Feb 25, 2026
b355f48
wip: formatted values support for nugrid
sloorush Feb 25, 2026
2d8cc6a
enchance state management for nugrid
sloorush Mar 5, 2026
e13fc14
Build 2d8cc6a
github-actions[bot] Mar 5, 2026
b8b013e
Stack column titles again
cursork Mar 6, 2026
b9be2fa
Build b8b013e
github-actions[bot] Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ kendo-ui-license.txt

# Personal TODOs
TODO.md

notes/
1 change: 1 addition & 0 deletions dist/assets/index-B2RKn-EQ.css

Large diffs are not rendered by default.

981 changes: 0 additions & 981 deletions dist/assets/index-B5L69WsV.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/assets/index-CCWCbohx.css

This file was deleted.

981 changes: 981 additions & 0 deletions dist/assets/index-CuAwCkID.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 49 additions & 3 deletions src/components/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
handleKeyPressUtils,
} from "../utils";
import { useAppData, useResizeObserver } from "../hooks";
import { useNuGridContext } from "./NuGrid/NuGridContext";
import { useEffect, useState } from "react";
import { useRef } from "react";
import { getObjectById, getImageStyles } from "../utils";
Expand All @@ -34,6 +35,10 @@ const Button = ({

const styles = setStyle(data?.Properties);
const { socket, findCurrentData, dataRef, handleData, reRender, inheritedProperties } = useAppData();

// Check if we're inside a NuGrid cell
const nuGridContext = useNuGridContext();
const isInNuGrid = !!nuGridContext;
const { Picture, State, Visible, Event, Caption, Align, Posn, Size, CSS, Active } = data?.Properties;
const { FontObj } = inheritedProperties(data, 'FontObj');

Expand All @@ -51,7 +56,7 @@ const Button = ({
document.getElementById(extractStringUntilLastPeriod(data?.ID))
);

const [checkInput, setCheckInput] = useState();
const [checkInput, setCheckInput] = useState(false);

const [radioValue, setRadioValue] = useState(State ? State : 0);

Expand All @@ -76,16 +81,21 @@ const Button = ({
);

const decideInput = () => {
// When in NuGrid, use cellValue from context (0 or 1)
if (isInNuGrid && nuGridContext) {
return setCheckInput(nuGridContext.cellValue === 1);
}
if (location == "inGrid") {
return setCheckInput(inputValue);
}
setCheckInput(State && State);
// Ensure we always set a boolean (not undefined) to avoid controlled/uncontrolled warning
setCheckInput(State === 1 || State === true);
};

useEffect(() => {
decideInput();
setPosition({ top: Posn && Posn[0], left: Posn && Posn[1] });
}, [data]);
}, [data, nuGridContext?.cellValue]);

const shortcutKey = Caption?.includes("&")
? Caption?.charAt(Caption.indexOf("&") + 1).toLowerCase()
Expand Down Expand Up @@ -320,6 +330,11 @@ const Button = ({
};

const handleCheckBoxEvent = (value) => {
// When in NuGrid, report change via context callback
if (isInNuGrid && nuGridContext) {
nuGridContext.onCellChange(value ? 1 : 0);
return;
}
if (location == "inGrid") {
handleSelectEvent(value);
handleCellChangedEvent(value);
Expand Down Expand Up @@ -430,6 +445,37 @@ const Button = ({
};

if (isCheckBox) {
// When in NuGrid, render a centered checkbox without labels
if (isInNuGrid) {
return (
<div
id={data.ID + ".$CONTAINER"}
style={{
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
zIndex: 1,
}}
>
<input
onFocus={handleGotFocus}
ref={inputRef}
onKeyDown={(e) => handleKeyPress(e)}
id={data?.ID}
type="checkbox"
checked={checkInput}
disabled={Active === 0}
onChange={(e) => {
setCheckInput(e.target.checked);
handleCheckBoxEvent(e.target.checked);
}}
/>
</div>
);
}

let checkBoxPosition = null;
if (Align && Align == "Left") {
checkBoxPosition = { position: "absolute", right: 0, top: 3 };
Expand Down
40 changes: 35 additions & 5 deletions src/components/Combo.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { setStyle, getFontStyles, extractStringUntilLastPeriod, getObjectTypeById, handleMouseDown, handleMouseUp, handleMouseEnter, handleMouseMove, handleMouseLeave, parseFlexStyles, handleMouseWheel, handleMouseDoubleClick, handleKeyPressUtils } from '../utils';

import { useAppData, useResizeObserver } from '../hooks';
import { useNuGridContext } from './NuGrid/NuGridContext';
import { useState, useRef, useEffect, useCallback } from 'react';

const Combo = ({ data, value, event = '', row = '', column = '', location = '', values = [] }) => {
// Check if we're inside a NuGrid cell
const nuGridContext = useNuGridContext();
const isInNuGrid = !!nuGridContext;
const parentSize = JSON.parse(localStorage.getItem(extractStringUntilLastPeriod(data?.ID)));

const inputRef = useRef();
Expand Down Expand Up @@ -37,6 +41,10 @@ const Combo = ({ data, value, event = '', row = '', column = '', location = '',

// Initialize with selected item, or Text property, or first item
const initialSelected = () => {
// When in NuGrid, use cellValue from context
if (isInNuGrid && nuGridContext) {
return nuGridContext.cellValue || '';
}
const index = SelItems?.findIndex((element) => element == 1);
if (index !== undefined && index !== -1 && Items) {
return Items[index];
Expand All @@ -45,11 +53,21 @@ const Combo = ({ data, value, event = '', row = '', column = '', location = '',
return data?.Properties?.Text || (Items?.[0]) || '';
};
const [comboInput, setComboInput] = useState(initialSelected);

// Update combo input when NuGrid cellValue changes
useEffect(() => {
if (isInNuGrid && nuGridContext) {
setComboInput(nuGridContext.cellValue || '');
}
}, [isInNuGrid, nuGridContext?.cellValue]);
const [position, setPosition] = useState({ top: Posn && Posn[0], left: Posn && Posn[1] });

const [parentOldDimensions, setParentOldDimensions] = useState(parentSize?.Size);

// Sync selection from SelItems - skip when in NuGrid (values come from grid context)
useEffect(() => {
if (isInNuGrid) return;

const index = SelItems?.findIndex((element) => element == 1);
if (index == undefined || index == -1) {
return;
Expand Down Expand Up @@ -254,14 +272,20 @@ const Combo = ({ data, value, event = '', row = '', column = '', location = '',
setIsOpen(false);
setHighlightedIndex(-1);

// When in NuGrid, report change via context callback
if (isInNuGrid && nuGridContext) {
nuGridContext.onCellChange(item);
return;
}

// ALWAYS fire Select event, even when reselecting same value
if (location === 'inGrid') {
handleSelectEvent(index);
handleCellChangeEvent(item);
} else {
handleSelectEvent(index);
}
}, [location, handleSelectEvent, handleCellChangeEvent]);
}, [location, handleSelectEvent, handleCellChangeEvent, isInNuGrid, nuGridContext]);

// Calculate dropdown position (fixed positioning for grid context)
const getDropdownPosition = useCallback(() => {
Expand All @@ -279,7 +303,7 @@ const Combo = ({ data, value, event = '', row = '', column = '', location = '',
// Determine if dropdown should appear above or below
const showAbove = spaceBelow < dropdownMaxHeight && spaceAbove > spaceBelow;

if (location === 'inGrid') {
if (location === 'inGrid' || isInNuGrid) {
// Fixed positioning for grid context to escape cell boundaries
return {
position: 'fixed',
Expand Down Expand Up @@ -511,11 +535,17 @@ const Combo = ({ data, value, event = '', row = '', column = '', location = '',
return (
<div
style={{
...styles,
...(isInNuGrid ? {} : styles),
borderColor: '#ccc',
display: Visible == 0 ? 'none' : 'block',
top: Posn?.[0],
left: Posn?.[1],
...(isInNuGrid ? {
position: 'relative',
width: '100%',
height: '100%',
} : {
top: Posn?.[0],
left: Posn?.[1],
}),
}}
onMouseDown={(e) => {
e.stopPropagation();
Expand Down
Loading